Is simulink model is independent of microcontrollers?
古いコメントを表示
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 件のコメント
Jerry
2025 年 7 月 21 日
移動済み: Walter Roberson
2025 年 7 月 28 日
Jerry
2025 年 7 月 21 日
移動済み: Walter Roberson
2025 年 7 月 28 日
Jerry
2025 年 7 月 21 日
移動済み: Walter Roberson
2025 年 7 月 28 日
採用された回答
その他の回答 (1 件)
Nithin
2025 年 7 月 28 日
0 投票
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.
カテゴリ
ヘルプ センター および File Exchange で STMicroelectronics Discovery Boards についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

