Skip to content

Conversation

@andrewparlane
Copy link
Contributor

The TAR register can be auto incremented after every write or read from
DRW. However this is only guaranteed to work for the lowest 10 bits of
TAR. Above that it's implementation defined.

On some targets it's just the 10 bits, meaning that something unknown
happens if you go over a !KB boundary.

The previous code dealt with this, by rewriting the TAR register every
1KB. However that doesn't work if you don't start your writes 1KB
aligned.

For example, if you write 1KB starting at address 0x200, the first 512
bytes write OK, after that it's implementation defined. On my target it
wrapped to 0 and wrote the last 512 bytes there.

My fix re-writes the TAR register whenever you hit a 1KB boundary,
regardless of start address.

The TAR register can be auto incremented after every write or read from
DRW. However this is only guaranteed to work for the lowest 10 bits of
TAR. Above that it's implementation defined.

On some targets it's just the 10 bits, meaning that something unknown
<implementation defined> happens if you go over a !KB boundary.

The previous code dealt with this, by rewriting the TAR register every
1KB. However that doesn't work if you don't start your writes 1KB
aligned.

For example, if you write 1KB starting at address 0x200, the first 512
bytes write OK, after that it's implementation defined. On my target it
wrapped to 0 and wrote the last 512 bytes there.

My fix re-writes the TAR register whenever you hit a 1KB boundary,
regardless of start address.
@cederom
Copy link
Owner

cederom commented Jun 23, 2017

Awsome work! Thanks Andy! Will look into it next week :-)

@andrewparlane
Copy link
Contributor Author

Any problems with this?

@cederom cederom merged commit 9e6f1a6 into cederom:master Aug 15, 2017
@cederom
Copy link
Owner

cederom commented Aug 15, 2017

Thank you @andrewparlane ! No problems.. just summertime.. sorry :-)

@andrewparlane
Copy link
Contributor Author

andrewparlane commented Aug 15, 2017 via email

@cederom
Copy link
Owner

cederom commented Aug 15, 2017

Btw @andrewparlane have you seen the https://github.com/mbedmicro/DAPLink project? It really speeds things up compared to LibSWD over USB from the Host.. DAPLink is a firmware put on MCU that dramatically speeds things up :-)

@andrewparlane
Copy link
Contributor Author

andrewparlane commented Aug 15, 2017 via email

@cederom
Copy link
Owner

cederom commented Aug 15, 2017

Not possible to customize? I see it running on a different boards, MCU and Targets.. looks very promising project! :-) But also nice to hear LibSWD has its unique advantages, thanks! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants