Skip to main content
Gianluca Costa
Associate II
June 20, 2018
Solved

Debug freeRTOS threads using GDB+openodc (SW4STM32)

  • June 20, 2018
  • 2 replies
  • 4129 views
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

    This topic has been closed for replies.
    Best answer by Hans Jonker
    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.

    2 replies

    Hans Jonker
    Associate III
    June 21, 2018
    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
    June 21, 2018
    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.

    Hans Jonker
    Hans JonkerBest answer
    Associate III
    June 22, 2018
    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.

    Gianluca Costa
    Associate II
    June 22, 2018
    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