[SOLVED] MATLAB Support Package for Arduino: cannot program board (R2018a)

15 views (last 30 days)
Hello, I am using MATLAB R2018a on Linux Mint 20.3 and have installed the Support Package for Arduino Hardware. I am using an Arduino UNO R3 board which I have connected to the port identified as
/dev/ttyAMC0
From my MATLAB GUI, I run the command
arduinosetup
to program the server onto my board (with the board connected via USB), select USB, then the board name "Uno" and the port "/dev/ttyACM0" both of which are recognized from the drop down lists, along with the libraries selected by default (Servo, SPI and I2C). But when I click PROGRAM, the process fails.
The RX and TX LEDs on the Arduino do not blink either, like they do when Im progamming from the IDE. I have followed all the steps as listed on the Installation guide but am stuck at setup. I have attached error log. I have attached the error log as a text file because it was too large (nik is my username, /home/nik/Code/MATLAB is my path where I store scripts and where MATLAB opens)
Any help will be greatly appreciated.

Answers (1)

Shovnik Paul
Shovnik Paul on 5 Jul 2022
Ok so I figured this out and am thus answering my own question (if the moderators think deleting this would be more appropriate, please let me know!) . So basically, the second last line in the error log gave away the problem:
error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
Basically Arduino's avrdude was looking for a library file which it could not find. I looked up this particular file and people on other Unix forums said that it has been replaced with the ncurses library file, so I ran the following command to see if I what ncurses library files I had installed currently:
$ find /usr/lib -name "libncurses*"
/usr/lib/x86_64-linux-gnu/libncursesw.so.6.2
/usr/lib/x86_64-linux-gnu/vlc/plugins/gui/libncurses_plugin.so
/usr/lib/x86_64-linux-gnu/libncurses.so.6
/usr/lib/x86_64-linux-gnu/libncursesw.so.6
/usr/lib/x86_64-linux-gnu/libncurses.so.6.2
From this list, libncurses.so.6 seemed to be the most appropriate, which I symlinked to the library file that avrdude was looking for: libtinfo.so.5 in a standard directory /usr/lib where it could be found:
$ ln -s /usr/lib/x86_64-linux-gnu/libncurses.so.6 /usr/lib/libtinfo.so.5
This fixed the issue for me. Here are some links that helped me:
  1. Arduino Forum Post
  2. Clang: libtinfo.so.5 could not be found
Hope this helps.

Categories

Find more on MATLAB Support Package for Arduino Hardware in Help Center and File Exchange

Tags

Products


Release

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!