This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Task switching problem when running Simulink generated code in ucosii real-time task

Hi guys,

I imported the Simulink generated code to a ucosii based STM32F4 project as a real-time task.

The problem I have is that the Simulink-code task is able to run as a single task without any issue, but it cannot perform task switching in multiple tasks situation. It appears the real-time system is stuck when the Simulink-code task is running with the other tasks (e.g. LED blinking task).

I doubt it is because the MCU got overloaded since the CPUUsage reaches 83% when the OSdelay is set to 2ms. But it is hard to imagine the other task like a simple LED blinking task will cause any burden to the system, and cause the system stuck.

Does anyone have a similar issue?

Thanks!