I am just curious if there is a walk through for modifying and then compiling the bootloader for the atmega 8 chips.. I have 4 or 5 to play with and I have some things I would like to use them in, but the huge bootup delay is real annoying.. I am hoping I can change it to something similar to the adaboot bootloader thats available for the 168's to make them a little easier to use.. I have gone and modified the ATmegaBOOT.c according to what I think I need to do, but I do not have a clue how to compile it.. been searching for a few days now with not a lot of success.. fuse bits I found.. even discussions on changing clock speed which I may do for use without an oscillator, but for now I would settle on learning the basics of compliling a bootloader.. Thanks for any help or pointing in the correct direction..
Well, the new arduino 0012 has the ability to burn directly with a programmer, which I asume you have if you plan to modify the bootloader, so why not just leave the bootloader off and use your programmer?
We just flew a sensor package that I developed this way, and it was a convenient way to work.
-j
Although I can do as you say, I still wanted the arduino bootloader present.. I just wanted to see how hard it was to modify the atmega8's like ladyada's changes to the amtega168's.. It'd be great for it to go right to sketch upon power up and only have the bootloader delay(lowered to 3 seconds) when reset is pressed.. By the great responses I'm getting, I don't think anyone's even using the atmega8's to play with anymore.. lol... Thanks for your suggestion kg4wsv...
Yes, But HOW TO COMPILE THE BOOTLOADER?
Nothing clear anywhere about it. Just 'you have to compile" , use "make"and so on. Yeah, HOW is the question, not WHAT...
PLEASE Guys, could anyone give a clue about the whole procedure?
-mac OR/AND windows-
help will be appreciated...
Isn't the reset time something to do with the fuses? If so you could burn it in AVR Studio but using a different fuse setting.
yes, fuse settings define some features on the ATmega...
My goal here, is to configure an atmega 8L to run at 4MHZ on internal oscillator, and configure also the ide to upload sketchs onto it, with some respect of the new cpu speed.
I succeed in setting the fuses without a programmer (serjtag & avrdude GUI, using bitbang mode).
The point now is to compile my .pde sketch to .hex files so i could upload them.
BUT for that, i have 1/to change some parametrs in the makefile, and then re-compile the bootloader. I'M STUCKED THERE !!!!
2/ modif some arduino ide prefs so it compiles the sketch properly
then upload the .hex to the boarduino using bitbang mode. ???
--Why there is no tutorial about compiling the bootloader? --
In theory, you connect to the .../bootloaders/atmega8 and type:
make DIRAVRBIN=<location of compiler binaries>
and that should be all that is required. (if you're on linux, or otherwise have avr-gcc installed in your PATH, the DIRAVRBIN piece shouldn't be needed, and you can just type "make".)
However, I am having trouble compiling the ATmega8 bootloader with the current (arduino-0015) compiler base. I get mysterious errors:
avr/bin/ld: address 0x2060 of ATmegaBOOT.elf section .text is not within region text
Fortunately, the older versions are still available. Here's the log of a successful arduino-0010 compile (I wanted to go back before the recent set of compiler "upgrades", which mean 10 or 11. 10 just happened to be more convenient...)
BillW-MacOSX-2<1387> cd /Downloads/arduino-0010/hardware/bootloaders/atmega8/
BillW-MacOSX-2<1388> make DIRAVRBIN=/Downloads/arduino-0010/hardware/tools/avr/bin/
#[note that the reset of this log is stuff emitted by "make", not stuff I had to type!]
/Downloads/arduino-0010/hardware/tools/avr/bin//avr-gcc -g -Wall -Os -mmcu=atmega8 -Datmega8 -DF_CPU=16000000 -DBAUD_RATE=19200 -I/include -c -o ATmegaBOOT.o ATmegaBOOT.c
In file included from ATmegaBOOT.c:39:
/Downloads/arduino-0010/hardware/tools/avr/bin/../lib/gcc/avr/4.0.2/../../../../avr/include/avr/delay.h:36:2: warning: #warning "This file has been moved to <util/delay.h>."
/Downloads/arduino-0010/hardware/tools/avr/bin//avr-gcc -g -Wall -Os -mmcu=atmega8 -Datmega8 -DF_CPU=16000000 -DBAUD_RATE=19200 -I/include -Wl,-Map,ATmegaBOOT.map,--section-start=.text=0x1c00 -o ATmegaBOOT.elf ATmegaBOOT.o
/Downloads/arduino-0010/hardware/tools/avr/bin//avr-objdump -h -S ATmegaBOOT.elf > ATmegaBOOT.lst
/Downloads/arduino-0010/hardware/tools/avr/bin//avr-objcopy -j .text -j .data -O ihex ATmegaBOOT.elf ATmegaBOOT.hex
/Downloads/arduino-0010/hardware/tools/avr/bin//avr-objcopy -j .text -j .data -O binary ATmegaBOOT.elf ATmegaBOOT.bin
/Downloads/arduino-0010/hardware/tools/avr/bin//avr-objcopy -j .text -j .data -O srec ATmegaBOOT.elf ATmegaBOOT.srec
/Downloads/arduino-0010/hardware/tools/avr/bin//avr-gcc -S -g -Wall -Os -mmcu=atmega8 -Datmega8 -DF_CPU=16000000 -DBAUD_RATE=19200 -I/include -g1 ATmegaBOOT.c
In file included from ATmegaBOOT.c:39:
/Downloads/arduino-0010/hardware/tools/avr/bin/../lib/gcc/avr/4.0.2/../../../../avr/include/avr/delay.h:36:2: warning: #warning "This file has been moved to <util/delay.h>."
/Downloads/arduino-0010/hardware/tools/avr/bin//avr-size ATmegaBOOT.hex
text data bss dec hex filename
0 1002 0 1002 3ea ATmegaBOOT.hex
"bash:make:command not found"
What/how/where to install the commands...
i'm on macosx.
I try also on windows.
I also have a real headhake:
It seems there is a big difference between all the tutorials, each refers to a un-certain IDE version, and files to edit simply don't exist anymore.
I don't figure where to start so.
I found fuses setup that suits my goals.
I modified the Makefile for atmega8.
Now no way to compile it?, what do i missed? :-X
There are all the exec in the arduino folder, but how do i invoque them?
Next , where do i change the DF CPU= 4000000L?
The only reference i found is in the /hardware/board.txt file,
absolutely no sign of that argument in "preference.txt".
WinAvr is not reachable for downloading,
I 'm boiling.
:question
It seems there is a big difference between all the tutorials, each refers to a un-certain IDE version, and files to edit simply don't exist anymore.
It shouldn't be so bad. The ATmega8 bootloader hasn't changed much recently, especially "what files are where." (in fact, the atmega8/ATmegaBOOT.c that is in 15 is exactly the same as the one in 10.)
"bash:make:command not found"
What/how/where to install the commands...
i'm on macosx.
Ah! I suspect that the big problem is that the people who have written the instructions and who are offering you advice have the MacOS "developer tools" installed, so they already have "make" in expected places. It looks like starting in ardunio-0012 there is a version of make included in the arduino distribution...
Next , where do i change the DF CPU= 4000000L?
In the bootloaders/atmega8/Makefile, there is an "obvious" -DF_CPU=16000000 that should be all you need to change FOR THE BOOTLOADER ITSELF.
So, the easiest path to getting a 4MHz bootloader is probably:
Download Arduino-0010 so you have the right version of the C compiler.
Download Ardunio-0012 so that you have make.
Edit arduino-0010/hardware/bootloaders/atmega8/Makefile to change the clock frequency (and fuses?)
In a shell window (terminal), cd to arduino-0010/hardware/bootloaders/atmega8/Makefile and type /Downloads/arduino-0012/hardware/tools/avr/bin/make DIRAVRBIN=/Downloads/arduino-0010/hardware/tools/avr/bin/
(Replacing "/Downloads" with whatever prefix is appropriate for where you put the arduino installs...)
I don't know if it's any comfort, but this sort of flailing around is exactly the sort of thing that the Arduino environment is supposed to prevent. You just happened to have your needs fall outside of the "easy" area.
thank you for that !!
it worked finally, following your indications...
[smiley=laugh.gif]
I also found the related files in the arduino10(wiring.c and Wconstant.h).
At least IDE compiles and upload to the specified target.
(I need to check the speed of the ATMEGA once installed)
Next is the boarduino at 4MHZ, then the standalones with batteries, finally, communicating with the MEGA i'm waiting for...
again, Thanks a lot !
I don't believe i would have found that alone...
by the way, i followed that:
http://www.cs.colorado.edu/~buechley/e-textile_kit/e-textile_kit_tech.html
can you summarize the best way to upload bootloader on an NG with atmega8 to avod start-up delay? i also looked into adaboot and others but got lost in all the bootloader code. i have an AVRISPmkII and Arduino0016 IDE so it would be easiest to just use Burn Bootloader command, but will use command line avrdude if necessary....