Arduino Due project running on Atmel Studio 6

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

It is so much better to work on Atmel Studio 6 than Arduino IDE. It is possible to get 8-bit arduinos to work on Atmel Studio today.See this link.

http://www.engblaze.com/tutorial...

Unfortunately, I searched on Google high and low but could not find anyone who has done the same thing for 32-bit Arduino Due.

Someone asked the same question on stackoverflow but it seems like no one could answer this useful question.
http://stackoverflow.com/questio...

Is it possible to have an Arduino Due project running on Atmel Studio 6? Can someone advise? Or is there some good material lurking on the internet on how to do this that I missed out?

Thank you.

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

Surely you can just do the "manual" process that people have been using fpor AVR8 for ages?

Basically you build a sketch in the Arduino IDE but turn on verbosity so you can see which temp directory the intermediate files are created in. Amongst those will be a libcore.a which is the main code for Arduino (pinMode, digitalWrite etc). Take a copy of this.

Now in AS6 you can create C++ projects and just added libcore.a to the list of link objects. You can then call pinMode and so on from your own code.

Obviously an Arduino sketch has the setup()/loop() structure but you can fake that with a small stub:

int main(void) {
  internal_arduino_setup();
  setup();
  while(1) {
    loop();
  }
}

Now I can't remember what "internal_arduino_setup()" is really called but it may be different for Due anyway so again the way to find out is to build an Arduino sketch and in the temporary build directory you will find the.cpp that Arduino auto created that contains that main() that calls setup() and loop(). Just copy whatever it was doing.

And that's pretty much all there is to it.