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 two short videos (registration required) highlighting:

System Workbench for STM32


Some (beginners) problems with OpenSTM32

Hello,
I’m new to STM32, and I have some problems:
I’m working with Linux (KUbuntu)

When I create a Project with CubeMX and finaly import it, everything seems to be fine until I try to create and include my own header-file in the main.c created by CubeMX.
According by the view, it seems to be in the same directory than the main.c, but it isn’t and it cannont be found by the Compiler.

For example, if my project is called “oled, I can find the main.c in “oled/Src”, and my newly created “oled.h” is found in “oled/SW4STM32/oled/Application/User”.

What the hell went wrong?

My second Problem:

I’m trying to use an ST-Link v2.
It is working with my maplemini if I use it manualy, but in SW4 I always get the following errors, if I try to connect to my board:


02:33:33 **** Programing project oled on chip ****
/home/harry/.eclipse/org.eclipse.platform_4.5.2_1473617060_linux_gtk_x86_64/plugins/fr.ac6.mcu.externaltools.openocd.linux64_1.8.0.201603291120/tools/openocd/bin/openocd -f oled.cfg -s /home/harry/workspace/ARM/oled/SW4STM32/oled -s /opt/eclipse/../../home/harry/.eclipse/org.eclipse.platform_4.5.2_1473617060_linux_gtk_x86_64/plugins/fr.ac6.mcu.debug_1.8.0.201603291114/resources/openocd/scripts -c “program Debug/oled.elf verify exit”
Open On-Chip Debugger 0.10.0-dev-00265-g12ff60f (2016-03-11-12:04)
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 v17 API v2 SWIM v4 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.208900
Error: init mode failed (unable to connect to the target)
in procedure ‘program’
in procedure ‘init’ called at file “embedded:startup.tcl”, line 473
in procedure ‘ocd_bouncer’

    • OpenOCD init failed **


Openstm1

Why can’t I change anything? - wrong place?

Harry

Hi

When ac6 imports a CubeMX created project it creates a physical folder structure below //SW4STM32/

Files initially there are links (not unix symlinks) to physical files created by CubeMX.
See also http://www.openstm32.org/forumthread543Question

Go to right click Project Explorer -> Properties -> C/C++ Build -> Settings -> Includes and add (Workspace) “User” folder.

For debug configuration go to Menu -> Run -> Debug Configurations and select a proper created openocd script.

Dieter


Thanks for the response!

Problem 1 is solved, and the debugging-problem is still in progress, but i’m some steps further ...I’l report.

Harry


Ok, debugging works so far...thanks a lot!

Now there is one problem left, when i try to program the chip: (target->prorgramm chip)

05:06:02 **** Programing project test1 on chip ****
/home/harry/.eclipse/org.eclipse.platform_4.5.2_1473617060_linux_gtk_x86_64/plugins/fr.ac6.mcu.externaltools.openocd.linux64_1.8.0.201603291120/tools/openocd/bin/openocd -f test1.cfg -s /home/harry/workspace/ARM/test1/SW4STM32/test1 -s /opt/eclipse/../../home/harry/.eclipse/org.eclipse.platform_4.5.2_1473617060_linux_gtk_x86_64/plugins/fr.ac6.mcu.debug_1.8.0.201603291114/resources/openocd/scripts -c “program Debug/test1.elf verify exit”
Open On-Chip Debugger 0.10.0-dev-00265-g12ff60f (2016-03-11-12:04)
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
in procedure ‘program’
in procedure ‘init’ called at file “embedded:startup.tcl”, line 473
in procedure ‘ocd_bouncer’

    • OpenOCD init failed **

shutdown command invoked

I’ve used the board-definition i created when initialy launched openocd.

What’s going wrong?
I think, it has to do with the reset-handling....any idea?

Harry


Ok, now I’m totaly confused!
My debugger “run by acceident”
I’ve forgotten to stop my manualy started openocd in an xterm.
That prevents openstm to start another openocd because the network-port is already occupied.
In this setup debugging works!

If eclipse starts the openocd, debugging don’t work, and I think, I’ve discored why:

The debug-script generated by OpenSTM looks like this:


  1. This is an test1 board with a single STM32F103C8Tx chip.
  2. Generated by System Workbench for STM32


source find interface/stlink-v2.cfg

set WORKAREASIZE 0x5000
transport select “hla_swd”


source find target/stm32f1x_stlink.cfg

  1. use hardware reset, connect under reset

reset_config srst_only srst_nogate



The problem in this setup are the 2 lines “transport select” and reset_config.
If I comment out this lines, and start openocd manualy with this script, everything works like expected, but as soon, as I try to debug from eclipse this file ist overwritten with it’s old content.
I than tried to use a custom debug-script (the above content with the 2 lines commented out), but eclipse seems to ignore this script.

Is there a template that i can change, or at which place do I find the srew to adjust this behavior?

Harry


Hi Harry,

this is how I solved the openocd problem: http://www.openstm32.org/tiki-view_forum_thread.php?comments_parentId=2221&topics_offset=69Question

Create a file blabla.cfg and refer to it as “local script” in the Debugger tab of the run/debug configurations dialog.
This file will not become overwritten.

I’m very interested to know whether this works out of the box for you
My Installation is totally recent and I had to replace
~/.p2/pool/plugins/fr.ac6.mcu.debug_1.7.0.201602121829/resources/openocd/scripts/target/stm32f1x.cfg (s.o)

BTW transport select “hla_swd” should be ok. The problem seems to be the reset config alone.

I’m using a Maple-mini (clone from ebay) and an ST-link v2 (clone from ebay).

Dieter


Hi Dieter,
seems to be exactly my setup!
I’m also using a maple-mini-clone from china and an ST-LINK V2 from ebay.

I’ll tried that already, but, I’ll give it a second chance.
Perhaps there was some caching involved in my 1st try.

Harry

Sir ,

I am novice to SystemWorkbench .

I haven’t set up openocd but SystemWorkBench can load/debug programs to STM32F4 Discovery Board .

While with custom board and st-link , it cannot load/debug programs.

Please let me know whether in this scenario openocd needed or not . And if needed how can I proceed ?

- Pinkesh


No, that dosn’t work!
openocd is terminated with returncode 143

Harry

edit still the reset-problem

Sorry for coming in late, not sure if you have solved it.

But with my maple-mini there are no RST line via that 4 pin SWD header.

I had to set under (Debug/Run settings/Debugger/Mode Setup) the dropdown to “Software system reset”

This then sends the reset as a command via SWD.


Tunisia

Hello Harry,

Have you connected the NRST pin of your maple-mini to the NRST pin of your ST-Link V2 ?

Regards,
Tarek BOUCHKATI


My problems are solved by a workaround.
For now I’m using the ST-Link V2.1 on my nucleo-board.

That works as expected.

Harry


Hi All,

I’m new in this area and have a small but for me very big problem. I can’t Run/Debug my project using Workbench. At trying to do it the tool returns following Error message:

” OpenOCD child process termination

Reason:
Unplugged target or STlink already in use or STlink USB driver not installed”

Need to mention that my target is plugged and I can program and debug it by using Keil uVision.

Could you please help me to solve this issue?

Thanks In Advance,
Hayk

Hi,

Make sure that you have finished debugging with Keil or any other tool connected to the STlink.
You can retry debug then.
The error msg saying that STLink might be already in use by another tool.

Rgds,
Laurent


Hi LaurentL,
Thank you for response,

I have closed Keil and tried it again but the same result.

Thanks,
Hayk


Hi Laurent,

Yes I have done it more then one time. I’m using STM32VLDISCOVERY board (MCU: STM32F100RB).
I’m programming the board by means of Keil with ST-Link Debugger and don’t get any problem/issue.
At programming by System Workbench it requires ST-Link/V2 and I can’t find option where I can change ST-Link/V2 to ST-Link. As I understood the on board debugger of my board is ST-link (not ST-Link/V2) so may be I need to change the debugger option? And if yes than how can I change it?

Regards,
Hayk


Hi,

The STM32VLDiscovery board is not supported by SW4STM32.
Because as you said, It has a STLink V1 embedded. (no USB driver needed for this STLink version).

In the list of STM32F1 boards supported, the VLdisco is not present.
see http://www.openstm32.org/Supported%2BSTM32%2BboardsQuestion

Rgds,
Laurent


To mr_hayko,

You also can see that the board is not present in the list when you create a project for the STM32F1 family.
Only Nucleo or Eval boards appear in the list.

Rgds,
Laurent


Hi Laurent,

Thank you very much, you were very supportive.
Thank you!!!

Best Regards,
Hayk