[Keil + RTX] "Call Stack" window only shows current thread and "System and Thread Viewer" is empty when selecting compiler version 6

Hi everyone,

I am maintaining the software for an old product. A lot of developers have touched the software over the years. (It is unfeasable to redo the entire project, so maintaining it is)

I chose the title of this question for searchability but essentially the entire RTOS aware debugging is gone. For reproducability I copied over one of the CMSIS examples which I will post below.

The system is compiled and debugged in µVision Keil (version 5.39.0.0). The software is running on an STM32 µC tho that shouldn't be important. My test bellow runs on an old STM32F103.

Through some testing I figured out that the culprit is the setting for the compiler version: selecting "Use default compiler version 5" allows Keil to start the RTOS aware debugging while "Use default compiler version 6" breaks the RTOS aware debugging.

I looked through the symbols in the generated axf file because it's likely that the RTOS aware debugging feature uses debug symbols to find the data to display however I found no meaningful difference between compiler version 5 and version 6.

My question is: What exactly regarding compiler version 6 causes the RTOS aware debugging to no longer work? What would I need to do/enable/set to bring back RTOS aware debugging when using default compiler version 6?

The test code (compiled with either compiler version 5 or 6 in µVision Keil with following packs: "ARM::CMSIS" v5.9.0 and "Keil::STM32F1xx_DFP" v2.4.1 and seleted the old "Keil RTX" RTOS with the "CORE"):

#include <cmsis_os.h>                                         // CMSIS RTOS header file

void job1 (void const *argument)  {              // thread function 'job1'
  while (1)  {
                                                // execute some code
    osDelay (10);                                // delay execution for 10 milliseconds
  }
}
 
osThreadDef(job1, osPriorityAboveNormal, 1, 0);  // define job1 as thread function
 
void job2 (void const *argument)  {              // thread function 'job2'
  osThreadCreate(osThread(job1),NULL);           // create job1 thread
  while (1)   {
                                               // execute some code
  }
}
 
osThreadDef(job2, osPriorityNormal, 1, 0);       // define job2 as thread function
 
void job3 (void const *argument)  {              // thread function 'job3'
  while (1)   {
                                                // execute some code
    osDelay (20);                                // delay execution for 20 milliseconds
  }
}
 
osThreadDef(job3, osPriorityNormal, 1, 0);       // define job3 as thread function
 
int main (void) {                                // program execution starts here
  osKernelInitialize ();                         // initialize RTOS kernel
                                                // setup and initialize peripherals
  osThreadCreate (osThread(job2), 0);
  osThreadCreate (osThread(job3), 0);
  osKernelStart ();                              // start kernel with job2 execution
}

Executing this code with compiler version 6 makes the debugger behave like this:

Executing this code with compiler version 5 instead makes it behave correctly (no other settings touched):

Thanks alot for your help!