Electronic – Programming SAM uC family without ATmel Studio

armeclipse

I've designed a board that used a SAM uC (Cortex M0+). I don't want to use the ATmel Stduio, I want to learn how to use eclipse and arm-gcc and OpenOCD ( still can't understand, what this one is for ?). So my question is it possible to do that and if yes, does anyone has hint how can I proceed ?

I've installed the 3 parts,and this is the farthest I could get:
enter image description here

Best Answer

Been trying to accomplish this too and as I see, there are three ways to do this in Eclipse. One is through the GNU ARM Eclipse tools plugin, second is to create a Makefile project and specify all the details about the target, toolchain and debugger manually and third is to create an empty project with an eclipse generated makefile.

If you use the plugin, it requires all your files, including the ones from ASF, to be in CMSIS recommended structure. But in my experience, the ASF file structure doesn't seem to be the way CMSIS recommends. Manually placing these files in the CMSIS structure is also difficult since these files in turn link to numerous other files in the ASF folders.

Or you can create an Eclipse Makefile project and use the makefiles provided in the ASF examples folders. This ASF makefile contains the paths for all the source file required for that example. You can then customize this makefile for your project. This would also involve correctly specifying the paths for all the files relative to your workspace in the project setup.

Third is to create an empty project and let eclipse create the makefile. Then, you can manually link the source files required for your project using the import feature of eclipse. This one seems to be the simplest. Compiles alright but I am yet to test this on hardware.

And then there's the option of ditching the ASF altogether and writing your own register definitions and drivers and use the GNU ARM Eclipse plugin. This is of course a LOT of work since you cannot use bits and pieces from the ASF; the files are far too interrelated. Even the startup file seems to include a header!