Go Down

Topic: Question on difference between bootloaders? (Read 6 times) previous topic - next topic

xl97

#45
Apr 18, 2013, 05:50 pm Last Edit: Apr 18, 2013, 06:44 pm by xl97 Reason: 1
Hi Pito-

sorry for lack of reply..

I dont always get time to play/test things.. between work and family.

but I havent given up!  :)



So far.. I have downloaded the Optiboot v5.0 source.

extracted the .zip file (archive)

taken the optiboot folder located here:

Optiboot_v5_source\optiboot-v5.0\bootloaders

and copied it to my Arduino IDE directories (I use V.23 and V1.0)

and renamed the folder to optiboot50


.....\Arduino_0023\hardware\arduino\bootloaders

.....\arduino-1.0\hardware\arduino\bootloaders


I went into EACH makefile in EACH directory:


.....\Arduino_0023\hardware\arduino\bootloaders\optiboot50\makefile

.....\arduino-1.0\hardware\arduino\bootloaders\optiboot50\makefile





and added this:  (after line 254)

Code: [Select]


#---------------------------------------------------------------------------
# Custom 8MHz Optiboot variant
#---------------------------------------------------------------------------
atmega328_8M: TARGET = atmega328
atmega328_8M: MCU_TARGET = atmega328p
atmega328_8M: CFLAGS += $(COMMON_OPTIONS)
atmega328_8M: AVR_FREQ ?= 8000000L
atmega328_8M: LDSECTIONS  = -Wl,--section-start=.text=0x7e00 -Wl,--section-start=.version=0x7ffe
atmega328_8M: $(PROGRAM)_atmega328_8M.hex
atmega328_8M: $(PROGRAM)_atmega328_8M.lst





Went to command promot.. changed directories to be inside the Optiboot directory..

typed thi: omake atmega328_8M BAUD_RATE=57600 LED=B5


and compiled both...


getting this as my output:

Code: [Select]



C:\Documents and Settings\Arduino\Arduino_0023\hardware\arduino\b
ootloaders\optiboot50>omake atmega328_8M BAUD_RATE=57600 LED=B5

C:\Documents and Settings\Arduino\Arduino_0023\hardware\arduino\b
ootloaders\optiboot50>..\..\..\tools\avr\utils\bin\make OS=windows ENV=arduino a
tmega328_8M BAUD_RATE=57600 LED=B5
BAUD RATE CHECK: Desired: 57600, Real: 58823, UBRRL = 16, Error=-2.1%
../../../tools/avr/bin/avr-gcc -g -Wall -Os -fno-inline-small-functions -fno-spl
it-wide-types -mshort-calls -mmcu=atmega328p -DF_CPU=8000000L  -DBAUD_RATE=57600
-DLED_START_FLASHES=3    -DLED=B5   -c -o optiboot.o optiboot.c
optiboot.c:256:2: warning: #warning BAUD_RATE error greater than -2%
../../../tools/avr/bin/avr-gcc -g -Wall -Os -fno-inline-small-functions -fno-spl
it-wide-types -mshort-calls -mmcu=atmega328p -DF_CPU=8000000L  -DBAUD_RATE=57600
-DLED_START_FLASHES=3    -DLED=B5 -Wl,--section-start=.text=0x7e00 -Wl,--sectio
n-start=.version=0x7ffe -Wl,--relax -Wl,--gc-sections -nostartfiles -nostdlib -o
optiboot_atmega328_8M.elf optiboot.o
../../../tools/avr/bin/avr-size optiboot_atmega328_8M.elf
  text    data     bss     dec     hex filename
   482       0       0     482     1e2 optiboot_atmega328_8M.elf
../../../tools/avr/bin/avr-objcopy -j .text -j .data -j .version --set-section-f
lags .version=alloc,load -O ihex optiboot_atmega328_8M.elf optiboot_atmega328_8M
.hex
..\..\..\tools\avr\bin\avr-objdump -h -S optiboot_atmega328_8M.elf > optiboot_at
mega328_8M.lst
rm optiboot.o optiboot_atmega328_8M.elf





C:\Documents and Settings\Arduino\arduino-1.0
\hardware\arduino\bootloaders\optiboot50>omake atmega328_8M BAUD_RATE=57600 LED=
B5

C:\Documents and Settings\Arduino\arduino-1.0
\hardware\arduino\bootloaders\optiboot50>..\..\..\tools\avr\utils\bin\make OS=wi
ndows ENV=arduino atmega328_8M BAUD_RATE=57600 LED=B5
BAUD RATE CHECK: Desired: 57600, Real: 58823, UBRRL = 16, Error=-2.1%
../../../tools/avr/bin/avr-gcc -g -Wall -Os -fno-inline-small-functions -fno-spl
it-wide-types -mshort-calls -mmcu=atmega328p -DF_CPU=8000000L  -DBAUD_RATE=57600
-DLED_START_FLASHES=3    -DLED=B5   -c -o optiboot.o optiboot.c
optiboot.c:256:2: warning: #warning BAUD_RATE error greater than -2%
../../../tools/avr/bin/avr-gcc -g -Wall -Os -fno-inline-small-functions -fno-spl
it-wide-types -mshort-calls -mmcu=atmega328p -DF_CPU=8000000L  -DBAUD_RATE=57600
-DLED_START_FLASHES=3    -DLED=B5 -Wl,--section-start=.text=0x7e00 -Wl,--sectio
n-start=.version=0x7ffe -Wl,--relax -Wl,--gc-sections -nostartfiles -nostdlib -o
optiboot_atmega328_8M.elf optiboot.o
../../../tools/avr/bin/avr-size optiboot_atmega328_8M.elf
  text    data     bss     dec     hex filename
   482       0       0     482     1e2 optiboot_atmega328_8M.elf
../../../tools/avr/bin/avr-objcopy -j .text -j .data -j .version --set-section-f
lags .version=alloc,load -O ihex optiboot_atmega328_8M.elf optiboot_atmega328_8M
.hex
..\..\..\tools\avr\bin\avr-objdump -h -S optiboot_atmega328_8M.elf > optiboot_at
mega328_8M.lst
rm optiboot.o optiboot_atmega328_8M.elf



an thats as far as I have gotten right now..

I have no clue what you mean by this:

"The oscillator type (and other stuff) is set with the fuses. So when burning in the .hex you have to flash the fuses as well.."


I have never 'manually' set fuses??  I just pick the option form the Arduino IDE.. and let the software 'do its thing'..


is what I am doing.. or need to do in the end.. NOT THIS?

I am un-clear on how to complete?

(would have been so much easier if the original pcb designer would have just incorporated an ICSP header/breakout)

all this using a 16MHZ board to flash a blank chip and put in to a 8MHZ board in the end/upload sketches to, seems like alot of trouble/work!   hahaha..




So.. I ran the compiler.. Im assuming it cresated a file (HEX) for me?

But now what?  What 'fuses'?  and do I need to move this hex to somewhere else now?

Do I still need to make an entry in the boards.txt file?

How does this different from Optiboot Arduino Pro/Pro-Mini @+3.3v/8MHz?

This new one will allow me to use the 16MHZ board to flash and install in a 8MHZ board without error or something?

thanks!





Go Up