Please take a minute to review and accept our Terms of Use.
Welcome to the PLECS User Forum, where you can ask questions and receive answers from other members of the community.

Many technical questions regarding PLECS are answered on the Technical Solutions page of our website. Tutorial videos, specific application examples, and pre-recorded webinars are available on our YouTube page. Please follow us on LinkedIn for the latest Plexim news.

Overrun with Nucleo-G474RE

0 votes
138 views
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\tsp_stm32_1.4.3\projects\g474.zip"

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

Best regards,
Raphael
asked May 21 by raphael.baumeler (45 points)

1 Answer

0 votes

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.
answered May 22 by Bryan Lieblick (1,949 points)
...