Is simulink model is independent of microcontrollers?
Mostrar comentarios más antiguos
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 comentarios
Jerry
el 21 de Jul. de 2025
Movida: Walter Roberson
el 28 de Jul. de 2025
Jerry
el 21 de Jul. de 2025
Movida: Walter Roberson
el 28 de Jul. de 2025
Jerry
el 21 de Jul. de 2025
Movida: Walter Roberson
el 28 de Jul. de 2025
Respuesta aceptada
Más respuestas (1)
Nithin
el 28 de Jul. de 2025
0 votos
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.
Categorías
Más información sobre Embedded Coder Supported Hardware en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

