cancel
Showing results for 
Search instead for 
Did you mean: 

Debug freeRTOS threads using GDB+openodc (SW4STM32)

Gianluca Costa
Associate II
Posted on June 20, 2018 at 15:33

Hi All,

I'm developing an application using CubeMx to generate the basic code. On CuebMx I enabled freeRTOS and LWIP.

Now I would like debug my threads but Eclipse gives me access only on the thread in esecution before the break/stop.

Someone (knows and so) can give me a link or the tips to enable on Eclipse  the view of all threads allocated?

Thanks... for any help.

Gianluca

1 ACCEPTED SOLUTION

Accepted Solutions
Posted on June 22, 2018 at 07:34

Well, the NXP thing works fine for the STM, there is actually nothing NXP specific in it, except it seems to have been made by them guys. I can only but guess that the ST-Link works equally fine, but I never tested that, for reasons beyond scope of this conversation.

View solution in original post

6 REPLIES 6
Hans Jonker
Associate III
Posted on June 21, 2018 at 07:58

Search for FreeRTOS Task Aware Debugger for GDB. This will lead you to an eclipse plugin (by NXP, sorry ST). I got that working with a segger SWD JLink.

Given proper setup, it will provide you with details on how much time was spent in each task, stack usage, the task state, what is blocking the task etc.

Kind regards,

     Hans Jonker

Gianluca Costa
Associate II
Posted on June 21, 2018 at 08:08

Hi Hans,

I read the article in reference to NXP but I wanted to know if there is something for the STM32 and with the interface ST-link v2

(the ST SWD interfacce).

Know where are sleeping my threads (more over if in deadlock) can be more useful .

Ciao.

Posted on June 22, 2018 at 07:34

Well, the NXP thing works fine for the STM, there is actually nothing NXP specific in it, except it seems to have been made by them guys. I can only but guess that the ST-Link works equally fine, but I never tested that, for reasons beyond scope of this conversation.

Posted on June 22, 2018 at 10:08

Many thanks.

I found how to enable GDB+openodc to read the info about freeRTOS thread (stacks). The useful link was:

https://mcuoneclipse.com/2016/04/09/freertos-thread-debugging-with-eclipse-and-openocd/

 

As you said anlso the plugin for Eclipse developed for NXP work well on STM32, and this without enable freeRTOS debug on GDB/openodc. This link describes how to install the plugin:

https://mcuoneclipse.com/2016/07/06/freertos-kernel-awareness-for-eclipse-from-nxp/

 

Ciao

Hello Costa,

I read the thread and tried to follow your last post with no success.

I'm working with SW4STM32 and debug with STLink (I have J-Link but I used the STLink as a first choice as it is on my eval board)

I successfully install the NXP plugin you pointed to and it is working fine.

What I need most is the thread aware part and for that I tried to follow your first link with no success.

GDB gave me error message, did you configure GDB as well?

Do you debug with Ac6 STM32 Debugging?

Can you give me some more details on how you make it work?

Thanks

Eyal

Hi Eyal,

did you add the "$_TARGETNAME configure -rtos FreeRTOS" in your gdb configuration file?

This was my configuration file for STM32F746BGTx uC.

source [find interface/stlink.cfg] 
 
set WORKAREASIZE 0x8000
 
transport select "hla_swd"
 
set CHIPNAME STM32F746BGTx
 
 
# Enable debug when in low power modes
set ENABLE_LOW_POWER 1
 
# Stop Watchdog counters when halt
set STOP_WATCHDOG 1
 
# STlink Debug clock frequency
set CLOCK_FREQ 4000
 
# use hardware reset, connect under reset
# connect_assert_srst needed if low power mode application running (WFI...)
reset_config srst_only srst_nogate connect_assert_srst
set CONNECT_UNDER_RESET 1
 
source [find target/stm32f7x.cfg]
 
$_TARGETNAME configure -rtos FreeRTOS