mattairtech / ArduinoCore-samd

This is a fork from arduino/ArduinoCore-samd on GitHub. This will be used to maintain Arduino support for SAM D|L|C (M0+ and M4F) boards including the MattairTech Xeno Mini and the MT-D21E (see https://www.mattairtech.com/). It adds support for new devices like the D51, L21, C21, and D11. It also adds new clock sources, like a high speed crystal or internal oscillator.
105 stars 43 forks source link

Core compilation error - 1.6.18-beta-b0 #20

Open obdevel opened 6 years ago

obdevel commented 6 years ago

Just trying the Blink sketch to test my installation and I get core compilation errors. Config is:

screen shot 2018-06-15 at 15 52 03

Errors:

...
"/Users/xx/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-gcc" -mcpu=cortex-m0plus -mthumb -c -g -Os -Wall -Wextra -std=gnu11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -MMD -DF_CPU=48000000L -DARDUINO=10805 -DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD "-I/Users/xx/Library/Arduino15/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Include/" "-I/Users/xx/Library/Arduino15/packages/MattairTech_Arduino/tools/CMSIS-Atmel/1.0.0-mattairtech-2/CMSIS/Device/ATMEL/" -DCLOCKCONFIG_32768HZ_CRYSTAL -DUSB_DISABLED -DONE_UART -DONE_WIRE -DONE_SPI -D__8KB_BOOTLOADER__ -D__SAMC21G18A__  "-I/Users/xx/Library/Arduino15/packages/MattairTech_Arduino/hardware/samd/1.6.18-beta-b0/cores/arduino" "-I/Users/xx/Library/Arduino15/packages/MattairTech_Arduino/hardware/samd/1.6.18-beta-b0/variants/Xeno_Mini" "/Users/xx/Library/Arduino15/packages/MattairTech_Arduino/hardware/samd/1.6.18-beta-b0/cores/arduino/wiring_analog.c" -o "/var/folders/03/s3pv8qk91w78m4_st_nbxl5m0000gn/T/arduino_build_389544/core/wiring_analog.c.o"

/Users/xx/Library/Arduino15/packages/MattairTech_Arduino/hardware/samd/1.6.18-beta-b0/cores/arduino/wiring_analog.c: In function 'analogReference':
/Users/xx/Library/Arduino15/packages/MattairTech_Arduino/hardware/samd/1.6.18-beta-b0/cores/arduino/wiring_analog.c:234:22: error: 'AR_INTREF_1V0' undeclared (first use in this function)
   } else if (mode >= AR_INTREF_1V0) {  // Values starting at AR_INTREF_1V0 are used for the Supply Controller reference (AR_INTREF)
                      ^
/Users/xx/Library/Arduino15/packages/MattairTech_Arduino/hardware/samd/1.6.18-beta-b0/cores/arduino/wiring_analog.c:234:22: note: each undeclared identifier is reported only once for each function it appears in
exit status 1
Error compiling for board MattairTech Xeno Mini.
mattairtech commented 6 years ago

This works for me. I suspect this has to do with your previous installation problems. Do you still have this problem after switching to the new json?

glennsky commented 6 years ago

The SAMC21 doesn't seem to have a AR_INTREF_1V0 defined (AR_INTREF_1V024 is defined) --- so I added this after line 87 in https://github.com/mattairtech/ArduinoCore-samd/blob/master/cores/arduino/wiring_analog.h

AR_INTREF_1V0 = 6,

This gets it to compile, though not sure if the analog would work as expected.

togglebit commented 5 years ago

FWIW I had to do the same the same thing with Beta-b1. Compiles, not tested analog.