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


FreeRTOS Thread Debugging with SW4STM32

Hi,

I’m a happy user of SW4STM32 and STM32CubeMX under linux (ubuntu 64).

Nevertheless, I recently tried to use thread debugging of a FreeRTOS based application within SW4STM32 for a CubeMX generated project. Here is a blog post showing how to configure OpenOCD in order to show the FreeRTOS tasks (Simply tell openOCD that you are using a RTOS by adding “-rtos FreeRTOS” to the “$_TARGETNAME” configure line in the target scripts file):
https://mcuoneclipse.com/2016/04/09/freertos-thread-debugging-with-eclipse-and-openocdQuestion

As SW4STM32 debug is based on OpenOCD and GDB, everything is going fine: all freeRTOS tasks appears in the debug view when I stop the execution of the program!
Nevertheless, this only work when the program execution is stopped in the first created task, and it works only once. Then, the debug session closed (GDB and OpenOCD “terminated”) with this error message in openOCD console view:
Error: Error reading first thread item location in FreeRTOS thread list

Any idea of what is going wrong ?

This could be a really great feature if it works out of the box !

Thanks in advance and for all the work made on SW4STM32.

Best regards,

BDufay

Tunisia

Hello Basile,

Have you used the FreeRTOS helper (FreeRTOS-openocd.c) ?
Does this error appears before or after the FreeRTOS scheduler is started ?

Regards,
Tarek


interstesting i’m not yet at this level (CubeMx proj on Discoveryf4)
i added the freetros in cfg file
i added the helper symbol

start debug gdb start but not wokring
in debug view no stop pause no thread frown

what appar on the end of the gdb console

New Thread 1
Warning: the current language does not match this frame.

New Remote target
Switching to Remote target
Invalid selected thread.

it work witthout the rtos configure in cfg but no Rtos awarness

France

Hi,

The problmem may be that OpenOCD sees there is FreeRTOS in your applications, but it can’t get the list of threads as there is no initialized data and no thread list; if you put a breakpoint after creating the first task (or better in the body of the first task) instead of putting it at main it should work.

We are looking at a solution for this but, regretfully, it will take some time...

Bernard (Ac6)


Hi BDufay!

Did you get it to work?


Could you please explain how to configure the SW4STM32 to debug with FreeRTOS?

I tried following the MCUonEclipse post, but got stuck in changing the config file, as I am using “manual spec” and selecting the stlink & SWD
or at least how do I create a debug script?
probably is something really easy, but im not getting neutral


thx in advance!


Nevermind, just got it working!

My workspace was some sort of broken, so I was not able to use local scripts, after crating a new workspace I got it debugging thru the local .cfg file

then just added

const int attributeused uxTopUsedPriority = configMAX_PRIORITIES;

to my source code
and

$_TARGETNAME configure -rtos FreeRTOS

to the .cfg and Its running (is important to add it after the inclusion of the “source find target/stm32f1x_stlink.cfg” line)


Thanks folksbiggrin


good to know
have to give it a new try
thansk for the feedback


Just a update:

I’ve noted that some of my tasks were missing in the list (typically tasks with more time paused) and I found a correction to the code:

const int USED uxTopUsedPriority = configMAX_PRIORITIES - 1;


this happens because of the way OpenOCD uses the number in uxTopUsedPriority to access an array, causing an out of bound access, explained better in these topics:

http://forum.segger.com/index.php?page=Thread&postID=12422Question

https://sourceforge.net/p/openocd/mailman/openocd-commit/thread/From_openocd-gerrit@users.sourceforge.net_Wed_May_04_21%3A40%3A13_2016/Question

smile