boards/stm32l0: Fix openocd to prevent flash locking#10343
boards/stm32l0: Fix openocd to prevent flash locking#10343aabadie merged 1 commit intoRIOT-OS:masterfrom
Conversation
This happens mainly when the firmware uses sleep pm modes (off or standby). I agree that this PR is useful for such cases. |
|
@aabadie Is there anything more that this needs? |
|
I just realized that this change is also affecting other nucleo boards: nucleo-l053r8 and nucleo-l031k8, because this openocd configuration file is shared between them. Since you are reusing the same openocd configuration than the one use by the b-l072z-lrwan1 board, maybe you could use the shared openocd configuration with this board as well ? |
|
I think we should may even expand this, the reason why the assert was left out seems to be so one could debug without resetting it catching a failure state. I am not sure if this should be the default action though, maybe it would be better to just set a flag to stop the reset assert from happening? If that is the case than many should be changed. |
|
so, how to move this forward? |
|
It would be good to see if the problem occurs on the other nucleo boards and if this fix is valid. |
This commit add the connect_assert_srst which requires the SRST to be asserted before trying to connect. Certain firmwares will cause it to get to a state where flashing fails and the reset button must be pushed at the correct time to recover.
bc47bab to
7c9ef1e
Compare
I think it is. Some months ago, in a previous PR (maybe #8475), I already tried to pass this change. IT was working on all L0 nucleo boards (for sure). But this is not the question.
|
Done, and it makes everything slightly cleaner! |
|
so @aabadie is this mergeable? seems to work with the L0s a we have... |
|
I think there was a PR that changed the reset assert to default and allows you to select if you want to flash without reset (so you can get into debug mode)... I don't know if that takes care of this. |
|
I have had the same problem with an f401re and appling the change to |
|
Ya, I think the issue is that one cannot enter into debug mode without it resetting. I will ask around, I thought there was a pr that would give the option but I couldn't find it. I would be nice to have this in for everything, it seems to make the flasher more robust. ping @kaspar030 @gebart @smlng |
|
I'm fine with this PR, but once it's merged we'll also have to merge #10479 rather soonish, otherwise |
|
I retriggered Murdock just in case and it's still green. Let's go! |
|
Thanks @aabadie! I forgot about this one. |
Contribution description
This commit add the connect_assert_srst which requires the SRST to be asserted before trying to connect.
Certain firmwares will cause it to get to a state where flashing fails and the reset button must be pushed at the correct time to recover.
Testing procedure
on 7645c66 commit
BOARD=nucleo-l073rz make flash -C tests/driver_my9221then try flashing anything after.
It seems in master the driver_my9221 doesn't cause lockup anymore but if it is already locked up it doesn't fix it (this pr does).
Issues/PRs references
Fixes #10341