Is there a simple way to use the Arduino libraries in Atmel Studio 6 or 7? Already tried it with include path but thats a never-ending story. Looking for a precompiled .a file for the Arduino Due so I only have to include the arduino.h if possible.
Update:
I try to build a static library for the Arduino DUE to import it in another project.
I imported a simple sketch and tested it for the UNO which works.
New project - Create project from Arduino sketch - select UNO and the sketch. Both projects build (the ArduinoCore and the sketch that has the ArduinoCore lib included).
Just to verify that my steps are correct.
Now for the DUE
Same steps (tested both for DUE programming port and native USB port, both have a red square around (the UNO doesn't)).
It seems it creates the project, but I get a lot of compiler errors. 16 in total.
here the sketch. Nothing really complicated
/*Begining of Auto generated code by Atmel studio */
#include <Arduino.h>
/*End of auto generated code by Atmel studio */
//Beginning of Auto generated function prototypes by Atmel Studio
//End of Auto generated function prototypes by Atmel Studio
int count = 0;
void setup() {
pinMode(13, OUTPUT); // Set pin 13 as an output
Serial.begin(9600); // Start serial communication at 9600 baud
}
void loop() {
digitalWrite(13, HIGH); // Turn the LED on
delay(500); // Wait 500 milliseconds
digitalWrite(13, LOW); // Turn the LED off
delay(500); // Wait another 500 milliseconds
// Print message to the serial monitor
Serial.print("count: ");
Serial.println(count);
count++;
}
Atmel Studio splits the source files from ..\Arduino15\packages\arduino\hardware into a include and a src directory.
I have the files "cortex_handlers.c", "IPAddress.cpp", "main.cpp" ... but not the header files. Would that explain it?
I imported the "chip.h" which solved the last errors but created a few new ones which I am on it.
Is there a simple way to do it, a template or an already precompiled Arduino lib for the DUE?
-
1One google search lead me to this.hcheung– hcheung05/31/2025 00:57:29Commented May 31 at 0:57
-
1I found this too but its not what I am looking for. It lets you create ino sketches. I also tried to import a sketch in Atmel Studio but doesnt work because it doesnt accept the path for the Arduino IDE. I already tried to copy all files and set the variables for the paths but only works for non-nested headers. And it requires the cpp-file in the main directory, otherwise it wants the a-file. I can import all files (because they depend on each other) but then I have to go through every file and change the paths. So I was hoping for a already pre-build library.michael86– michael8605/31/2025 01:15:42Commented May 31 at 1:15
-
3Well, it allows you to run Arduino framework on Atmel Studio. You could wish what you want but what makes you think your way is the way that will work? BTW, Your comment supposed to be part of your question to explain what you've tried.hcheung– hcheung05/31/2025 01:35:36Commented May 31 at 1:35
-
2@michael86 please add the info to your question and delete the commentjsotola– jsotola05/31/2025 06:00:40Commented May 31 at 6:00
-
While extending your question, please add a minimal, complete and reproducible example that shows the problem.the busybee– the busybee05/31/2025 08:34:57Commented May 31 at 8:34