Arduino IDE 错误:MPLAB XC32 C++ 许可证未激活

问题描述 投票:0回答:1

我想做的事:

我想学习如何使用 Basys MXC32 设备进行编程。

我做了什么

我使用 Arduino IDE(版本 1.8.19)并且使用 Ubuntu 22.02。我遵循了本教程中所写的内容。我在 Arduino IDE 上安装了 Digilent Core,并在“Diligent Basys MX3”(工具 > 主板)上设置了主板值。我将端口设置为“/devtty/USB0”

我尝试编译最简单的代码

//#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:


}

我的问题

当我尝试编译代码(我单击“验证”按钮)时,出现此错误:


/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.

因此,我在代码中包含了 Arduino 库。我的代码现在是:

#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:


}

当我尝试编译代码时,我遇到了这个问题:

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.

我注意到了:

XCLM:无法提升权限 - XCLM 二进制文件是否为 setuid-root?

错误:MPLAB XC32 C++ 许可证未激活

我在计算机上安装了MPLAB XC32 c++编译器,但是,我仍然遇到同样的问题。

linux arduino arduino-ide mplab
1个回答
0
投票

XCLM:无法提升权限 - XCLM 二进制文件是否为 setuid-root?

此错误表明

xclm
可执行文件可能由 root 用户拥有,并且想要以 root 身份执行,但不能。我不知道为什么会出现这种情况,这可能是一个更大的问题,但是您可以尝试允许
xclm
使用其所有者的权限(root)执行,即使 root 没有运行它,方法如下:

sudo chmod u+s "$(which xclm)"

这将为位于

which xclm
所示路径的文件设置“setuid”权限位。

也许您遇到这种情况是因为按照这些说明操作时,您在 Linux 上以 root 身份运行 Arduino IDE (https://digilent.com/reference/learn/software/tutorials/digilent-core-install/start)添加附加板?您是否以 root 身份运行 IDE?如果是这样,你就不应该这样。

如果您因为上传固件时出现一些权限错误而以 root 身份运行 Arduino IDE,则您需要做的是将您的用户添加到

dialout
组,并可能安装一些
/etc/udev
规则。请在此处查看我的说明:https://github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles/tree/master/arduino#1-problem-uploading-to-board--need-to-add-user-to-dialout-group--这样做

然后,卸载 Arduino IDE 和所有新板,重新安装,以 root 身份运行(不是),重新安装板,然后从那里开始。板不应该以 root 身份安装。

© www.soinside.com 2019 - 2024. All rights reserved.