Overrun with Nucleo-G474RE

Dear Plexim Team

I do not understand what it means when the code reaches overrun = 1 in the dispatcher_stm32g4xx.c File.
The model in the attachement is very simple and i think it should be possible to reach a sampling time of 1us. At the moment it is only possible to build the model without overrun when using a sampling time of >10us.

I generate the code into STM32 Cube IDE and use the template project from “…Coder Targets sp_stm32_1.4.3\projects\g474.zip”

How can i improve my model to reach a sampling time of 1us?

Best regards,
Raphael

STM32_StateMachine_Test.plecs (24.9 KB)

Raphael, there are certain things one can do on the margin, but overall the code generation framework comes with a certain level of baseline overhead that may prevent execution at 1 usec.

A few ideas you can explore:

Your model does not have any scopes or tunable parameters. Disable external mode in the Coder Options + Target + External Mode tab.In the Coder Options + Target + Advanced tab change the task scheduler from FreeRTOS to Bare-Metal.Change the compiler optimization flags.State machines and C-Scripts include additional overhead. Implementing your logic with basic PLECS blocks may be more efficient.