cancel
Showing results for 
Search instead for 
Did you mean: 

Please fix the fw_cortex_m4.sh issue

hypnotriod
Associate II

Hello. I was playing around with Debian on the STM32mp157F-DK2 and stumble on this issue/bug when I tried to debug M4 from CubeIDE and got something like this:

Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : STLINK V2J38M27 (API v2) VID:PID 0483:3752
Info : Target voltage: 3.238573
Info : clock speed 4000 kHz
Info : stlink_dap_op_connect(connect)
Info : SWD DPIDR 0x6ba02477
Info : stlink_dap_op_connect(connect)
Info : SWD DPIDR 0x6ba02477
Info : STM32MP157AACx.cm4: hardware has 6 breakpoints, 4 watchpoints
Info : STM32MP157AACx.cpu0: hardware has 6 breakpoints, 4 watchpoints
Info : STM32MP157AACx.cpu1: hardware has 6 breakpoints, 4 watchpoints
Info : STM32MP157AACx.cm4: external reset detected
Info : starting gdb server for STM32MP157AACx.cpu0 on 3334
Info : Listening on port 3334 for gdb connections
Info : starting gdb server for STM32MP157AACx.cm4 on 3333
Info : Listening on port 3333 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
Info : Halt timed out, wake up GDB.
Error: timed out while waiting for target halted
Error executing event gdb-attach on target STM32MP157AACx.cm4:

Info : New GDB Connection: 1, Target STM32MP157AACx.cm4, state: reset
Warn : GDB connection 1 on target STM32MP157AACx.cm4 not halted
Warn : negative reply, retrying
Warn : negative reply, retrying
Info : accepting 'gdb' connection on tcp/3333
Info : Halt timed out, wake up GDB.
Error: timed out while waiting for target halted
Error executing event gdb-attach on target STM32MP157AACx.cm4:

Info : New GDB Connection: 2, Target STM32MP157AACx.cm4, state: reset
Warn : GDB connection 2 on target STM32MP157AACx.cm4 not halted
Warn : negative reply, retrying
Warn : negative reply, retrying
Warn : target not halted
Info : target STM32MP157AACx.cm4 was not halted when resume was requested

It happens that autogenerated fw_cortex_m4.sh script file has some syntax issue which prevent the firmware loading on Debian (shellcheck.net does complain):

#if [ $1 == "start" ] # Need to be replaced with the next line
if [ "$1" = "start" ]
#if [ $1 == "stop" ] # Need to be replaced with the next line
if [ "$1" = "stop" ]

This issue was discovered a while ago here at DigiKey forum but I guess was never addressed in CubeMX

0 REPLIES 0