Can I deploy a Simulink model to Arduino using ICSP instead of USB?
4 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2020-2-10
回答: MathWorks Support Team
2020-2-10
I will be producing multiple newly design boards and programming their processors with my Simulink model.
The prototype has a USB port on the Arduino board through which we load our Simulink model coded in C.
Can I upload the model to the board through an ICSP connection rather than a USB connection?
采纳的回答
MathWorks Support Team
2020-2-10
As of Simulink R2019b, there's no way to directly flash an Arduino board using MATLAB/Simulink with ICSP, but there's a workaround that may be suitable.
When you build a model using Simulink, a hex file is generated for AVR targets. This file is generated in the same folder as the model with the same name as model.
For example for arduino_gettingstarted.slx model, a file called arduino_gettingstarted.hex will be generated.
This hex file can be deployed to the target without connecting the USB port.
For example, to deploy the generated file to Arduino Nano using Arduino Uno as ISP, you can run the following command in Windows Command Prompt:
C:\Arduino\R2019b\arduino-1.8.10\hardware\tools\avr/bin/avrdude -CC:\Arduino\R2019b\arduino-1.8.10\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cstk500v1 -PCOM76 -b19200 -Uflash:w:C:\Users\USERNAME\AppData\Local\Temp\test\arduino_gettingstarted.hex:i
The command above is for example only.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Arduino Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!