Simulink unable to upload to Arduino Nano 3.0 Linux
Show older comments
System - Ubuntu 18.04
Matlab Version - R2019b
Device - Arduino Nano 3
I connected the arduino nano to the computer. Using matlab support for arduino package I am able to upload code successfully onto the nano. It also works with the regular arduino nano.
I then opened the arduino_getting_started found here
I changed the board to arduino nano 3.0 and selected the correct COM port /tty/USB0.
I am sure this is the correct COM port because it works with the matlab version.
When I pressed upload and deploy to board I encounter the error below.
AVR Memory Usage
----------------
Device: atmega328p
Program: 4252 bytes (13.0% Full)
(.text + .data + .bootloader)
Data: 232 bytes (11.3% Full)
(.data + .bss + .noinit)
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
### Build procedure for model: 'arduino_gettingstarted' aborted due to an error.
The following error occurred during deployment to your hardware board:
Could not connect to specified Arduino board.
Verify that the board is connected to your host, and that the host COM port set in the model matches the COM port name in the host.
To change the host COM port in the model, click 'Simulation ', click 'Model Configuration Parameters'... In the dialog that opens, select the 'Hardware Implementation' pane, click 'Target hardware resources > Host-board connection' and set the COM port number.
To find out the COM port in the host, open a terminal and type ls /dev/ttyACM* in the terminal. Choose the name that corresponds to your board.
I've also tried manually bootloading the code onto the arduino using this command, which succeeded.
~/Documents/MATLAB/SupportPackages/R2019b/3P.instrset/arduinoide.instrset/arduino-1.8.8/hardware/tools/avr/bin/avrdude -C /home/vuwij/Documents/MATLAB/SupportPackages/R2019b/3P.instrset/arduinoide.instrset/arduino-1.8.8/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -carduino -P/dev/ttyUSB0 -b115200 -D -Uflash:w:$(pwd)/arduino_gettingstarted.hex
I've attached the exact slx which caused the problem.

Accepted Answer
More Answers (1)
varun lal
on 13 Oct 2020
0 votes
How can we set matlab2020b to work with old bootloader of arduino nano v3?
2 Comments
Arun Kumar
on 13 Oct 2020
Hi Varun,
You can't use old bootloader with R2020b. Please update the bootloader to use Aduino Nano with R2020b.
-Arun
varun lal
on 13 Oct 2020
Ok, some problems in updating bootloader, now I am building hex and manually flashing to arduino board
Categories
Find more on Arduino 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!