GenBoard/Firmware/BuildFirmwareFAQ

This page is mostly for developers,

since users normally get the released firmware from GenBoard/UnderDevelopment/FirmwareChanges and use the built vems.hex image.

It's assumed you're familiar with GenBoard/FirmWare and acquired a firmware tree that you would like to compile to a binary which can be uploaded to the AVR (GenBoard/Firmware/Upload).

To compile the code you will need some easy to install software:


If you don't use sh, you get an error message like this:

avr-gcc -c -g -O2 -Wall -Wstrict-prototypes -Wa,-ahlms=megasquirt.lst -mmcu=atmega128 -I. megasquirt.c -o megasquirt.o

process_begin: CreateProcess((null),

avr-gcc -c -g -O2 -Wall -Wstrict-prototypes -Wa,-ahlms=megasquirt.lst -mmcu=atmega128 -I. megasquirt.c -o megasquirt.o, ... ) failed.

make (e=2): The system cannot find the file specified.

C:\WINAVR\UTILS\BIN\MAKE.EXE: *** [megasquirt.o] Error 2

USE SH for running MAKE not winblows CMD prompt!

I had the same problem for days. When I first tried winavr and makefile from cvs, it worked

out of the box. I thought it was something about cygwin (that I later installed) and libraries.

I could not sort it for days. One time I tried to run make from sh and hey presto, it worked. (I cannot remember if I ran make from sh the very first time it worked, probably) Use sh not cmd. Sh is included in the WinAVR package. When I installed some broken program, it set LIB variable so the linking failed. After I unset LIB the compile and linking succeeds.

Tip for Windows users

If you have problems with the sh shell under Windows, cmd can be used instead... The only thing you must change after installed ActivePerl, is the PATH variable. If Perl's folder comes earlier in the PATH, the Perl's 'make' command will be used when you typing make... which causes the famous CreateProcess error. Make sure that your avrlib's 'bin' folder precede the Perl binaries folder in the PATH environment variable!

Win 9x users: take a look to autoexec.bat, Win NT clone users: go to System Properties/Advanced/Environment Variables. Restart required in both cases! Type 'echo %PATH%' to the command prompt if you are not sure!

Note !!!

The famous CreateProcess error happens (at least in Windows boxes) also when there is an syntax bug in 'makefile' located in firmware folder.

Like the syntax error in version 1.0.18 (it might be possible that earlier versions also suffers from this same makefile syntax error) firmware makefile has in line:

etc/airdenfactor.c: airdenfactor.c

correct syntax is

etc/airdenfactor.c:

When 'makefile' file is corrected, firmware compiles OK from 'CMD' and also 'SH'


If you get this kind of error

''... rage.o actuators.o ve.o iac.o keyboard.o lcd.o heap.o eventqueue.o button.o be

nchmark.o lcd_display.o injconf.o ignconf.o timing.o kb.o menu.o ringbuf.o phase

signal.o ego.o wbo2.o pid.o log.o C:\Program Files\Microsoft Visual Studio\DF98

\IMSL\LIB;C:\Program Files\Microsoft Visual Studio\DF98\LIB;C:\Program Files\Mic

rosoft Visual Studio\VC98\LIB -Wl,-Map=megasquirt.map,--cref -mmcu=atmega128 -o

megasquirt.elf

avr-gcc.exe: C:Program: No such file or directory

avr-gcc.exe: FilesMicrosoft: No such file or directory

avr-gcc.exe: Visual: No such file or directory

avr-gcc.exe: StudioDF98IMSLLIB: No such file or directory

C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\make12003.sh: C:Program: command not found

C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\make12003.sh: C:Program: command not found

...''

Note: you need to unset LIB in the sh (shell from unixutils). Changing the windows global enviroment varibles didn't work on my win2k Box. So unset LIB it each time you start the shell. When I figure out a permanent fix I'll post it. (GRMracer)


another compiling problem..

my_make at http://kombi.ulkhyvlers.net/vems/files

f -mmcu=atmega128 -o vems.elf

comm.o(.text+0xca6): In function `srl_generic_P_upper':

/home/vems/firmware/comm.c:823: undefined reference to `pgm_read_byte_far'

make: *** [vems.elf] Error 1

rm injconf.o eventqueue.o spi.o phasesignal.o timing.o benchmark.o ringbuf.o ignconf.o multitooth.o menu.o knock.o

The above is related to old avr-libc. Upgrade to newer avr-libc (or winavr). Maybe Mik will commit a small workaround ifdef, but easiest for now seems to just upgrade.

> tried to run make. got an error message. at line 33 a personal

configuration called 'my_make' is missing.

copy it from doc and align it to your needs. It affects how big LCD is used (if any), etc...


Perl tips:

Get the latest active perl!


After you have a vems.hex file you can upload it to a real AtMega128 or simulate under simulavr (linux, gdb, free) or avrstudio (atmel.com free). Check