Is simulink model is independent of microcontrollers?
Mostra commenti meno recenti
Is it possible to create a Simulink model that is independent of specific microcontrollers?
For example, in the model, the STM32 block is used for CAN transmission. But if I want to deploy the same model to an Arduino, I have to replace the STM32 block with an Arduino-compatible one.
So, is it possible to create a custom block or abstraction that works across multiple microcontrollers like STM32, PIC32, and Arduino without changing the hardware-specific block each time?

3 Commenti
Jerry
il 21 Lug 2025
Spostato: Walter Roberson
il 28 Lug 2025
Jerry
il 21 Lug 2025
Spostato: Walter Roberson
il 28 Lug 2025
Jerry
il 21 Lug 2025
Spostato: Walter Roberson
il 28 Lug 2025
Risposta accettata
Più risposte (1)
Nithin
il 28 Lug 2025
0 voti
One approach that you can try is with variant subsystems as mentioned earlier, which should solve your problem. Refer to the documentation for more details: https://in.mathworks.com/help/simulink/slref/variantsubsystem.html
With this, you can keep the FDCAN blocks for multiple targets within the variant subsystem and implement an expression to control which variant is active based on the target hardware selection in the model config set. With this approach, the model remains the same, however you will have to change the config set based on the desired target.
Categorie
Scopri di più su Embedded Coder Supported Hardware in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

