Go Down

Topic: New optiboot; beta testers welcome... (Read 126219 times) previous topic - next topic

westfw

Quote
FuseBytes: I got:
"pgm_read_byte" was not declared in this scope at line 83

You probably need to download the Flash library from the playground, or remove the #define of USEFLASHLIB
Quote
OptiLoader:
I got: variable or field "read_image" declared void

That one I can't explain.  yeah, read_image is declared void, and it is consistently used that way too.

I'll try to take a look at the compiles on a "virgin" system and see if I can duplicate the problems...


leo72

Thanks. I'll wait for news from you  ;)

westfw

I've confirmed that fusebytes works without the USEFLASHLIB (and I've uploaded a new version that makes this the default.)

I couldn't duplicate the problem with optiLoader on either virgin WXP or Unbuntu10 arduino installs (ok, the Unbuntu version was the v18 installed by the package manager with the arduino parts overwritten by the v22 download.)

nicman

westfw,

I burned the optiboot_atmega328.hex file (attached at the beginning of this thread) onto a 328P DIP chip and on an Arduino Duemilanove.  I did this twice, following the instructions listed here:
http://arduino.cc/forum/index.php/topic,65099.0.html
and
http://www.sparkfun.com/tutorials/247

I used avrdude 5.10 on Windows Vista and on my Linux machine (Fedora 15).

No errors whatsoever during the burning of the bootloader, but I then couldn't communicate with either of the chips.  I got this error when trying to upload the "fade" sketch from the "examples":

Binary sketch size: 1252 bytes (of a 30720 byte maximum)
avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

I then burned the standard bootloader using the Arduino 0022 IDE, choosing the Arduino Duemilanove board and finally selecting "Burn Bootloader -> w/ Arduino as ISP".  Again, no errors during the burn AND was able to communicate with the board and load a sample program.

Am I doing anything wrong here?  I must be the only one that hasn't been able to make this work!

westfw

Did you change the board type (Tools/Board) to Uno after putting optiboot on the chip?  Once a 328 has optiboot, it acts more like an Uno than an Duemilanove (the upload speed is different.)   (hmm.  I don't think I mentioned that, did I?) (similarly, if you put optiboot on an Atmega8 or Atmega168, you need to create NEW board entries to reflect the change in upload speed (and memory available.)


nicman

Oh...  No I didn't select UNO from the board list.  Thanks, I'll try that tonight when I get home from work and I'll let you know.

Thanks again.

putyn

can i run this bootloader on an atmega8 with its internal oscillator ?

MarkT

Selecting board = UNO means '16MHz 328P optiboot',  Duemilanova means '16MHz 328P old-bootloader'.
[ I won't respond to messages, use the forum please ]

westfw

Quote
can i run this bootloader on an atmega8 with its internal oscillator ?

In theory.  The makefile claims to support old-style Lilypads (m168 running on 8MHz internal osc), but there is not current makefile entry for the m8 in that configuration.  None of the internal oscillator (or other non-16MHz) options have been tested with the latest code (efforts are focused on the production Arduinos...)

nicman

Success.  Just selected Arduino UNO from the board menu, loaded the sample fade sketch, and all is working OK.

Thanks for the help, MarkT and westfw.

putyn


Quote
can i run this bootloader on an atmega8 with its internal oscillator ?

In theory.  The makefile claims to support old-style Lilypads (m168 running on 8MHz internal osc), but there is not current makefile entry for the m8 in that configuration.  None of the internal oscillator (or other non-16MHz) options have been tested with the latest code (efforts are focused on the production Arduinos...)



ok ill try to change the make file for the atmega8 and try to compile it - ill post my results here

putyn

#41
Aug 05, 2011, 02:17 pm Last Edit: Aug 05, 2011, 07:48 pm by putyn Reason: 1
so i modified the entry for atmega8 to this
Code: [Select]

atmega8: TARGET = atmega8
atmega8: MCU_TARGET = atmega8
atmega8: CFLAGS += '-DLED_START_FLASHES=3' '-DBAUD_RATE=115200'
atmega8: AVR_FREQ = 8000000L
atmega8: LDSECTIONS  = -Wl,--section-start=.text=0x1e00 -Wl,--section-start=.version=0x1ffe
atmega8: $(PROGRAM)_atmega8.hex
atmega8: $(PROGRAM)_atmega8.lst

atmega8_isp: atmega8
atmega8_isp: TARGET = atmega8
atmega8_isp: MCU_TARGET = atmega8
# SPIEN, CKOPT, Bootsize=512B
atmega8_isp: HFUSE = CC
# 2.7V brownout, 8mhz int rc osc 6ck+64ms
atmega8_isp: LFUSE = A4
atmega8_isp: isp


then i had to edit this line
Code: [Select]

ISPFUSES    = avrdude -c $(ISPTOOL) -p $(MCU_TARGET) -P $(ISPPORT) $(ISPSPEED) \
-e -u -U lock:w:0x3f:m -U efuse:w:0x$(EFUSE):m -U hfuse:w:0x$(HFUSE):m -U lfuse:w:0x$(LFUSE):m
because atmega8 doesn't support the efuse
but i can upload only once after i burn the bootloader - any ideas ?
im testing from ubuntu 10.10 32bit

later that day - after a few more tries (burning the bootloader) finally i can upload more than one sketch on the atmega8
tested via the ftdi chip and via a serial port (with an max232 adapter)

also what its the bootloader size so i can change the value in board.txt file ?

westfw

Optiboot uses a 512 byte boot section, leaving 7680 bytes for your sketch.

newhobby

Can I read/write to EEPROM with avrdude -U option?

westfw

Optiboot cannot read or write EEPROM at all.
You could use AVR dude with a "real device programmer" connected to the ISP connector to read/write EEPROM.

Hmm.  A variation of the ArduinoISP sketch could be used to let the device program it's own EEPROM ...

Go Up