Is simulink model is independent of microcontrollers?
Afficher commentaires plus anciens
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 commentaires
Jerry
le 21 Juil 2025
Déplacé(e) : Walter Roberson
le 28 Juil 2025
Jerry
le 21 Juil 2025
Déplacé(e) : Walter Roberson
le 28 Juil 2025
Jerry
le 21 Juil 2025
Déplacé(e) : Walter Roberson
le 28 Juil 2025
Réponse acceptée
Plus de réponses (1)
Nithin
le 28 Juil 2025
0 votes
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.
Catégories
En savoir plus sur STMicroelectronics Discovery Boards dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

