Loading...
 
Skip to main content

System Workbench for STM32


Programming in pure assembler

Hi Laurent,

In the "debug configurations", debugger tab, which mode do you have ? manual spec, device: ST-LinkV2, interface: SWD
Did you choose an st board like a nucleo F103 or other F1 st board ? no other board to try at hand
Or you're using "use local script" and you have a custom board ? no local script
Or you're using the "Manual spec" mode ? yes

I tried this with and without the RESET line connected. Checked the connection on the board and there is connectivity between the board external header pin4 and pin7 NRST of the chip.

I added the command line option you suggested. Programming doesn't work yet:
-------
Programing project Ninja32 on chip ****
(a few lines deleted)
Error: libusb_open() failed with LIBUSB_ERROR_ACCESS
Error: open failed (no matching adapter found)
in procedure 'program'
in procedure 'init' called at file "embedded:startup.tcl", line 473
in procedure 'ocd_bouncer'
-------
Nevertheless, the command line option helped a bit.
The debugger can halt the chip now, but it runs into another issue.
-------
Open On-Chip Debugger 0.10.0-dev-00275-gd486ac2-dirty (2017-03-06-15:22)
(a few lines deleted)
Error: BUG: can't assert SRST
Info : STM32F103C8Tx.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'gdb' connection on tcp/3333
Error: TRST/SRST error
STM32F103C8Tx.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 00000000 pc: 0x080001ac msp: 0x20004ffc
Info : device id = 0x20036410
Info : flash size = 64kbytes
STM32F103C8Tx.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 00000000 pc: 0x080001ac msp: 0x20004ffc
STM32F103C8Tx.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 00000000 pc: 0x080001ac msp: 0x20004ffc
-------
...and then after a few seconds a popup with the following message appears:
-------
Error in final launch sequence
Failed to execute MI command:
load C:\\Data\\workspace\\Ninja32\\Debug\\Ninja32.elf
Error message from debugger back end:
Error finishing flash operation
Error finishing flash operation
-------
A second attempt gives me different messages:
-------
Open On-Chip Debugger 0.10.0-dev-00275-gd486ac2-dirty (2017-03-06-15:22)
(a few lines deleted)
Error: BUG: can't assert SRST
Info : STM32F103C8Tx.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'gdb' connection on tcp/3333
Error: TRST/SRST error
STM32F103C8Tx.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
Info : device id = 0x20036410
Info : flash size = 64kbytes
Error: address + size wrapped(0xfffffffe, 0x00000004)
STM32F103C8Tx.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
STM32F103C8Tx.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
STM32F103C8Tx.cpu: target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x2000003a msp: 0xfffffffc
STM32F103C8Tx.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 00000000 pc: 0x080001ac msp: 0x20004ffc
-------
No popup appears this time.
I can click Suspend and the debug actions (step into/over/return) become selectable.
When clicking on Step Into I get:
-------
Info : halted: PC: 0x0800018c
Info : halted: PC: 0x0800018c
(repeated until I click Suspend again)
Info : halted: PC: 0x0800018c
Info : The target is not running when halt was requested, stopping GDB.
Info : The target is not running when halt was requested, stopping GDB.
Info : The target is not running when halt was requested, stopping GDB.
Info : halted: PC: 0x0800018c
-------
Those two results repeat for all following attempts.
A look into my code shows me that the chip had a Hard Fault (HardFault_Handler() at 0x800018c)
Again, the same code runs fine and can be single-stepped using ST-LINK alone (STSW-LINK007 Version 2.28.18)

Thanks for your help.
- Klaus