Closed korken89 closed 5 years ago
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @therealprof (or someone else) soon.
If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.
Please see the contribution instructions for more information.
The JLink seems very unstable for semihosting, sometimes it returns -2 and -3 as well. I would not accept this PR. The better fix is to use OpenOCD, it does not have this issue.
@korken89 Can you add some more info about this fix and its retraction? I'm playing around with an LPCXpresso55S69 and in my case (GDB + JLink) the hprintln
is just being silently swallowed. OpenOCD isn't currently an option since it has no support (yet) AFAIK.
Sure! The fix checks the return value from the system call, and it was sometimes -1. So this was changed to be accepted. This is however probably a bug in jlink.
The better fix, if one wants to do this, is to accept negative numbers plus some testing of what -1, -2 etc corresponds to.
Thanks! Seems I haven't hit your issue yet, I was just lacking monitor semihosting IOClient 2
. :man_facepalming:
Hehe, a easy thing to miss :) but if you at the same issue I had, please report it
Explanation
When sending 1 character it returns -1 from syscall. This fix mitigates the issue, but it not correct. This is probably not the correct way to solve it (might be a bug in the JLink debugger firmware), but it currently solves the issue.
To reproduce
JLink version info (this dev board https://www.decawave.com/product/dwm1001-development-board/):
Minimal example showing the problem: