How to Set up Arduino for working with shakti Processor
Disclaimer: The Setup is illustrated for Ubuntu Version 18.04.5 LTS, the process may differ for other distros and is not applicable for non linux operating systems
STEP 1: Setting up the Arduino IDE
1.) download the Arduino Debian package
2.) Extract the downloaded package to the downloads folder or a folder of your choice.
3.) open the container folder, right click and select open in terminal.
4.) once the terminal line appears run the following command
chmod +x install.sh
The command will not yield any response from the terminal and would move on the the next line, if it happens then the command has executed successfully.
5.) run the following command to install arduino in the OS.
sudo bash install.sh
7.) The following command will install arduino and if the installation is successful you'll see the arduino icon in the desktop, if you face any issues repeat the steps 1-7.
8.) we can use the Arduino IDE on the desktop, but it will not have root privledges and in the long run we have faced issues with the serial monitor and opening the port for upload, hence we suggest to run the arduino through the terminal command
sudo arduino
this will allow us to run arduino as a root user and provide access throughout the system, thus enabling us to continue using the shakti processor without any hinderance
Note: Since it runs arduino as root, the existing arduino folder and libraries folder will not be used, instead the arduino folder that's present in the root directory will be used, we will discuss how to access this folder in the later sections of this article.
STEP 2: Configuring Arduino for Shakti Boards
1.) Open the terminal and run the "sudo Arduino" command to open Arduino
2.) Navigate to Files -> Preferences -> Settings and add the following URL in the additional boards Manager https://gitlab.com/shaktiproject/software/arduino-IDE-test/-/raw/master/package_shakti_index.json
3.) Go to the boards manager (Tools->Board: -> Select Board Manager), once it's open search for Shakti and install the boards, it'll take a while to download and install tools.
Note: You may face issues at this stage, if at all you face any issues try repeating the steps, at times the installation may be shown as successful but you may not be able to properly use the IDE to upload programs to the board, if this issue arises uninstall and reinstall the board from the boards manager.
4.) Upon successful installation, select tools -> Boards -> Shakti -> Your Required Board.
STEP 3: Rectify the errors
We've Tried installing the IDE in 3 different computer systems the steps were the same, however the following error did persist in all the scenarios,
/root/.arduino15/packages/shakti/tools/riscv32-unknown-elf-gcc/1.0/bin/../libexec/gcc/riscv32-unknown-elf/8.2.0/cc1plus: error while loading shared libraries: libmpfr.so.4: cannot open shared object file: No such file or directory
exit status 1
Error compiling for board Parashu.
fix:
the error indicates that the libmpfr.so has been dropped from the version of linux that you're working on, IDEALLY UBUNTU. hence to rectify the error, we're supposed to create a symbolic link
running this command in the terminal will rectify this error:
sudo ln -s /usr/lib/x86_64-linux-gnu/libmpfr.so.6 /usr/lib/x86_64-linux-gnu/libmpfr.so.4
try to compile the program after running the command. possitively this should resolve the issue.
Once that error is rectified we can proceed, however when we tested out the updated version of the arduino we faced certain other errors that has to be rectified before proceeding further
/root/.arduino15/packages/shakti/hardware/riscv/1.0.0/uploader/elf2hexspansion.sh: line 46: gcc: command not found
/root/.arduino15/packages/shakti/hardware/riscv/1.0.0/uploader/elf2hexspansion.sh: line 48: elf_to_header: No such file or directory
/root/.arduino15/packages/shakti/hardware/riscv/1.0.0/uploader/utils/uploader/spansion/deploy.c:35:10: fatal error: flashdata.h: No such file or directory
#include "flashdata.h"
^~~~~~~~~~~~~
compilation terminated.
riscv32-unknown-elf-gcc: error: output/deploy.o: No such file or directory
issue:
gcc -g -w -DFILEPATH=\"$3\" $4/utils/uploader/elf_to_header.c -o $3/elf_to_header
as shown in this line of executable shell script, the inner files namely elf2hexpansion.sh uses gcc to compile other .c files to produce a output that could be used in the later segments of the script, unavailability of gcc compiler may cause such issues to arise.
Fix: These errors could be rectified rather simply, this is because the gcc compiler is missing in your operating system. open terminal and type the following commands to rectify this issue.
apt get update
sudo apt install gcc
Once this is done, the Arduino program should compile without any error as illustrated.
Comments
Post a Comment