Go Down

Topic: Compile Bootloaders under Windows 7 (Read 4125 times) previous topic - next topic

demolishun

How do I setup a development environment to compile the bootloaders?

I am running Windows 7 and can compile sketches.

I have followed the instructions here:
http://arduino.cc/playground/Code/WindowsCommandLine

Those only got me so far.  Now when I use abuild to compile the bootloader file it gives me this error:
avr-gcc: .\obj\arduino_runtime_atmega8_withlibs.a: No such file or directory

I can only assume at this point that I am really have no idea how to setup the proper environment for compiling a bootloader. 

One other thing I did try is copying the bootloader code into a sketch.  This does compile, but it seems like it creates a larger hex file than it should.  There has got to be a better way to go about this especially since there are nice make files in the directories with the bootloaders.

Any help would be appreciated.

demolishun

Okay, got the abuild process to work.  The paths were incorrect for arduino-0022.

In agetpref.bat

change this:
Code: [Select]

REM ---------------------------------------------------------------------------
REM     Verify that ARDUINO_PATH points to a valid Arduino-0011 installation...

set arduino_runtime=!arduino_path!\hardware\cores\arduino

to this:
Code: [Select]

REM ---------------------------------------------------------------------------
REM     Verify that ARDUINO_PATH points to a valid Arduino-0011 installation...

REM set arduino_runtime=!arduino_path!\hardware\cores\arduino
set arduino_runtime=!arduino_path!\hardware\arduino\cores\arduino


change this:
Code: [Select]

REM ---------------------------------------------------------------------------
REM     Make sure we can find cygwin1.dll and compiler/linker tools...
set path=!arduino_path!;!arduino_path!\tools\avr\bin;!path!
!abuild_report! set path to: !path!

to this:
Code: [Select]

REM ---------------------------------------------------------------------------
REM     Make sure we can find cygwin1.dll and compiler/linker tools...
REM set path=!arduino_path!;!arduino_path!\tools\avr\bin;!path!
set path=!arduino_path!;!arduino_path!\hardware\tools\avr\bin;!path!
!abuild_report! set path to: !path!


Now I get a successful build of a bootloader file.  Not sure how big it should be but it compiles to 1122 bytes.  Does anyone know how big it should be?  Should it be less than 1K?  I am wondering if I need to figure out optimizations I need to turn on.

demolishun

And now for something completely different...

I revisited using the makefile. 

I did a few things:
1. I installed the WinAVR toolchain.
2. I changed this
Code: [Select]

#DIRAVR = /usr/local/avr
DIRAVR = C:/arduino-0022/hardware/tools/avr

3. I also adjusted the optimizations, otherwise the code was not small enough to fit and the tools would complain about it
Code: [Select]

#OPTIMIZE   = -Os
OPTIMIZE   = -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -Wl,--gc-sections -fno-inline-small-functions


So now I can just type make and stuff and everything works!

demolishun

...and...the bootloader is smaller than the one Arduino puts out!  Muahahahaha!  ;)

I am really liking the Arduino development platform.  It provides an easy way to get things up and running.  It also provides reference designs for bigger and better things.  This is definitely a great dev tool for embedded robotics.  I just got put on a project to develop a robotic platform for a system that will be in places humans should not be.  This system gives me all the tools I need to get that done quickly.  I expect they will continue to develop smarter, faster, and bigger systems.  If all goes well we will be doing volume for Arduino boards for our systems.

Way to go on great engineering.  It is a genius that takes something complex and makes it simple.

Thanks

WillR


...and...the bootloader is smaller than the one Arduino puts out!  Muahahahaha!  ;)

I am really liking the Arduino development platform.  It provides an easy way to get things up and running.  It also provides reference designs for bigger and better things.  This is definitely a great dev tool for embedded robotics.  I just got put on a project to develop a robotic platform for a system that will be in places humans should not be.  This system gives me all the tools I need to get that done quickly.  I expect they will continue to develop smarter, faster, and bigger systems.  If all goes well we will be doing volume for Arduino boards for our systems.

Way to go on great engineering.  It is a genius that takes something complex and makes it simple.

Thanks


I'll just pile on here and say I agree with you.

This is a great test and development platform! I am using the MEGA2560  -- soon to be the 32MHz Plus version... right Arduino? :P
Just another Hacker

Go Up