Reputation: 119
What I want to do :
I want to learn how to program with the Basys MXC32 device.
What I have done
I use Arduino IDE (version 1.8.19) and I am on Ubuntu 22.02 . I followed what is written in this tutorial. I installed Digilent Core on Arduino IDE and set the Board value on "Diligent Basys MX3" (Tools > Board). I set the port on "/devtty/USB0"
I tried to compile the easiest code
//#include <xc.h>
void setup() {
// put your setup code here, to run once:
//LED_Init();
//LED_SetValue(4, 1); //turn on LED4
}
/void loop() {
// put your main code here, to run repeatedly:
}
My problem
When I try to compile the code (I click on the "verify" button) I have this error :
/home/adam/arduino-1.8.19/arduino-builder -dump-prefs -logger=machine -hardware /home/adam/arduino-1.8.19/hardware -hardware /home/adam/.arduino15/packages -tools /home/adam/arduino-1.8.19/tools-builder -tools /home/adam/arduino-1.8.19/hardware/tools/avr -tools /home/adam/.arduino15/packages -built-in-libraries /home/adam/arduino-1.8.19/libraries -libraries /home/adam/Arduino/libraries -fqbn=Digilent:pic32:Digilent_BasysMX3 -vid-pid=0403_6001 -ide-version=10819 -build-path /tmp/arduino_build_806736 -warnings=none -build-cache /tmp/arduino_cache_76086 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.DigilentPGM.path=/home/adam/.arduino15/packages/Digilent/tools/DigilentPGM/v1.000-digilent -prefs=runtime.tools.DigilentPGM-v1.000-digilent.path=/home/adam/.arduino15/packages/Digilent/tools/DigilentPGM/v1.000-digilent -prefs=runtime.tools.drivers-windows.path=/home/adam/.arduino15/packages/Digilent/tools/drivers-windows/v2 -prefs=runtime.tools.drivers-windows-v2.path=/home/adam/.arduino15/packages/Digilent/tools/drivers-windows/v2 -prefs=runtime.tools.xc32-tools.path=/home/adam/.arduino15/packages/Digilent/tools/xc32-tools/xc32-1.43 -prefs=runtime.tools.xc32-tools-xc32-1.43.path=/home/adam/.arduino15/packages/Digilent/tools/xc32-tools/xc32-1.43 -verbose /home/adam/Arduino/BasysMX3/sketch_jan29a/sketch_jan29a.ino
/home/adam/arduino-1.8.19/arduino-builder -compile -logger=machine -hardware /home/adam/arduino-1.8.19/hardware -hardware /home/adam/.arduino15/packages -tools /home/adam/arduino-1.8.19/tools-builder -tools /home/adam/arduino-1.8.19/hardware/tools/avr -tools /home/adam/.arduino15/packages -built-in-libraries /home/adam/arduino-1.8.19/libraries -libraries /home/adam/Arduino/libraries -fqbn=Digilent:pic32:Digilent_BasysMX3 -vid-pid=0403_6001 -ide-version=10819 -build-path /tmp/arduino_build_806736 -warnings=none -build-cache /tmp/arduino_cache_76086 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.DigilentPGM.path=/home/adam/.arduino15/packages/Digilent/tools/DigilentPGM/v1.000-digilent -prefs=runtime.tools.DigilentPGM-v1.000-digilent.path=/home/adam/.arduino15/packages/Digilent/tools/DigilentPGM/v1.000-digilent -prefs=runtime.tools.drivers-windows.path=/home/adam/.arduino15/packages/Digilent/tools/drivers-windows/v2 -prefs=runtime.tools.drivers-windows-v2.path=/home/adam/.arduino15/packages/Digilent/tools/drivers-windows/v2 -prefs=runtime.tools.xc32-tools.path=/home/adam/.arduino15/packages/Digilent/tools/xc32-tools/xc32-1.43 -prefs=runtime.tools.xc32-tools-xc32-1.43.path=/home/adam/.arduino15/packages/Digilent/tools/xc32-tools/xc32-1.43 -verbose /home/adam/Arduino/BasysMX3/sketch_jan29a/sketch_jan29a.ino
Using board 'Digilent_BasysMX3' from platform in folder: /home/adam/.arduino15/packages/Digilent/hardware/pic32/1.0.4
Using core 'pic32' from platform in folder: /home/adam/.arduino15/packages/Digilent/hardware/pic32/1.0.4
Detecting libraries used...
/home/adam/.arduino15/packages/Digilent/tools/xc32-tools/xc32-1.43/bin/xc32-g++ -c -g -O0 -w -mno-smart-io -fno-exceptions -ffunction-sections -fdata-sections -mdebugger -Wcast-align -fno-short-double -ftoplevel-reorder -mnewlib-libc -std=gnu++11 -w -x c++ -E -CC -mprocessor=32MX370F512L -DF_CPU=80000000UL -DARDUINO=10819 -D_BOARD_BASYS_MX3_ -DARDUINO_ARCH_PIC32 -DMPIDEVER=16777998 -DMPIDE=150 -DIDE=Arduino -I/tmp/arduino_build_806736/sketch -I/home/adam/.arduino15/packages/Digilent/hardware/pic32/1.0.4/cores/pic32 -I/home/adam/.arduino15/packages/Digilent/hardware/pic32/1.0.4/variants/Basys_MX3 /tmp/arduino_build_806736/sketch/sketch_jan29a.ino.cpp -o /dev/null
Alternatives for Arduino.h: []XCLM: Failed to elevate privilege - is the XCLM binary setuid-root?
ResolveLibrary(Arduino.h)
-> candidates: []
/tmp/arduino_build_806736/sketch/sketch_jan29a.ino.cpp:1:0: error: MPLAB XC32 C++ license not activated
#include <Arduino.h>
^
/tmp/arduino_build_806736/sketch/sketch_jan29a.ino.cpp:1:0: note: Visit http://www.microchip.com/MPLABXCcompilers to acquire a free C++ license
exit status 255
/home/adam/arduino-1.8.19/arduino-builder returned 255
Error compiling for board Digilent Basys MX3.
So, I included the Arduino library on my code. My code is now :
#include <Arduino.h>
//#include <xc.h>
void setup() {
// put your setup code here, to run once:
//LED_Init();
//LED_SetValue(4, 1); //turn on LED4
}
/void loop() {
// put your main code here, to run repeatedly:
}
When I try to compile the code, I have this issue :
Arduino: 1.8.19 (Linux), Board: "Digilent Basys MX3"
/home/adam/arduino-1.8.19/arduino-builder -dump-prefs -logger=machine -hardware /home/adam/arduino-1.8.19/hardware -hardware /home/adam/.arduino15/packages -tools /home/adam/arduino-1.8.19/tools-builder -tools /home/adam/arduino-1.8.19/hardware/tools/avr -tools /home/adam/.arduino15/packages -built-in-libraries /home/adam/arduino-1.8.19/libraries -libraries /home/adam/Arduino/libraries -fqbn=Digilent:pic32:Digilent_BasysMX3 -vid-pid=0403_6001 -ide-version=10819 -build-path /tmp/arduino_build_806736 -warnings=none -build-cache /tmp/arduino_cache_76086 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.DigilentPGM.path=/home/adam/.arduino15/packages/Digilent/tools/DigilentPGM/v1.000-digilent -prefs=runtime.tools.DigilentPGM-v1.000-digilent.path=/home/adam/.arduino15/packages/Digilent/tools/DigilentPGM/v1.000-digilent -prefs=runtime.tools.drivers-windows.path=/home/adam/.arduino15/packages/Digilent/tools/drivers-windows/v2 -prefs=runtime.tools.drivers-windows-v2.path=/home/adam/.arduino15/packages/Digilent/tools/drivers-windows/v2 -prefs=runtime.tools.xc32-tools.path=/home/adam/.arduino15/packages/Digilent/tools/xc32-tools/xc32-1.43 -prefs=runtime.tools.xc32-tools-xc32-1.43.path=/home/adam/.arduino15/packages/Digilent/tools/xc32-tools/xc32-1.43 -verbose /home/adam/Arduino/BasysMX3/sketch_jan29a/sketch_jan29a.ino
/home/adam/arduino-1.8.19/arduino-builder -compile -logger=machine -hardware /home/adam/arduino-1.8.19/hardware -hardware /home/adam/.arduino15/packages -tools /home/adam/arduino-1.8.19/tools-builder -tools /home/adam/arduino-1.8.19/hardware/tools/avr -tools /home/adam/.arduino15/packages -built-in-libraries /home/adam/arduino-1.8.19/libraries -libraries /home/adam/Arduino/libraries -fqbn=Digilent:pic32:Digilent_BasysMX3 -vid-pid=0403_6001 -ide-version=10819 -build-path /tmp/arduino_build_806736 -warnings=none -build-cache /tmp/arduino_cache_76086 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.DigilentPGM.path=/home/adam/.arduino15/packages/Digilent/tools/DigilentPGM/v1.000-digilent -prefs=runtime.tools.DigilentPGM-v1.000-digilent.path=/home/adam/.arduino15/packages/Digilent/tools/DigilentPGM/v1.000-digilent -prefs=runtime.tools.drivers-windows.path=/home/adam/.arduino15/packages/Digilent/tools/drivers-windows/v2 -prefs=runtime.tools.drivers-windows-v2.path=/home/adam/.arduino15/packages/Digilent/tools/drivers-windows/v2 -prefs=runtime.tools.xc32-tools.path=/home/adam/.arduino15/packages/Digilent/tools/xc32-tools/xc32-1.43 -prefs=runtime.tools.xc32-tools-xc32-1.43.path=/home/adam/.arduino15/packages/Digilent/tools/xc32-tools/xc32-1.43 -verbose /home/adam/Arduino/BasysMX3/sketch_jan29a/sketch_jan29a.ino
Using board 'Digilent_BasysMX3' from platform in folder: /home/adam/.arduino15/packages/Digilent/hardware/pic32/1.0.4
Using core 'pic32' from platform in folder: /home/adam/.arduino15/packages/Digilent/hardware/pic32/1.0.4
Detecting libraries used...
/home/adam/.arduino15/packages/Digilent/tools/xc32-tools/xc32-1.43/bin/xc32-g++ -c -g -O0 -w -mno-smart-io -fno-exceptions -ffunction-sections -fdata-sections -mdebugger -Wcast-align -fno-short-double -ftoplevel-reorder -mnewlib-libc -std=gnu++11 -w -x c++ -E -CC -mprocessor=32MX370F512L -DF_CPU=80000000UL -DARDUINO=10819 -D_BOARD_BASYS_MX3_ -DARDUINO_ARCH_PIC32 -DMPIDEVER=16777998 -DMPIDE=150 -DIDE=Arduino -I/tmp/arduino_build_806736/sketch -I/home/adam/.arduino15/packages/Digilent/hardware/pic32/1.0.4/cores/pic32 -I/home/adam/.arduino15/packages/Digilent/hardware/pic32/1.0.4/variants/Basys_MX3 /tmp/arduino_build_806736/sketch/sketch_jan29a.ino.cpp -o /dev/null
Error while detecting libraries included by /tmp/arduino_build_806736/sketch/sketch_jan29a.ino.cpp
Generating function prototypes...
/home/adam/.arduino15/packages/Digilent/tools/xc32-tools/xc32-1.43/bin/xc32-g++ -c -g -O0 -w -mno-smart-io -fno-exceptions -ffunction-sections -fdata-sections -mdebugger -Wcast-align -fno-short-double -ftoplevel-reorder -mnewlib-libc -std=gnu++11 -w -x c++ -E -CC -mprocessor=32MX370F512L -DF_CPU=80000000UL -DARDUINO=10819 -D_BOARD_BASYS_MX3_ -DARDUINO_ARCH_PIC32 -DMPIDEVER=16777998 -DMPIDE=150 -DIDE=Arduino -I/tmp/arduino_build_806736/sketch -I/home/adam/.arduino15/packages/Digilent/hardware/pic32/1.0.4/cores/pic32 -I/home/adam/.arduino15/packages/Digilent/hardware/pic32/1.0.4/variants/Basys_MX3 /tmp/arduino_build_806736/sketch/sketch_jan29a.ino.cpp -o /tmp/arduino_build_806736/preproc/ctags_target_for_gcc_minus_e.cpp
XCLM: Failed to elevate privilege - is the XCLM binary setuid-root?
/tmp/arduino_build_806736/sketch/sketch_jan29a.ino.cpp:1:0: error: MPLAB XC32 C++ license not activated
#line 1 "/home/adam/Arduino/BasysMX3/sketch_jan29a/sketch_jan29a.ino"
^
/tmp/arduino_build_806736/sketch/sketch_jan29a.ino.cpp:1:0: note: Visit http://www.microchip.com/MPLABXCcompilers to acquire a free C++ license
exit status 255
/home/adam/arduino-1.8.19/arduino-builder returned 255
Error compiling for board Digilent Basys MX3.
I noticed :
XCLM: Failed to elevate privilege - is the XCLM binary setuid-root?
error: MPLAB XC32 C++ license not activated
I installed the MPLAB XC32 c++ compiler on my computer however, I still have the same issue.
Upvotes: 0
Views: 166
Reputation: 53065
XCLM: Failed to elevate privilege - is the XCLM binary setuid-root?
This error indicates that the xclm
executable is probably owned by root, and wants to execute as root, but cannot. I don't know why it is in this situation, and that is probably a bigger concern, but you can try allowing the xclm
to execute with its owner's permissions (root) even when root is not running it, by doing this:
sudo chmod u+s "$(which xclm)"
Update: looking at your output, your xclm
(XC32 License Manager executable) is probably located here: /home/adam/.arduino15/packages/Digilent/tools/xc32-tools/xc32-1.43/bin/xclm
. So try this instead:
sudo chmod u+s "/home/adam/.arduino15/packages/Digilent/tools/xc32-tools/xc32-1.43/bin/xclm"
This sets the "setuid" permission bit for the file located at the path shown by which xclm
.
Perhaps you got into this situation because you were running the Arduino IDE as root on Linux when you followed these instructions (https://digilent.com/reference/learn/software/tutorials/digilent-core-install/start) to add the additional board? Are you running the IDE as root? If so, you shouldn't be.
If you ran the Arduino IDE as root because of some permissions errors when uploading firmware, what you need to do is add your user to the dialout
group instead, and potentially install some /etc/udev
rules. See my instructions here: https://github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles/tree/master/arduino#1-problem-uploading-to-board--need-to-add-user-to-dialout-group--do-this
Then, uninstall the Arduino IDE and all new boards, reinstall it, run the IDE not as root, reinstall the boards inside it, and go from there. Boards should not be installed as root.
Upvotes: 0