Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boards/stm32f746g-disco: use connect_assert_srst with openocd #17449

Merged
merged 1 commit into from Jan 3, 2022

Conversation

aabadie
Copy link
Contributor

@aabadie aabadie commented Dec 27, 2021

Contribution description

This PR enables connect_assert_srst in the reset_config option of OpenOCD for the stm32f746g-disco board. Without this option, the board is sometimes unflashable automatically (especially just after it's plugged to the computer).

Testing procedure

  • on master I sometimes get the following openocd output:
$ BOARD=stm32f746g-disco make -C examples/hello-world flash-only --no-print-directory 
/work/riot/RIOT/dist/tools/openocd/openocd.sh flash /work/riot/RIOT/examples/hello-world/bin/stm32f746g-disco/hello-world.elf
### Flashing Target ###
Open On-Chip Debugger 0.11.0+dev-00546-g5795f4d3e (2021-12-23-10:48)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : DEPRECATED target event trace-config; use TPIU events {pre,post}-{enable,disable}
Info : clock speed 2000 kHz
Info : STLINK V2J25M14 (API v2) VID:PID 0483:374B
Info : Target voltage: 3.224115
Error: Cortex-M PARTNO 0x0 is unrecognized
Warn : target stm32f7x.cpu examination failed
Info : starting gdb server for stm32f7x.cpu on 0
Info : Listening on port 45791 for gdb connections
    TargetName         Type       Endian TapName            State       
--  ------------------ ---------- ------ ------------------ ------------
 0* stm32f7x.cpu       hla_target little stm32f7x.cpu       unknown

Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Error: Cortex-M PARTNO 0x0 is unrecognized
TARGET: stm32f7x.cpu - Not halted
make: *** [/work/riot/RIOT/examples/hello-world/../../Makefile.include:807: flash-only] Error 1

The second time it works though:

$ BOARD=stm32f746g-disco make -C examples/hello-world flash-only --no-print-directory 
/work/riot/RIOT/dist/tools/openocd/openocd.sh flash /work/riot/RIOT/examples/hello-world/bin/stm32f746g-disco/hello-world.elf
### Flashing Target ###
Open On-Chip Debugger 0.11.0+dev-00546-g5795f4d3e (2021-12-23-10:48)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : DEPRECATED target event trace-config; use TPIU events {pre,post}-{enable,disable}
Info : clock speed 2000 kHz
Info : STLINK V2J25M14 (API v2) VID:PID 0483:374B
Info : Target voltage: 3.227261
Info : stm32f7x.cpu: Cortex-M7 r0p1 processor detected
Warn : Silicon bug: single stepping may enter pending exception handler!
Info : stm32f7x.cpu: target has 8 breakpoints, 4 watchpoints
Info : starting gdb server for stm32f7x.cpu on 0
Info : Listening on port 34797 for gdb connections
    TargetName         Type       Endian TapName            State       
--  ------------------ ---------- ------ ------------------ ------------
 0* stm32f7x.cpu       hla_target little stm32f7x.cpu       halted

Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08000918 msp: 0x20000200
Info : device id = 0x10016449
Info : flash size = 1024 kbytes
auto erase enabled
wrote 32768 bytes from file /work/riot/RIOT/examples/hello-world/bin/stm32f746g-disco/hello-world.elf in 0.776735s (41.198 KiB/s)

verified 9304 bytes in 0.079801s (113.857 KiB/s)

Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
shutdown command invoked
Done flashing

With this PR, the board can be flashed reliably.

Issues/PRs references

Noticed that while working on #17437 and #17448

@aabadie aabadie added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs labels Dec 27, 2021
@github-actions github-actions bot added the Area: boards Area: Board ports label Dec 28, 2021
@aabadie aabadie added the Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) label Jan 3, 2022
@aabadie
Copy link
Contributor Author

aabadie commented Jan 3, 2022

@benpicco this is similar as #17462 (if you want to ACK it as well :) )

@benpicco
Copy link
Contributor

benpicco commented Jan 3, 2022

Might this be needed for all f7 boards?

@aabadie
Copy link
Contributor Author

aabadie commented Jan 3, 2022

Might this be needed for all f7 boards?

Maybe but I can't test the others :)

@aabadie aabadie merged commit 082ea7a into RIOT-OS:master Jan 3, 2022
@aabadie aabadie deleted the pr/boards/stm32f746g_disco_openocd branch January 3, 2022 11:14
@fjmolinas fjmolinas added this to the Release 2022.01 milestone Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants