dist/tools/openocd: add OPENOCD_EXTRA_INIT_RESET use for nucleo-f091rc#11976
dist/tools/openocd: add OPENOCD_EXTRA_INIT_RESET use for nucleo-f091rc#11976MrKevinWeiss merged 2 commits intoRIOT-OS:masterfrom
Conversation
|
@cladmi I would appreciate your input on this. |
|
Talking with @aabadie IRL, |
|
Ohhh, interesting way of handling this. You basically solved the issue that when using Only thing with the implementation is that it breaks the boundary that the openocd low level configuration is in the As you looked a bit more in the low level openocd configurations, do you think the same behavior could be achieved from a configuration file automatically only on flash and reset ? |
|
It may be easier than I expected :) I removed the If I will do more extensive tests tomorrow. |
|
Yup this is a common issue. Do we make it recover from a unflashable state or allow debug connect on running system. There has already been some |
So you would do something like this? I'm not sure I understand correctly the implementation change you are looking for. @cladmi |
Exactly, that is the behavior I am thinking about :) On the implementation maybe checking for |
This would have to be duplicated onder |
Or use an intermediate global What I did not like was having the |
Ok this seems better, to me. |
|
I did not manage to test yet on other boards but it is still in my plans. |
|
I tried with my With the I will try with my other boards from #10870 |
|
|
|
Did you try |
|
And if you flash However when testing I did a mistake and tried to flash with I can correctly flash |
This would give me the same behaviour as what I was doing in #11550 for the For the For |
|
I also tested my change from 900f6b8 and the difference from the reset configuration with I did not test |
|
For completeness, I tried on |
1c42ff2 to
6a6e684
Compare
|
@cladmi rebased to fix conflict issues. I also added your suggested changes. This will need squashing to split adding |
|
Retested the nucleo-f091rc on the CI rack and everything seems good, it locks up in master and is fixed with this PR. If you want you can squash? I am a bit curious so know if the |
|
The I think you can already squash the PR as it changed a lot. It will be easier to review anyway. I can test it again this afternoon. |
It could be overwritten by doing |
|
Just to let you know: we tested on our HIL, this definitely fixes the flashing problem. So would be nice to get this in quickly, however I don't have any opinion regarding the implementation/integration into our build system and tools. I trust @cladmi on this. |
|
@MrKevinWeiss @cladmi Squashed, OPENOCD_RESET_USE_CONNECT_ASSERT_SRST=0 make -C tests/ssp/ BOARD=nucleo-f091rc resetOPENOCD_RESET_USE_CONNECT_ASSERT_SRST=1 make -C tests/ssp/ BOARD=nucleo-f091rc reset |
- Add a variable to add extra openocd commands before resetting a board. These will not be called when `debug`, in contrast to OPENOCD_CONFIG, OPENOCD_EXTRA_INIT and OPENOCD_ADAPTER_INIT. - Add connect_assert_srst to reset config if OPENOCD_RESET_USE_CONNECT_ASSERT_SRST=1
2cae82c to
6471153
Compare
- Nucleo-f091rc can become unflashable when hardfaults occure. To make sure flashing succeeds `connect_assert_srst` is called before connecting to flash threw openocd.
6471153 to
06c830e
Compare
|
@cladmi comments addressed. |
|
Good for me, I re-tested my |
|
@MrKevinWeiss @cladmi All green, do you have anymore comments? |
|
It's good for me (but I am not allowed to ACK). |
MrKevinWeiss
left a comment
There was a problem hiding this comment.
I tested before and if @cladmi tested the overwrite then I will ACK.
|
The overwrite is only about defining the variable with |
|
@fjmolinas Thank you for finding the right way of handling this
|
|
@MrKevinWeiss @smlng @cladmi Thanks for the review and testing! |
|
Is this not funny when you think about it? A PR open for almost one month, no reviewer reviewing it. Me, contributor, as I like this change, spent several hours in the manual, testing the implementation, doing local tests of openocd, challenging with the other boards that had similar fix, test my own PRs that addressed the same issue in the old way based on this change, rebase my PRs on it, give feedback on the implementation, the limitation, the documentation. Then, as it is discovered today that it is needed for a board in the CI, it "would be nice to be in quickly", so gets merged based on maintainers testing only the fixed board, not the whole feature and concept, and on "I trust this contributor". "I want it all, and I want it now" If it was that urgent, adding at least a "thank you, you saved our ass" would have been welcomed. |
Well, I have to say that I was interested by this PR and with @fjmolinas we discussed it IRL as he mentioned at the beginning of the discussion. It's just that vacations came in between. But what I find funny with your comment, is that you (@cladmi) consider yourself as a simple contributor just because you decided (I still don't understand why honestly) to resign from the maintainer status. But we all know here that you were maintainer not so long ago and already did (a lot of) good reviews and merged quite some stuff. And that's why people trust a not so simple contributor like you. |
|
@cladmi you got that a bit wrong.
Btw. I don't remember ever getting a thank you for a PR I made; for reviews and testing -- yes, many times. Generally I don't deem it necessary, but appreciated it is. TL;DR: thanks @fjmolinas and @cladmi |
|
Thanks @cladmi 😄 |
That is exactly why I complain about not getting an explicit review. This is not a simple change! Francisco managed to be so right and precise with this fix. Maybe it end up in only a few makefile/shell lines, but the important part is not the integration but the openocd part, what it solves, how, why it works, which impact it will have. What were we doing before and why were we not doing this? Does it deprecate the 5 other handling in RIOT ? I personally rebased 3 of my PRs on this one, open one to use this and added a cleanup/bug fix.
It was not a thing when I started, but at least all the last ones with you have :) https://github.com/RIOT-OS/RIOT/pulls?q=is%3Apr+reviewed-by%3Asmlng+author%3Acladmi+is%3Amerged
It was to put it in contrast with the really quick merge with no maintainer explicit review. I know you were both in vacation.
Trust is unfortunately not a review. I do not trust what I do. And yes, I am a contributor and should be considered as such. As long as a review can be done without following https://github.com/RIOT-OS/RIOT/blob/master/MAINTAINING.md I am better as a contributor. (btw, if I am in a state where a review is not necessary for my contributions, I have many PRs waiting :p) |
Contribution description
When testing #11809 I realized that after flashing
tests/ssponnucleo-f091rcthe board becomes un-flashable which caused all subsequent tests to fail. This can be avoided ifconnect_assert_srstis added to the reset configuration.To avoid this also being called when debugging a new configuration parameter is introduced to only call this when reseting or flashing the board but not on debug actions. Since not all platforms support
connect_assert_srstthis is not used as default.Testing procedure
Reproducing
To reproduce on master executing the following will fail on the second try:
make -C tests/ssp/ BOARD=nucleo-f091rc flashThe following also fails
make -C tests/ssp/ BOARD=nucleo-f091rc flash resetTesting
With this PR it succeeds. Also the following succeeds:
2x
make -C tests/ssp/ BOARD=nucleo-f091rc flashmake -C tests/ssp/ BOARD=nucleo-f091rc flash resetmake -C tests/xtimer_usleep/ BOARD=nucleo-f091rc flash debugIssues/PRs references
Related to #8976, #10479