0

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.

7
  • Does xclm -hostinfo work for you? If it gives a privilege error, I bet you installed as root using sudo when you should not have. Whenever installing something, never use sudo to perform the install unless the install fails without it, else it gives root ownership of installed executables mistakenly. Commented Jan 29, 2024 at 16:10
  • To address the error: MPLAB XC32 C++ license not activated, I have some related XC32 compiler Q&As here: 1) How to install the free XC32++ compiler license (including .gitignore setup and refreshing the project), 2) How to renew your paid Microchip XC32 Compiler Pro license when it has expired or is about to expire Commented Jan 29, 2024 at 16:12
  • You could also try running the Arduino IDE as root as a temporary fix, to see if that solves it. I had no idea that it could support PIC32 boards, by the way. Commented Jan 29, 2024 at 16:13
  • @GabrielStaples I don"t have xclm on my system. when I type "which xclm" on my terminal I have nothing. I also installed XC32+ compiler license but it doesn't work. Commented Jan 29, 2024 at 21:55
  • I left comments under my answer. Commented Jan 29, 2024 at 22:44

1 Answer 1

0

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.

Sign up to request clarification or add additional context in comments.

4 Comments

I don't have xclm.
@Student_in_computer_science, looking at your output, it should be here: /home/adam/.arduino15/packages/Digilent/tools/xc32-tools/xc32-1.43/bin/xclm.
Use the full path wherever I specified just xclm. Ex: /home/adam/.arduino15/packages/Digilent/tools/xc32-tools/xc32-1.43/bin/xclm -hostinfo
I have it ! The command xclm -hostinfo gives me the host id and the hostname. There is no error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.