Page 1 of 1

bootloader + code is less then %100 but fails?

Posted: Mon Jan 16, 2017 4:22 pm
by ulao
I know it's like a desert around here anymore but avr-freeks are not helping much. I hope someone knows enough about this to help. Going to keep it simple and to the point for now. I'll be happy to add anything I can so just ask.

I have a atmega328 chip
I have the bootloader that most everyone uses with v-usb and it compiles to around %5 of the chip.
My code when compiled to about %86 fits fine
I use bootloadhid to flash

when my code grows beyond %86 I get flahs errors but %86 + %5 does not come close to %100? I'm trying to track down where the limit is coming from.

Here is a compile from my main code
Device: atmega328p
Program: 28704 bytes (87.6% Full)
(.text + .data + .bootloader)
Data: 1227 bytes (59.9% Full)
(.data + .bss + .noinit)

First I have no idea why it says .bootloader because I do no have that defined in my code anywhere. I don't think that is related to my issue but a problem in itself. I though you had to have a "__attribute__((section(".bootloader"))) " to do that?

When I build the bootloader code I see this
Program Memory Usage : 1910 bytes 5.8 % Full
Data Memory Usage : 59 bytes 2.9 % Full


So if I add 5.8(boot) + 87.6(code) I'm only at 93.4, we would this cause flash errors.

Errors I get from botloadhid
device size -00032768
data (28674) exceeds flash size!
flashing 28800 (0x7080) bytes start at 0