How can the pyboard be reprogrammed with a new C project using ST-Link/v2?
Posted: Wed Feb 27, 2019 1:10 pm
Hello,
I'd like to reprogram and debug the STM32F4 on the pyboard using an external ST-Link/v2 with a C project that I have generated and compiled from STM32CubeMX.
I've done this with the STM32F4DISCOVERY board before using these instructions: https://electronics.stackexchange.com/a/410840
I tried using these instructions as a reference: https://github.com/micropython/micropyt ... -for-STM32
The connections from the ST-Link/v2 are connected as follows:
PIN1 (VAPP) -> 3V3
PIN7 (TMS_SWDIO) -> PA13 (X21-2)
PIN9 (TCK_SWCLK) -> PA14 (X20-2)
PIN15 (NRST) -> NRST (RST)
PIN20 (GND) -> GND
The ST-Link Manual is here: https://www.st.com/resource/en/user_man ... 026748.pdf
I'm thinking that perhaps because the SWDIO and SWCLK lines are shared with LEDs, the default pyboard firmware may be holding these lines high or low?
When I try to push the program using OpenOCD:
Open On-Chip Debugger 0.10.0+dev-00608-g68f09deb (2018-12-06-12:24)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : clock speed 2000 kHz
Info : STLINK V2J29S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.252840
Error: init mode failed (unable to connect to the target)
in procedure 'program'
in procedure 'init' called at file "embedded:startup.tcl", line 496
in procedure 'ocd_bouncer'
** OpenOCD init failed **
shutdown command invoked
Thanks.
I'd like to reprogram and debug the STM32F4 on the pyboard using an external ST-Link/v2 with a C project that I have generated and compiled from STM32CubeMX.
I've done this with the STM32F4DISCOVERY board before using these instructions: https://electronics.stackexchange.com/a/410840
I tried using these instructions as a reference: https://github.com/micropython/micropyt ... -for-STM32
The connections from the ST-Link/v2 are connected as follows:
PIN1 (VAPP) -> 3V3
PIN7 (TMS_SWDIO) -> PA13 (X21-2)
PIN9 (TCK_SWCLK) -> PA14 (X20-2)
PIN15 (NRST) -> NRST (RST)
PIN20 (GND) -> GND
The ST-Link Manual is here: https://www.st.com/resource/en/user_man ... 026748.pdf
I'm thinking that perhaps because the SWDIO and SWCLK lines are shared with LEDs, the default pyboard firmware may be holding these lines high or low?
When I try to push the program using OpenOCD:
Open On-Chip Debugger 0.10.0+dev-00608-g68f09deb (2018-12-06-12:24)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : clock speed 2000 kHz
Info : STLINK V2J29S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.252840
Error: init mode failed (unable to connect to the target)
in procedure 'program'
in procedure 'init' called at file "embedded:startup.tcl", line 496
in procedure 'ocd_bouncer'
** OpenOCD init failed **
shutdown command invoked
Thanks.