Can I deploy a Simulink model to Arduino using ICSP instead of USB?
4 views (last 30 days)
Show older comments
MathWorks Support Team
on 10 Feb 2020
Answered: MathWorks Support Team
on 10 Feb 2020
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?
Accepted Answer
MathWorks Support Team
on 10 Feb 2020
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 Comments
More Answers (0)
See Also
Categories
Find more on Run on Target Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!