Loading...
 

SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world. And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4.
You can get more information from the ac6-tools website and download (registration required) various documents highlighting:

System Workbench for STM32


Cannot debug using openOCD

Hello everyone,

I am trying to configure SW4STM32 in order to do some on-device debugging using OpenOCD. Everything seems quite straightforward and the getting started guide doesn’t say much about it (just create the configuration and go for it!). However, I keep getting the same recurrent error constantly while trying to debug an example from HAL (a popup window from the IDE):

Error in final launch sequence
Failed to execute MI command:
symbol-file C:\STM32Cube_FW_F2_V1.3.0\Projects\STM322xG_EVAL\Examples\UART\UART_Hyperterminal_DMA\SW4STM32\STM322xG_EVAL\Debug\STM322xG_EVAL.bin

Error message from debugger back end:
`C:\STM32Cube_FW_F2_V1.3.0\Projects\STM322xG_EVAL\Examples\UART\UART_Hyperterminal_DMA\SW4STM32\STM322xG_EVAL\Debug\STM322xG_EVAL.bin’: can’t read symbols: File format not recognized.
`C:\STM32Cube_FW_F2_V1.3.0\Projects\STM322xG_EVAL\Examples\UART\UART_Hyperterminal_DMA\SW4STM32\STM322xG_EVAL\Debug\STM322xG_EVAL.bin’: can’t read symbols: File format not recognized.

I have been searching around the net and I haven’t succeeded finding any specific solution, just some references to similar problems being caused by 64-bit architectures.

As for OpenOCD, it shows some messages, but nothing indicating any errors. Adapter speed, adapter_nsrst_delay, “unable to match requested speed” x2, clock speed, STLINK v2, using STLINK api, voltage and last, the cpu and “hardware has 6 breakpoints, 4 watchpoints”.

Any ideas on why this one pops out? I have set a similar environment in an std Eclipse CDT release, I just don’t get why this keeps happening...

Thanks in advance!

France

You should not pass the BIN file to the debugger but rather the ELF file; the BIN is a binary image, suitable to flash the MCU but not for debugging, as there is no symbol table in it.

Bernard (Ac6)

Thanks a lot!

I just changed the Post-build steps options to generate a hex file rather than a bin file. This time I can access the debug view and it seems to do some more work, but I end up in a similar type of error:

No symbol table is loaded. Use the “file” command.
No symbol table is loaded. Use the “file” command.
No symbol table is loaded. Use the “file” command.

(just like that, three times). The hex file seems proper, since I can flash it and execute it, I just don’t succeed in debugging it from SW.

EDIT:

Had to take a deep breath and check what I had done in an std Eclipse release to make it work. The thing is frustration was blinding me and I kept doing very basic mistakes. I solved it by:

1.- As said, generating a hex file rather than a bin.
2.- In the Debug Configuration Settings, I was trying to use the hex itself, rather than the elf... Had to set the path to the elf file manually, since SW doesn’t seem to recognize anything inside the workspace or the project.
3.- Flash the board with the hex file...
4.- Use the newly properly configured Debug Configuration...

And it works. Feeling like a total disaster.

Thanks again!


Hi!

I have a userboard with a STM32F030RTC. Starting the debug-session using OpenOCD exits with following message:


Open On-Chip Debugger 0.10.0-dev-00267-g884c33c (2016-03-16-12:22)
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: 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 : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : clock speed 950 kHz
Info : STLINK v2 JTAG v27 API v2 SWIM v6 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 2.496126
Info : stm32f0x.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : accepting ‘gdb’ connection on tcp/3333
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
adapter speed: 950 kHz
stm32f0x.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0xc1000000 pc: 0x0800029c msp: 0x20008000
Error: mem2array: Read @ 0x40021004, w=4, cnt=1, failed
C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.debug_1.8.0.201603291114\resources\openocd\scripts/mem_helper.tcl:6: Error:
in procedure ‘reset’
in procedure ‘ocd_bouncer’
in procedure ‘ocd_process_reset’
in procedure ‘ocd_process_reset_inner’ called at file “embedded:startup.tcl”, line 248
in procedure ‘stm32f0x.cpu’ called at file “embedded:startup.tcl”, line 370
in procedure ‘ocd_bouncer’
in procedure ‘stm32f0x_default_reset_init’
in procedure ‘mmw’ called at file “C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.debug_1.8.0.201603291114\resources\openocd\scripts/target/stm32f0x.cfg”, line 83
in procedure ‘mrw’ called at file “C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.debug_1.8.0.201603291114\resources\openocd\scripts/mem_helper.tcl”, line 16
at file “C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.debug_1.8.0.201603291114\resources\openocd\scripts/mem_helper.tcl”, line 6

Error: jtag status contains invalid mode value - communication failure
Polling target stm32f0x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
Error: auto_probe failed
Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use ‘gdb_memory_map disable’.
Error: attempted ‘gdb’ connection rejected

Using the Program-Utility: „STM32 ST-LINK Utility“ works fine with activated „connect Under Reset“ in the „Mode“ option, but not with default settings.

The screenshot of the debug configuration is attached.

Thanks in advance!

Regards SlawaG