boards/nucleo-f767zi: add correct flash bank openocd config#13179
boards/nucleo-f767zi: add correct flash bank openocd config#13179aabadie merged 2 commits intoRIOT-OS:masterfrom
Conversation
aabadie
left a comment
There was a problem hiding this comment.
Some typos and questions.
I won't be able to test before next week.
boards/common/stm32/dist/stm32f7.cfg
Outdated
| @@ -1,3 +1,6 @@ | |||
| source [find target/stm32f7x.cfg] | |||
|
|
|||
| flash bank $_FLASHNAME.noprobe stm32f2x 0x08000000 0 0 0 $_TARGETNAME | |||
There was a problem hiding this comment.
Why stm32f2x ? Shouldn't it be stm32f7x instead ?
There was a problem hiding this comment.
To be honest I just used the same config that was in the openocd file, but replacing the address. I'll take a close look at all the parameters.
There was a problem hiding this comment.
Ok, had a look stm32f7 doesn't have a specific flash driver they use stm32f2x, see files in https://github.com/ntfreak/openocd/tree/master/src/flash/nor and have a look at
You have acces to my CI machine, you can test there, the board is connected. |
aabadie
left a comment
There was a problem hiding this comment.
Looks good, well documented and works: I tested on nucleo-f767zi and nucleo-f746zg. On master, flashing tests/riotboot fails on nucleo-f767zi but it works with this PR. This PR has no negative impact on other F7 boards.
Unfortunately, I found some typos and some reworking to improve the inline comments. You can squash all changes.
Allow specifying index of `flash bank` to read configuration from in cases where the configuration provided in openocd is incorrect. This is the case for the majority of stm32 boards where it relies on `flash probe` to get the correct value.
openocd configuration file for `stm32f7` relies on probing to find out FLASH_ADDR. On nucleo-f767zi board probing (`flash probe 0`) fails when `srst` is asserted, but `srst` needs to be asserted to be able to flash the `BOARD` when sleeping or after a hardfault. To circumvent this in boards/common/stm32/dist/stm32f7.cfg we define a new flash bank with the appropriate fash start address and specify that this is the flash bank to be used as default configuration instead of the default by setting FLASH_BANK=4
aa86295 to
1dec5ba
Compare
|
@aabadie all green! |
aabadie
left a comment
There was a problem hiding this comment.
No more typo and was already tested with success.
ACK and go!
|
Backport provided in #13219 |
|
According to gdb this leads to: Overlapping regions in memory map, which results in it being ignored and me not being able to set breakpoints. gdb tells openocd to set soft break points, if it does not know about the memory map, which do not work (in flash regions?). older versions of openocd (current ubuntu) ignore if gdb tells them to set soft breakpoints and decide on their own depending o the address. |
|
please have a look at what this PR does
this all is done to somehow push an Address from the board information to openocd.sh. I think it would have been easier if you just provide the address in Makefile.import, and modified openocd.sh to use such a address if it exists (may also be possible that such a mechanism allready exists) see the attached tt-patch.txt btw the line: tells openocd to use auto configuration for the flash http://www.openocd.org/doc/html/Flash-Commands.html#index-stm32f2x |
Contribution description
This pr fixes flashing bin files on
nucleo-f767zi, this issue is not present on allnucleo-f7*boards.Flashing bin files on
nucleo-f767zifails for two reasons:Playing around with
openocd.shI have found thatflash probe 0fails on thisBOARDwhensrstisasserted, but ifsrstisdeassertedprobing fails anyway if the device ishardfaultedor insleep mode.I couldn't find the reason why probing fails in this case, but to keep asserting
srstI added the correctFLASH_ADDRin ourstm32f7.cfgfile and addedFLASH_BANKto allow specifying whichflash bankto use as configuration input and not use the one intarget/stm32f7x.cfgTesting procedure
make -C tests/riotboot/ BOARD=nucleo-f767zi flash