Closed manuelbl closed 2 years ago
It looks as if I found the root cause. On the Arduino Nano 33 BLE, the reset signal takes a long time to return to the high state:
For comparison, a Nordic nRF52840-DK:
As a result, all memory read and write operations in cortexm_reset() fail as the MCU is still stopped. Furthermore, a fault condition is still pending.
I'll prepare a PR that waits for an additional 1ms after toggling the SRST.
Considering that @manuelbl closed #576 without a merged solution I assume this is still a problem? Do we have an alternate solution? Does it still need to be implemented?
@esden / @dragonmux it seems to have been handled by Uwe in effd43ce38a3d9d4d3339ff4e0f416bccd2f997a and I believe can be closed
Hi Perigoso, thanks for finding that. Closing.
I'm using the BMP with PlatformIO and an Arduino Nano 33 BLE (nRF52840). Debugging works but firmware upload reliably fails every other time. In particular, it fails after resetting the Arduino (by power cycling or pressing the button on the board).
The executed command is:
And the output is:
The error message on the last line is from the
load
command.With a debug version of BMP I have narrowed down the problem to this line:
https://github.com/blacksphere/blackmagic/blob/master/src/target/nrf51.c#L165
Further investigations showed that the error will always occur on the first
target_mem_...
call. In fact, it looks like it's already pending before the function is called. It goes away with a call totarget_check_error()
before line 160.I'll will further investigate it and come up with a PR. So stay tuned.