FS#32504 - [avr-binutils] avr-size lacks the -C and --mcu options
Attached to Project:
Community Packages
Opened by bobpaul (bobpaul) - Tuesday, 06 November 2012, 22:33 GMT
Last edited by Jakob Gruber (schuay) - Tuesday, 13 November 2012, 22:23 GMT
Opened by bobpaul (bobpaul) - Tuesday, 06 November 2012, 22:33 GMT
Last edited by Jakob Gruber (schuay) - Tuesday, 13 November 2012, 22:23 GMT
|
Details
Description:
avr-size in other distributions (winavr, debian/ubuntu packages, fedora packages) include a patch to include a "-C | --format=avr" and "--mcu=avrmcu". This allows someone to do, for example, "avr-size -C --mcu=xmega16d4" and get platform specific output like: Device: atxmega16d4 Program: 10880 bytes (53.1% Full) (.text + .data + .bootloader) Data: 1154 bytes (56.3% Full) (.data + .bss + .noinit) In paranthesis you can see the elf sections included in the summation output, allong with a percentage specific to that platform. In this output, "Program:" is a sum of everything stored in program space (flash memory) whereas "Data:" corresponds to allocated staticly allocated RAM. This is a much more useful summary than the sysv or berkeley format that just gives .text, .data, .bootloader, .fuse, etc individually. Additional info: * Ubuntu forgot to apply the patches back in release 10.10 (lucid). There's blogs (ex: http://mightyohm.com/blog/2010/08/fix-for-broken-avr-size-in-ubuntu-10-04-lucid/) and at least 1 bug report (https://bugs.launchpad.net/ubuntu/+source/binutils-avr/+bug/576676) about the issue. * I believe upstream source of the patches come from the WinAVR project. From the bug report, it sounds they can also be found in the Debian/Ubuntu source .deb files. Steps to reproduce: 1. pacman -S avr-size 2. avr-size --help 3. note "-A|-B --format={sysv|berkeley}" |
This task depends upon
Closed by Jakob Gruber (schuay)
Tuesday, 13 November 2012, 22:23 GMT
Reason for closing: Fixed
Additional comments about closing: avr-binutils 2.23-2
Tuesday, 13 November 2012, 22:23 GMT
Reason for closing: Fixed
Additional comments about closing: avr-binutils 2.23-2
Changes from the Ubuntu patch:
Fix global/local variable name clash.
Add atxmega16d4 size info.
PKGBUILD (2.1 KiB)
http://sourceware.org/ml/binutils/2012-11/msg00097.html
As expected, it was not appreciated. Maybe I'll take his advice and make a separate utility. The problem is that there's lots of guides and documentation out there that assume you're using WinAVR and you have the patched avr-size, plus other distros add the patch.
If someone's helping another developer debug an issue and they see from the make output that 95% of the data space is full, they're more likely to lead you towards an issue related to low memory than they are if they just see the raw values for .data, .bss, .noinit, .text, .bootloader, .fuse, etc. It's less obvious, and the symptoms caused by out of memory can also happen due to a variety of other reasons (interrupts setup incorrectly, etc). Not everyone knows how to estimate the static memory usage of every Atmel AVR product, but the patched avr-size does.
Jon - Much appreciation on the patch! Perhaps another course of action would be to try and convince Atmel (they seem to be maintaining what used to be WinAVR) to try and satisfy upstream or spin avr-size off to a seperate, official utility. I'm sure you don't want to have to keep tabs on every new Atmel product so you can update your patch for new microcontrollers.
Taking this upstream in some form sounds great, I'd suggest you keep pursuing that and let us know in case of any progress.