Hi all
I've been succssfully using Nanos & Unos for some years but I wanted a very small board so I acquired a couple of Seeeduino Xiaos.
I have installed the software for managing the board in the IDE but I get a compile error:
arm-none-eabi-g++: error: DCC: No such file or directory
arm-none-eabi-g++: error: signal: No such file or directory
arm-none-eabi-g++: error: decoder.ino""": Invalid argument
Compilation error: exit status 1}
I did as suggested on another forum and removed the board libraries and re-installed them but to no avail.
The code works fine on a Nano using the exact same sketch with just the board details changed.
I'm using IDE2rc3
Hi @melmerby. I'm going to ask you to post some additional information that might help us to identify the problem.
Please do this:
Select File > Preferences from the Arduino IDE menus.
Check the box next to "Show verbose output during: ☐ compilation".
Click the OK button.
Select Sketch > Verify/Compile from the Arduino IDE menus.
Wait for the compilation to end.
Right click on the black "Output" pane at the bottom of the Arduino IDE 2.x window.
From the context menu, click Copy All.
Open a forum reply here by clicking the Reply button.
Click the </> icon on the post composer toolbar.
This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
Press Ctrl+V.
This will paste the compilation output into the code block.
Move the cursor outside of the code tags before you add any additional text to your reply.
Should not be necessary, but unfortunately it is currently necessary to do a restart between those two steps at the moment when using Arduino IDE 2.x (not needed at all with 1.x):
I have updated to IDE2 rc4 now and re-installed the DCC Decoder library from the GitHub zip (the one I am including)
I hope this is the correct format:
```cpp
Using board 'seeed_XIAO_m0' from platform in folder: C:\Users\Keith.DESKTOP-55532Q9\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.8.2
Using core 'arduino' from platform in folder: C:\Users\Keith.DESKTOP-55532Q9\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.8.2
Detecting libraries used...
"C:\\Users\\Keith.DESKTOP-55532Q9\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++14 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions "-D__SKETCH_NAME__=\"\"\"Dapol" DCC signal "decoder.ino\"\"\"" -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10607 -DARDUINO_SEEED_XIAO_M0 -DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -D__SAMD21__ -D__SAMD21G18A__ -DARM_MATH_CM0PLUS -DSEEED_XIAO_M0 -DUSB_VID=0x2886 -DUSB_PID=0x802F -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Seeed\"" "-DUSB_PRODUCT=\"Seeed XIAO M0\"" "-IC:\\Users\\Keith.DESKTOP-55532Q9\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\samd\\1.8.2\\cores\\arduino/TinyUSB" "-IC:\\Users\\Keith.DESKTOP-55532Q9\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\samd\\1.8.2\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-IC:\\Users\\Keith.DESKTOP-55532Q9\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\samd\\1.8.2\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" -DARDUINO_SAMD_ZERO -D__SAMD21__ -D__SAMD21G18A__ -DARM_MATH_CM0PLUS -DSEEED_XIAO_M0 -DUSB_VID=0x2886 -DUSB_PID=0x802F -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Seeed\"" "-DUSB_PRODUCT=\"Seeed XIAO M0\"" "-IC:\\Users\\Keith.DESKTOP-55532Q9\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\samd\\1.8.2\\cores\\arduino/TinyUSB" "-IC:\\Users\\Keith.DESKTOP-55532Q9\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\samd\\1.8.2\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-IC:\\Users\\Keith.DESKTOP-55532Q9\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\samd\\1.8.2\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" "-IC:\\Users\\Keith.DESKTOP-55532Q9\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\tools\\CMSIS\\5.7.0/CMSIS/Core/Include/" "-IC:\\Users\\Keith.DESKTOP-55532Q9\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\tools\\CMSIS\\5.7.0/CMSIS/DSP/Include/" "-IC:\\Users\\Keith.DESKTOP-55532Q9\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\tools\\CMSIS-Atmel\\1.2.1/CMSIS-Atmel/CMSIS/Device/ATMEL/" "-IC:\\Users\\Keith.DESKTOP-55532Q9\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\samd\\1.8.2\\cores\\arduino" "-IC:\\Users\\Keith.DESKTOP-55532Q9\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\samd\\1.8.2\\variants\\XIAO_m0" "C:\\Users\\Keith.DESKTOP-55532Q9\\AppData\\Local\\Temp\\arduino-sketch-59EE9D39C977C4C676AD6139B9C9256A\\sketch\\Dapol DCC signal decoder.ino.cpp" -o nul
Error while detecting libraries included by C:\Users\Keith.DESKTOP-55532Q9\AppData\Local\Temp\arduino-sketch-59EE9D39C977C4C676AD6139B9C9256A\sketch\Dapol DCC signal decoder.ino.cpp
Generating function prototypes...
"C:\\Users\\Keith.DESKTOP-55532Q9\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++14 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions "-D__SKETCH_NAME__=\"\"\"Dapol" DCC signal "decoder.ino\"\"\"" -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10607 -DARDUINO_SEEED_XIAO_M0 -DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -D__SAMD21__ -D__SAMD21G18A__ -DARM_MATH_CM0PLUS -DSEEED_XIAO_M0 -DUSB_VID=0x2886 -DUSB_PID=0x802F -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Seeed\"" "-DUSB_PRODUCT=\"Seeed XIAO M0\"" "-IC:\\Users\\Keith.DESKTOP-55532Q9\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\samd\\1.8.2\\cores\\arduino/TinyUSB" "-IC:\\Users\\Keith.DESKTOP-55532Q9\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\samd\\1.8.2\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-IC:\\Users\\Keith.DESKTOP-55532Q9\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\samd\\1.8.2\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" -DARDUINO_SAMD_ZERO -D__SAMD21__ -D__SAMD21G18A__ -DARM_MATH_CM0PLUS -DSEEED_XIAO_M0 -DUSB_VID=0x2886 -DUSB_PID=0x802F -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Seeed\"" "-DUSB_PRODUCT=\"Seeed XIAO M0\"" "-IC:\\Users\\Keith.DESKTOP-55532Q9\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\samd\\1.8.2\\cores\\arduino/TinyUSB" "-IC:\\Users\\Keith.DESKTOP-55532Q9\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\samd\\1.8.2\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-IC:\\Users\\Keith.DESKTOP-55532Q9\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\samd\\1.8.2\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" "-IC:\\Users\\Keith.DESKTOP-55532Q9\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\tools\\CMSIS\\5.7.0/CMSIS/Core/Include/" "-IC:\\Users\\Keith.DESKTOP-55532Q9\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\tools\\CMSIS\\5.7.0/CMSIS/DSP/Include/" "-IC:\\Users\\Keith.DESKTOP-55532Q9\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\tools\\CMSIS-Atmel\\1.2.1/CMSIS-Atmel/CMSIS/Device/ATMEL/" "-IC:\\Users\\Keith.DESKTOP-55532Q9\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\samd\\1.8.2\\cores\\arduino" "-IC:\\Users\\Keith.DESKTOP-55532Q9\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\samd\\1.8.2\\variants\\XIAO_m0" "C:\\Users\\Keith.DESKTOP-55532Q9\\AppData\\Local\\Temp\\arduino-sketch-59EE9D39C977C4C676AD6139B9C9256A\\sketch\\Dapol DCC signal decoder.ino.cpp" -o "C:\\Users\\Keith.DESKTOP-55532Q9\\AppData\\Local\\Temp\\arduino-sketch-59EE9D39C977C4C676AD6139B9C9256A\\preproc\\ctags_target_for_gcc_minus_e.cpp"
arm-none-eabi-g++: error: DCC: No such file or directory
arm-none-eabi-g++: error: signal: No such file or directory
arm-none-eabi-g++: error: decoder.ino""": Invalid argument
Compilation error: exit status 1
The problem is your sketch file name "Dapol DCC signal decoder.ino". Spaces are not allowed in sketch files. It is actually a bug in the Arduino IDE 2.x that it allows you to create or open sketches with prohibited file names.
So you need to do two things:
Close the Arduino IDE.
Rename the sketch folder name from Dapol DCC signal decoder to something without spaces
(e.g., DapolDCCSignalDecoder)
Rename the sketch file from Dapol DCC signal decoder.ino to the same name as the folder
(e.g., DapolDCCSignalDecoder.ino)
Because the compilation recipe in the "Arduino AVR Boards" platform of the Nano does not contain this thing that was added to the compilation recipe in the "Seeed SAMD (32-bits ARM Cortex-M0+ and Cortex-M4) Boards" platform of the XIAO:
-D__SKETCH_NAME__="""{build.project_name}"""
With the spaces in your sketch name, that is expanded to this nonsensical monstrosity of a -D compiler flag:
Having got the project compiling and uploading correctly, I now find it wont run on the Xiao.
The Xiao (2 of them) have both been checked for correct operation with simple input/output sketches to prove the pins being used actually work.
The project sketch works 'as is' on a Nano.
The project is thus:
A DCC input from a DCC command station goes to Pin 2 on the board via a 6N137 opto coupler (this is a standard input for DCC decoder projects. The open collector load is returned to the 3.3v line so as to suit the 3.3v Xiao.
The DCC signal is available at this pin, see 'scope waveform:
The problem is that although the signal is apparently reaching Pin2 correctly, the program is not operating.
Pins 3,4,5,6 should switch between Vcc and 0v when a switching command is received from the DCC command station. The data into Pin2 changes but the pins do not switch.
This is the sketch:
#include <DCC_Decoder.h>
#define NUMACCESSORIES 2 // Enter the number of accessories here
// GO TO setup() TO CONFIGURE DCC ADDRESSES AND PIN NUMBERS
typedef struct DCCAccessoryData {
int address; // User Configurable DCC address
byte outputpin1; // User Configurable Arduino pin
byte outputpin2; // User Configurable Arduino pin
byte dccstate; // Internal use DCC state of accessory, 1=on, 0=off
};
DCCAccessoryData accessory[NUMACCESSORIES];
// The DCC library calls this function to set / reset accessories
void BasicAccDecoderPacket_Handler(int address, boolean activate, byte data) {
address -= 1;
address *= 4;
address += 1;
address += (data & 0x06) >> 1;
// address = address - 4; // uncomment this line for Roco Maus or z21
boolean enable = (data & 0x01) ? 1 : 0;
for (byte i=0; i<NUMACCESSORIES; i++) {
if (address == accessory[i].address) {
if (enable) accessory[i].dccstate = 1;
else accessory[i].dccstate = 0;
}
}
}
void setup() {
// CONFIGURATION OF ACCESSORIES
// Copy & Paste as many times as you have accessories
// The amount must be same as NUMACCESSORIES
// Don't forget to increment the array index
accessory[0].address = 505; // DCC address
accessory[0].outputpin1 = 3; // Arduino pin
accessory[0].outputpin2 = 4; // Arduino pin
accessory[1].address = 506; // DCC address
accessory[1].outputpin1 = 5; // Arduino pin
accessory[1].outputpin2 = 6; // Arduino pin
// END OF CONFIGURATION OF ACCESSORIES
DCC.SetBasicAccessoryDecoderPacketHandler(BasicAccDecoderPacket_Handler, true);
DCC.SetupDecoder( 0x00, 0x00, 0 );
for(byte i=0; i<NUMACCESSORIES; i++) {
pinMode (accessory[i].outputpin1, OUTPUT);
digitalWrite(accessory[i].outputpin1, LOW);
pinMode (accessory[i].outputpin2, OUTPUT);
digitalWrite(accessory[i].outputpin2, HIGH);
}
}
void loop() {
DCC.loop(); // Call to library function that reads the DCC data
for(byte i=0; i<NUMACCESSORIES; i++) {
if (accessory[i].dccstate)
(digitalWrite(accessory[i].outputpin2, LOW), digitalWrite(accessory[i].outputpin1, HIGH));
else
(digitalWrite(accessory[i].outputpin1, LOW), digitalWrite(accessory[i].outputpin2, HIGH));
}
}
Any suggestions?
Is the Xiao compatible with normal Arduino sketches?