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


ST Link V2 on STM32L0538-DISCO not woking

Hi folks!

Unfortunately, I can not download and debug my STM32L0358 board since I get the following error message:

Open On-Chip Debugger 0.10.0-dev-00004-gcef2a8c-dirty (2017-08-31-14:07)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
srst_only separate srst_nogate srst_open_drain connect_assert_srst
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 240 kHz
adapter_nsrst_delay: 100
Info : clock speed 240 kHz
Info : STLINK v2 JTAG v21 API v2 M v5 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 3.241744
Error: Unable to set adapter speed
Info : STM32L053C8Tx.cpu: hardware has 4 breakpoints, 2 watchpoints
Error: Unable to set adapter speed
adapter speed: 240 kHz
STM32L053C8Tx.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0xf1000000 pc: 0x080018c0 msp: 0x20002000
STM32L0: Enabling HSI16
Error: Unable to set adapter speed
adapter speed: 4000 kHz

    • Programming Started **

auto erase enabled
Info : Device: STM32L0xx (Cat. 3)
Info : STM32L flash size is 64kb, base address is 0x8000000
STM32L053C8Tx.cpu: target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x2000000e msp: 0x20002000
wrote 8192 bytes from file Debug/STM32L0_RTO_DEMO.elf in 3.531728s (2.265 KiB/s)

    • Programming Finished **
    • Verify Started **

STM32L053C8Tx.cpu: target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x2000002e msp: 0x20002000
STM32L053C8Tx.cpu: target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x2000002e msp: 0x20002000
verified 8156 bytes in 0.229333s (34.730 KiB/s)

    • Verified OK **
    • Resetting Target **

Error: Unable to set adapter speed
adapter speed: 240 kHz
in procedure ‘program’
in procedure ‘reset’ called at file “embedded:startup.tcl”, line 507
in procedure ‘ocd_bouncer’



Since I’m quite a newbie I do not have a clue what is going on here. Hence any help is kindly appreciated.
I use system workbench Version: 2.1.1.201708311556

Hello,

On the log, we can see the mcu has been programmed, verified and reset.

The error messages on adapter speed are because the STLink firmware in the discovery board is not up to date.
But the default speed used is ok.
To avoid these errors, you can update the STLink firmware with the stlink upgrade tool available here :
http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/stsw-link007.htmlQuestion

Then, just to let you know, you used the “run” button but you can use the debug button to debug your code.
Or use the right click mouse on project name and use menu “Debug as” AC6...

You can also update to a newer version of SW4STM32 (v2.3.0 as now).

Rgds,
Laurent


Hi Laurent!

Thanks for the hint. I updated the firmware but the problem still persists. I also tried in debug mode. Below you can see the console output. It looks like the connection gets lost and established in an endless loop manner.
Have you something similar yet?

Best Regards


Open On-Chip Debugger 0.10.0-dev-00004-gcef2a8c-dirty (2017-08-31-14:07)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
srst_only separate srst_nogate srst_open_drain connect_assert_srst
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 240 kHz
adapter_nsrst_delay: 100
Info : tcl server disabled
Info : telnet server disabled
Info : clock speed 240 kHz
Info : STLINK v2 JTAG v29 API v2 M v18 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 3.240158
Info : Stlink adapter speed set to 240 kHz
Info : STM32L053C8Tx.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : accepting ‘gdb’ connection on tcp/3333
Info : Stlink adapter speed set to 240 kHz
adapter speed: 240 kHz
STM32L053C8Tx.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0xf1000000 pc: 0x080018c0 msp: 0x20002000
STM32L0: Enabling HSI16
Info : Stlink adapter speed set to 4000 kHz
adapter speed: 4000 kHz
Info : Device: STM32L0xx (Cat. 3)
Info : STM32L flash size is 64kb, base address is 0x8000000
Info : Stlink adapter speed set to 240 kHz
adapter speed: 240 kHz
in procedure ‘reset’
in procedure ‘ocd_bouncer’


Error: jtag status contains invalid mode value - communication failure
Polling target STM32L053C8Tx.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target STM32L053C8Tx.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 300ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure

Warn : protection of the STM32L flash is not implemented
cleared protection for sectors 0 through 11 on flash bank 0
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target STM32L053C8Tx.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 700ms
Info : Stlink adapter speed set to 240 kHz
adapter speed: 240 kHz
Error: mem2array: Read @ 0x40021034, w=4, cnt=1, failed
C:/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.debug_2.1.1.201708311556/resources/openocd/st_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 ‘STM32L053C8Tx.cpu’ called at file “embedded:startup.tcl”, line 299
in procedure ‘ocd_bouncer’
in procedure ‘mmw’
in procedure ‘mrw’ called at file “C:/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.debug_2.1.1.201708311556/resources/openocd/st_scripts/mem_helper.tcl”, line 16
at file “C:/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.debug_2.1.1.201708311556/resources/openocd/st_scripts/mem_helper.tcl”, line 6

Info : Previous state query failed, trying to reconnect
STM32L053C8Tx.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0xf1000000 pc: 0x080018c0 msp: 0x20002000
STM32L0: Enabling HSI16
Info : Stlink adapter speed set to 4000 kHz
adapter speed: 4000 kHz
Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (1104). Workaround: increase “set remotetimeout” in GDB
Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (1934). Workaround: increase “set remotetimeout” in GDB
STM32L053C8Tx.cpu: target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x2000000e msp: 0x20002000
STM32L053C8Tx.cpu: target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x2000000e msp: 0x20002000
STM32L053C8Tx.cpu: target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x2000000e msp: 0x20002000
STM32L053C8Tx.cpu: target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x2000000e msp: 0x20002000
STM32L053C8Tx.cpu: target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x2000000e msp: 0x20002000
STM32L053C8Tx.cpu: target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x2000000e msp: 0x20002000
Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (2946). Workaround: increase “set remotetimeout” in GDB
Info : Stlink adapter speed set to 240 kHz
adapter speed: 240 kHz
STM32L053C8Tx.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0xf1000000 pc: 0x080018c0 msp: 0x20002000
Polling target STM32L053C8Tx.cpu failed, trying to reexamine
Info : STM32L053C8Tx.cpu: hardware has 4 breakpoints, 2 watchpoints
Error: jtag status contains invalid mode value - communication failure
Warn : target STM32L053C8Tx.cpu is not halted
Polling target STM32L053C8Tx.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
Warn : target not halted
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target STM32L053C8Tx.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 300ms
Error: address + size wrapped(0xffffffff, 0x00000004)
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target STM32L053C8Tx.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 700ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target STM32L053C8Tx.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 1500ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target STM32L053C8Tx.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 3100ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target STM32L053C8Tx.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 6300ms
Info : dropped ‘gdb’ connection

Hello,

At least the stlink can change its freq so the fw update is ok.

I can see some stuff about protections ?
Can you check the option bytes and remove write protections or other protections to debug.
You can use STM32 STLink utility to manage option bytes.

Then, i don’t know what can cause the other messages.
Is it a custom board or a nucleo board ?
If it is a custom board, did you connect the reset line from STLink to the mcu reset pin ?

If reset is not connected, you can choose the “software system reset” in debug config (debugger tab).
But it would be preferable to connect reset to avoid issues if you’ll use low power modes or SWD as GPIOs.

Rgds,
Laurent


Hi Laurent!

I’m really sorry for the late reply. I’m using a STM32L0-discovery board. Meanwhile I’m pretty shure that the problem originates not from the board since, I tried it on a different machine running Linux OS and I do not face any problems there. Hence, I guess I can live with that solution.

Many thanks for your advice!

BR
Thomas


Hi Guys

I kind of have the same issue. I use sw4stm32 (2.3) on windows 10, with a Nucleo-F103RB configured thanks to stm32cubemx.

Configuring, compiling, running the project works fine but there’s an issue when I try to debug it, as you can see on the report downstairs.

I have tried couple of configurations using another computer or another Nucleo board, but the problem remains the same.

I followed your advices, as updating the stlink, I can’t find a solution.

Do you see what I’m doing wrong?

Regards,

Cédric.

=====
OpenOCD child process termination

Reason:
Unplugged target during debug session

--- Details ---

Unplugged target during debug session
Open On-Chip Debugger 0.10.0-dev-00005-g4030e1c-dirty (2017-10-24-08:00)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
srst_only separate srst_nogate srst_open_drain connect_assert_srst
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter_nsrst_delay: 100
adapter speed: 950 kHz
Info : tcl server disabled
Info : telnet server disabled
Info : clock speed 950 kHz
Info : STLINK v2 JTAG v29 API v2 M v18 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 58.019050
Info : Stlink adapter speed set to 950 kHz
Info : STM32F103RBTx.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting ‘gdb’ connection on tcp/3333
Info : Stlink adapter speed set to 950 kHz
adapter speed: 950 kHz
STM32F103RBTx.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080012f0 msp: 0x20005000
Info : Stlink adapter speed set to 4000 kHz
adapter speed: 4000 kHz
Info : device id = 0x20036410
Info : flash size = 128kbytes
Info : Stlink adapter speed set to 950 kHz
adapter speed: 950 kHz
STM32F103RBTx.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080012f0 msp: 0x20005000
Info : Stlink adapter speed set to 950 kHz
adapter speed: 950 kHz
STM32F103RBTx.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080012f0 msp: 0x20005000
Info : Stlink adapter speed set to 4000 kHz
adapter speed: 4000 kHz
STM32F103RBTx.cpu: target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x2000003a msp: 0x20005000
Info : Stlink adapter speed set to 950 kHz
adapter speed: 950 kHz
STM32F103RBTx.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080012f0 msp: 0x20005000
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: jtag status contains invalid mode value - communication failure
Polling target STM32F103RBTx.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target STM32F103RBTx.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 300ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target STM32F103RBTx.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 700ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target STM32F103RBTx.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 1500ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target STM32F103RBTx.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 3100ms
shutdown command invoked


Info : dropped ‘gdb’ connection

It works, problem solved.

Thanks Laurent,

Cédric.


hi guys !
am actually new to the stm32 n am having an issue debugging my board ; it s an NZ32sX board from modtronix based on stm32l151 , i use USB port to power up the board N This board doesn’t open an UART or serial interface threw the USB automatically, and the USB device driver hasn’t been implemented to RIOT yet. Therefore, to open an UART interface one has to connect a usb/ttl converter to the UART3 pins PB11 (RX3) and PB10 (TX3 so i added a digilent board so i can observe the hello world in a terminal
when i build the project using the SW4STM32 software, the built is fine but when i try to debugg it i get an error

here is the CODE :

  1. include “mbed.h”


DigitalOut myled(LED1);
DigitalIn myButton(USER_BUTTON);
Serial pc(USBTX, USBRX); //Use default TX and RX. Available via USB Com port when using PGM-NUCLEO programmer

int main() {
pc.printf(“\r\nHello World”); // Write to default UART. Available via USB Com port when using PGM-NUCLEO programmer

//Endless while loop
while(1) {


myled = 1; // LED is ON
wait_ms(1000); // 200 ms
myled = 0; // LED is OFF
wait_ms(1000); // 500 ms
}
}



the ERROR message :
problem occured :Error in final launch sequence
Failed to execute MI command:
-target-select remote localhost:3333

Error message from debugger back end:
localhost:3333: Le système a tenté de joindre un lecteur à un répertoire stocké sur un lecteur joint.
localhost:3333: Le système a tenté de joindre un lecteur à un répertoire stocké sur un lecteur joint.


i don’t use any STlink , just the nz32 board n to upload the code i use DFU bootloader so i don’t understand the origin of the following error n how to fix it so it’d debug successfully :

openOCD child process termination
Reason :
unpluged target or STLink already in use or STlink USB driver not installed

Open On-Chip Debugger 0.10.0-dev-00007-g58350bc-dirty (2018-01-12-12:21)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter_nsrst_delay: 100
adapter speed: 240 kHz
Info : tcl server disabled
Info : telnet server disabled
Info : clock speed 240 kHz
Error: open failed (no matching adapter found)
in procedure ‘init’
in procedure ‘ocd_bouncer’


can anyone help me out here ?
regards

Hello,

You should write your own post for a new subject, your issue has no link with this post (STLink V2 on STM32L...)

Nevermind, i can answer quite quickly, SW4STM32 is debugging with STLink probe (JLINK can be used but you need to tweak the config files) so your dev board environnement will never be supported by SW4STM32.

For your error : Error: open failed (no matching adapter found) in procedure ‘init’
It means, it hasn’t found a STLink board adapter connected on USB.

Rgds,
Laurent

hi laurent !
sorry for the misplaced post !
i have absolutely no idea how to use JLINK or what is needed to be changed in the config files so my board environnement will never be supported by SW4STM32 so would you please give me a hint or be kind enough to tell me how to do that ?
kind regards

Hi,
Your board has no debug probe (STlink or other) so you should buy an STlink and then connect to the SWD pins and Reset of the STM32 and then you will be able to debug.

I googled NZ32xS board and didn’t find anything.
Ok, found a Modtronix NZ32-SC151 board with STM32L151RC.
On website, it says for : Programming and Debugging
This board can be programmed using the following methods:
• Using the STM32 built in USB or UART Bootloader.
• Using the Modtronix PGM-NUCLEO programmer and debugger. Programming is via ST-LINK/V2-1 or Drag and drop. Additionally a USB virtual com port is provided for debugging.

So, you can reprogram your appli via the bootloader but you can’t debug it as is, you need to connect a probe.

Rgds,
Laurent

i get it now , so to debug i need a debug probe ! thanks
Yeah that ‘s the board i am using : nz32sc151
regards