Unable to debug STM32F4103T6U7A with larger binary size
Hello all,
I am using the STM32 Workbench Version: 2.0.1.201705161428 on Ubuntu 14.04.5 LTS with OpenOCD version 0.10.0-dev-00278-ga53935e-dirty from the same version of the debugging tools.
If my binary size is smaller than 10164 bytes I can debug my project if it is larger I cannot.
Here is the -d2 output of the small binary (successful) debugging:
code
Open On-Chip Debugger 0.10.0-dev-00278-ga53935e-dirty (2017-05-09-09:16)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
srst_only separate srst_nogate srst_open_drain connect_assert_srst
srst_only separate srst_nogate srst_open_drain connect_assert_srst
Info : clock speed 1000 kHz
Info : STLINK v2 JTAG v28 API v2 SWIM v7 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.218823
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : STM32F103T6Ux.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting ‘gdb’ connection on tcp/3333
STM32F103T6Ux.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
Info : device id = 0x10006412
Info : flash size = 32kbytes
Error: address + size wrapped(0xfffffffe, 0x00000004)
STM32F103T6Ux.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
STM32F103T6Ux.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
STM32F103T6Ux.cpu: target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x2000003a msp: 0xfffffffc
STM32F103T6Ux.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080026c4 msp: 0x20001800
/code
And here is with a larger binary (failing) debugging:
code
Open On-Chip Debugger 0.10.0-dev-00278-ga53935e-dirty (2017-05-09-09:16)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
srst_only separate srst_nogate srst_open_drain connect_assert_srst
srst_only separate srst_nogate srst_open_drain connect_assert_srst
Info : clock speed 1000 kHz
Info : STLINK v2 JTAG v28 API v2 SWIM v7 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.217255
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : STM32F103T6Ux.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting ‘gdb’ connection on tcp/3333
STM32F103T6Ux.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
Info : device id = 0x10006412
Info : flash size = 32kbytes
Error: address + size wrapped(0xfffffffe, 0x00000004)
STM32F103T6Ux.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
STM32F103T6Ux.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
Error: timed out while waiting for target halted
STM32F103T6Ux.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x21000000 pc: 0x20000006 msp: 0xfffffffc
Error: error waiting for target flash write algorithm
Error: error writing to flash at address 0x08000000 at offset 0x00000000
STM32F103T6Ux.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
Error: address + size wrapped(0xffffffff, 0x00000004)
Error: address + size wrapped(0xffffffff, 0x00000002)
Error: address + size wrapped(0xffffffff, 0x00000004)
Error: address + size wrapped(0xffffffff, 0x00000002)
Info : dropped ‘gdb’ connection
If I increase the debug level to -d3 I see the following output before the termination:
code
Debug: 1341 733 stlink_usb.c:514 stlink_usb_error_check(): unknown/unexpected STLINK status code 0x1
Debug: 1342 733 target.c:2314 target_write_u32(): address: 0x2000003c, value: 0x00000000
Debug: 1343 733 hla_target.c:766 adapter_write_memory(): adapter_write_memory 0x2000003c 4 1
Debug: 1344 735 stlink_usb.c:475 stlink_usb_error_check(): SWD_AP_FAULT
Debug: 1345 735 target.c:2788 target_wait_state(): waiting for target halted...
/code