I'm starting with SAM D20 microcontrollers and I was testing project example USART QUICK START CALLBACK.
The output binary file is 8236 bytes long (in Debug without optimization and in Release with -Os option). It seems a very big size for a trivial application!!
Incredibly this example consumes an half of the Flash memory of the smallest D20 (16KB of Flash)!!!!
It seems the Flash memory requirement for D20 micro is much more strong respect a simple 8-bit AVR micro!! I choosed to migrate from AVR to D20 to have a modern architecture that let me store much more code and have more complex application. But it seems it isn't the right direction.
Please, help me understanding how those D20 micros can be used.
Code size for SAM D20: how big is it?
Moderator: nferre
Post
For example:
says that __divdi3 needs 0x3b0=944bytes and __udivdi3 needs 0x380=896 bytes.
Why the linker includes those functions if the example doesn't use any division? Is it ASF that uses those functions?
I'm starting thinking ASF is not my friend
Re: Code size for SAM D20: how big is it?
What do I look for? I think .text sections (I'm sorry, I'm not a guru).awneil wrote:Have a look at the map file to see where it's all going.
For example:
Code: Select all
.text 0x000011c4 0x3b0 c:/program files (x86)/atmel/atmel toolchain/arm gcc/native/4.8.1426/arm-gnu-toolchain/bin/../lib/gcc/arm-none-eabi/4.8.3/armv6-m\libgcc.a(_divdi3.o)
0x000011c4 __divdi3
.text 0x00001574 0x380 c:/program files (x86)/atmel/atmel toolchain/arm gcc/native/4.8.1426/arm-gnu-toolchain/bin/../lib/gcc/arm-none-eabi/4.8.3/armv6-m\libgcc.a(_udivdi3.o)
0x00001574 __udivdi3
Why the linker includes those functions if the example doesn't use any division? Is it ASF that uses those functions?
I'm starting thinking ASF is not my friend

I hope, because if the memory size increases linearly with the code, I'll need a 10MB Flash microcontrollerawneil wrote:It is typical of trivial applications that the setup swamps the "real work"...

Post
Re: Code size for SAM D20: how big is it?
Regarding code space, I've found we can save about 1KB of Flash memory using newlib-nano instead of newlib.
It is possible to use newlib-nano directly in Atmel Studio in the Linker General propertis of the project.
From the activity of this group, it seems I'm the only user of this microcontroller
It is possible to use newlib-nano directly in Atmel Studio in the Linker General propertis of the project.
From the activity of this group, it seems I'm the only user of this microcontroller

Return to “SAM D20 Cortex-M0+ MCU”
Who is online
Users browsing this forum: No registered users and 1 guest