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


Flashing and debugging of externally compiled program

Hello,
I would like to use System Workbench (SW) as the external flasher and debugger. My usecase is following:
- edit source files in external editor
- compile source files externally by my build scripts
- flash and debug my application using System Workbanch

Application is compiled by the GCC compiler and I can provide all compilation outputs to SW.

I used this workflow with the TI TMS570 and the Code Compser Studio which is based on the Eclipse as well.

I tried to found an information on google, the SW documentation page and this forum but without success. It is possible this workflow? If yes, how to do that?

Thank you, Mat.

Tunisia

Hello Mat,

I do not know why you need such solutions, I prefer always using an IDE especially if it is eclipse based :-)

But this is possible.

As I have inderstood, you have already compiled your project => So you have an executable (elf) file : should contains debug informations (symbols + file paths + ...)

To program/debug an elf file without having a System Workbench I have done the following :
Note: This works only if source files are in the same location as compilation machine

  1. Create a dummy project
    1. File > New C Project
      Project name : dummy project
      Project type  : Executable > Empty Project
      Toolchain  : Ac6 STM32 MCU GCC
    2. Select your board Or Create It
    3. Select No Firmware
  2. From menu : Run > Debug configurations
    1. Create a new Ac6 STM32 debugging configuration
      Project  : dummy project
      C/C++ Application : browse for your elf file
      Disable auto build
  3. Launch your debug configuration



Please let me know if this is OK for you ? Or If I misundestood your request ?

Best Regards,
TarekB
ST


Thank you very much for quick reply.

I followed your guide step by step and get this error message at the end (launching the debug session).

OpenOCD Script not found (or not support yet): 
C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.debug_1.6.0.201512071631\resources\openocd\scripts\st_board


I created my board configuration using STM32F103VC. I think the error is occured because there is no OpenOCD script for STM32F103VC in st_board directory.

I tried to create new project (compiled by SW) for STM32L Disovery and it was working (compilation and debugging).


Tunisia

In device list there is no STM32F103VC, there is STM32F103VCHx and STM32F103VCTx

Mpokorny F103 Board Definition


I’m sorry, I selected STM32F103VCTx of course. The rest of type string is not interesting in my opinion because describes mcu package. It is not related to debug configuration:)

So, your guide works for me for STM32L Discovery board (st-link v2 and built-in mcu).

Then, I made a progress with my custom board. The openocd script was missing in debug configuration. I created my own related to my board:

source [find interface/stlink-v2.cfg]
source [find target/stm32f1x_stlink.cfg]
# use hardware reset, connect under reset
reset_config srst_only srst_nogate


I received next error message:

Error in final launch sequence 
Failed to execute MI command: 
load ""

Error message from debugger back end: 
Error erasing flash with vFlashErase packet 
Error erasing flash with vFlashErase packet


I found a forum topicQuestion dealing this issue. When I tried change reset_config to none received error message:

Error in final launch sequence
Failed to execute MI command:
-target-select remote localhost:3333

Error message from debugger back end:
localhost:3333: The system tried to connect the unit to the directories on a drive attached to them. (Translation from my native language!)

In the same topicQuestion it is noted the problem could be caused by openocd version with a bug (1.6). So, I revert to openocd version 1.3 and no changes. Next change of reset_config configuration did not provide additional progress.

Tunisia

>> The rest of type string is not interesting in my opinion because describes mcu package. It is not related to debug configuration:)
The complete part number should be specified

I have tried using STM32F429I-DISC1 (ST-Link V2-1) and STM32F3Discovery (ST-Link V2) and it works

Just a comment:
to use STLink V2-1 you should include this in your custom.cfg
source [find interface/stlink-v2-1.cfg]

Note: When creating a board, you can specify ST-Link version, After that SystemWorkbech will create the custom.cfg for you :-)



This kind of message can appear if

  • You have multiple running debug instance and both of them are listening to the same port number (3333)
  • You device flash memory is protected


Genarally it is the first case, so try to close the running debug session and try again (from Debug view : Terminate/Disconnect All).
Also restarting SystemWorkbench will do the Job too.

>> Note: When creating a board, you can specify ST-Link version, After that SystemWorkbech will create the custom.cfg for you :-)

Great, I tried launch debug session with this .cfg but I still received the error: ..-+Error erasing flash with vFlashErase packet+-.

OpenOCD log is below. I think there is a problem with reset_config. I have connected stlink and my board only by 4 wires - VCC, SWDIO, SWDCLK and GND. Could it couse the problem?

Open On-Chip Debugger 0.9.0-dev-00418-g9afb8b4-dirty (2015-09-28-12:09)
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 v25 API v2 SWIM v0 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 2.946236
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'gdb' connection on tcp/3333
Error: timed out while waiting for target halted
TARGET: stm32f1x.cpu - Not halted
in procedure 'reset' 
in procedure 'ocd_bouncer'



Info : device id = 0x10036414
Info : flash size = 256kbytes
Error: timed out while waiting for target halted
TARGET: stm32f1x.cpu - Not halted
in procedure 'reset' 
in procedure 'ocd_bouncer'


Error: timed out while waiting for target halted
Tunisia

>> OpenOCD log is below. I think there is a problem with reset_config. I have connected stlink and my board only by 4 wires - VCC, SWDIO, SWDCLK and GND. Could it couse the problem?
Yes, OpenOCD uses the Hardware reset (this is specified within stm32f1x.cfg) ⇒ You need to connect the NRST pin (recommended)

If this is not possible (due to design limitation), then use software reset instead.