Go Down

Topic: Atmel Studio With Arduino Due (Read 7 times) previous topic - next topic

ctbenergy


OptimusPrime

Hi!
How did you setup your project?
I am trying to set up a compiling project for two days now - without success.
First i tried the "Arduino Due/X - ATSAM3X8E" C/C++ template delivered with Atmel Studio. This creates a main.c and in the project properties only the c compiler is listed. I'd like to use the Arduino-library. Therefore i need a C++ compiler (right?). Any suggestions how to get him in there? Do you know what the template configueres?
---Didn't get the C++ compiler in :( so i tried setting up a custom project

I started with the "GCC C++ Executable Project" Template and choose the ATMSAMX38E as device. Now i see the C++ compiler in the project properties. He got some additional informations:
- the directories /variants/arduino_due_x, /system/libsam, and /sam/cores
- the symbols ARDUINO=152, and F_CPU=84000000
- the linker to the libcore.a - compiled for the Programming Port Arduino Due
- i copy pasted the content of the Arduino-Software compiled .cpp into the main.cpp
---> and end up with 5 errors: "use of enum 'adc_resolution_t' without previous declaration", "use of enum 'adc_channel_num_t' without previous declaration"...in adc.h.
So i visited adc.h and found a lof of lines like: "#if SAM3S_SERIES || SAM4_SERIES || ...." followed by definitions of the variables described in the errors. Could it be that i need to tell my code somewhere else that i use a SAM3X8E?

I got quite stuck here. Does anyone else have similar problems?
Thank you for your help!

neil12

I found this as well and posted my fix
http://arduino.cc/forum/index.php/topic,134907.msg1144567.html#msg1144567

The fix seems to be change AS6 to be the sames as the arduino-1.5.1r2 in
C:\Program Files\Atmel\Atmel Studio 6.0\extensions\Atmel\ARMGCC\3.3.1.128\ARMSupportFiles\Device\ATMEL\sam.h
/* Entire SAM3XA series */
#define SAM3XA_SERIES (SAM3X4 || SAM3X8 || SAM3A4 || SAM3A8)
from
#define SAM3XA_SERIES (SAM3A4 || SAM3A8)

I got it from
\My Documents\Arduino\arduino-1.5.1r2\hardware\arduino\sam\system\CMSIS\Device\ATMEL\sam.h
/* Entire SAM3XA series */
#define SAM3XA_SERIES ( SAM3X4 || SAM3X8 || SAM3A4 || SAM3A8)

OptimusPrime

Hi!
Thank you neil for your advice!
I got rid off the "no previous declaration" errors! :)
But.... :(
Now i am facing 58 errors like: undefined reference to 'GetTickCount' in wiring.c, undefined ref. to 'PIO_GetOutputDataStatus' in digital_wiring.c...and so on.
I only include Arduino.h like in the temporary compiled cpp from the arduino sdk.
Please help me out! This is so demotivating! I really don't know what i am doing wrong!
This was so easy with Uno...i did it many times without these strange probs....i am looking forward to loading the code up from atmel-studio...  =(
Can't somebody post a compiling example-atmel-solution?
That would be great!


IAM_Carbon_Based


Hi!
Thank you neil for your advice!
I got rid off the "no previous declaration" errors! :)
But.... :(
Now i am facing 58 errors like: undefined reference to 'GetTickCount' in wiring.c, undefined ref. to 'PIO_GetOutputDataStatus' in digital_wiring.c...and so on.
I only include Arduino.h like in the temporary compiled cpp from the arduino sdk.
Please help me out! This is so demotivating! I really don't know what i am doing wrong!
This was so easy with Uno...i did it many times without these strange probs....i am looking forward to loading the code up from atmel-studio...  =(
Can't somebody post a compiling example-atmel-solution?
That would be great!




I second this, I still am unable to get Atmel Studio to compile with the Arduino libraries.

Go Up