Atmel Studi 7 + Arduino Libraries

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

Recently i bought a Feather Bluefruit M0 from Adafruit. The board has a SAMD21G18 and also a nRF51822 bluetooh. I did this thing because i thought that Atmel Studio is powerfull enough to let me program the board in it, with the arduino libraries. I want the Arduino libraries because I don't want to rewrite some libraries which can help me. In order to make the Atmel studio work, I installed Arduino 1.6.5 Arduino SAM processor Arduino SAMD processor, all the things necesarry . I also installed Adafruit Sam supoort for feather , so what i was said to install, i did it. I tried thousands of time to import a blink led into Atmel Studio , I get the error that sam.h is not detected. i looked after him in every file, no change of finding. If any1 can help me it would be great, the other solution is to code in ARduino IDE :((((.

 

For the programming it uses bootloader, in Atmel Studio i only want to program and build my solution, for writing it , i will use another program. 

 

<Severity    Code    Description    Project    File    Line
Error        recipe for target 'Sketch.o' failed    sketch_apr30a    C:\Users\alex\Documents\Atmel Studio\7.0\Invictus\Invictus\sketch_apr30a\Debug\Makefile    87
Error        recipe for target 'src/core/delay.o' failed    ArduinoCore    C:\Users\alex\Documents\Atmel Studio\7.0\Invictus\Invictus\ArduinoCore\Debug\Makefile    305
Error        recipe for target 'src/core/IPAddress.o' failed    ArduinoCore    C:\Users\alex\Documents\Atmel Studio\7.0\Invictus\Invictus\ArduinoCore\Debug\Makefile    312
Error        conflicting types for 'utoa'    ArduinoCore    C:\Users\alex\Documents\Atmel Studio\7.0\Invictus\Invictus\ArduinoCore\include\core\itoa.h    29
Error        conflicting declaration of C function 'char* utoa(long unsigned int, char*, int)'    ArduinoCore    C:\Users\alex\Documents\Atmel Studio\7.0\Invictus\Invictus\ArduinoCore\include\core\itoa.h    29
Error        SPI.h: No such file or directory    sketch_apr30a    C:\Users\alex\Documents\Atmel Studio\7.0\Invictus\Invictus\sketch_apr30a\Sketch.cpp    16
Message        previous declaration of 'utoa' was here    ArduinoCore    c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\stdlib.h    184
Message        previous declaration 'char* utoa(unsigned int, char*, int)'    ArduinoCore    c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\stdlib.h    184

>

 

<

Project "ArduinoCore.cppproj" (default targets):
Target "PreBuildEvent" skipped, due to false condition; ('$(PreBuildEvent)'!='') was evaluated as (''!='').
Target "CoreBuild" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets" from project "C:\Users\alex\Documents\Atmel Studio\7.0\Invictus\Invictus\ArduinoCore\ArduinoCore.cppproj" (target "Build" depends on it):
    Using "RunCompilerTask" task from assembly "C:\Program Files (x86)\Atmel\Studio\7.0\Extensions\Application\AvrGCC.dll".
    Task "RunCompilerTask"
        Shell Utils Path C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils
        C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\make.exe all --jobs 4 --output-sync 
        Building file: ../src/core/abi.cpp
        Invoking: ARM/GNU C Compiler : 4.9.3
        "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=10608 -DARDUINO_SAMD_FEATHER_M0 -DARDUINO_ARCH_SAMD -DUSB_VID=0x239A -DUSB_PID=0x800B -DUSB_PRODUCT="\"Feather M0\"" -DUSB_MANUFACTURER="\"Adafruit\"" -DUSBCON -DSAMD_SERIES  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include" -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"  -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/abi.d" -MT"src/core/abi.d" -MT"src/core/abi.o"   -o "src/core/abi.o" "../src/core/abi.cpp" 
        Finished building: ../src/core/abi.cpp
        Building file: ../src/core/delay.c
        Invoking: ARM/GNU C Compiler : 4.9.3
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-gcc.exe"  -x c -mthumb -D__SAMD21G18A__ -DDEBUG -DF_CPU=48000000L -DARDUINO=10608 -DARDUINO_SAMD_FEATHER_M0 -DARDUINO_ARCH_SAMD -DUSB_VID=0x239A -DUSB_PID=0x800B -DUSB_PRODUCT="\"Feather M0\"" -DUSB_MANUFACTURER="\"Adafruit\"" -DUSBCON -DSAMD_SERIES  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include" -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"  -Os -fno-threadsafe-statics -fno-exceptions -ffunction-sections -fdata-sections -g3 -w -mcpu=cortex-m0plus -c -std=gnu11 --param max-inline-insns-single=500 -nostdlib -MD -MP -MF "src/core/delay.d" -MT"src/core/delay.d" -MT"src/core/delay.o"   -o "src/core/delay.o" "../src/core/delay.c" 
C:\Users\alex\Documents\Atmel Studio\7.0\Invictus\Invictus\ArduinoCore\Debug\Makefile(305,1): error: recipe for target 'src/core/delay.o' failed
        In file included from ..\include\core/Arduino.h:40:0,
                         from ../src/core/delay.c:20:
C:\Users\alex\Documents\Atmel Studio\7.0\Invictus\Invictus\ArduinoCore\include\core\itoa.h(29,14): error: conflicting types for 'utoa'
         extern char* utoa( unsigned long value, char *string, int radix ) ;
                      ^
        In file included from c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\stdlib.h:11:0,
                         from ..\include\core/Arduino.h:25,
                         from ../src/core/delay.c:20:
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\stdlib.h(184,8): info: previous declaration of 'utoa' was here
         char * _EXFUN(utoa,(unsigned, char *, int));
                ^
        make: *** [src/core/delay.o] Error 1
        make: *** Waiting for unfinished jobs....
        Building file: ../src/core/avr/dtostrf.c
        Invoking: ARM/GNU C Compiler : 4.9.3
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-gcc.exe"  -x c -mthumb -D__SAMD21G18A__ -DDEBUG -DF_CPU=48000000L -DARDUINO=10608 -DARDUINO_SAMD_FEATHER_M0 -DARDUINO_ARCH_SAMD -DUSB_VID=0x239A -DUSB_PID=0x800B -DUSB_PRODUCT="\"Feather M0\"" -DUSB_MANUFACTURER="\"Adafruit\"" -DUSBCON -DSAMD_SERIES  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include" -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"  -Os -fno-threadsafe-statics -fno-exceptions -ffunction-sections -fdata-sections -g3 -w -mcpu=cortex-m0plus -c -std=gnu11 --param max-inline-insns-single=500 -nostdlib -MD -MP -MF "src/core/avr/dtostrf.d" -MT"src/core/avr/dtostrf.d" -MT"src/core/avr/dtostrf.o"   -o "src/core/avr/dtostrf.o" "../src/core/avr/dtostrf.c" 
        Finished building: ../src/core/avr/dtostrf.c
        In file included from ..\include\core/Arduino.h:40:0,
                         from ../src/core/IPAddress.cpp:20:
C:\Users\alex\Documents\Atmel Studio\7.0\Invictus\Invictus\ArduinoCore\include\core\itoa.h(29,65): error: conflicting declaration of C function 'char* utoa(long unsigned int, char*, int)'
         extern char* utoa( unsigned long value, char *string, int radix ) ;
                                                                         ^
        In file included from c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\stdlib.h:11:0,
                         from ..\include\core/Arduino.h:25,
                         from ../src/core/IPAddress.cpp:20:
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\stdlib.h(184,8): info: previous declaration 'char* utoa(unsigned int, char*, int)'
         char * _EXFUN(utoa,(unsigned, char *, int));
                ^
        make: *** [src/core/IPAddress.o] Error 1
        Building file: ../src/core/IPAddress.cpp
        Invoking: ARM/GNU C Compiler : 4.9.3
        "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=10608 -DARDUINO_SAMD_FEATHER_M0 -DARDUINO_ARCH_SAMD -DUSB_VID=0x239A -DUSB_PID=0x800B -DUSB_PRODUCT="\"Feather M0\"" -DUSB_MANUFACTURER="\"Adafruit\"" -DUSBCON -DSAMD_SERIES  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include" -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"  -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/IPAddress.d" -MT"src/core/IPAddress.d" -MT"src/core/IPAddress.o"   -o "src/core/IPAddress.o" "../src/core/IPAddress.cpp" 
C:\Users\alex\Documents\Atmel Studio\7.0\Invictus\Invictus\ArduinoCore\Debug\Makefile(312,1): error: recipe for target 'src/core/IPAddress.o' failed
        Building file: ../src/core/cortex_handlers.c
        Invoking: ARM/GNU C Compiler : 4.9.3
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-gcc.exe"  -x c -mthumb -D__SAMD21G18A__ -DDEBUG -DF_CPU=48000000L -DARDUINO=10608 -DARDUINO_SAMD_FEATHER_M0 -DARDUINO_ARCH_SAMD -DUSB_VID=0x239A -DUSB_PID=0x800B -DUSB_PRODUCT="\"Feather M0\"" -DUSB_MANUFACTURER="\"Adafruit\"" -DUSBCON -DSAMD_SERIES  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include" -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"  -Os -fno-threadsafe-statics -fno-exceptions -ffunction-sections -fdata-sections -g3 -w -mcpu=cortex-m0plus -c -std=gnu11 --param max-inline-insns-single=500 -nostdlib -MD -MP -MF "src/core/cortex_handlers.d" -MT"src/core/cortex_handlers.d" -MT"src/core/cortex_handlers.o"   -o "src/core/cortex_handlers.o" "../src/core/cortex_handlers.c" 
        Finished building: ../src/core/cortex_handlers.c
    Done executing task "RunCompilerTask" -- FAILED.
Done building target "CoreBuild" in project "ArduinoCore.cppproj" -- FAILED.
Done building project "ArduinoCore.cppproj" -- FAILED.

Build FAILED.
------ Build started: Project: sketch_apr30a, Configuration: Debug ARM ------
Build started.
Project "sketch_apr30a.cppproj" (default targets):
Target "PreBuildEvent" skipped, due to false condition; ('$(PreBuildEvent)'!='') was evaluated as (''!='').
Target "CoreBuild" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets" from project "C:\Users\alex\Documents\Atmel Studio\7.0\Invictus\Invictus\sketch_apr30a\sketch_apr30a.cppproj" (target "Build" depends on it):
    Using "RunCompilerTask" task from assembly "C:\Program Files (x86)\Atmel\Studio\7.0\Extensions\Application\AvrGCC.dll".
    Task "RunCompilerTask"
        Shell Utils Path C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils
        C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\make.exe all --jobs 4 --output-sync 
C:\Users\alex\Documents\Atmel Studio\7.0\Invictus\Invictus\sketch_apr30a\Sketch.cpp(16,17): error: SPI.h: No such file or directory
         #include <SPI.h>
                         ^
        compilation terminated.
        make: *** [Sketch.o] Error 1
        Building file: .././Sketch.cpp
        Invoking: ARM/GNU C Compiler : 4.9.3
        "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=10608 -DARDUINO_SAMD_FEATHER_M0 -DARDUINO_ARCH_SAMD -DUSB_VID=0x239A -DUSB_PID=0x800B -DUSB_PRODUCT="\"Feather M0\"" -DUSB_MANUFACTURER="\"Adafruit\"" -DUSBCON -DSAMD_SERIES  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include" -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include" -I"..\\..\ArduinoCore\include\core" -I"..\\..\ArduinoCore\include\variants" -I"..\\..\ArduinoCore\include\core\avr" -I"..\\..\ArduinoCore\include\core\USB"  -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 "Sketch.d" -MT"Sketch.d" -MT"Sketch.o"   -o "Sketch.o" ".././Sketch.cpp" 
C:\Users\alex\Documents\Atmel Studio\7.0\Invictus\Invictus\sketch_apr30a\Debug\Makefile(87,1): error: recipe for target 'Sketch.o' failed
    Done executing task "RunCompilerTask" -- FAILED.
Done building target "CoreBuild" in project "sketch_apr30a.cppproj" -- FAILED.
Done building project "sketch_apr30a.cppproj" -- FAILED.

>

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

I believe that the Arduino import into Atmel studio only supports AVR Arduinos, and not any of the ARM ones.

 

 

Bob.

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

Bob, Atmel Studio 7.0.1006 installed yesterday by me, shows the Adafruit Feather M0 as a board option when you create a project from Arduino sketch.  But I get very similar errors to nikel1992 above.  What is the mechanism to get the Adafruit M0 libraries fixed?

 

 

 

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

 

Does your sketch compiles successfully in Arduino IDE?

Will you be able to share your sketch file that has the issue?

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

The sketch is the simple blink example sketch in the Arduino IDE. Yes, it compiles clean and runs correctly in the Arduino IDE.

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

I have attached the blink.cpp that AS7 generates from the Arduino IDE blink example sketch and the output from the build.  (There were actually two other errors which I have already corrected - argument types for utoa)

 

You may be interested to know that when the blink example sketch is built for the Arduino Zero by the Arduino IDE, it builds clean and runs correctly on the Adafruit Feather M0.  So the AS7 toolchain must be picking up something erroneous when the target is Adafruit Feather M0.

 

Thanks,

Rick

Attachment(s):