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


CubeMX - only Debug ?

Newcomers questions ... and yes, I did use Google etc. ... :-) ... tried at least ...

So I used the latest versions as of today on a clean notebook that otherwise never had any development stuff installed. Installed JRE, Eclipse, Workbench and CubeMX. I used the nice
tutorial on how to use CubeMX with the Workbench ... In my case I used a STM32F429 Discovery board and left everything to defaults in the CubeMX ... an empty project so to say.

CubeMX generated code and I imported that into the Workbench ... it compiled ... it also loaded onto the board (btw. how do I ever get that fancy demo back which came preinstalled :-) ...) ...

The first thing I noticed was that in the console I see 2 times the same message which basically states that the system is stopped, deleted, flashed, started and then terminated.
Also breakpoints are mentioned while I never set any of them :-( ... and I didn’t even want
to debug I just wanted to run that stuff.

Since there is a while(){...} at the end of main.c I really don’t understand that ... why do that twice and how does that exit from the while, etc. ... strange.

So I decided that I needed a Release version ... but that turned out not to be an option.
When I activated that I got a file not present error ... I checked in the setup and YES,
the include directories are there only when on Debug not when on Release. So I copied
that information and also attempted to find other places of differences between Debug and Release that shouldn’t be there ... well, it only got worse and worse. Frankly - if I want to handle all that compiler, linker, etc. stuff by my own I can also use Ultra Edit and a command line and not bother with a GUI at all. So I wonder what I have to do to get a working Release build ... does anybody know what I did wrong ?

Then of course I thought it would be just great to put anything into that empty loop to see if it gets executed at least ... why not switch an LED, right ? Well, PG13 and PG14 are connected to LEDs and they are even defined as LD3 and LD4 from the CubeMX ... I tried a couple of things but nothing was “in the right language” it seems ... so my next question now is: Is there a truly useful website or PDF or other where I can find out what function to call for various purposes ? I really thought switching on an already set up and initialzed GPIO pin should be as easy as it can get ...

Hmmm, after programming embedded for decades and already 3 different new types of controllers this year without much trouble I find this STM32F world rather frustrating. So much stuff on the Internet for so many possibilities but judging by all the complaints a lot of things don’t quite work. I really hoped that this Workbench would solve it for me :-) ...

OK, I answer on my own post to add some info ...

... found out how to toggle that LED ... still need a way to learn all about that HAL ... philosophy, list of functions, list of defines ... how to use it right

... here’s what I get at the end of a successfull “Build all” and “Run” (I still only have the Debug configuration) ...


...
Info : STLINK v2 JTAG v17 API v2 SWIM v0 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 2.863477
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000f4c msp: 0x20030000
configuring PLL

    • Programming Started **

auto erase enabled
Info : device id = 0x10036419
Info : flash size = 2048kbytes
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x20000042 msp: 0x20030000
wrote 16384 bytes from file Debug/Test.elf in 0.998401s (16.026 KiB/s)

    • Programming Finished **
    • Verify Started **

target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x2000002e msp: 0x20030000
verified 4184 bytes in 0.219401s (18.623 KiB/s)

    • Verified OK **
    • Resetting Target **

shutdown command invoked



What bothers me is ... the LEDs are still blinking while I write this ... so what are all these breakpoints and shutdown ? Guess I shouldn’t think about it any more as things are running now ... Probably just the status of the STlink, not of the target ...

Still the other things remain ... but OK, the LEDs blink, so life is good :-) (used to do that with a couple of transistors or even lower stuff once upon a time :-) ...)


When you used “run’ the “debug” configuration was used it is “run or debug” condfiguration.

Run basicaly program the binary into the mcu flash and then reset “shutdown” the devcie when done.

that shutdwon message is certainly concerning the debugger that is use to flash.
over break message is also comming from debugger. Aftrer mcu reset, the cpu was halted on the reset vector
or neraby ( pc: 0x20000042 ) what is best done as we want the mcu in a known state and halted while we reprogram it’s flash.

It is Like if you started debug , did not ran any code and exit imediatly reseting the board.
btw most user just do not look at all this debugger mesage , just do the same unless you’r having debugger or debug start issue ;)


I can only agree stm32 world is a bit frustrating for new comer , can be a bit hard to start but then it is not so bad :-D

to get demo again on board get the binary from st site (reflash using stlink utility)
or open the board demo project rebuilt and flash it wit the workbench.
As you installed CubeMX CubeF4 lsources are in “C:\Users\michel\STM32Cube\Repository\STM32Cube_FW_F4_V1.9.0\Projects\STM32F429I-Discovery\Demonstrations\SW4STM32”
just replace michel and f/w version by your user name and version you get (

Note that using existing example project is btw a nice way to learn ;)

Hmm ... thanks ... the problem I have is that after using CubeMX to configure pins and middleware and code generation
I import all the generated code (project) into the workbench and there I only get a working setup for Debug but non for
Release ... but after finishing with debugging I would like to build a Release in order to be faster and use less memory.


If you look in the .cproject file for your project, you will find that CubeMX included a commented out messed up Release configuration for you project. I have no idea what it would take to make it right, and I guess the CubeMX people don’t either.