lucas53 / arduino-tiny

Automatically exported from code.google.com/p/arduino-tiny
Other
0 stars 0 forks source link

Optiboot for wrong MCU for att85? #95

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. download arduino-tiny-0100-0017.zip and configure attiny85 boards
2. flash optiboot_attiny85.hex bootloader via arduino
3. try to use timer1 (delay/micros) - it doesn't work - never returns
After disassembling optiboot it's clear it was compiled for Attiny84 since it 
uses RAMSTART at 0x0100 and WDTVECTOR at 0x04 while ATTiny85 should use 0x0060 
and 0x0C

http://code.google.com/p/arduino-tiny/source/browse/bootloaders/optiboot/optiboo
t_attiny85.hex
Line 13
:101E800000FCFDCFE114F104E1F4 C0900001 D0901A
here at the end codes disassembled as
1e8a:   c0 90 00 01     lds r12, 0x0100 <- RAMSTART
and line 14
:101E90000101D0928501C0928401 80900801 909048
1e9a:   80 90 08 01     lds r8, 0x0108 <- RAMSTART+WDTVECTOR<<1

And guess what? 0x04 is TIMER1_OVF Vector.

Can you plz repackage the one from original trnape folder 
http://code.google.com/r/trnape-optiboot/source/browse/#hg%2Foptiboot%2Fbootload
ers%2Foptiboot ?
I'm yet about to test trnape's one, but here the inconsistency is obvious.
Regards,
Ruslam

Original issue reported on code.google.com by ruffer...@gmail.com on 22 Nov 2013 at 7:34

GoogleCodeExporter commented 8 years ago
Actually I followed other way - since I found that trnape's version is yet more 
increased in size and moved deeper to the memory. 

Instead I reworked existing disassembled version and corrected 
timers/vectors/etc. The result is I decreased the code yet by two pages so now 
it fits at 0x1e00.
The repo is here https://github.com/rufferson/optiboot, timer works without 
problems so everything blinks.

Regards,
Ruslan

Original comment by ruffer...@gmail.com on 4 Dec 2013 at 9:07