baerwolf / USBaspLoader

An (V)USB bootloader firmware for AVR-MCUs emulating the popular USBasp for programming itself
Other
178 stars 146 forks source link

Trouble compiling with WinAVR #9

Closed thomasfredericks closed 10 years ago

thomasfredericks commented 10 years ago

My setup :

When I try to compile UPDATER from the MASTER branch I get the following error :

process_begin: CreateProcess(NULL, stat -c %s usbasploader.raw, ...) failed.
make[1]: Entering directory `C:/Users/thoma_000/Documents/projects/agit pov/boards/coyote/bootloader
/USBaspLoader-master(previous)/updater'
In file included from updater.c:6:
usbasploader.h:17:3: error: #error SIZEOF_new_firmware
In file included from updater.c:6:
usbasploader.h:21: error: expected expression before '>>' token
usbasploader.h:22: error: 'usbasploader' undeclared here (not in a function)
updater.c:52:4: warning: #warning I do not know where new "bootloader__do_spm" is located - assuming
 "NEW_BOOTLOADER_ADDRESS+(funcaddr___bootloader__do_spm % SPM_PAGESIZE)"
updater.c:60:4: warning: #warning "TEMP_SPM_PAGEADR" is not defined explicitly - will choose END OF
FLASH !
updater.c:115:26: error: operator '<=' has no left operand
updater.c:120:26: error: operator '>' has no left operand
updater.c: In function 'mypgm_readpage':
updater.c:171: warning: implicit declaration of function 'memcpy_PF'
updater.c: In function 'main':
updater.c:282: error: expected expression before ';' token
updater.c:288: error: 'a' undeclared (first use in this function)
updater.c:288: error: (Each undeclared identifier is reported only once
updater.c:288: error: for each function it appears in.)
updater.c:289: error: 'b' undeclared (first use in this function)
updater.c:324: error: expected expression before ';' token
make[1]: *** [updater.o] Error 1
make[1]: Leaving directory `C:/Users/thoma_000/Documents/projects/agit pov/boards/coyote/bootloader/
USBaspLoader-master(previous)/updater'
make: *** [do_updater] Error 2

With the 94c580c branch, I get the following error when I try to compile the FIRMWARE :

======>BUILDING BOOTLOADER FIRMWARE
.
make[1]: Entering directory `C:/Users/thoma_000/Documents/projects/agit pov/boards/coyote/bootloader
/USBaspLoader-94c580c(last)/USBaspLoader-94c580c/firmware'
      0 [main] sh 8036 sync_with_child: child 4484(0x224) died before initialization with status cod
e 0xC0000142
   1081 [main] sh 8036 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
make[1]: *** [main.asm] Error 128
make[1]: Leaving directory `C:/Users/thoma_000/Documents/projects/agit pov/boards/coyote/bootloader/
USBaspLoader-94c580c(last)/USBaspLoader-94c580c/firmware'
make: *** [do_firmware] Error 2
baerwolf commented 10 years ago

Please try a recent WinAVR. For example Atmel just provided the 3.4.3 version:

http://www.atmel.com/images/avr8-gnu-toolchain-installer-3.4.3.12-win32.any.x86.exe

Or perhaps you read the paragraph for Windows http://matrixstorm.com/avr/tinyusbboard/#asmorc_windows

"Since the new toolchain avr8-gnu-toolchain-installer-3.4.3.12-win32.any.x86.exe is without an installer and thus harder to setup/use, you might want to use older avr-toolchain-installer-3.4.2.1573-win32.win32.x86 available from the mirrors instead. "

thomasfredericks commented 10 years ago

I installed avr-toolchain-installer-3.4.2.1573-win32.win32.x86 since avr8-gnu-toolchain-installer-3.4.3.12-win32.any.x86.exe does not include make, sh, etc

I get the following output when compiling. Isn't the compiled bootloader too big for the chip? I still get errors for the updater.

Do you think this will be solved with avr8-gnu-toolchain-installer-3.4.3.12?

"======>BUILDING BOOTLOADER FIRMWARE"
"."
make[1]: Entering directory `C:/Users/thoma_000/Documents/projects/agit pov/boards/coyote/bootloader
/USBaspLoader-94c580c(last)/USBaspLoader-94c580c/firmware'
In file included from usbdrv/usbdrv.c:10:0,
                 from main.c:45:
usbdrv/usbdrv.h:223:24: warning: 'usbFunctionDescriptor' used but never defined [enabled by default]

"."
"."
"."
"!!!ATTANTION!!!"
"(data+text) MUST fit into your MCUs bootloader section"
"."
   text    data     bss     dec     hex filename
   2062       6      56    2124     84c main.elf
"."
"."
"."
make[1]: Leaving directory `C:/Users/thoma_000/Documents/projects/agit pov/boards/coyote/bootloader/
USBaspLoader-94c580c(last)/USBaspLoader-94c580c/firmware'
"."
"."
"======>BUILDING BOOTLOADER UPDATER (EXPERIMENTAL)"
"."
make[1]: Entering directory `C:/Users/thoma_000/Documents/projects/agit pov/boards/coyote/bootloader
/USBaspLoader-94c580c(last)/USBaspLoader-94c580c/updater'
updater.c:52:4: warning: #warning I do not know where new "bootloader__do_spm" is located - assuming
 "NEW_BOOTLOADER_ADDRESS+(funcaddr___bootloader__do_spm % SPM_PAGESIZE)" [-Wcpp]
updater.c:60:4: warning: #warning "TEMP_SPM_PAGEADR" is not defined explicitly - will choose END OF
FLASH ! [-Wcpp]
updater.c:121:4: error: #error firmware too big! firmware does not fit into flash memory!
make[1]: *** [updater.o] Error 1
make[1]: Leaving directory `C:/Users/thoma_000/Documents/projects/agit pov/boards/coyote/bootloader/
USBaspLoader-94c580c(last)/USBaspLoader-94c580c/updater'
make: *** [do_updater] Error 2
baerwolf commented 10 years ago

Hi.

The issue with your toolchain is solved. But as you already stated: Your firmware does not fit into the bootsection. This is why the updater part aborted compilation:

"updater.c:121:4: error: #error firmware too big! firmware does not fit into flash memory!"

This might be, because you changed clock from 16MHz to 12MHz. Decreasing clock roughly means increasing the firmware (because of timed USB code). The default configuration set of the stable releases of USBaspLoader didn't took this into consideration. So either you switch some features off, to make it fit or you use/take a look into the testing branch. The testing branch now has an auto feature-selection depending on the clock (12MHz or 16MHz at the moment).

Compiling the testing should work with no worries.

BR Stephan

thomasfredericks commented 10 years ago

Hi, everything is good. You can close this issue. Thank you.

baerwolf commented 10 years ago

Thank you, too.

I wish you a Merry Christmas.

BR Stephan