cancel
Showing results for 
Search instead for 
Did you mean: 

Issues Debugging FreeRTOS with J-Link

Artur Vieira
Associate III

Having some issues trying to debug a FreeRTOS project using JLink, using an STM32U5G9 (Riverdi 5" Display Board)

 

If I enable "serverRtos" in the launch configuration:

"configurations": [
        {
            "type": "jlinkgdbtarget",
            "request": "launch",
            "name": "STM32Cube: STM32 Launch JLink GDB Server",
            "origin": "snippet",
            "cwd": "${workspaceFolder}",
            "preBuild": "${command:st-stm32-ide-debug-launch.build}",
            "runEntry": "main",
            "serverSpeed": "12000",
            "serverRtos": {
                "enabled": true,
                "port": "60000",
                "driver": "freertos",
                "driverPort": "ARM_CM33_NTZ"
            },
            "preRunCommands": [
                "monitor exec SetRTTSearchRanges 0x200bb800 0x234800" 
            ],
            "imagesAndSymbols": [
                {
                    "imageFileName": "${command:st-stm32-ide-debug-launch.get-projects-binary-from-context1}"
                }
            ]
        }
    ]

And then try to start a debug session, i get a disconnect error:

Reading 20 bytes @ address 0x200C2A5C
Read 4 bytes @ address 0x200C2A28 (Data = 0x200C2970)
Read 4 bytes @ address 0x200C2A58 (Data = 0x200BEA20)
Read 4 bytes @ address 0x200C2A6C (Data = 0x200C2A18)
Reading 16384 bytes @ address 0x200BEA20
RTOS proxy: Missing symbol: pxCurrentTimerList.
Lost connection to GDB Server
Read 4 bytes @ address 0x200C2A78 (Data = 0x00000018)
GDB closed TCP/IP connection (Socket 1028)
{"label":"","value":[{"label":"Driver","value":"freeRTOS"},{"label":"Kernel state","value":"Started"}]}
RTOS proxy: Proxy stopped.
RTOS proxy: C:\Users\artur\AppData\Local\stm32cube\bundles\rtos-proxy\0.17.0+st.3\bin\RtosProxy has exited with code 0Remote communication error.  Target disconnected: error while reading: No error.
GDB response with no command: 14
Restoring target state and closing J-Link connection...
Shutting down...
cube has exited with code 0

 

It complains about not finding "pxCurrentTimerList" although it is present in the map file (I even created a rtos timer on purpose to make sure that there where timers in use).

 

Already using J-Link bundle pack 8.38.0+st.1 as recommended by https://community.st.com/t5/stm32cubeide-for-visual-studio/cannot-start-rtos-aware-debug-session-using-j-link/m-p/870735/highlight/true#M1827.

 

Also added the code suggestion indicated in https://community.st.com/t5/stm32cubeide-for-visual-studio/stm32cube-rtos-state-not-showing-all-queues-semaphores/m-p/865915/highlight/true#M1708 since initially was also complaining about missing "xQueueRegistrySize".

 

The processor I am using is a STM32U5G9, does the "serverRtos" has a limitation on the RAM range where it tries to fetch this kind of data? Something similar to an issue with Segger RTT that the auto-discovery of RTT Block is limited in range by default. This because at the moment I am reserving a big block of RAM starting at base address for the display buffer.

 

Thank You

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Seems to be solved in latest extension update.

 

Using:

JLink-gdbserver v9.14.1+st.1
rtos-proxy v0.18.1+st.3

 

View solution in original post

5 REPLIES 5
Florent V
ST Employee

Hi @Artur Vieira,

Could you please add the following attribute to check if the error message becomes more detailed?

"verbose": true

And also, in a second test, disable the serverRtos to check if the issue persists.

Best Regards,
/Flo

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Could you please add the following attribute to check if the error message becomes more detailed?
"verbose": true

 


@Florent V I have tried enabling "verbose", the error is more os less the same:

To client: {"seq":0,"type":"event","event":"output","body":{"category":"proxy","output":"RTOS proxy: Missing symbol: pxCurrentTimerList.\r\n"}}
RTOS proxy: Missing symbol: pxCurrentTimerList.
To client: {"seq":0,"type":"event","event":"output","body":{"category":"proxy","output":"RTOS proxy: Lost connection to GDB Server\r\n"}}

 In attachment the full log output.

The variable "pxCurrentTimerList" is defined at the following address according to "arm-none-eabi-nm.exe" parsing the elf file...

20020f08 B pxCurrentTimerList

And it's also visible in the "map" file:

 .bss.pxCurrentTimerList
                0x20020f08        0x4 cmake/stm32cubemx/CMakeFiles/RTOS2.dir/__/__/Middlewares/Third_Party/FreeRTOS/Source/timers.c.obj
                0x20020f08                pxCurrentTimerList

 


And also, in a second test, disable the serverRtos to check if the issue persists.

Yes, if I disable the serverRtos, the debug session starts normally, obviously without the RTOS information.

 

Thank You

Hi @Artur Vieira,

Thank you for the log.
Indeed, the error is not more explicit.
So far, I have not been able to reproduce it on my side. 
Even though the variable seems well defined, I wonder if it might be the cause of the issue or at least producing a side effect.
Would it be possible to share the project or a lightweight version ?

Kind Regards,
/Flo

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

@Florent V You can check this GitHub repo https://github.com/arturv2000/lvgl_riverdi5 it's the current test project. 

 

This is an LVGL integration project so it's quite "large".

Just one thing to keep in mind, do not regenerate the project using the ioc files, the current code is no longer "compatible" with it....

 

 At the moment, tried to use the Cortex-debug extension and it works, the RTOS tasks and info appear, although have an issue with it, but it's not relevant to this.

Seems to be solved in latest extension update.

 

Using:

JLink-gdbserver v9.14.1+st.1
rtos-proxy v0.18.1+st.3