dritcey / optiboot

Automatically exported from code.google.com/p/optiboot
0 stars 0 forks source link

Sketch seems bigger after upload #89

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Compile optiboot for a barebone m8 @ 4mhz (crystal).
2. Upload Sketch with at least 7.462 byte.
3. Sketch is not executed properly.

What is the expected output? What do you see instead?

I'm Using Arduino IDE which works fine so far. I attached a LCD to the AVR. 
Untill the sketch size (shown by Arduino IDE) reaches something between 7.406 
byte (working) and 7.462 byte (not working anymore) everythings fine. After 
that point the LCD goes crazy and the 1 line is flickering (see picture).

With AVR-HexViewer 
(http://www.avr-praxis.de/forum/showthread.php?1176-Tool-AVR-HexViewer) I 
checked the layout of the sketch hex-file and the optiboot hex-file. They seem 
to overlapp in page 120. But by calculation it should work: 8.192(m8 flash) - 
512(optiboot) - 7.462(sketch) = 218 > 0. Some blocks arent fully use (or at 
least AVR-HexViewer says so), that might be the problem but I dont know.

What version of the product are you using? On what operating system?

- Windows 7 x64 Pro
- Arduino IDE ERW 1.05 (http://code.google.com/p/arduino-erw/)
- AVR ATmega8-16PU

Please provide any additional information below.

- My optiboot hex-file
- Not working sketch hex-file
- Picture of not working LCD

Original issue reported on code.google.com by milkpir...@gmail.com on 25 Sep 2013 at 4:01

Attachments:

GoogleCodeExporter commented 8 years ago
Ok I converted the sketch hex-file hex2bin 
(http://sourceforge.net/projects/hex2bin/) the the raw binary and guess what? 
The final binary is bigger than the Arduino IDE tells me. Will go on to the 
Arduino forum to ask them.

Original comment by milkpir...@gmail.com on 26 Sep 2013 at 3:22

GoogleCodeExporter commented 8 years ago
Closed.

Original comment by wes...@gmail.com on 14 May 2014 at 8:11

GoogleCodeExporter commented 8 years ago
Hello,

I'm facing exactly the same issue, I have custom bootloader with bootz set to 
512W_3E00, of course I changed in boards.txt the max sktech size to 31744 (so 
going to address 7BFF max) according the size of my bootloader.

With a big sketch, Arduino IDE tells me that 
Binary sketch size: 31,632 bytes (of a 31,744 byte maximum)
But looking in hex file I've got code going above 0x7C00 (starting code of by 
bootloader) 
and of course uploading fails with
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x7c00
         0x6f != 0xcd
avrdude: verification error; content mismatch
avrdude: Send: Q [51]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 

avrdude done.  Thank you.

Did you solved this problem or found a solution to have real sketch size ?

Original comment by ch.hall...@gmail.com on 19 Feb 2015 at 1:04

GoogleCodeExporter commented 8 years ago
hey ch.hall...@gmail.com,

I guess my problem was related to the Arduino IDE mod (Arduino IDE ERW) or to a 
bug in the avr-size.exe in my toolchain. If so you should try to update the to 
the latest Arduin IDE or put the latest AVR toolchain into the Arduino programm 
folder. I guess there are some tutorials on google how to do that...

BUT: Since you also have problems writing to the device I think avrdude isnt 
communicating well with your bootloader or your AVR is broken (already had that 
several times). Try to programm it with lower speed (i.e. set the -B bitclock 
value higher). It seems like hex is saying the rest of the flash should be 
empty but it isnt since your bootloader sits in the end. I'm sorry but I guess 
i couldnt help you much.

Why dont you use optiboot? It has a footprint as small as 512W as far as I knwo 
and its fully integrated to Arduino or did you mean by custom bootloader that 
you modiefied optiboot?

Hope I could help somehow. Good luck!

Original comment by milkpir...@gmail.com on 19 Feb 2015 at 7:42