-stack-list-frames error with invalid thread ID

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

-stack-list-frames error with invalid thread ID

1,788 Views
matt_ellis
Contributor II

I'm getting an error message when I "suspend" a debugging session for the first time after starting a debug session.  I'm using the following:

  • S32 Design Studio for ARM Version 2018.R1
  • JLink Ultra+ debugger V4.5
  • FreeRTOS V10.1.1
  • SEGGER J-Link GDB Server V6.40 Command Line Version (JLinkGDBServerCL.exe)  with FreeRTOS aware debugger RTOSPlugin_FreeRTOS.dll
  • S32K144 mcu (Cortex M4F)

The error dialog I get is as follows, indicating that there is an "Invalid thread id:2".....

Which kind of makes sense since there is no Thread 2 listed in the debugger thread list:

After clicking "OK" in the error dialog, I'm able to debug and things seem to work fine.  I don't see the error dialog again when I suspend the debugger; it only shows up the first time.

Any ideas?  Thanks for your help!

Matt

Labels (2)
9 Replies

1,457 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

tried reproduce  your issue, but no success. I have only j-link lite probe and  I'm using FreeRTOS v10.0.1 from SDK. If it is possible you can share your project and I'll try it on my machine.  

Jiri

0 Kudos

1,457 Views
matt_ellis
Contributor II

Hi Jiri,

Thanks for the quick response!  I'll be happy to share my project.  Could you provide instructions on how I should share it?

Thanks,

Matt

0 Kudos

1,457 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

in reply just click on Use advanced editor. This feature allows you attach files:

pastedImage_1.png

Jiri

0 Kudos

1,457 Views
matt_ellis
Contributor II

Gotcha; thanks.  Attached is my zipped project directory.  Please let me know if you need anything else.

Best Regards,

Matt

0 Kudos

1,457 Views
BlackNight
NXP Employee
NXP Employee

Hi Matt,

I tried your zip file, but I had troubles to build it (using the default Debug configuration). Not sure why, but for example include paths seem not to be properly configured, and it seems you have mixed FreeRTOS files?

I tried to verify your issue with the project on  mcuoneclipse/Examples/S32DS/S32K144_FreeRTOS_PEx at master · ErichStyger/mcuoneclipse · GitHub  (attached as well), and I don't see what you are reporting. Maybe you can try that project on your side too?

Erich

0 Kudos

1,457 Views
matt_ellis
Contributor II

Hi Erich,

I did implement your port (Tutorial: FreeRTOS 10.0.1 with NXP S32 Design Studio 2018.R1 | MCU on Eclipse), because I wanted to get the latest version of FreeRTOS.   It works great, by the way!  I also implemented Using custom FreeRTOS with S32K SDK and OSIF for ARM | MCU on Eclipse .  In addition I changed the output directory for "Config Folder" to "../source/FreeRTOS_custom" so that I have FreeRTOS_config.h outside of the Generated_Code folder, so that might explain the include path differences you're seeing (I've also added include paths to my source code in the "source/*" directories.

Could you explain why you think I have mixed FreeRTOS files?  If I do have that problem, I'll try to fix it!

I tried the project you suggested.  I'm able to compile and run it, but it doesn't seem to behave correctly for me.  The AppTask doesn't seem to run (a breakpoint set in that function isn't hit and the LEDs don't toggle).

I think your theory about timing between the GDB (J-Link) server and the (Eclipse) GDB client causing the issue makes sense.  Is there a way to modify that timing to delay the GDB client?  I can give that a try and let you know if it resolves the issue.

Thanks,

Matt

0 Kudos

1,457 Views
BlackNight
NXP Employee
NXP Employee

Hi Matt,

yes, that project blinks on my side. But I see that I did not had included the J-Link debug configuration. Have you created that debug configuration on your side?

Just in case: it is attached now with the launch configuration.

I did try to delay the Segger J-Link server, but this did not really help, so I don't have a solution for this.

Your project did not had the needed subfolder includes configured:

pastedImage_1.png

All what it had was this (note the duplicated entries?):

"${ARM_EWL_DIR}/EWL_C/include"
"${ARM_EWL_DIR}/EWL_C/include/arm"
"${ARM_EWL_DIR}/EWL_Runtime/include"
"${ARM_EWL_DIR}/EWL_Runtime/include/arm"
"${ProjDirPath}/Generated_Code"
"${ProjDirPath}/include"
"${S32K144_SDK_GCC_0.8.6_PATH}/platform/drivers/src/lin"
"${S32K144_SDK_GCC_0.8.6_PATH}/platform/devices/S32K144/startup"
"${S32K144_SDK_GCC_0.8.6_PATH}/rtos/osif"
"${S32K144_SDK_GCC_0.8.6_PATH}/middleware/sbc/sbc_uja1169/include"
"${S32K144_SDK_GCC_0.8.6_PATH}/platform/devices/common"
"${S32K144_SDK_GCC_0.8.6_PATH}/platform/drivers/src/sai"
"${S32K144_SDK_GCC_0.8.6_PATH}/platform/devices/S32K144/include"
"${S32K144_SDK_GCC_0.8.6_PATH}/platform/drivers/src/enet"
"${S32K144_SDK_GCC_0.8.6_PATH}/platform/drivers/src/flexio"
"${S32K144_SDK_GCC_0.8.6_PATH}/middleware/lin/include"
"${S32K144_SDK_GCC_0.8.6_PATH}/platform/devices/S32K142/startup"
"${S32K144_SDK_GCC_0.8.6_PATH}/middleware/lin/coreapi"
"${S32K144_SDK_GCC_0.8.6_PATH}/platform/drivers/src/eim"
"${S32K144_SDK_GCC_0.8.6_PATH}/platform/devices/S32K148/startup"
"${S32K144_SDK_GCC_0.8.6_PATH}/platform/drivers/src/adc"
"${S32K144_SDK_GCC_0.8.6_PATH}/platform/drivers/src/erm"
"${S32K144_SDK_GCC_0.8.6_PATH}/platform/drivers/src/pins"
"${S32K144_SDK_GCC_0.8.6_PATH}/platform/devices/S32K146/include"
"${S32K144_SDK_GCC_0.8.6_PATH}/platform/drivers/src/clock/S32K1xx"
"${S32K144_SDK_GCC_0.8.6_PATH}/middleware/lin/transport"
"${S32K144_SDK_GCC_0.8.6_PATH}/platform/devices"
"${S32K144_SDK_GCC_0.8.6_PATH}/platform/drivers/src/ewm"
"${S32K144_SDK_GCC_0.8.6_PATH}/platform/drivers/inc"
"${S32K144_SDK_GCC_0.8.6_PATH}/platform/devices/S32K148/include"
"${S32K144_SDK_GCC_0.8.6_PATH}/platform/drivers/src/quadspi"
"${S32K144_SDK_GCC_0.8.6_PATH}/platform/drivers/src/wdog"
"${S32K144_SDK_GCC_0.8.6_PATH}/platform/pal/spi/inc"
"${S32K144_SDK_GCC_0.8.6_PATH}/platform/drivers/src/rtc"
"${S32K144_SDK_GCC_0.8.6_PATH}/platform/devices/S32K146/startup"
"${S32K144_SDK_GCC_0.8.6_PATH}/platform/drivers/src/flexcan"
"${S32K144_SDK_GCC_0.8.6_PATH}/platform/devices/S32K142/include"
"${ProjDirPath}/Generated_Code"
"${ProjDirPath}/Sources"
"${ProjDirPath}/SDK/platform/drivers/src/clock/S32K1xx"
"${ProjDirPath}/SDK/platform/devices"
"${ProjDirPath}/SDK/platform/devices/common"
"${ProjDirPath}/SDK/platform/devices/S32K144/include"
"${ProjDirPath}/SDK/platform/devices/S32K144/startup"
"${ProjDirPath}/SDK/platform/drivers/inc"
"${ProjDirPath}/SDK/rtos/osif/"

I hope this helps,

Erich

0 Kudos

1,457 Views
jiri_kral
NXP Employee
NXP Employee

Hi Matt, 

I tried your project, but I don't have FreeRTOS which you are using (Probably from Erich's blog). 

Jiri

0 Kudos

1,457 Views
BlackNight
NXP Employee
NXP Employee

Jiri,

yes, that's the port I did. I'll give it a try if I can reproduce it. I saw that message as well with other FreeRTOS ports, and I belive it is about the timing between the GDB (J-Link) server and the (Eclipse) GDB client: if the client asks too early for the threads and the J-Link was not able to read the memory yet, such a message might appear. That's at least what I think.

Erich