Can ASF be compiled into a static Lib for one specific HW?

Discussions about all user software around SAM Series.

Moderator: nferre

AntSmith
Posts: 1
Joined: Thu Apr 17, 2014 6:23 pm

Can ASF be compiled into a static Lib for one specific HW?

Thu Apr 17, 2014 6:26 pm

Note: cross-posted at the AVR Freaks Forum:
http://www.avrfreaks.net/index.php?name ... highlight=

I'm using Eclipse IDE with the GNU ARM plugin and the ATMEL ASF. Although I've done it, its a real pain to set everything up manually to include and build the ASF modules in a new project.

I asked ATMEL tech support and they told me (with no explanation) that ASF can not be compiled into a single static lib (for one given architecture and board).

This still bugs me as I don't understand why it can't. I'm doing sam3x8e development on a UDOO and it seems that I should be able to generate a sam3x8e static ASF library. Then (if I'm not mistaken) I can include this lib in a new project and only the archived library modules that I actually use will be included in my target binary. Project set-up should be much easier as all the sam3x8e customization is already done in my custom sam3x8e static ASF lib.

Has anyone else tried this before?
Can anyone explain why you can't build ASF into a static lib for one specific ATMEL part?

Thanks,
AntSmith
Dig Kleppe
Posts: 1
Joined: Wed Sep 16, 2015 8:33 pm

Re: Can ASF be compiled into a static Lib for one specific H

Fri Sep 18, 2015 6:00 pm

A little late reply:
It can be done, i just did it in this way:

In Atmel studio:
Make a ASF project for your board with the modules you need. Call it ASFlib.
Change the build artifact to "Static lib"
Build. There is the lib.
That was the easy part.
The studioproject is now full of include paths. You cannot copy them. (one of the reasons I hate Studio). The same for symbols.

So open the projectfile with a texteditor and find the XML lines for the includepaths and symbols.
Copy them.
In eclipse I set a environment var like ASFLIBPATH = ${workspace_loc}\ASFlib
I prefix all the paths with this like:
"${ASFLIBPATH}/src/ASF/common2/services/delay"
If you change the lib only one line has to be adapted.

Past them into your eclipse include paths and symbols. (hurray for eclipse).

* set ldscript to the one in ASF e.g. "${ASFLIBPATH}/src/ASF/sam0/utils/linker_scripts/samd21/gcc/samd21j18a_flash.ld}"

* set linker flags like in Studio e.g. -Wl,--entry=Reset_Handler -Wl,--cref -mthumb
include your fresh lib

Your new eclipse project is now a lot better to handle without hundreds of ASF files.
( like the samD21 FreeRtos demo : 1490 files)
Dig

Return to “Software”

Who is online

Users browsing this forum: No registered users and 1 guest