Error when compiling ArduinoCore

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi!

 

First of all, thanks for taking the time to read my issue. 

 

I'm trying to load a simple Arduino sketch into Atmel Studio, with the Create Project From Arduino Sketch option. It's the Blink sketch as it appears on the Arduino IDE examples. The μC I'm working with is the SAMD21G18A. When I load the project it creates two items in the project explorer, one with my sketch name, and one called ArduinoCore. ArduinoCore won't compile, and then my sketch will fail as it's missing a library. The reason why ArduinoCore won't compile is because it says the recipe for a certain file failed, although it compiles other files that are C++, as the one that fails ('USBCore.o') seem to be lacking certain structs. Some relevant lines from the output are:
 

...
...
Invoking: ARM/GNU C Compiler : 5.3.1
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-g++.exe" -mthumb -D__SAMD21G18A__ -DDEBUG -DF_CPU=48000000L -DARDUINO=10801 -DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -DUSB_VID=0x2341 -DUSB_PID=0x804d -DUSB_PRODUCT="\"Arduino Zero\"" -DUSB_MANUFACTURER="\"Arduino LLC\"" -DUSBCON -DSAMD_SERIES  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include" -I"..\include\core" -I"..\include\core\avr" -I"..\include\core\USB" -I"..\include\variants" -I"..\include\core\samd21" -I"..\include\core\samd21\include" -I"..\include\core\samd21\include\component" -I"..\include\core\samd21\include\instance" -I"..\include\core\samd21\include\pio" -I"C:\Users\Joel\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.1.0\CMSIS\Device\ATMEL"  -Os -fno-threadsafe-statics -fno-exceptions -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -g3 -w -mcpu=cortex-m0plus -c -std=gnu++11 --param max-inline-insns-single=500 -nostdlib -MD -MP -MF "src/core/USB/CDC.d" -MT"src/core/USB/CDC.d" -MT"src/core/USB/CDC.o"   -o "src/core/USB/CDC.o" "../src/core/USB/CDC.cpp" 
		Finished building: ../src/core/USB/CDC.cpp
		Building file: ../src/core/USB/PluggableUSB.cpp
		Invoking: ARM/GNU C Compiler : 5.3.1
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-g++.exe" -mthumb -D__SAMD21G18A__ -DDEBUG -DF_CPU=48000000L -DARDUINO=10801 -DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -DUSB_VID=0x2341 -DUSB_PID=0x804d -DUSB_PRODUCT="\"Arduino Zero\"" -DUSB_MANUFACTURER="\"Arduino LLC\"" -DUSBCON -DSAMD_SERIES  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include" -I"..\include\core" -I"..\include\core\avr" -I"..\include\core\USB" -I"..\include\variants" -I"..\include\core\samd21" -I"..\include\core\samd21\include" -I"..\include\core\samd21\include\component" -I"..\include\core\samd21\include\instance" -I"..\include\core\samd21\include\pio" -I"C:\Users\Joel\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.1.0\CMSIS\Device\ATMEL"  -Os -fno-threadsafe-statics -fno-exceptions -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -g3 -w -mcpu=cortex-m0plus -c -std=gnu++11 --param max-inline-insns-single=500 -nostdlib -MD -MP -MF "src/core/USB/PluggableUSB.d" -MT"src/core/USB/PluggableUSB.d" -MT"src/core/USB/PluggableUSB.o"   -o "src/core/USB/PluggableUSB.o" "../src/core/USB/PluggableUSB.cpp" 
		Finished building: ../src/core/USB/PluggableUSB.cpp
		Building file: ../src/core/USB/USBCore.cpp
		Invoking: ARM/GNU C Compiler : 5.3.1
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-g++.exe" -mthumb -D__SAMD21G18A__ -DDEBUG -DF_CPU=48000000L -DARDUINO=10801 -DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -DUSB_VID=0x2341 -DUSB_PID=0x804d -DUSB_PRODUCT="\"Arduino Zero\"" -DUSB_MANUFACTURER="\"Arduino LLC\"" -DUSBCON -DSAMD_SERIES  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include" -I"..\include\core" -I"..\include\core\avr" -I"..\include\core\USB" -I"..\include\variants" -I"..\include\core\samd21" -I"..\include\core\samd21\include" -I"..\include\core\samd21\include\component" -I"..\include\core\samd21\include\instance" -I"..\include\core\samd21\include\pio" -I"C:\Users\Joel\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.1.0\CMSIS\Device\ATMEL"  -Os -fno-threadsafe-statics -fno-exceptions -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -g3 -w -mcpu=cortex-m0plus -c -std=gnu++11 --param max-inline-insns-single=500 -nostdlib -MD -MP -MF "src/core/USB/USBCore.d" -MT"src/core/USB/USBCore.d" -MT"src/core/USB/USBCore.o"   -o "src/core/USB/USBCore.o" "../src/core/USB/USBCore.cpp" 
D:\Joel\Desktop\ArduinoSketch1\ArduinoSketch1\ArduinoCore\Debug\Makefile(344,1): error: recipe for target 'src/core/USB/USBCore.o' failed
		In file included from ../src/core/USB/USBCore.cpp:21:0:
		..\include\core\USB/SAMD21_USBDevice.h: In member function 'bool USBDevice_SAMD21G18x::epBank0IsStalled(ep_t)':
D:\Joel\Desktop\ArduinoSketch1\ArduinoSketch1\ArduinoCore\include\core\USB\SAMD21_USBDevice.h(94,96): error: 'volatile struct USB_DEVICE_EPINTFLAG_Type::<anonymous>' has no member named 'STALL0'
		  inline bool epBank0IsStalled(ep_t ep)           { return usb.DeviceEndpoint[ep].EPINTFLAG.bit.STALL0; }
		                                                                                                ^
		..\include\core\USB/SAMD21_USBDevice.h: In member function 'bool USBDevice_SAMD21G18x::epBank1IsStalled(ep_t)':
D:\Joel\Desktop\ArduinoSketch1\ArduinoSketch1\ArduinoCore\include\core\USB\SAMD21_USBDevice.h(95,96): error: 'volatile struct USB_DEVICE_EPINTFLAG_Type::<anonymous>' has no member named 'STALL1'
		  inline bool epBank1IsStalled(ep_t ep)           { return usb.DeviceEndpoint[ep].EPINTFLAG.bit.STALL1; }
		                                                                                                ^
		..\include\core\USB/SAMD21_USBDevice.h: In member function 'bool USBDevice_SAMD21G18x::epBank0IsTransferComplete(ep_t)':
D:\Joel\Desktop\ArduinoSketch1\ArduinoSketch1\ArduinoCore\include\core\USB\SAMD21_USBDevice.h(96,96): error: 'volatile struct USB_DEVICE_EPINTFLAG_Type::<anonymous>' has no member named 'TRCPT0'
		  inline bool epBank0IsTransferComplete(ep_t ep)  { return usb.DeviceEndpoint[ep].EPINTFLAG.bit.TRCPT0; }
		                                                                                                ^
...
...

The output of the console and errors are attached as files. If I am not wrong, the relevant file USBCore.cpp is an Arduino file, so it might be related to a change in the Arduino libraries, or an update in the boards or something like that? If the IDE is trying to use an old file, is there a way to point to the relevant one? Or is it the problem that the new version is breaking the Atmel Studio ability to import the sketches? I think I made it work some months ago...

 

I'm using the latest versions of the IDE and SAMD boards (1.8.1 and 1.6.12). I didn't include the project because I guess it's a problem related with my setup, or somebody else would have posted a message about it before me. I couldn't find anything related in the forums.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You do have the appropriate Arduino IDE installed, don't you?

 

ISTR that Atmel Studio relies upon this ...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi! 

I can't log with my account so I made another one. Weird...

 

Anyway, what do you mean with the right one? I downloaded it from .cc, I'm not using .org's, if that's what you mean. Otherwise I don't understand what you mean. And I guess is correctly installed, as I have no other issues with it, but if you can point to some way to find something that is not as it should, tell me.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, I'm having the exact same problem,

 

Atmel Studio 7 (7.0.1417)

Arduino IDE (arduino.cc) 1.8.4

 

I have a sketch with USB, that won't compile and get the same errors as your post. Tried updating all libraries/packages etc to latest but no luck.

 

Have you had any success resolving problem?

 

Last Edited: Wed. Sep 6, 2017 - 06:20 AM