boards/b-l072z-lrwan1: fix openocd configuration and 'make debug'#8790
boards/b-l072z-lrwan1: fix openocd configuration and 'make debug'#8790cladmi merged 3 commits intoRIOT-OS:masterfrom
Conversation
|
This PR is quite important for a good user experience with the ST LRWAN1. I don't know who could be a good reviewer for this, maybe @gebart or @vincent-d ? |
|
This was somehow already taken into account in boards/common/nucleo/dist/ where all the configs for stlink are stored. I suppose this needs a major refactor to avoid the declaration of similar configurations for this debugger. Though this is not a nucleo board, it uses the same debugger. Do you know if there are major changes in the physical connections compared to a nucleo board? |
Yes and they are very similar, see #8475, where I tried to factorize all these boards. But this PR adds an extra reset option ( The main thing I'm unsure is the change in openocd.sh. |
4f08b13 to
b773e49
Compare
Ok, then I'd say first merge #8475, which is almost ready as far as I see the discussion.
Which extra reset? On openocd.sh? Anyhow, currently the stm32l0 have the options you added, minus the
This would need extensive testing to see if the boards using openocd are not affected. In my small experience with it, I'd say it doesn't hurt at all, it's just an extra reset, but I'd like to test on some boards to see if it really doesn't affect. |
But this change is required if I want use |
Sorry, maybe I was unclear, I updated my comment with the option name (already mentioned in the initial description of this PR though).
Not sure, I would say that the discussion there is staled. Maybe @haukepetersen or @gebart want to add something there.
That's exactly my point. |
dist/tools/openocd/openocd.sh
Outdated
| -c 'init' \ | ||
| -c 'targets' \ | ||
| -c 'halt' \ | ||
| -c 'reset halt' \ |
There was a problem hiding this comment.
I think this should be made configurable somehow so you can only set it for certain boards.
b773e49 to
f2cc3bc
Compare
f2cc3bc to
e28f6a0
Compare
|
@cladmi, not sure it's better, but I added some information in the commit message. |
As described, there are changes for doing |
There's no need for trst signal, just srst is enough. Also not using srst_nogate seems safer.
connect_assert_srst is used to enforce a CPU reset before connecting to it with openocd. This is useful when debugging on-chip. For details on openocd reset configuration, see
e28f6a0 to
ba30315
Compare
@cladmi, I split the commit in 3, hope this is fine for you :) |
|
@miri64, are you ok with the changes here ? |
I trust @cladmi's judgement more than my own, when it comes to openocd ;-)
Contribution description
This PR is an attempt to fix the make
flashanddebugtargets with the b-l072z-lrwan1 board. The current state in master prevents thedebugfrom being used with it.#8500 initially tried to provide a solution for flashing the board when the MCU is in low-power mode. Digging a little more in OpenOCD documentation, it appears that just the
connect_assert_srstreset option was required: this option forces a wake up of the MCU before flashing (e.g ensure 'SRST is asserted'). So the first part of this PR is to restore the initial config (srst_only) and addconnect_assert_srstbecause only this new option was required.But the problem now is that when one adds this new option, it breaks the
make debugcommand for this board (and maybe others).So the second part of this PR tries to fix the
make debugby forcing a reset in the openocd debug command.It works for this board, now I can flash, even if the MCU is in low-power mode, and debug the board. But I'm not sure if the change in openocd.sh is valid.
Issues/PRs references
None