Problems Simulating CMSIS RTOS

Discussion on both general simulation and Proteus VSM microcontroller simulation.
Post Reply
strat57
Unlicenced User
Posts: 1
Joined: Thu 2021-12-23 22:43

Problems Simulating CMSIS RTOS

Post by strat57 »

Has anyone had any success simulating CMSIS-OS RTOS (really just a hardware abstraction of FreeRTOS) on any of the ST microcontrollers?
I tried to follow the example here https://embetronicx.com/tutorials/micro ... -cmsis-v2/
which seems to show it running in a Proteus testbench. However, when I try, I get multiple issues.

The first issue I traced to the way the priority bits are determined...
/* Determine the number of priority bits available. First write to all
possible bits. */
*pucFirstUserPriorityRegister = portMAX_8_BIT_VALUE;

/* Read the value back to see how many bits stuck. */
ucMaxPriorityValue = *pucFirstUserPriorityRegister;

I think the "real hardware" reads back 0's in the unused bits and hence ucMaxPriorityValue should read back 240 in my case. However, simulation reads back the original 255.

However, after hard coding the right value, the OS starts the first task but soon afterwards crashes complaining that there is "No source line at address 61000000". Likely management of the program counter is getting messed up, but the code is very difficult to debug because it looks like the OS moves into assembly for PC management.

Thanks
Post Reply