boards/stm32: generalize use of connect_assert_srst for flashing#12158
boards/stm32: generalize use of connect_assert_srst for flashing#12158fjmolinas merged 4 commits intoRIOT-OS:masterfrom
Conversation
This allows to flash/reset even over a crashed or sleeping firmware
The test procedure was very specifig of the I'll test that it workd on |
|
I'm having some flashing issues with a couple of boards, not sure if the issue is on my CI or I had to add I'm also unable to flash |
I need to look in to this some more, but the convenience is that if really needed we can add another optional configuration to be added to |
|
Maybe #12261 (comment) could also help for testing this. |
You mean setting |
|
Yes. |
I tried that but I'm not able to reproduce whatever state the board was in where it couldn't be flashed... I'll run all tests on CI again to see if I find the culprit. |
I think that's from one of two reasons:
It's a bit of a crap shoot in that there is no standard among the variety of mcus in terms of when SWD should be powered versus not. I don't have experience with stm32 but I'd suggest power-cycling after flashing a firmware that calls pm_set(0) in case it behaves like efm32. If that doesn't do the trick, only the reference manual can say what will. |
|
I ran all tests again for the boards in issue and I didn't encounter any issues. #### nucleo-f103rb/failuresummary.md#### nucleo-l073rz/failuresummary.md#### nucleo-l432kc/failuresummary.mdI'm not sure what happened, It could have been an issue with my local setup. I wouldn't stall the PR because of this. |
|
For OPENOCD_RESET_USE_CONNECT_ASSERT_SRST=0 PORT=/dev/ttyACM1 make -C tests/ssp/ BOARD=b-l072z-lrwan1 flash -j3OPENOCD_RESET_USE_CONNECT_ASSERT_SRST=1 PORT=/dev/ttyACM1 make -C tests/ssp/ BOARD=b-l072z-lrwan1 flash -j3 |
Thanks for the input @benemorius. I'm not sure this is the case here, since I'm able to flash the boards again when
This might have been the case for the 3 boards mentioned, but I haven't been able to reproduce the conditions that led to the board needing to be power-cycled to be flashed again (or needing to to set - I would not stall this PR because of this. |
|
For OPENOCD_RESET_USE_CONNECT_ASSERT_SRST=0 PORT=/dev/ttyACM1 make -C tests/periph_pm/ BOARD=i-nucleo-lrwan1 flash -j3OPENOCD_RESET_USE_CONNECT_ASSERT_SRST=1 PORT=/dev/ttyACM1 make -C tests/periph_pm/ BOARD=i-nucleo-lrwan1 flash -j3 |
|
@fjmolinas, thanks for testing this in depth. Are we good to go here ? |
Yep lets go with this one. |
|
Thank you! |
|
For further reference, if somebody has an issue on his board after this PR, just do a PR adding |
Contribution description
This PR is a follow-up and generalization of #11976 to all nucleo. The common OpenOCD confguration for stm32l0 based boards is also adapted (removed use of connect_assert_srst) and related boards (b-l072z-lrwan1, lsn50, i-nucleo-lrwan1) are adapted as well.
There are other boards using stlink that could be also adapted: stm32 discovery boards, stm32f108, b-l475e-iot01a and ublox-c030-u201.
Testing procedure
Same testing procedure as the one in #11976 but for all mentioned boards (all nucleo + stm32l0 based boards)
Issues/PRs references
Follow-up of #11976.