From a5b1af4999345239df5086351b52a5b4d2daa97e Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 27 Aug 2016 18:40:50 +0300 Subject: Normalize line endings --- tmk_core/common/avr/xprintf.S | 1000 +++++----- tmk_core/common/avr/xprintf.h | 222 +-- tmk_core/protocol/iwrap/suart.S | 312 ++-- tmk_core/protocol/iwrap/suart.h | 16 +- tmk_core/protocol/iwrap/wd.h | 318 ++-- .../protocol/lufa/LUFA-git/Bootloaders/CDC/asf.xml | 322 ++-- .../protocol/lufa/LUFA-git/Bootloaders/DFU/asf.xml | 312 ++-- .../protocol/lufa/LUFA-git/Bootloaders/HID/asf.xml | 246 +-- .../Bootloaders/MassStorage/BootloaderAPITable.S | 204 +- .../lufa/LUFA-git/Bootloaders/MassStorage/asf.xml | 312 ++-- .../lufa/LUFA-git/Bootloaders/MassStorage/makefile | 136 +- .../Bootloaders/Printer/BootloaderAPITable.S | 182 +- .../lufa/LUFA-git/Bootloaders/Printer/asf.xml | 318 ++-- .../lufa/LUFA-git/Bootloaders/Printer/makefile | 110 +- .../LUFA-git/LUFA/Build/HID_EEPROM_Loader/makefile | 84 +- .../LUFA/CodeTemplates/DeviceTemplate/asf.xml | 110 +- .../LUFA/CodeTemplates/HostTemplate/asf.xml | 82 +- .../LUFA-git/LUFA/DoxygenPages/BuildSystem.txt | 1950 ++++++++++---------- 18 files changed, 3118 insertions(+), 3118 deletions(-) (limited to 'tmk_core') diff --git a/tmk_core/common/avr/xprintf.S b/tmk_core/common/avr/xprintf.S index 0cec70ce2..06434b98d 100644 --- a/tmk_core/common/avr/xprintf.S +++ b/tmk_core/common/avr/xprintf.S @@ -1,500 +1,500 @@ -;---------------------------------------------------------------------------; -; Extended itoa, puts, printf and atoi (C)ChaN, 2011 -;---------------------------------------------------------------------------; - - // Base size is 152 bytes -#define CR_CRLF 0 // Convert \n to \r\n (+10 bytes) -#define USE_XPRINTF 1 // Enable xprintf function (+194 bytes) -#define USE_XSPRINTF 0 // Add xsprintf function (+78 bytes) -#define USE_XFPRINTF 0 // Add xfprintf function (+54 bytes) -#define USE_XATOI 0 // Enable xatoi function (+182 bytes) - - -#if FLASHEND > 0x1FFFF -#error xitoa module does not support 256K devices -#endif - -.nolist -#include // Include device specific definitions. -.list - -#ifdef SPM_PAGESIZE // Recent devices have "lpm Rd,Z+" and "movw". -.macro _LPMI reg - lpm \reg, Z+ -.endm -.macro _MOVW dh,dl, sh,sl - movw \dl, \sl -.endm -#else // Earlier devices do not have "lpm Rd,Z+" nor "movw". -.macro _LPMI reg - lpm - mov \reg, r0 - adiw ZL, 1 -.endm -.macro _MOVW dh,dl, sh,sl - mov \dl, \sl - mov \dh, \sh -.endm -#endif - - - -;--------------------------------------------------------------------------- -; Stub function to forward to user output function -; -;Prototype: void xputc (char chr // a character to be output -; ); -;Size: 12/12 words - -.section .bss -.global xfunc_out ; xfunc_out must be initialized before using this module. -xfunc_out: .ds.w 1 -.section .text - - -.func xputc -.global xputc -xputc: -#if CR_CRLF - cpi r24, 10 ;LF --> CRLF - brne 1f ; - ldi r24, 13 ; - rcall 1f ; - ldi r24, 10 ;/ -1: -#endif - push ZH - push ZL - lds ZL, xfunc_out+0 ;Pointer to the registered output function. - lds ZH, xfunc_out+1 ;/ - sbiw ZL, 0 ;Skip if null - breq 2f ;/ - icall -2: pop ZL - pop ZH - ret -.endfunc - - - -;--------------------------------------------------------------------------- -; Direct ROM string output -; -;Prototype: void xputs (const char *str_p // rom string to be output -; ); - -.func xputs -.global xputs -xputs: - _MOVW ZH,ZL, r25,r24 ; Z = pointer to rom string -1: _LPMI r24 - cpi r24, 0 - breq 2f - rcall xputc - rjmp 1b -2: ret -.endfunc - - -;--------------------------------------------------------------------------- -; Extended direct numeral string output (32bit version) -; -;Prototype: void xitoa (long value, // value to be output -; char radix, // radix -; char width); // minimum width -; - -.func xitoa -.global xitoa -xitoa: - ;r25:r22 = value, r20 = base, r18 = digits - clr r31 ;r31 = stack level - ldi r30, ' ' ;r30 = sign - ldi r19, ' ' ;r19 = filler - sbrs r20, 7 ;When base indicates signd format and the value - rjmp 0f ;is minus, add a '-'. - neg r20 ; - sbrs r25, 7 ; - rjmp 0f ; - ldi r30, '-' ; - com r22 ; - com r23 ; - com r24 ; - com r25 ; - adc r22, r1 ; - adc r23, r1 ; - adc r24, r1 ; - adc r25, r1 ;/ -0: sbrs r18, 7 ;When digits indicates zero filled, - rjmp 1f ;filler is '0'. - neg r18 ; - ldi r19, '0' ;/ - ;----- string conversion loop -1: ldi r21, 32 ;r26 = r25:r22 % r20 - clr r26 ;r25:r22 /= r20 -2: lsl r22 ; - rol r23 ; - rol r24 ; - rol r25 ; - rol r26 ; - cp r26, r20 ; - brcs 3f ; - sub r26, r20 ; - inc r22 ; -3: dec r21 ; - brne 2b ;/ - cpi r26, 10 ;r26 is a numeral digit '0'-'F' - brcs 4f ; - subi r26, -7 ; -4: subi r26, -'0' ;/ - push r26 ;Stack it - inc r31 ;/ - cp r22, r1 ;Repeat until r25:r22 gets zero - cpc r23, r1 ; - cpc r24, r1 ; - cpc r25, r1 ; - brne 1b ;/ - - cpi r30, '-' ;Minus sign if needed - brne 5f ; - push r30 ; - inc r31 ;/ -5: cp r31, r18 ;Filler - brcc 6f ; - push r19 ; - inc r31 ; - rjmp 5b ;/ - -6: pop r24 ;Flush stacked digits and exit - rcall xputc ; - dec r31 ; - brne 6b ;/ - - ret -.endfunc - - - -;---------------------------------------------------------------------------; -; Formatted string output (16/32bit version) -; -;Prototype: -; void __xprintf (const char *format_p, ...); -; void __xsprintf(char*, const char *format_p, ...); -; void __xfprintf(void(*func)(char), const char *format_p, ...); -; - -#if USE_XPRINTF - -.func xvprintf -xvprintf: - ld ZL, Y+ ;Z = pointer to format string - ld ZH, Y+ ;/ - -0: _LPMI r24 ;Get a format char - cpi r24, 0 ;End of format string? - breq 90f ;/ - cpi r24, '%' ;Is format? - breq 20f ;/ -1: rcall xputc ;Put a normal character - rjmp 0b ;/ -90: ret - -20: ldi r18, 0 ;r18: digits - clt ;T: filler - _LPMI r21 ;Get flags - cpi r21, '%' ;Is a %? - breq 1b ;/ - cpi r21, '0' ;Zero filled? - brne 23f ; - set ;/ -22: _LPMI r21 ;Get width -23: cpi r21, '9'+1 ; - brcc 24f ; - subi r21, '0' ; - brcs 90b ; - lsl r18 ; - mov r0, r18 ; - lsl r18 ; - lsl r18 ; - add r18, r0 ; - add r18, r21 ; - rjmp 22b ;/ - -24: brtc 25f ;get value (low word) - neg r18 ; -25: ld r24, Y+ ; - ld r25, Y+ ;/ - cpi r21, 'c' ;Is type character? - breq 1b ;/ - cpi r21, 's' ;Is type RAM string? - breq 50f ;/ - cpi r21, 'S' ;Is type ROM string? - breq 60f ;/ - _MOVW r23,r22,r25,r24 ;r25:r22 = value - clr r24 ; - clr r25 ; - clt ;/ - cpi r21, 'l' ;Is long int? - brne 26f ; - ld r24, Y+ ;get value (high word) - ld r25, Y+ ; - set ; - _LPMI r21 ;/ -26: cpi r21, 'd' ;Is type signed decimal? - brne 27f ;/ - ldi r20, -10 ; - brts 40f ; - sbrs r23, 7 ; - rjmp 40f ; - ldi r24, -1 ; - ldi r25, -1 ; - rjmp 40f ;/ -27: cpi r21, 'u' ;Is type unsigned decimal? - ldi r20, 10 ; - breq 40f ;/ - cpi r21, 'X' ;Is type hexdecimal? - ldi r20, 16 ; - breq 40f ;/ - cpi r21, 'b' ;Is type binary? - ldi r20, 2 ; - breq 40f ;/ - ret ;abort -40: push ZH ;Output the value - push ZL ; - rcall xitoa ; -42: pop ZL ; - pop ZH ; - rjmp 0b ;/ - -50: push ZH ;Put a string on the RAM - push ZL - _MOVW ZH,ZL, r25,r24 -51: ld r24, Z+ - cpi r24, 0 - breq 42b - rcall xputc - rjmp 51b - -60: push ZH ;Put a string on the ROM - push ZL - rcall xputs - rjmp 42b -.endfunc - - -.func __xprintf -.global __xprintf -__xprintf: - push YH - push YL - in YL, _SFR_IO_ADDR(SPL) -#ifdef SPH - in YH, _SFR_IO_ADDR(SPH) -#else - clr YH -#endif - adiw YL, 5 ;Y = pointer to arguments - rcall xvprintf - pop YL - pop YH - ret -.endfunc - - -#if USE_XSPRINTF - -.func __xsprintf -putram: - _MOVW ZH,ZL, r15,r14 - st Z+, r24 - _MOVW r15,r14, ZH,ZL - ret -.global __xsprintf -__xsprintf: - push YH - push YL - in YL, _SFR_IO_ADDR(SPL) -#ifdef SPH - in YH, _SFR_IO_ADDR(SPH) -#else - clr YH -#endif - adiw YL, 5 ;Y = pointer to arguments - lds ZL, xfunc_out+0 ;Save registered output function - lds ZH, xfunc_out+1 ; - push ZL ; - push ZH ;/ - ldi ZL, lo8(pm(putram));Set local output function - ldi ZH, hi8(pm(putram)); - sts xfunc_out+0, ZL ; - sts xfunc_out+1, ZH ;/ - push r15 ;Initialize pointer to string buffer - push r14 ; - ld r14, Y+ ; - ld r15, Y+ ;/ - rcall xvprintf - _MOVW ZH,ZL, r15,r14 ;Terminate string - st Z, r1 ; - pop r14 ; - pop r15 ;/ - pop ZH ;Restore registered output function - pop ZL ; - sts xfunc_out+0, ZL ; - sts xfunc_out+1, ZH ;/ - pop YL - pop YH - ret -.endfunc -#endif - - -#if USE_XFPRINTF -.func __xfprintf -.global __xfprintf -__xfprintf: - push YH - push YL - in YL, _SFR_IO_ADDR(SPL) -#ifdef SPH - in YH, _SFR_IO_ADDR(SPH) -#else - clr YH -#endif - adiw YL, 5 ;Y = pointer to arguments - lds ZL, xfunc_out+0 ;Save registered output function - lds ZH, xfunc_out+1 ; - push ZL ; - push ZH ;/ - ld ZL, Y+ ;Set output function - ld ZH, Y+ ; - sts xfunc_out+0, ZL ; - sts xfunc_out+1, ZH ;/ - rcall xvprintf - pop ZH ;Restore registered output function - pop ZL ; - sts xfunc_out+0, ZL ; - sts xfunc_out+1, ZH ;/ - pop YL - pop YH - ret -.endfunc -#endif - -#endif - - - -;--------------------------------------------------------------------------- -; Extended numeral string input -; -;Prototype: -; char xatoi ( /* 1: Successful, 0: Failed */ -; const char **str, /* pointer to pointer to source string */ -; long *res /* result */ -; ); -; - - -#if USE_XATOI -.func xatoi -.global xatoi -xatoi: - _MOVW r1, r0, r23, r22 - _MOVW XH, XL, r25, r24 - ld ZL, X+ - ld ZH, X+ - clr r18 ;r21:r18 = 0; - clr r19 ; - clr r20 ; - clr r21 ;/ - clt ;T = 0; - - ldi r25, 10 ;r25 = 10; - rjmp 41f ;/ -40: adiw ZL, 1 ;Z++; -41: ld r22, Z ;r22 = *Z; - cpi r22, ' ' ;if(r22 == ' ') continue - breq 40b ;/ - brcs 70f ;if(r22 < ' ') error; - cpi r22, '-' ;if(r22 == '-') { - brne 42f ; T = 1; - set ; continue; - rjmp 40b ;} -42: cpi r22, '9'+1 ;if(r22 > '9') error; - brcc 70f ;/ - cpi r22, '0' ;if(r22 < '0') error; - brcs 70f ;/ - brne 51f ;if(r22 > '0') cv_start; - ldi r25, 8 ;r25 = 8; - adiw ZL, 1 ;r22 = *(++Z); - ld r22, Z ;/ - cpi r22, ' '+1 ;if(r22 <= ' ') exit; - brcs 80f ;/ - cpi r22, 'b' ;if(r22 == 'b') { - brne 43f ; r25 = 2; - ldi r25, 2 ; cv_start; - rjmp 50f ;} -43: cpi r22, 'x' ;if(r22 != 'x') error; - brne 51f ;/ - ldi r25, 16 ;r25 = 16; - -50: adiw ZL, 1 ;Z++; - ld r22, Z ;r22 = *Z; -51: cpi r22, ' '+1 ;if(r22 <= ' ') break; - brcs 80f ;/ - cpi r22, 'a' ;if(r22 >= 'a') r22 =- 0x20; - brcs 52f ; - subi r22, 0x20 ;/ -52: subi r22, '0' ;if((r22 -= '0') < 0) error; - brcs 70f ;/ - cpi r22, 10 ;if(r22 >= 10) { - brcs 53f ; r22 -= 7; - subi r22, 7 ; if(r22 < 10) - cpi r22, 10 ; - brcs 70f ;} -53: cp r22, r25 ;if(r22 >= r25) error; - brcc 70f ;/ -60: ldi r24, 33 ;r21:r18 *= r25; - sub r23, r23 ; -61: brcc 62f ; - add r23, r25 ; -62: lsr r23 ; - ror r21 ; - ror r20 ; - ror r19 ; - ror r18 ; - dec r24 ; - brne 61b ;/ - add r18, r22 ;r21:r18 += r22; - adc r19, r24 ; - adc r20, r24 ; - adc r21, r24 ;/ - rjmp 50b ;repeat - -70: ldi r24, 0 - rjmp 81f -80: ldi r24, 1 -81: brtc 82f - clr r22 - com r18 - com r19 - com r20 - com r21 - adc r18, r22 - adc r19, r22 - adc r20, r22 - adc r21, r22 -82: st -X, ZH - st -X, ZL - _MOVW XH, XL, r1, r0 - st X+, r18 - st X+, r19 - st X+, r20 - st X+, r21 - clr r1 - ret -.endfunc -#endif - - +;---------------------------------------------------------------------------; +; Extended itoa, puts, printf and atoi (C)ChaN, 2011 +;---------------------------------------------------------------------------; + + // Base size is 152 bytes +#define CR_CRLF 0 // Convert \n to \r\n (+10 bytes) +#define USE_XPRINTF 1 // Enable xprintf function (+194 bytes) +#define USE_XSPRINTF 0 // Add xsprintf function (+78 bytes) +#define USE_XFPRINTF 0 // Add xfprintf function (+54 bytes) +#define USE_XATOI 0 // Enable xatoi function (+182 bytes) + + +#if FLASHEND > 0x1FFFF +#error xitoa module does not support 256K devices +#endif + +.nolist +#include // Include device specific definitions. +.list + +#ifdef SPM_PAGESIZE // Recent devices have "lpm Rd,Z+" and "movw". +.macro _LPMI reg + lpm \reg, Z+ +.endm +.macro _MOVW dh,dl, sh,sl + movw \dl, \sl +.endm +#else // Earlier devices do not have "lpm Rd,Z+" nor "movw". +.macro _LPMI reg + lpm + mov \reg, r0 + adiw ZL, 1 +.endm +.macro _MOVW dh,dl, sh,sl + mov \dl, \sl + mov \dh, \sh +.endm +#endif + + + +;--------------------------------------------------------------------------- +; Stub function to forward to user output function +; +;Prototype: void xputc (char chr // a character to be output +; ); +;Size: 12/12 words + +.section .bss +.global xfunc_out ; xfunc_out must be initialized before using this module. +xfunc_out: .ds.w 1 +.section .text + + +.func xputc +.global xputc +xputc: +#if CR_CRLF + cpi r24, 10 ;LF --> CRLF + brne 1f ; + ldi r24, 13 ; + rcall 1f ; + ldi r24, 10 ;/ +1: +#endif + push ZH + push ZL + lds ZL, xfunc_out+0 ;Pointer to the registered output function. + lds ZH, xfunc_out+1 ;/ + sbiw ZL, 0 ;Skip if null + breq 2f ;/ + icall +2: pop ZL + pop ZH + ret +.endfunc + + + +;--------------------------------------------------------------------------- +; Direct ROM string output +; +;Prototype: void xputs (const char *str_p // rom string to be output +; ); + +.func xputs +.global xputs +xputs: + _MOVW ZH,ZL, r25,r24 ; Z = pointer to rom string +1: _LPMI r24 + cpi r24, 0 + breq 2f + rcall xputc + rjmp 1b +2: ret +.endfunc + + +;--------------------------------------------------------------------------- +; Extended direct numeral string output (32bit version) +; +;Prototype: void xitoa (long value, // value to be output +; char radix, // radix +; char width); // minimum width +; + +.func xitoa +.global xitoa +xitoa: + ;r25:r22 = value, r20 = base, r18 = digits + clr r31 ;r31 = stack level + ldi r30, ' ' ;r30 = sign + ldi r19, ' ' ;r19 = filler + sbrs r20, 7 ;When base indicates signd format and the value + rjmp 0f ;is minus, add a '-'. + neg r20 ; + sbrs r25, 7 ; + rjmp 0f ; + ldi r30, '-' ; + com r22 ; + com r23 ; + com r24 ; + com r25 ; + adc r22, r1 ; + adc r23, r1 ; + adc r24, r1 ; + adc r25, r1 ;/ +0: sbrs r18, 7 ;When digits indicates zero filled, + rjmp 1f ;filler is '0'. + neg r18 ; + ldi r19, '0' ;/ + ;----- string conversion loop +1: ldi r21, 32 ;r26 = r25:r22 % r20 + clr r26 ;r25:r22 /= r20 +2: lsl r22 ; + rol r23 ; + rol r24 ; + rol r25 ; + rol r26 ; + cp r26, r20 ; + brcs 3f ; + sub r26, r20 ; + inc r22 ; +3: dec r21 ; + brne 2b ;/ + cpi r26, 10 ;r26 is a numeral digit '0'-'F' + brcs 4f ; + subi r26, -7 ; +4: subi r26, -'0' ;/ + push r26 ;Stack it + inc r31 ;/ + cp r22, r1 ;Repeat until r25:r22 gets zero + cpc r23, r1 ; + cpc r24, r1 ; + cpc r25, r1 ; + brne 1b ;/ + + cpi r30, '-' ;Minus sign if needed + brne 5f ; + push r30 ; + inc r31 ;/ +5: cp r31, r18 ;Filler + brcc 6f ; + push r19 ; + inc r31 ; + rjmp 5b ;/ + +6: pop r24 ;Flush stacked digits and exit + rcall xputc ; + dec r31 ; + brne 6b ;/ + + ret +.endfunc + + + +;---------------------------------------------------------------------------; +; Formatted string output (16/32bit version) +; +;Prototype: +; void __xprintf (const char *format_p, ...); +; void __xsprintf(char*, const char *format_p, ...); +; void __xfprintf(void(*func)(char), const char *format_p, ...); +; + +#if USE_XPRINTF + +.func xvprintf +xvprintf: + ld ZL, Y+ ;Z = pointer to format string + ld ZH, Y+ ;/ + +0: _LPMI r24 ;Get a format char + cpi r24, 0 ;End of format string? + breq 90f ;/ + cpi r24, '%' ;Is format? + breq 20f ;/ +1: rcall xputc ;Put a normal character + rjmp 0b ;/ +90: ret + +20: ldi r18, 0 ;r18: digits + clt ;T: filler + _LPMI r21 ;Get flags + cpi r21, '%' ;Is a %? + breq 1b ;/ + cpi r21, '0' ;Zero filled? + brne 23f ; + set ;/ +22: _LPMI r21 ;Get width +23: cpi r21, '9'+1 ; + brcc 24f ; + subi r21, '0' ; + brcs 90b ; + lsl r18 ; + mov r0, r18 ; + lsl r18 ; + lsl r18 ; + add r18, r0 ; + add r18, r21 ; + rjmp 22b ;/ + +24: brtc 25f ;get value (low word) + neg r18 ; +25: ld r24, Y+ ; + ld r25, Y+ ;/ + cpi r21, 'c' ;Is type character? + breq 1b ;/ + cpi r21, 's' ;Is type RAM string? + breq 50f ;/ + cpi r21, 'S' ;Is type ROM string? + breq 60f ;/ + _MOVW r23,r22,r25,r24 ;r25:r22 = value + clr r24 ; + clr r25 ; + clt ;/ + cpi r21, 'l' ;Is long int? + brne 26f ; + ld r24, Y+ ;get value (high word) + ld r25, Y+ ; + set ; + _LPMI r21 ;/ +26: cpi r21, 'd' ;Is type signed decimal? + brne 27f ;/ + ldi r20, -10 ; + brts 40f ; + sbrs r23, 7 ; + rjmp 40f ; + ldi r24, -1 ; + ldi r25, -1 ; + rjmp 40f ;/ +27: cpi r21, 'u' ;Is type unsigned decimal? + ldi r20, 10 ; + breq 40f ;/ + cpi r21, 'X' ;Is type hexdecimal? + ldi r20, 16 ; + breq 40f ;/ + cpi r21, 'b' ;Is type binary? + ldi r20, 2 ; + breq 40f ;/ + ret ;abort +40: push ZH ;Output the value + push ZL ; + rcall xitoa ; +42: pop ZL ; + pop ZH ; + rjmp 0b ;/ + +50: push ZH ;Put a string on the RAM + push ZL + _MOVW ZH,ZL, r25,r24 +51: ld r24, Z+ + cpi r24, 0 + breq 42b + rcall xputc + rjmp 51b + +60: push ZH ;Put a string on the ROM + push ZL + rcall xputs + rjmp 42b +.endfunc + + +.func __xprintf +.global __xprintf +__xprintf: + push YH + push YL + in YL, _SFR_IO_ADDR(SPL) +#ifdef SPH + in YH, _SFR_IO_ADDR(SPH) +#else + clr YH +#endif + adiw YL, 5 ;Y = pointer to arguments + rcall xvprintf + pop YL + pop YH + ret +.endfunc + + +#if USE_XSPRINTF + +.func __xsprintf +putram: + _MOVW ZH,ZL, r15,r14 + st Z+, r24 + _MOVW r15,r14, ZH,ZL + ret +.global __xsprintf +__xsprintf: + push YH + push YL + in YL, _SFR_IO_ADDR(SPL) +#ifdef SPH + in YH, _SFR_IO_ADDR(SPH) +#else + clr YH +#endif + adiw YL, 5 ;Y = pointer to arguments + lds ZL, xfunc_out+0 ;Save registered output function + lds ZH, xfunc_out+1 ; + push ZL ; + push ZH ;/ + ldi ZL, lo8(pm(putram));Set local output function + ldi ZH, hi8(pm(putram)); + sts xfunc_out+0, ZL ; + sts xfunc_out+1, ZH ;/ + push r15 ;Initialize pointer to string buffer + push r14 ; + ld r14, Y+ ; + ld r15, Y+ ;/ + rcall xvprintf + _MOVW ZH,ZL, r15,r14 ;Terminate string + st Z, r1 ; + pop r14 ; + pop r15 ;/ + pop ZH ;Restore registered output function + pop ZL ; + sts xfunc_out+0, ZL ; + sts xfunc_out+1, ZH ;/ + pop YL + pop YH + ret +.endfunc +#endif + + +#if USE_XFPRINTF +.func __xfprintf +.global __xfprintf +__xfprintf: + push YH + push YL + in YL, _SFR_IO_ADDR(SPL) +#ifdef SPH + in YH, _SFR_IO_ADDR(SPH) +#else + clr YH +#endif + adiw YL, 5 ;Y = pointer to arguments + lds ZL, xfunc_out+0 ;Save registered output function + lds ZH, xfunc_out+1 ; + push ZL ; + push ZH ;/ + ld ZL, Y+ ;Set output function + ld ZH, Y+ ; + sts xfunc_out+0, ZL ; + sts xfunc_out+1, ZH ;/ + rcall xvprintf + pop ZH ;Restore registered output function + pop ZL ; + sts xfunc_out+0, ZL ; + sts xfunc_out+1, ZH ;/ + pop YL + pop YH + ret +.endfunc +#endif + +#endif + + + +;--------------------------------------------------------------------------- +; Extended numeral string input +; +;Prototype: +; char xatoi ( /* 1: Successful, 0: Failed */ +; const char **str, /* pointer to pointer to source string */ +; long *res /* result */ +; ); +; + + +#if USE_XATOI +.func xatoi +.global xatoi +xatoi: + _MOVW r1, r0, r23, r22 + _MOVW XH, XL, r25, r24 + ld ZL, X+ + ld ZH, X+ + clr r18 ;r21:r18 = 0; + clr r19 ; + clr r20 ; + clr r21 ;/ + clt ;T = 0; + + ldi r25, 10 ;r25 = 10; + rjmp 41f ;/ +40: adiw ZL, 1 ;Z++; +41: ld r22, Z ;r22 = *Z; + cpi r22, ' ' ;if(r22 == ' ') continue + breq 40b ;/ + brcs 70f ;if(r22 < ' ') error; + cpi r22, '-' ;if(r22 == '-') { + brne 42f ; T = 1; + set ; continue; + rjmp 40b ;} +42: cpi r22, '9'+1 ;if(r22 > '9') error; + brcc 70f ;/ + cpi r22, '0' ;if(r22 < '0') error; + brcs 70f ;/ + brne 51f ;if(r22 > '0') cv_start; + ldi r25, 8 ;r25 = 8; + adiw ZL, 1 ;r22 = *(++Z); + ld r22, Z ;/ + cpi r22, ' '+1 ;if(r22 <= ' ') exit; + brcs 80f ;/ + cpi r22, 'b' ;if(r22 == 'b') { + brne 43f ; r25 = 2; + ldi r25, 2 ; cv_start; + rjmp 50f ;} +43: cpi r22, 'x' ;if(r22 != 'x') error; + brne 51f ;/ + ldi r25, 16 ;r25 = 16; + +50: adiw ZL, 1 ;Z++; + ld r22, Z ;r22 = *Z; +51: cpi r22, ' '+1 ;if(r22 <= ' ') break; + brcs 80f ;/ + cpi r22, 'a' ;if(r22 >= 'a') r22 =- 0x20; + brcs 52f ; + subi r22, 0x20 ;/ +52: subi r22, '0' ;if((r22 -= '0') < 0) error; + brcs 70f ;/ + cpi r22, 10 ;if(r22 >= 10) { + brcs 53f ; r22 -= 7; + subi r22, 7 ; if(r22 < 10) + cpi r22, 10 ; + brcs 70f ;} +53: cp r22, r25 ;if(r22 >= r25) error; + brcc 70f ;/ +60: ldi r24, 33 ;r21:r18 *= r25; + sub r23, r23 ; +61: brcc 62f ; + add r23, r25 ; +62: lsr r23 ; + ror r21 ; + ror r20 ; + ror r19 ; + ror r18 ; + dec r24 ; + brne 61b ;/ + add r18, r22 ;r21:r18 += r22; + adc r19, r24 ; + adc r20, r24 ; + adc r21, r24 ;/ + rjmp 50b ;repeat + +70: ldi r24, 0 + rjmp 81f +80: ldi r24, 1 +81: brtc 82f + clr r22 + com r18 + com r19 + com r20 + com r21 + adc r18, r22 + adc r19, r22 + adc r20, r22 + adc r21, r22 +82: st -X, ZH + st -X, ZL + _MOVW XH, XL, r1, r0 + st X+, r18 + st X+, r19 + st X+, r20 + st X+, r21 + clr r1 + ret +.endfunc +#endif + + diff --git a/tmk_core/common/avr/xprintf.h b/tmk_core/common/avr/xprintf.h index 59c6f2531..e53c0dd8e 100644 --- a/tmk_core/common/avr/xprintf.h +++ b/tmk_core/common/avr/xprintf.h @@ -1,111 +1,111 @@ -/*--------------------------------------------------------------------------- - Extended itoa, puts and printf (C)ChaN, 2011 ------------------------------------------------------------------------------*/ - -#ifndef XPRINTF_H -#define XPRINTF_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -extern void (*xfunc_out)(uint8_t); -#define xdev_out(func) xfunc_out = (void(*)(uint8_t))(func) - -/* This is a pointer to user defined output function. It must be initialized - before using this modle. -*/ - -void xputc(char chr); - -/* This is a stub function to forward outputs to user defined output function. - All outputs from this module are output via this function. -*/ - - -/*-----------------------------------------------------------------------------*/ -void xputs(const char *string_p); - -/* The string placed in the ROM is forwarded to xputc() directly. -*/ - - -/*-----------------------------------------------------------------------------*/ -void xitoa(long value, char radix, char width); - -/* Extended itoa(). - - value radix width output - 100 10 6 " 100" - 100 10 -6 "000100" - 100 10 0 "100" - 4294967295 10 0 "4294967295" - 4294967295 -10 0 "-1" - 655360 16 -8 "000A0000" - 1024 16 0 "400" - 0x55 2 -8 "01010101" -*/ - - -/*-----------------------------------------------------------------------------*/ -#define xprintf(format, ...) __xprintf(PSTR(format), ##__VA_ARGS__) -#define xsprintf(str, format, ...) __xsprintf(str, PSTR(format), ##__VA_ARGS__) -#define xfprintf(func, format, ...) __xfprintf(func, PSTR(format), ##__VA_ARGS__) - -void __xprintf(const char *format_p, ...); /* Send formatted string to the registered device */ -void __xsprintf(char*, const char *format_p, ...); /* Put formatted string to the memory */ -void __xfprintf(void(*func)(uint8_t), const char *format_p, ...); /* Send formatted string to the specified device */ - -/* Format string is placed in the ROM. The format flags is similar to printf(). - - %[flag][width][size]type - - flag - A '0' means filled with '0' when output is shorter than width. - ' ' is used in default. This is effective only numeral type. - width - Minimum width in decimal number. This is effective only numeral type. - Default width is zero. - size - A 'l' means the argument is long(32bit). Default is short(16bit). - This is effective only numeral type. - type - 'c' : Character, argument is the value - 's' : String placed on the RAM, argument is the pointer - 'S' : String placed on the ROM, argument is the pointer - 'd' : Signed decimal, argument is the value - 'u' : Unsigned decimal, argument is the value - 'X' : Hexdecimal, argument is the value - 'b' : Binary, argument is the value - '%' : '%' - -*/ - - -/*-----------------------------------------------------------------------------*/ -char xatoi(char **str, long *ret); - -/* Get value of the numeral string. - - str - Pointer to pointer to source string - - "0b11001010" binary - "0377" octal - "0xff800" hexdecimal - "1250000" decimal - "-25000" decimal - - ret - Pointer to return value -*/ - -#ifdef __cplusplus -} -#endif - -#endif - +/*--------------------------------------------------------------------------- + Extended itoa, puts and printf (C)ChaN, 2011 +-----------------------------------------------------------------------------*/ + +#ifndef XPRINTF_H +#define XPRINTF_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +extern void (*xfunc_out)(uint8_t); +#define xdev_out(func) xfunc_out = (void(*)(uint8_t))(func) + +/* This is a pointer to user defined output function. It must be initialized + before using this modle. +*/ + +void xputc(char chr); + +/* This is a stub function to forward outputs to user defined output function. + All outputs from this module are output via this function. +*/ + + +/*-----------------------------------------------------------------------------*/ +void xputs(const char *string_p); + +/* The string placed in the ROM is forwarded to xputc() directly. +*/ + + +/*-----------------------------------------------------------------------------*/ +void xitoa(long value, char radix, char width); + +/* Extended itoa(). + + value radix width output + 100 10 6 " 100" + 100 10 -6 "000100" + 100 10 0 "100" + 4294967295 10 0 "4294967295" + 4294967295 -10 0 "-1" + 655360 16 -8 "000A0000" + 1024 16 0 "400" + 0x55 2 -8 "01010101" +*/ + + +/*-----------------------------------------------------------------------------*/ +#define xprintf(format, ...) __xprintf(PSTR(format), ##__VA_ARGS__) +#define xsprintf(str, format, ...) __xsprintf(str, PSTR(format), ##__VA_ARGS__) +#define xfprintf(func, format, ...) __xfprintf(func, PSTR(format), ##__VA_ARGS__) + +void __xprintf(const char *format_p, ...); /* Send formatted string to the registered device */ +void __xsprintf(char*, const char *format_p, ...); /* Put formatted string to the memory */ +void __xfprintf(void(*func)(uint8_t), const char *format_p, ...); /* Send formatted string to the specified device */ + +/* Format string is placed in the ROM. The format flags is similar to printf(). + + %[flag][width][size]type + + flag + A '0' means filled with '0' when output is shorter than width. + ' ' is used in default. This is effective only numeral type. + width + Minimum width in decimal number. This is effective only numeral type. + Default width is zero. + size + A 'l' means the argument is long(32bit). Default is short(16bit). + This is effective only numeral type. + type + 'c' : Character, argument is the value + 's' : String placed on the RAM, argument is the pointer + 'S' : String placed on the ROM, argument is the pointer + 'd' : Signed decimal, argument is the value + 'u' : Unsigned decimal, argument is the value + 'X' : Hexdecimal, argument is the value + 'b' : Binary, argument is the value + '%' : '%' + +*/ + + +/*-----------------------------------------------------------------------------*/ +char xatoi(char **str, long *ret); + +/* Get value of the numeral string. + + str + Pointer to pointer to source string + + "0b11001010" binary + "0377" octal + "0xff800" hexdecimal + "1250000" decimal + "-25000" decimal + + ret + Pointer to return value +*/ + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/tmk_core/protocol/iwrap/suart.S b/tmk_core/protocol/iwrap/suart.S index 1b0290963..a873515e1 100644 --- a/tmk_core/protocol/iwrap/suart.S +++ b/tmk_core/protocol/iwrap/suart.S @@ -1,156 +1,156 @@ -;---------------------------------------------------------------------------; -; Software implemented UART module ; -; (C)ChaN, 2005 (http://elm-chan.org/) ; -;---------------------------------------------------------------------------; -; Bit rate settings: -; -; 1MHz 2MHz 4MHz 6MHz 8MHz 10MHz 12MHz 16MHz 20MHz -; 2.4kbps 138 - - - - - - - - -; 4.8kbps 68 138 - - - - - - - -; 9.6kbps 33 68 138 208 - - - - - -; 19.2kbps - 33 68 102 138 173 208 - - -; 38.4kbps - - 33 50 68 85 102 138 172 -; 57.6kbps - - 21 33 44 56 68 91 114 -; 115.2kbps - - - - 21 27 33 44 56 - -.nolist -#include -.list - -#define BPS 102 /* Bit delay. (see above table) */ -#define BIDIR 0 /* 0:Separated Tx/Rx, 1:Shared Tx/Rx */ - -#define OUT_1 sbi _SFR_IO_ADDR(SUART_OUT_PORT), SUART_OUT_BIT /* Output 1 */ -#define OUT_0 cbi _SFR_IO_ADDR(SUART_OUT_PORT), SUART_OUT_BIT /* Output 0 */ -#define SKIP_IN_1 sbis _SFR_IO_ADDR(SUART_IN_PIN), SUART_IN_BIT /* Skip if 1 */ -#define SKIP_IN_0 sbic _SFR_IO_ADDR(SUART_IN_PIN), SUART_IN_BIT /* Skip if 0 */ - - - -#ifdef SPM_PAGESIZE -.macro _LPMI reg - lpm \reg, Z+ -.endm -.macro _MOVW dh,dl, sh,sl - movw \dl, \sl -.endm -#else -.macro _LPMI reg - lpm - mov \reg, r0 - adiw ZL, 1 -.endm -.macro _MOVW dh,dl, sh,sl - mov \dl, \sl - mov \dh, \sh -.endm -#endif - - - -;---------------------------------------------------------------------------; -; Transmit a byte in serial format of N81 -; -;Prototype: void xmit (uint8_t data); -;Size: 16 words - -.global xmit -.func xmit -xmit: -#if BIDIR - ldi r23, BPS-1 ;Pre-idle time for bidirectional data line -5: dec r23 ; - brne 5b ;/ -#endif - in r0, _SFR_IO_ADDR(SREG) ;Save flags - - com r24 ;C = start bit - ldi r25, 10 ;Bit counter - cli ;Start critical section - -1: ldi r23, BPS-1 ;----- Bit transferring loop -2: dec r23 ;Wait for a bit time - brne 2b ;/ - brcs 3f ;MISO = bit to be sent - OUT_1 ; -3: brcc 4f ; - OUT_0 ;/ -4: lsr r24 ;Get next bit into C - dec r25 ;All bits sent? - brne 1b ; no, coutinue - - out _SFR_IO_ADDR(SREG), r0 ;End of critical section - ret -.endfunc - - - -;---------------------------------------------------------------------------; -; Receive a byte -; -;Prototype: uint8_t rcvr (void); -;Size: 19 words - -.global rcvr -.func rcvr -rcvr: - in r0, _SFR_IO_ADDR(SREG) ;Save flags - - ldi r24, 0x80 ;Receiving shift reg - cli ;Start critical section - -1: SKIP_IN_1 ;Wait for idle - rjmp 1b -2: SKIP_IN_0 ;Wait for start bit - rjmp 2b - ldi r25, BPS/2 ;Wait for half bit time -3: dec r25 - brne 3b - -4: ldi r25, BPS ;----- Bit receiving loop -5: dec r25 ;Wait for a bit time - brne 5b ;/ - lsr r24 ;Next bit - SKIP_IN_0 ;Get a data bit into r24.7 - ori r24, 0x80 - brcc 4b ;All bits received? no, continue - - out _SFR_IO_ADDR(SREG), r0 ;End of critical section - ret -.endfunc - - -; Not wait for start bit. This should be called after detecting start bit. -.global recv -.func recv -recv: - in r0, _SFR_IO_ADDR(SREG) ;Save flags - - ldi r24, 0x80 ;Receiving shift reg - cli ;Start critical section - -;1: SKIP_IN_1 ;Wait for idle -; rjmp 1b -;2: SKIP_IN_0 ;Wait for start bit -; rjmp 2b - ldi r25, BPS/2 ;Wait for half bit time -3: dec r25 - brne 3b - -4: ldi r25, BPS ;----- Bit receiving loop -5: dec r25 ;Wait for a bit time - brne 5b ;/ - lsr r24 ;Next bit - SKIP_IN_0 ;Get a data bit into r24.7 - ori r24, 0x80 - brcc 4b ;All bits received? no, continue - - ldi r25, BPS/2 ;Wait for half bit time -6: dec r25 - brne 6b -7: SKIP_IN_1 ;Wait for stop bit - rjmp 7b - - out _SFR_IO_ADDR(SREG), r0 ;End of critical section - ret -.endfunc +;---------------------------------------------------------------------------; +; Software implemented UART module ; +; (C)ChaN, 2005 (http://elm-chan.org/) ; +;---------------------------------------------------------------------------; +; Bit rate settings: +; +; 1MHz 2MHz 4MHz 6MHz 8MHz 10MHz 12MHz 16MHz 20MHz +; 2.4kbps 138 - - - - - - - - +; 4.8kbps 68 138 - - - - - - - +; 9.6kbps 33 68 138 208 - - - - - +; 19.2kbps - 33 68 102 138 173 208 - - +; 38.4kbps - - 33 50 68 85 102 138 172 +; 57.6kbps - - 21 33 44 56 68 91 114 +; 115.2kbps - - - - 21 27 33 44 56 + +.nolist +#include +.list + +#define BPS 102 /* Bit delay. (see above table) */ +#define BIDIR 0 /* 0:Separated Tx/Rx, 1:Shared Tx/Rx */ + +#define OUT_1 sbi _SFR_IO_ADDR(SUART_OUT_PORT), SUART_OUT_BIT /* Output 1 */ +#define OUT_0 cbi _SFR_IO_ADDR(SUART_OUT_PORT), SUART_OUT_BIT /* Output 0 */ +#define SKIP_IN_1 sbis _SFR_IO_ADDR(SUART_IN_PIN), SUART_IN_BIT /* Skip if 1 */ +#define SKIP_IN_0 sbic _SFR_IO_ADDR(SUART_IN_PIN), SUART_IN_BIT /* Skip if 0 */ + + + +#ifdef SPM_PAGESIZE +.macro _LPMI reg + lpm \reg, Z+ +.endm +.macro _MOVW dh,dl, sh,sl + movw \dl, \sl +.endm +#else +.macro _LPMI reg + lpm + mov \reg, r0 + adiw ZL, 1 +.endm +.macro _MOVW dh,dl, sh,sl + mov \dl, \sl + mov \dh, \sh +.endm +#endif + + + +;---------------------------------------------------------------------------; +; Transmit a byte in serial format of N81 +; +;Prototype: void xmit (uint8_t data); +;Size: 16 words + +.global xmit +.func xmit +xmit: +#if BIDIR + ldi r23, BPS-1 ;Pre-idle time for bidirectional data line +5: dec r23 ; + brne 5b ;/ +#endif + in r0, _SFR_IO_ADDR(SREG) ;Save flags + + com r24 ;C = start bit + ldi r25, 10 ;Bit counter + cli ;Start critical section + +1: ldi r23, BPS-1 ;----- Bit transferring loop +2: dec r23 ;Wait for a bit time + brne 2b ;/ + brcs 3f ;MISO = bit to be sent + OUT_1 ; +3: brcc 4f ; + OUT_0 ;/ +4: lsr r24 ;Get next bit into C + dec r25 ;All bits sent? + brne 1b ; no, coutinue + + out _SFR_IO_ADDR(SREG), r0 ;End of critical section + ret +.endfunc + + + +;---------------------------------------------------------------------------; +; Receive a byte +; +;Prototype: uint8_t rcvr (void); +;Size: 19 words + +.global rcvr +.func rcvr +rcvr: + in r0, _SFR_IO_ADDR(SREG) ;Save flags + + ldi r24, 0x80 ;Receiving shift reg + cli ;Start critical section + +1: SKIP_IN_1 ;Wait for idle + rjmp 1b +2: SKIP_IN_0 ;Wait for start bit + rjmp 2b + ldi r25, BPS/2 ;Wait for half bit time +3: dec r25 + brne 3b + +4: ldi r25, BPS ;----- Bit receiving loop +5: dec r25 ;Wait for a bit time + brne 5b ;/ + lsr r24 ;Next bit + SKIP_IN_0 ;Get a data bit into r24.7 + ori r24, 0x80 + brcc 4b ;All bits received? no, continue + + out _SFR_IO_ADDR(SREG), r0 ;End of critical section + ret +.endfunc + + +; Not wait for start bit. This should be called after detecting start bit. +.global recv +.func recv +recv: + in r0, _SFR_IO_ADDR(SREG) ;Save flags + + ldi r24, 0x80 ;Receiving shift reg + cli ;Start critical section + +;1: SKIP_IN_1 ;Wait for idle +; rjmp 1b +;2: SKIP_IN_0 ;Wait for start bit +; rjmp 2b + ldi r25, BPS/2 ;Wait for half bit time +3: dec r25 + brne 3b + +4: ldi r25, BPS ;----- Bit receiving loop +5: dec r25 ;Wait for a bit time + brne 5b ;/ + lsr r24 ;Next bit + SKIP_IN_0 ;Get a data bit into r24.7 + ori r24, 0x80 + brcc 4b ;All bits received? no, continue + + ldi r25, BPS/2 ;Wait for half bit time +6: dec r25 + brne 6b +7: SKIP_IN_1 ;Wait for stop bit + rjmp 7b + + out _SFR_IO_ADDR(SREG), r0 ;End of critical section + ret +.endfunc diff --git a/tmk_core/protocol/iwrap/suart.h b/tmk_core/protocol/iwrap/suart.h index 72725b998..7d92be069 100644 --- a/tmk_core/protocol/iwrap/suart.h +++ b/tmk_core/protocol/iwrap/suart.h @@ -1,8 +1,8 @@ -#ifndef SUART -#define SUART - -void xmit(uint8_t); -uint8_t rcvr(void); -uint8_t recv(void); - -#endif /* SUART */ +#ifndef SUART +#define SUART + +void xmit(uint8_t); +uint8_t rcvr(void); +uint8_t recv(void); + +#endif /* SUART */ diff --git a/tmk_core/protocol/iwrap/wd.h b/tmk_core/protocol/iwrap/wd.h index 99058f033..12395bf69 100644 --- a/tmk_core/protocol/iwrap/wd.h +++ b/tmk_core/protocol/iwrap/wd.h @@ -1,159 +1,159 @@ -/* This is from http://www.mtcnet.net/~henryvm/wdt/ */ -#ifndef _AVR_WD_H_ -#define _AVR_WD_H_ - -#include - -/* -Copyright (c) 2009, Curt Van Maanen - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - -include usage- - #include "wd.h" //if in same directory as project - #include //if wd.h is in avr directory - -set watchdog modes and prescale - -usage- - WD_SET(mode,[timeout]); //prescale always set - -modes- - WD_OFF disabled - WD_RST normal reset mode - WD_IRQ interrupt only mode (if supported) - WD_RST_IRQ interrupt+reset mode (if supported) - -timeout- - WDTO_15MS default if no timeout provided - WDTO_30MS - WDTO_60MS - WDTO_120MS - WDTO_250MS - WDTO_500MS - WDTO_1S - WDTO_2S - WDTO_4S (if supported) - WDTO_8S (if supported) - -examples- - WD_SET(WD_RST,WDTO_1S); //reset mode, 1s timeout - WD_SET(WD_OFF); //watchdog disabled (if not fused on) - WD_SET(WD_RST); //reset mode, 15ms (default timeout) - WD_SET(WD_IRQ,WDTO_120MS); //interrupt only mode, 120ms timeout - WD_SET(WD_RST_IRQ,WDTO_2S); //interrupt+reset mode, 2S timeout - - -for enhanced watchdogs, if the watchdog is not being used WDRF should be -cleared on every power up or reset, along with disabling the watchdog- - WD_DISABLE(); //clear WDRF, then turn off watchdog - -*/ - -//reset registers to the same name (MCUCSR) -#if !defined(MCUCSR) -#define MCUCSR MCUSR -#endif - -//watchdog registers to the same name (WDTCSR) -#if !defined(WDTCSR) -#define WDTCSR WDTCR -#endif - -//if enhanced watchdog, define irq values, create disable macro -#if defined(WDIF) -#define WD_IRQ 0xC0 -#define WD_RST_IRQ 0xC8 -#define WD_DISABLE() do{ \ - MCUCSR &= ~(1< + +/* +Copyright (c) 2009, Curt Van Maanen + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + +include usage- + #include "wd.h" //if in same directory as project + #include //if wd.h is in avr directory + +set watchdog modes and prescale + +usage- + WD_SET(mode,[timeout]); //prescale always set + +modes- + WD_OFF disabled + WD_RST normal reset mode + WD_IRQ interrupt only mode (if supported) + WD_RST_IRQ interrupt+reset mode (if supported) + +timeout- + WDTO_15MS default if no timeout provided + WDTO_30MS + WDTO_60MS + WDTO_120MS + WDTO_250MS + WDTO_500MS + WDTO_1S + WDTO_2S + WDTO_4S (if supported) + WDTO_8S (if supported) + +examples- + WD_SET(WD_RST,WDTO_1S); //reset mode, 1s timeout + WD_SET(WD_OFF); //watchdog disabled (if not fused on) + WD_SET(WD_RST); //reset mode, 15ms (default timeout) + WD_SET(WD_IRQ,WDTO_120MS); //interrupt only mode, 120ms timeout + WD_SET(WD_RST_IRQ,WDTO_2S); //interrupt+reset mode, 2S timeout + + +for enhanced watchdogs, if the watchdog is not being used WDRF should be +cleared on every power up or reset, along with disabling the watchdog- + WD_DISABLE(); //clear WDRF, then turn off watchdog + +*/ + +//reset registers to the same name (MCUCSR) +#if !defined(MCUCSR) +#define MCUCSR MCUSR +#endif + +//watchdog registers to the same name (WDTCSR) +#if !defined(WDTCSR) +#define WDTCSR WDTCR +#endif + +//if enhanced watchdog, define irq values, create disable macro +#if defined(WDIF) +#define WD_IRQ 0xC0 +#define WD_RST_IRQ 0xC8 +#define WD_DISABLE() do{ \ + MCUCSR &= ~(1< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CDC Class Bootloader, capable of reprogramming a device using avrdude or other AVR109 protocol compliant software when plugged into a host. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CDC Class Bootloader, capable of reprogramming a device using avrdude or other AVR109 protocol compliant software when plugged into a host. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/DFU/asf.xml b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/DFU/asf.xml index 6f3312b76..f56aba69f 100644 --- a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/DFU/asf.xml +++ b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/DFU/asf.xml @@ -1,156 +1,156 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DFU Class Bootloader, capable of reprogramming a device using the Atmel FLIP or other AVR DFU programming software when plugged into a host. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DFU Class Bootloader, capable of reprogramming a device using the Atmel FLIP or other AVR DFU programming software when plugged into a host. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/HID/asf.xml b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/HID/asf.xml index 9394b1353..c67b9419e 100644 --- a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/HID/asf.xml +++ b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/HID/asf.xml @@ -1,123 +1,123 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - HID Class Bootloader, capable of reprogramming a device via a custom cross-platform command line utility when plugged into a host. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + HID Class Bootloader, capable of reprogramming a device via a custom cross-platform command line utility when plugged into a host. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/BootloaderAPITable.S b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/BootloaderAPITable.S index 6844d4b01..91fc94966 100644 --- a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/BootloaderAPITable.S +++ b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/BootloaderAPITable.S @@ -1,102 +1,102 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2014. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -*/ - -/* - Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaims all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -#if AUX_BOOT_SECTION_SIZE > 0 -#warning Using a AUX bootloader section in addition to the defined bootloader space (see documentation). - -; Trampoline to jump over the AUX bootloader section to the start of the bootloader, -; on devices where an AUX bootloader section is used. -.section .boot_aux_trampoline, "ax" -.global Boot_AUX_Trampoline -Boot_AUX_Trampoline: - jmp BOOT_START_ADDR -#endif - -; Trampolines to actual API implementations if the target address is outside the -; range of a rjmp instruction (can happen with large bootloader sections) -.section .apitable_trampolines, "ax" -.global BootloaderAPI_Trampolines -BootloaderAPI_Trampolines: - - BootloaderAPI_ErasePage_Trampoline: - jmp BootloaderAPI_ErasePage - BootloaderAPI_WritePage_Trampoline: - jmp BootloaderAPI_WritePage - BootloaderAPI_FillWord_Trampoline: - jmp BootloaderAPI_FillWord - BootloaderAPI_ReadSignature_Trampoline: - jmp BootloaderAPI_ReadSignature - BootloaderAPI_ReadFuse_Trampoline: - jmp BootloaderAPI_ReadFuse - BootloaderAPI_ReadLock_Trampoline: - jmp BootloaderAPI_ReadLock - BootloaderAPI_WriteLock_Trampoline: - jmp BootloaderAPI_WriteLock - BootloaderAPI_UNUSED1: - ret - BootloaderAPI_UNUSED2: - ret - BootloaderAPI_UNUSED3: - ret - BootloaderAPI_UNUSED4: - ret - BootloaderAPI_UNUSED5: - ret - - - -; API function jump table -.section .apitable_jumptable, "ax" -.global BootloaderAPI_JumpTable -BootloaderAPI_JumpTable: - - rjmp BootloaderAPI_ErasePage_Trampoline - rjmp BootloaderAPI_WritePage_Trampoline - rjmp BootloaderAPI_FillWord_Trampoline - rjmp BootloaderAPI_ReadSignature_Trampoline - rjmp BootloaderAPI_ReadFuse_Trampoline - rjmp BootloaderAPI_ReadLock_Trampoline - rjmp BootloaderAPI_WriteLock_Trampoline - rjmp BootloaderAPI_UNUSED1 ; UNUSED ENTRY 1 - rjmp BootloaderAPI_UNUSED2 ; UNUSED ENTRY 2 - rjmp BootloaderAPI_UNUSED3 ; UNUSED ENTRY 3 - rjmp BootloaderAPI_UNUSED4 ; UNUSED ENTRY 4 - rjmp BootloaderAPI_UNUSED5 ; UNUSED ENTRY 5 - - - -; Bootloader table signatures and information -.section .apitable_signatures, "ax" -.global BootloaderAPI_Signatures -BootloaderAPI_Signatures: - - .long BOOT_START_ADDR ; Start address of the bootloader - .word 0xDF30 ; Signature for the MS class bootloader, V1 - .word 0xDCFB ; Signature for a LUFA class bootloader +/* + LUFA Library + Copyright (C) Dean Camera, 2014. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaims all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +#if AUX_BOOT_SECTION_SIZE > 0 +#warning Using a AUX bootloader section in addition to the defined bootloader space (see documentation). + +; Trampoline to jump over the AUX bootloader section to the start of the bootloader, +; on devices where an AUX bootloader section is used. +.section .boot_aux_trampoline, "ax" +.global Boot_AUX_Trampoline +Boot_AUX_Trampoline: + jmp BOOT_START_ADDR +#endif + +; Trampolines to actual API implementations if the target address is outside the +; range of a rjmp instruction (can happen with large bootloader sections) +.section .apitable_trampolines, "ax" +.global BootloaderAPI_Trampolines +BootloaderAPI_Trampolines: + + BootloaderAPI_ErasePage_Trampoline: + jmp BootloaderAPI_ErasePage + BootloaderAPI_WritePage_Trampoline: + jmp BootloaderAPI_WritePage + BootloaderAPI_FillWord_Trampoline: + jmp BootloaderAPI_FillWord + BootloaderAPI_ReadSignature_Trampoline: + jmp BootloaderAPI_ReadSignature + BootloaderAPI_ReadFuse_Trampoline: + jmp BootloaderAPI_ReadFuse + BootloaderAPI_ReadLock_Trampoline: + jmp BootloaderAPI_ReadLock + BootloaderAPI_WriteLock_Trampoline: + jmp BootloaderAPI_WriteLock + BootloaderAPI_UNUSED1: + ret + BootloaderAPI_UNUSED2: + ret + BootloaderAPI_UNUSED3: + ret + BootloaderAPI_UNUSED4: + ret + BootloaderAPI_UNUSED5: + ret + + + +; API function jump table +.section .apitable_jumptable, "ax" +.global BootloaderAPI_JumpTable +BootloaderAPI_JumpTable: + + rjmp BootloaderAPI_ErasePage_Trampoline + rjmp BootloaderAPI_WritePage_Trampoline + rjmp BootloaderAPI_FillWord_Trampoline + rjmp BootloaderAPI_ReadSignature_Trampoline + rjmp BootloaderAPI_ReadFuse_Trampoline + rjmp BootloaderAPI_ReadLock_Trampoline + rjmp BootloaderAPI_WriteLock_Trampoline + rjmp BootloaderAPI_UNUSED1 ; UNUSED ENTRY 1 + rjmp BootloaderAPI_UNUSED2 ; UNUSED ENTRY 2 + rjmp BootloaderAPI_UNUSED3 ; UNUSED ENTRY 3 + rjmp BootloaderAPI_UNUSED4 ; UNUSED ENTRY 4 + rjmp BootloaderAPI_UNUSED5 ; UNUSED ENTRY 5 + + + +; Bootloader table signatures and information +.section .apitable_signatures, "ax" +.global BootloaderAPI_Signatures +BootloaderAPI_Signatures: + + .long BOOT_START_ADDR ; Start address of the bootloader + .word 0xDF30 ; Signature for the MS class bootloader, V1 + .word 0xDCFB ; Signature for a LUFA class bootloader diff --git a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/asf.xml b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/asf.xml index f1d550d1e..700ffa26f 100644 --- a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/asf.xml +++ b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/asf.xml @@ -1,156 +1,156 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Mass Storage Class Bootloader, capable of reprogramming a device via binary BIN files copied to the virtual FAT12 file-system it creates when plugged into a host. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Mass Storage Class Bootloader, capable of reprogramming a device via binary BIN files copied to the virtual FAT12 file-system it creates when plugged into a host. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/makefile b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/makefile index 91bb4038e..a0edb2c4f 100644 --- a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/makefile +++ b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/makefile @@ -1,68 +1,68 @@ -# -# LUFA Library -# Copyright (C) Dean Camera, 2014. -# -# dean [at] fourwalledcubicle [dot] com -# www.lufa-lib.org -# -# -------------------------------------- -# LUFA Project Makefile. -# -------------------------------------- - -# Run "make help" for target help. - -MCU = at90usb1287 -ARCH = AVR8 -BOARD = USBKEY -F_CPU = 8000000 -F_USB = $(F_CPU) -OPTIMIZATION = s -TARGET = BootloaderMassStorage -SRC = $(TARGET).c Descriptors.c BootloaderAPI.c BootloaderAPITable.S Lib/SCSI.c Lib/VirtualFAT.c $(LUFA_SRC_USB) $(LUFA_SRC_USBCLASS) -LUFA_PATH = ../../LUFA -CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/ -DBOOT_START_ADDR=$(BOOT_START_OFFSET) -LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START_OFFSET) $(BOOT_API_LD_FLAGS) - -# Flash size and bootloader section sizes of the target, in KB. These must -# match the target's total FLASH size and the bootloader size set in the -# device's fuses. -FLASH_SIZE_KB = 128 -BOOT_SECTION_SIZE_KB = 8 - -# Bootloader address calculation formulas -# Do not modify these macros, but rather modify the dependent values above. -CALC_ADDRESS_IN_HEX = $(shell printf "0x%X" $$(( $(1) )) ) -BOOT_START_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024 ) -BOOT_SEC_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) * 1024) - ($(strip $(1))) ) - -# Bootloader linker section flags for relocating the API table sections to -# known FLASH addresses - these should not normally be user-edited. -BOOT_SECTION_LD_FLAG = -Wl,--section-start=$(strip $(1))=$(call BOOT_SEC_OFFSET, $(3)) -Wl,--undefined=$(strip $(2)) -BOOT_API_LD_FLAGS = $(call BOOT_SECTION_LD_FLAG, .apitable_trampolines, BootloaderAPI_Trampolines, 96) -BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_jumptable, BootloaderAPI_JumpTable, 32) -BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_signatures, BootloaderAPI_Signatures, 8) - -# Check if the bootloader needs an AUX section, located before the real bootloader section to store some of the -# bootloader code. This is required for 32KB and smaller devices, where the actual bootloader is 6KB but the maximum -# bootloader section size is 4KB. The actual usable application space will be reduced by 6KB for these devices. -ifeq ($(BOOT_SECTION_SIZE_KB),8) - CC_FLAGS += -DAUX_BOOT_SECTION_SIZE=0 -else - AUX_BOOT_SECTION_SIZE_KB = (6 - $(BOOT_SECTION_SIZE_KB)) - - CC_FLAGS += -DAUX_BOOT_SECTION_SIZE='($(AUX_BOOT_SECTION_SIZE_KB) * 1024)' - LD_FLAGS += -Wl,--section-start=.boot_aux=$(call BOOT_SEC_OFFSET, (($(BOOT_SECTION_SIZE_KB) + $(AUX_BOOT_SECTION_SIZE_KB)) * 1024 - 16)) - LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .boot_aux_trampoline, Boot_AUX_Trampoline, ($(BOOT_SECTION_SIZE_KB) + $(AUX_BOOT_SECTION_SIZE_KB)) * 1024) -endif - -# Default target -all: - -# Include LUFA build script makefiles -include $(LUFA_PATH)/Build/lufa_core.mk -include $(LUFA_PATH)/Build/lufa_sources.mk -include $(LUFA_PATH)/Build/lufa_build.mk -include $(LUFA_PATH)/Build/lufa_cppcheck.mk -include $(LUFA_PATH)/Build/lufa_doxygen.mk -include $(LUFA_PATH)/Build/lufa_avrdude.mk -include $(LUFA_PATH)/Build/lufa_atprogram.mk +# +# LUFA Library +# Copyright (C) Dean Camera, 2014. +# +# dean [at] fourwalledcubicle [dot] com +# www.lufa-lib.org +# +# -------------------------------------- +# LUFA Project Makefile. +# -------------------------------------- + +# Run "make help" for target help. + +MCU = at90usb1287 +ARCH = AVR8 +BOARD = USBKEY +F_CPU = 8000000 +F_USB = $(F_CPU) +OPTIMIZATION = s +TARGET = BootloaderMassStorage +SRC = $(TARGET).c Descriptors.c BootloaderAPI.c BootloaderAPITable.S Lib/SCSI.c Lib/VirtualFAT.c $(LUFA_SRC_USB) $(LUFA_SRC_USBCLASS) +LUFA_PATH = ../../LUFA +CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/ -DBOOT_START_ADDR=$(BOOT_START_OFFSET) +LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START_OFFSET) $(BOOT_API_LD_FLAGS) + +# Flash size and bootloader section sizes of the target, in KB. These must +# match the target's total FLASH size and the bootloader size set in the +# device's fuses. +FLASH_SIZE_KB = 128 +BOOT_SECTION_SIZE_KB = 8 + +# Bootloader address calculation formulas +# Do not modify these macros, but rather modify the dependent values above. +CALC_ADDRESS_IN_HEX = $(shell printf "0x%X" $$(( $(1) )) ) +BOOT_START_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024 ) +BOOT_SEC_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) * 1024) - ($(strip $(1))) ) + +# Bootloader linker section flags for relocating the API table sections to +# known FLASH addresses - these should not normally be user-edited. +BOOT_SECTION_LD_FLAG = -Wl,--section-start=$(strip $(1))=$(call BOOT_SEC_OFFSET, $(3)) -Wl,--undefined=$(strip $(2)) +BOOT_API_LD_FLAGS = $(call BOOT_SECTION_LD_FLAG, .apitable_trampolines, BootloaderAPI_Trampolines, 96) +BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_jumptable, BootloaderAPI_JumpTable, 32) +BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_signatures, BootloaderAPI_Signatures, 8) + +# Check if the bootloader needs an AUX section, located before the real bootloader section to store some of the +# bootloader code. This is required for 32KB and smaller devices, where the actual bootloader is 6KB but the maximum +# bootloader section size is 4KB. The actual usable application space will be reduced by 6KB for these devices. +ifeq ($(BOOT_SECTION_SIZE_KB),8) + CC_FLAGS += -DAUX_BOOT_SECTION_SIZE=0 +else + AUX_BOOT_SECTION_SIZE_KB = (6 - $(BOOT_SECTION_SIZE_KB)) + + CC_FLAGS += -DAUX_BOOT_SECTION_SIZE='($(AUX_BOOT_SECTION_SIZE_KB) * 1024)' + LD_FLAGS += -Wl,--section-start=.boot_aux=$(call BOOT_SEC_OFFSET, (($(BOOT_SECTION_SIZE_KB) + $(AUX_BOOT_SECTION_SIZE_KB)) * 1024 - 16)) + LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .boot_aux_trampoline, Boot_AUX_Trampoline, ($(BOOT_SECTION_SIZE_KB) + $(AUX_BOOT_SECTION_SIZE_KB)) * 1024) +endif + +# Default target +all: + +# Include LUFA build script makefiles +include $(LUFA_PATH)/Build/lufa_core.mk +include $(LUFA_PATH)/Build/lufa_sources.mk +include $(LUFA_PATH)/Build/lufa_build.mk +include $(LUFA_PATH)/Build/lufa_cppcheck.mk +include $(LUFA_PATH)/Build/lufa_doxygen.mk +include $(LUFA_PATH)/Build/lufa_avrdude.mk +include $(LUFA_PATH)/Build/lufa_atprogram.mk diff --git a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/Printer/BootloaderAPITable.S b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/Printer/BootloaderAPITable.S index ec499b74e..88c51da82 100644 --- a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/Printer/BootloaderAPITable.S +++ b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/Printer/BootloaderAPITable.S @@ -1,91 +1,91 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2014. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -*/ - -/* - Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaims all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -; Trampolines to actual API implementations if the target address is outside the -; range of a rjmp instruction (can happen with large bootloader sections) -.section .apitable_trampolines, "ax" -.global BootloaderAPI_Trampolines -BootloaderAPI_Trampolines: - - BootloaderAPI_ErasePage_Trampoline: - jmp BootloaderAPI_ErasePage - BootloaderAPI_WritePage_Trampoline: - jmp BootloaderAPI_WritePage - BootloaderAPI_FillWord_Trampoline: - jmp BootloaderAPI_FillWord - BootloaderAPI_ReadSignature_Trampoline: - jmp BootloaderAPI_ReadSignature - BootloaderAPI_ReadFuse_Trampoline: - jmp BootloaderAPI_ReadFuse - BootloaderAPI_ReadLock_Trampoline: - jmp BootloaderAPI_ReadLock - BootloaderAPI_WriteLock_Trampoline: - jmp BootloaderAPI_WriteLock - BootloaderAPI_UNUSED1: - ret - BootloaderAPI_UNUSED2: - ret - BootloaderAPI_UNUSED3: - ret - BootloaderAPI_UNUSED4: - ret - BootloaderAPI_UNUSED5: - ret - - - -; API function jump table -.section .apitable_jumptable, "ax" -.global BootloaderAPI_JumpTable -BootloaderAPI_JumpTable: - - rjmp BootloaderAPI_ErasePage_Trampoline - rjmp BootloaderAPI_WritePage_Trampoline - rjmp BootloaderAPI_FillWord_Trampoline - rjmp BootloaderAPI_ReadSignature_Trampoline - rjmp BootloaderAPI_ReadFuse_Trampoline - rjmp BootloaderAPI_ReadLock_Trampoline - rjmp BootloaderAPI_WriteLock_Trampoline - rjmp BootloaderAPI_UNUSED1 ; UNUSED ENTRY 1 - rjmp BootloaderAPI_UNUSED2 ; UNUSED ENTRY 2 - rjmp BootloaderAPI_UNUSED3 ; UNUSED ENTRY 3 - rjmp BootloaderAPI_UNUSED4 ; UNUSED ENTRY 4 - rjmp BootloaderAPI_UNUSED5 ; UNUSED ENTRY 5 - - - -; Bootloader table signatures and information -.section .apitable_signatures, "ax" -.global BootloaderAPI_Signatures -BootloaderAPI_Signatures: - - .long BOOT_START_ADDR ; Start address of the bootloader - .word 0xDF20 ; Signature for the Printer class bootloader - .word 0xDCFB ; Signature for a LUFA class bootloader +/* + LUFA Library + Copyright (C) Dean Camera, 2014. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaims all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +; Trampolines to actual API implementations if the target address is outside the +; range of a rjmp instruction (can happen with large bootloader sections) +.section .apitable_trampolines, "ax" +.global BootloaderAPI_Trampolines +BootloaderAPI_Trampolines: + + BootloaderAPI_ErasePage_Trampoline: + jmp BootloaderAPI_ErasePage + BootloaderAPI_WritePage_Trampoline: + jmp BootloaderAPI_WritePage + BootloaderAPI_FillWord_Trampoline: + jmp BootloaderAPI_FillWord + BootloaderAPI_ReadSignature_Trampoline: + jmp BootloaderAPI_ReadSignature + BootloaderAPI_ReadFuse_Trampoline: + jmp BootloaderAPI_ReadFuse + BootloaderAPI_ReadLock_Trampoline: + jmp BootloaderAPI_ReadLock + BootloaderAPI_WriteLock_Trampoline: + jmp BootloaderAPI_WriteLock + BootloaderAPI_UNUSED1: + ret + BootloaderAPI_UNUSED2: + ret + BootloaderAPI_UNUSED3: + ret + BootloaderAPI_UNUSED4: + ret + BootloaderAPI_UNUSED5: + ret + + + +; API function jump table +.section .apitable_jumptable, "ax" +.global BootloaderAPI_JumpTable +BootloaderAPI_JumpTable: + + rjmp BootloaderAPI_ErasePage_Trampoline + rjmp BootloaderAPI_WritePage_Trampoline + rjmp BootloaderAPI_FillWord_Trampoline + rjmp BootloaderAPI_ReadSignature_Trampoline + rjmp BootloaderAPI_ReadFuse_Trampoline + rjmp BootloaderAPI_ReadLock_Trampoline + rjmp BootloaderAPI_WriteLock_Trampoline + rjmp BootloaderAPI_UNUSED1 ; UNUSED ENTRY 1 + rjmp BootloaderAPI_UNUSED2 ; UNUSED ENTRY 2 + rjmp BootloaderAPI_UNUSED3 ; UNUSED ENTRY 3 + rjmp BootloaderAPI_UNUSED4 ; UNUSED ENTRY 4 + rjmp BootloaderAPI_UNUSED5 ; UNUSED ENTRY 5 + + + +; Bootloader table signatures and information +.section .apitable_signatures, "ax" +.global BootloaderAPI_Signatures +BootloaderAPI_Signatures: + + .long BOOT_START_ADDR ; Start address of the bootloader + .word 0xDF20 ; Signature for the Printer class bootloader + .word 0xDCFB ; Signature for a LUFA class bootloader diff --git a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/Printer/asf.xml b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/Printer/asf.xml index 86a56911e..b5c0c6b3a 100644 --- a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/Printer/asf.xml +++ b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/Printer/asf.xml @@ -1,159 +1,159 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Printer Class Bootloader, capable of reprogramming a device by "printing" new HEX files to the virtual Plain-Text printer it creates when plugged into a host. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Printer Class Bootloader, capable of reprogramming a device by "printing" new HEX files to the virtual Plain-Text printer it creates when plugged into a host. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/Printer/makefile b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/Printer/makefile index 0716c3bbe..0db035de3 100644 --- a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/Printer/makefile +++ b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/Printer/makefile @@ -1,55 +1,55 @@ -# -# LUFA Library -# Copyright (C) Dean Camera, 2014. -# -# dean [at] fourwalledcubicle [dot] com -# www.lufa-lib.org -# -# -------------------------------------- -# LUFA Project Makefile. -# -------------------------------------- - -# Run "make help" for target help. - -MCU = at90usb1287 -ARCH = AVR8 -BOARD = USBKEY -F_CPU = 8000000 -F_USB = $(F_CPU) -OPTIMIZATION = s -TARGET = BootloaderPrinter -SRC = $(TARGET).c Descriptors.c BootloaderAPI.c BootloaderAPITable.S $(LUFA_SRC_USB) $(LUFA_SRC_USBCLASS) -LUFA_PATH = ../../LUFA -CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/ -DBOOT_START_ADDR=$(BOOT_START_OFFSET) -LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START_OFFSET) $(BOOT_API_LD_FLAGS) - -# Flash size and bootloader section sizes of the target, in KB. These must -# match the target's total FLASH size and the bootloader size set in the -# device's fuses. -FLASH_SIZE_KB = 128 -BOOT_SECTION_SIZE_KB = 8 - -# Bootloader address calculation formulas -# Do not modify these macros, but rather modify the dependent values above. -CALC_ADDRESS_IN_HEX = $(shell printf "0x%X" $$(( $(1) )) ) -BOOT_START_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024 ) -BOOT_SEC_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) * 1024) - ($(strip $(1))) ) - -# Bootloader linker section flags for relocating the API table sections to -# known FLASH addresses - these should not normally be user-edited. -BOOT_SECTION_LD_FLAG = -Wl,--section-start=$(strip $(1))=$(call BOOT_SEC_OFFSET, $(3)) -Wl,--undefined=$(strip $(2)) -BOOT_API_LD_FLAGS = $(call BOOT_SECTION_LD_FLAG, .apitable_trampolines, BootloaderAPI_Trampolines, 96) -BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_jumptable, BootloaderAPI_JumpTable, 32) -BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_signatures, BootloaderAPI_Signatures, 8) - -# Default target -all: - -# Include LUFA build script makefiles -include $(LUFA_PATH)/Build/lufa_core.mk -include $(LUFA_PATH)/Build/lufa_sources.mk -include $(LUFA_PATH)/Build/lufa_build.mk -include $(LUFA_PATH)/Build/lufa_cppcheck.mk -include $(LUFA_PATH)/Build/lufa_doxygen.mk -include $(LUFA_PATH)/Build/lufa_avrdude.mk -include $(LUFA_PATH)/Build/lufa_atprogram.mk +# +# LUFA Library +# Copyright (C) Dean Camera, 2014. +# +# dean [at] fourwalledcubicle [dot] com +# www.lufa-lib.org +# +# -------------------------------------- +# LUFA Project Makefile. +# -------------------------------------- + +# Run "make help" for target help. + +MCU = at90usb1287 +ARCH = AVR8 +BOARD = USBKEY +F_CPU = 8000000 +F_USB = $(F_CPU) +OPTIMIZATION = s +TARGET = BootloaderPrinter +SRC = $(TARGET).c Descriptors.c BootloaderAPI.c BootloaderAPITable.S $(LUFA_SRC_USB) $(LUFA_SRC_USBCLASS) +LUFA_PATH = ../../LUFA +CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/ -DBOOT_START_ADDR=$(BOOT_START_OFFSET) +LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START_OFFSET) $(BOOT_API_LD_FLAGS) + +# Flash size and bootloader section sizes of the target, in KB. These must +# match the target's total FLASH size and the bootloader size set in the +# device's fuses. +FLASH_SIZE_KB = 128 +BOOT_SECTION_SIZE_KB = 8 + +# Bootloader address calculation formulas +# Do not modify these macros, but rather modify the dependent values above. +CALC_ADDRESS_IN_HEX = $(shell printf "0x%X" $$(( $(1) )) ) +BOOT_START_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024 ) +BOOT_SEC_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) * 1024) - ($(strip $(1))) ) + +# Bootloader linker section flags for relocating the API table sections to +# known FLASH addresses - these should not normally be user-edited. +BOOT_SECTION_LD_FLAG = -Wl,--section-start=$(strip $(1))=$(call BOOT_SEC_OFFSET, $(3)) -Wl,--undefined=$(strip $(2)) +BOOT_API_LD_FLAGS = $(call BOOT_SECTION_LD_FLAG, .apitable_trampolines, BootloaderAPI_Trampolines, 96) +BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_jumptable, BootloaderAPI_JumpTable, 32) +BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_signatures, BootloaderAPI_Signatures, 8) + +# Default target +all: + +# Include LUFA build script makefiles +include $(LUFA_PATH)/Build/lufa_core.mk +include $(LUFA_PATH)/Build/lufa_sources.mk +include $(LUFA_PATH)/Build/lufa_build.mk +include $(LUFA_PATH)/Build/lufa_cppcheck.mk +include $(LUFA_PATH)/Build/lufa_doxygen.mk +include $(LUFA_PATH)/Build/lufa_avrdude.mk +include $(LUFA_PATH)/Build/lufa_atprogram.mk diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/Build/HID_EEPROM_Loader/makefile b/tmk_core/protocol/lufa/LUFA-git/LUFA/Build/HID_EEPROM_Loader/makefile index 9fd188c93..e839ba6b1 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/Build/HID_EEPROM_Loader/makefile +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/Build/HID_EEPROM_Loader/makefile @@ -1,42 +1,42 @@ -# -# LUFA Library -# Copyright (C) Dean Camera, 2014. -# -# dean [at] fourwalledcubicle [dot] com -# www.lufa-lib.org -# -# -------------------------------------- -# LUFA Project Makefile. -# -------------------------------------- - -# Run "make help" for target help. - -MCU = at90usb1287 -ARCH = AVR8 -F_CPU = 1000000 -F_USB = $(F_CPU) -OPTIMIZATION = s -TARGET = HID_EEPROM_Loader -SRC = $(TARGET).c -LUFA_PATH = ../../../LUFA -CC_FLAGS = -LD_FLAGS = -OBJECT_FILES = InputEEData.o - -# Default target -all: - -# Determine the AVR sub-architecture of the build main application object file -FIND_AVR_SUBARCH = avr$(shell avr-objdump -f $(TARGET).o | grep architecture | cut -d':' -f3 | cut -d',' -f1) - -# Create a linkable object file with the input binary EEPROM data stored in the FLASH section -InputEEData.o: InputEEData.bin $(TARGET).o $(MAKEFILE_LIST) - @echo $(MSG_OBJCPY_CMD) Converting \"$<\" to a object file \"$@\" - avr-objcopy -I binary -O elf32-avr -B $(call FIND_AVR_SUBARCH) --rename-section .data=.progmem.data,contents,alloc,readonly,data $< $@ - -# Include LUFA build script makefiles -include $(LUFA_PATH)/Build/lufa_core.mk -include $(LUFA_PATH)/Build/lufa_build.mk -include $(LUFA_PATH)/Build/lufa_cppcheck.mk -include $(LUFA_PATH)/Build/lufa_doxygen.mk -include $(LUFA_PATH)/Build/lufa_hid.mk +# +# LUFA Library +# Copyright (C) Dean Camera, 2014. +# +# dean [at] fourwalledcubicle [dot] com +# www.lufa-lib.org +# +# -------------------------------------- +# LUFA Project Makefile. +# -------------------------------------- + +# Run "make help" for target help. + +MCU = at90usb1287 +ARCH = AVR8 +F_CPU = 1000000 +F_USB = $(F_CPU) +OPTIMIZATION = s +TARGET = HID_EEPROM_Loader +SRC = $(TARGET).c +LUFA_PATH = ../../../LUFA +CC_FLAGS = +LD_FLAGS = +OBJECT_FILES = InputEEData.o + +# Default target +all: + +# Determine the AVR sub-architecture of the build main application object file +FIND_AVR_SUBARCH = avr$(shell avr-objdump -f $(TARGET).o | grep architecture | cut -d':' -f3 | cut -d',' -f1) + +# Create a linkable object file with the input binary EEPROM data stored in the FLASH section +InputEEData.o: InputEEData.bin $(TARGET).o $(MAKEFILE_LIST) + @echo $(MSG_OBJCPY_CMD) Converting \"$<\" to a object file \"$@\" + avr-objcopy -I binary -O elf32-avr -B $(call FIND_AVR_SUBARCH) --rename-section .data=.progmem.data,contents,alloc,readonly,data $< $@ + +# Include LUFA build script makefiles +include $(LUFA_PATH)/Build/lufa_core.mk +include $(LUFA_PATH)/Build/lufa_build.mk +include $(LUFA_PATH)/Build/lufa_cppcheck.mk +include $(LUFA_PATH)/Build/lufa_doxygen.mk +include $(LUFA_PATH)/Build/lufa_hid.mk diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/asf.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/asf.xml index fd65db283..e952714e1 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/asf.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/asf.xml @@ -1,55 +1,55 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - Template for a LUFA USB device mode application. - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + Template for a LUFA USB device mode application. + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/HostTemplate/asf.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/HostTemplate/asf.xml index c1996ec71..c3860c056 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/HostTemplate/asf.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/HostTemplate/asf.xml @@ -1,41 +1,41 @@ - - - - - - - - - - - - - - - - Template for a LUFA USB host mode application. - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + Template for a LUFA USB host mode application. + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/BuildSystem.txt b/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/BuildSystem.txt index 7ddfa1be3..0ae1dd678 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/BuildSystem.txt +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/BuildSystem.txt @@ -1,975 +1,975 @@ -/** \file - * - * This file contains special DoxyGen information for the generation of the main page and other special - * documentation pages. It is not a project source file. - */ - -/** \page Page_BuildSystem The LUFA Build System - * - * \section Sec_BuildSystem_Overview Overview of the LUFA Build System - * The LUFA build system is an attempt at making a set of re-usable, modular build make files which - * can be referenced in a LUFA powered project, to minimize the amount of code required in an - * application makefile. The system is written in GNU Make, and each module is independent of - * one-another. - * - * For details on the prerequisites needed for Linux and Windows machines to be able to use the LUFA - * build system, see \ref Sec_CompilingApps_Prerequisites. - * - * To use a LUFA build system module, simply add an include to your project makefile. All user projects - * should at a minimum include \ref Page_BuildModule_CORE for base functionality: - * \code - * include $(LUFA_PATH)/Build/lufa_core.mk - * \endcode - * - * Once included in your project makefile, the associated build module targets will be added to your - * project's build makefile targets automatically. To call a build target, run make {TARGET_NAME} - * from the command line, substituting in the appropriate target name. - * - * \see \ref Sec_ConfiguringApps_AppMakefileParams for a copy of the sample LUFA project makefile. - * - * Each build module may have one or more mandatory parameters (GNU Make variables) which must - * be supplied in the project makefile for the module to work, and one or more optional parameters which - * may be defined and which will assume a sensible default if not. - * - * \section SSec_BuildSystem_Modules Available Modules - * - * The following modules are included in this LUFA release: - * - * \li \subpage Page_BuildModule_ATPROGRAM - Device Programming - * \li \subpage Page_BuildModule_AVRDUDE - Device Programming - * \li \subpage Page_BuildModule_BUILD - Compiling/Assembling/Linking - * \li \subpage Page_BuildModule_CORE - Core Build System Functions - * \li \subpage Page_BuildModule_CPPCHECK - Static Code Analysis - * \li \subpage Page_BuildModule_DFU - Device Programming - * \li \subpage Page_BuildModule_DOXYGEN - Automated Source Code Documentation - * \li \subpage Page_BuildModule_HID - Device Programming - * \li \subpage Page_BuildModule_SOURCES - LUFA Module Source Code Variables - * - * If you have problems building using the LUFA build system, see \subpage Page_BuildTroubleshooting for resolution steps. - */ - - /** \page Page_BuildModule_BUILD The BUILD build module - * - * The BUILD LUFA build system module, providing targets for the compilation, - * assembling and linking of an application from source code into binary files - * suitable for programming into a target device, using the GCC compiler. - * - * To use this module in your application makefile, add the following code: - * \code - * include $(LUFA_PATH)/Build/lufa_build.mk - * \endcode - * - * \section SSec_BuildModule_BUILD_Requirements Requirements - * This module requires the the architecture appropriate binaries of the GCC compiler are available in your - * system's PATH variable. The GCC compiler and associated toolchain is distributed in Atmel AVR Studio - * 5.x and Atmel Studio 6.x installation directories, as well as in many third party distribution packages. - * - * \section SSec_BuildModule_BUILD_Targets Targets - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
sizeDisplay size of the compiled application FLASH and SRAM segments.
symbol-sizesDisplay a size-sorted list of symbols from the compiled application, in decimal bytes.
libBuild and archive all source files into a library A binary file.
allBuild and link the application into ELF debug and HEX binary files.
elfBuild and link the application into an ELF debug file.
binBuild and link the application and produce a BIN binary file.
hexBuild and link the application and produce HEX and EEP binary files.
lssBuild and link the application and produce a LSS source code/assembly code mixed listing file.
cleanRemove all intermediary files and binary output files.
mostlycleanRemove all intermediary files but preserve any binary output files.
<filename>.sCreate an assembly listing of a given input C/C++ source file.
- * - * \section SSec_BuildModule_BUILD_MandatoryParams Mandatory Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
TARGETName of the application output file prefix (e.g. TestApplication).
ARCHArchitecture of the target processor (see \ref Page_DeviceSupport).
MCUName of the Atmel processor model (e.g. at90usb1287).
SRCList of relative or absolute paths to the application C (.c), C++ (.cpp) and Assembly (.S) source files.
F_USBSpeed in Hz of the input clock frequency to the target's USB controller.
LUFA_PATHPath to the LUFA library core, either relative or absolute (e.g. ../LUFA-000000/LUFA/).
- * - * \section SSec_BuildModule_BUILD_OptionalParams Optional Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
BOARDLUFA board hardware drivers to use (see \ref Page_DeviceSupport).
OPTIMIZATIONOptimization level to use when compiling source files (see GCC manual).
C_STANDARDVersion of the C standard to apply when compiling C++ source files (see GCC manual).
CPP_STANDARDVersion of the C++ standard to apply when compiling C++ source files (see GCC manual).
DEBUG_FORMATFormat of the debug information to embed in the generated object files (see GCC manual).
DEBUG_LEVELLevel of the debugging information to embed in the generated object files (see GCC manual).
F_CPUSpeed of the processor CPU clock, in Hz.
C_FLAGSFlags to pass to the C compiler only, after the automatically generated flags.
CPP_FLAGSFlags to pass to the C++ compiler only, after the automatically generated flags.
ASM_FLAGSFlags to pass to the assembler only, after the automatically generated flags.
CC_FLAGSCommon flags to pass to the C/C++ compiler and assembler, after the automatically generated flags.
COMPILER_PATHDirectory where the C/C++ toolchain is located, if not available in the system PATH.
LD_FLAGSFlags to pass to the linker, after the automatically generated flags.
LINKER_RELAXATIONSEnables or disables linker relaxations when linking the application binary. This can reduce the total size - * of the application by replacing full \c CALL instructions with smaller \c RCALL instructions where possible. - * \note On some unpatched versions of binutils, this can cause link failures in some circumstances. If you - * receive a link error relocation truncated to fit: R_AVR_13_PCREL, disable this setting.
OBJDIRDirectory to place the generated object and dependency files. If set to "." the same folder as the source file will be used. - * \note When this option is enabled, all source filenames must be unique.
OBJECT_FILESList of additional object files that should be linked into the resulting binary.
- * - * \section SSec_BuildModule_BUILD_ProvidedVariables Module Provided Variables - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_BUILD_ProvidedMacros Module Provided Macros - * - * - * - * - * - *
None
- */ - -/** \page Page_BuildModule_CORE The CORE build module - * - * The core LUFA build system module, providing common build system help and information targets. - * - * To use this module in your application makefile, add the following code: - * \code - * include $(LUFA_PATH)/Build/lufa_core.mk - * \endcode - * - * \section SSec_BuildModule_CORE_Requirements Requirements - * This module has no requirements outside a standard *nix shell like environment; the sh - * shell, GNU make and *nix CoreUtils (echo, printf, etc.). - * - * \section SSec_BuildModule_CORE_Targets Targets - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
helpDisplay build system help and configuration information.
list_targetsList all available build targets from the build system.
list_modulesList all available build modules from the build system.
list_mandatoryList all mandatory parameters required by the included modules.
list_optionalList all optional parameters required by the included modules.
list_providedList all variables provided by the included modules.
list_macrosList all macros provided by the included modules.
- * - * \section SSec_BuildModule_CORE_MandatoryParams Mandatory Parameters - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_CORE_OptionalParams Optional Parameters - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_CORE_ProvidedVariables Module Provided Variables - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_CORE_ProvidedMacros Module Provided Macros - * - * - * - * - * - *
None
- */ - -/** \page Page_BuildModule_ATPROGRAM The ATPROGRAM build module - * - * The ATPROGRAM programming utility LUFA build system module, providing targets to reprogram an - * Atmel processor FLASH and EEPROM memories with a project's compiled binary output files. - * - * To use this module in your application makefile, add the following code: - * \code - * include $(LUFA_PATH)/Build/lufa_atprogram.mk - * \endcode - * - * \section SSec_BuildModule_ATPROGRAM_Requirements Requirements - * This module requires the atprogram.exe utility to be available in your system's PATH - * variable. The atprogram.exe utility is distributed in Atmel AVR Studio 5.x and Atmel Studio 6.x - * inside the application install folder's "\atbackend" subdirectory. - * - * \section SSec_BuildModule_ATPROGRAM_Targets Targets - * - * - * - * - * - * - * - * - * - * - *
atprogramProgram the device FLASH memory with the application's executable data.
atprogram-eeProgram the device EEPROM memory with the application's EEPROM data.
- * - * \section SSec_BuildModule_ATPROGRAM_MandatoryParams Mandatory Parameters - * - * - * - * - * - * - * - * - * - * - *
MCUName of the Atmel processor model (e.g. at90usb1287).
TARGETName of the application output file prefix (e.g. TestApplication).
- * - * \section SSec_BuildModule_ATPROGRAM_OptionalParams Optional Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
ATPROGRAM_PROGRAMMERName of the Atmel programmer or debugger tool to communicate with (e.g. jtagice3).
ATPROGRAM_INTERFACEName of the programming interface to use when programming the target (e.g. spi).
ATPROGRAM_PORTName of the communication port to use when when programming with a serially connected tool (e.g. COM2).
- * - * \section SSec_BuildModule_ATPROGRAM_ProvidedVariables Module Provided Variables - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_ATPROGRAM_ProvidedMacros Module Provided Macros - * - * - * - * - * - *
None
- */ - -/** \page Page_BuildModule_AVRDUDE The AVRDUDE build module - * - * The AVRDUDE programming utility LUFA build system module, providing targets to reprogram an - * Atmel processor FLASH and EEPROM memories with a project's compiled binary output files. - * - * To use this module in your application makefile, add the following code: - * \code - * include $(LUFA_PATH)/Build/lufa_avrdude.mk - * \endcode - * - * \section SSec_BuildModule_AVRDUDE_Requirements Requirements - * This module requires the avrdude utility to be available in your system's PATH - * variable. The avrdude utility is distributed in the old WinAVR project releases for - * Windows (http://winavr.sourceforge.net) or can be installed on *nix systems via the project's - * source code (https://savannah.nongnu.org/projects/avrdude) or through the package manager. - * - * \section SSec_BuildModule_AVRDUDE_Targets Targets - * - * - * - * - * - * - * - * - * - * - *
avrdudeProgram the device FLASH memory with the application's executable data.
avrdude-eeProgram the device EEPROM memory with the application's EEPROM data.
- * - * \section SSec_BuildModule_AVRDUDE_MandatoryParams Mandatory Parameters - * - * - * - * - * - * - * - * - * - * - *
MCUName of the Atmel processor model (e.g. at90usb1287).
TARGETName of the application output file prefix (e.g. TestApplication).
- * - * \section SSec_BuildModule_AVRDUDE_OptionalParams Optional Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
AVRDUDE_PROGRAMMERName of the programmer or debugger tool to communicate with (e.g. jtagicemkii).
AVRDUDE_PORTName of the communication port to use when when programming with the connected tool (e.g. COM2, /dev/ttyUSB0 or usb).
AVRDUDE_FLAGSAdditional flags to pass to avrdude when programming, applied after the automatically generated flags.
- * - * \section SSec_BuildModule_AVRDUDE_ProvidedVariables Module Provided Variables - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_AVRDUDE_ProvidedMacros Module Provided Macros - * - * - * - * - * - *
None
- */ - - /** \page Page_BuildModule_CPPCHECK The CPPCHECK build module - * - * The CPPCHECK programming utility LUFA build system module, providing targets to statically - * analyze C and C++ source code for errors and performance/style issues. - * - * To use this module in your application makefile, add the following code: - * \code - * include $(LUFA_PATH)/Build/lufa_cppcheck.mk - * \endcode - * - * \section SSec_BuildModule_CPPCHECK_Requirements Requirements - * This module requires the cppcheck utility to be available in your system's PATH - * variable. The cppcheck utility is distributed through the project's home page - * (http://cppcheck.sourceforge.net) for Windows, and can be installed on *nix systems via - * the project's source code or through the package manager. - * - * \section SSec_BuildModule_CPPCHECK_Targets Targets - * - * - * - * - * - * - * - * - * - * - *
cppcheckStatically analyze the project source code for issues.
cppcheck-configCheck the cppcheck configuration - scan source code and warn about missing header files and other issues.
- * - * \section SSec_BuildModule_CPPCHECK_MandatoryParams Mandatory Parameters - * - * - * - * - * - * - *
SRCList of source files to statically analyze.
- * - * \section SSec_BuildModule_CPPCHECK_OptionalParams Optional Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
CPPCHECK_INCLUDESPath of extra directories to check when attemting to resolve C/C++ header file includes.
CPPCHECK_EXCLUDESPaths or path fragments to exclude when analyzing.
CPPCHECK_MSG_TEMPLATEOutput message template to use when printing errors, warnings and information (see cppcheck documentation).
CPPCHECK_ENABLEAnalysis rule categories to enable (see cppcheck documentation).
CPPCHECK_SUPPRESSSpecific analysis rules to suppress (see cppcheck documentation).
CPPCHECK_FAIL_ON_WARNINGSet to Y to fail the analysis job with an error exit code if warnings are found, N to continue without failing.
CPPCHECK_QUIETSet to Y to suppress all output except warnings and errors, N to show verbose output information.
CPPCHECK_FLAGSExtra flags to pass to cppcheck, after the automatically generated flags.
- * - * \section SSec_BuildModule_CPPCHECK_ProvidedVariables Module Provided Variables - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_CPPCHECK_ProvidedMacros Module Provided Macros - * - * - * - * - * - *
None
- */ - - /** \page Page_BuildModule_DFU The DFU build module - * - * The DFU programming utility LUFA build system module, providing targets to reprogram an - * Atmel processor FLASH and EEPROM memories with a project's compiled binary output files. - * This module requires a DFU class bootloader to be running in the target, compatible with - * the DFU bootloader protocol as published by Atmel. - * - * To use this module in your application makefile, add the following code: - * \code - * include $(LUFA_PATH)/Build/lufa_dfu.mk - * \endcode - * - * \section SSec_BuildModule_DFU_Requirements Requirements - * This module requires either the batchisp utility from Atmel's FLIP utility, or the open - * source dfu-programmer utility (http://dfu-programmer.sourceforge.net/) to be - * available in your system's PATH variable. On *nix systems the dfu-programmer utility - * can be installed via the project's source code or through the package manager. - * - * \section SSec_BuildModule_DFU_Targets Targets - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
dfuProgram the device FLASH memory with the application's executable data using dfu-programmer.
dfu-eeProgram the device EEPROM memory with the application's EEPROM data using dfu-programmer.
flipProgram the device FLASH memory with the application's executable data using batchisp.
flip-eeProgram the device EEPROM memory with the application's EEPROM data using batchisp.
- * - * \section SSec_BuildModule_DFU_MandatoryParams Mandatory Parameters - * - * - * - * - * - * - * - * - * - * - *
MCUName of the Atmel processor model (e.g. at90usb1287).
TARGETName of the application output file prefix (e.g. TestApplication).
- * - * \section SSec_BuildModule_DFU_OptionalParams Optional Parameters - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_DFU_ProvidedVariables Module Provided Variables - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_DFU_ProvidedMacros Module Provided Macros - * - * - * - * - * - *
None
- */ - - /** \page Page_BuildModule_DOXYGEN The DOXYGEN build module - * - * The DOXYGEN code documentation utility LUFA build system module, providing targets to generate - * project HTML and other format documentation from a set of source files that include special - * Doxygen comments. - * - * To use this module in your application makefile, add the following code: - * \code - * include $(LUFA_PATH)/Build/lufa_doxygen.mk - * \endcode - * - * \section SSec_BuildModule_DOXYGEN_Requirements Requirements - * This module requires the doxygen utility from the Doxygen website - * (http://www.doxygen.org/) to be available in your system's PATH variable. On *nix - * systems the doxygen utility can be installed via the project's source code or through - * the package manager. - * - * \section SSec_BuildModule_DOXYGEN_Targets Targets - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
doxygenGenerate project documentation.
doxygen_createCreate a new Doxygen configuration file using the latest template.
doxygen_upgradeUpgrade an existing Doxygen configuration file to the latest template
- * - * \section SSec_BuildModule_DOXYGEN_MandatoryParams Mandatory Parameters - * - * - * - * - * - * - *
LUFA_PATHPath to the LUFA library core, either relative or absolute (e.g. ../LUFA-000000/LUFA/).
- * - * \section SSec_BuildModule_DOXYGEN_OptionalParams Optional Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
DOXYGEN_CONFName and path of the base Doxygen configuration file for the project.
DOXYGEN_FAIL_ON_WARNINGSet to Y to fail the generation with an error exit code if warnings are found other than unsupported configuration parameters, N to continue without failing.
DOXYGEN_OVERRIDE_PARAMSExtra Doxygen configuration parameters to apply, overriding the corresponding config entry in the project's configuration file (e.g. QUIET=YES).
- * - * \section SSec_BuildModule_DOXYGEN_ProvidedVariables Module Provided Variables - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_DOXYGEN_ProvidedMacros Module Provided Macros - * - * - * - * - * - *
None
- */ - - /** \page Page_BuildModule_HID The HID build module - * - * The HID programming utility LUFA build system module, providing targets to reprogram an - * Atmel processor's FLASH memory with a project's compiled binary output file. This module - * requires a HID class bootloader to be running in the target, using a protocol compatible - * with the PJRC "HalfKay" protocol (http://www.pjrc.com/teensy/halfkay_protocol.html). - * - * To use this module in your application makefile, add the following code: - * \code - * include $(LUFA_PATH)/Build/lufa_hid.mk - * \endcode - * - * \section SSec_BuildModule_HID_Requirements Requirements - * This module requires either the hid_bootloader_cli utility from the included LUFA HID - * class bootloader API subdirectory, or the teensy_loader_cli utility from PJRC - * (http://www.pjrc.com/teensy/loader_cli.html) to be available in your system's PATH - * variable. - * - * \section SSec_BuildModule_HID_Targets Targets - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
hidProgram the device FLASH memory with the application's executable data using hid_bootloader_cli.
hid-eeProgram the device EEPROM memory with the application's EEPROM data using hid_bootloader_cli and - * a temporary AVR application programmed into the target's FLASH. - * \note This will erase the currently loaded application in the target.
teensyProgram the device FLASH memory with the application's executable data using teensy_loader_cli.
teensy-eeProgram the device EEPROM memory with the application's EEPROM data using teensy_loader_cli and - * a temporary AVR application programmed into the target's FLASH. - * \note This will erase the currently loaded application in the target.
- * - * \section SSec_BuildModule_HID_MandatoryParams Mandatory Parameters - * - * - * - * - * - * - * - * - * - * - *
MCUName of the Atmel processor model (e.g. at90usb1287).
TARGETName of the application output file prefix (e.g. TestApplication).
- * - * \section SSec_BuildModule_HID_OptionalParams Optional Parameters - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_HID_ProvidedVariables Module Provided Variables - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_HID_ProvidedMacros Module Provided Macros - * - * - * - * - * - *
None
- */ - - /** \page Page_BuildModule_SOURCES The SOURCES build module - * - * The SOURCES LUFA build system module, providing variables listing the various LUFA source files - * required to be build by a project for a given LUFA module. This module gives a way to reference - * LUFA source files symbolically, so that changes to the library structure do not break the library - * makefile. - * - * To use this module in your application makefile, add the following code: - * \code - * include $(LUFA_PATH)/Build/lufa_sources.mk - * \endcode - * - * \section SSec_BuildModule_SOURCES_Requirements Requirements - * None. - * - * \section SSec_BuildModule_SOURCES_Targets Targets - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_SOURCES_MandatoryParams Mandatory Parameters - * - * - * - * - * - * - * - * - * - * - *
LUFA_PATHPath to the LUFA library core, either relative or absolute (e.g. ../LUFA-000000/LUFA/).
ARCHArchitecture of the target processor (see \ref Page_DeviceSupport).
- * - * \section SSec_BuildModule_SOURCES_OptionalParams Optional Parameters - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_SOURCES_ProvidedVariables Module Provided Variables - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
LUFA_SRC_USBList of LUFA USB driver source files.
LUFA_SRC_USBCLASSList of LUFA USB Class driver source files.
LUFA_SRC_TEMPERATUREList of LUFA temperature sensor driver source files.
LUFA_SRC_SERIALList of LUFA Serial U(S)ART driver source files.
LUFA_SRC_TWIList of LUFA TWI driver source files.
LUFA_SRC_PLATFORMList of LUFA architecture specific platform management source files.
- * - * \section SSec_BuildModule_SOURCES_ProvidedMacros Module Provided Macros - * - * - * - * - * - *
None
- */ - -/** \page Page_BuildTroubleshooting Troubleshooting Information - * - * LUFA uses a lot of advanced features of the AVR-GCC compiler, linker, and surrounding binaries. This can sometimes lead to problems compiling applications if one of these - * features is buggy in the version of the tools used in a build environment. Missing utilities and incorrectly set makefile configuration options can also result in different - * errors being produced when compilation or other operations are attempted. The table below lists a set of commonly encountered errors and their resolutions. - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
ProblemResolution
Error "relocation truncated to fit: R_AVR_13_PCREL against symbol {X}" shown when compiling.Try compiling with the setting LINKER_RELAXATIONS=N in your LUFA Build System 2.0 makefile, or remove the line -Wl,--relax - * from other makefiles. Alternatively, make sure you have the latest version of the Atmel Toolchain installed for your system.
Error "error: ld terminated with signal 11 [Segmentation fault]" shown when compiling.Try compiling with the setting DEBUG_LEVEL=2 in your LUFA Build System 2.0 makefile, or make sure you are using binutils version 2.22 or later.
Error "EMERGENCY ABORT: INFINITE RECURSION DETECTED" shown when compiling.Make sure you are using an up to date version of GNU Make when compiling. This error is a safety system added to the mid-level makefiles, to prevent an issue with - * GNU make or other variants of Make causing an infinitely recursive build.
Error "Unsupported architecture "{X}"" shown when compiling.Ensure your makefile's ARCH setting is set to one of the architecture names (case-sensitive) supported by the version of LUFA you are compiling against.
Error "Makefile {X} value not set" shown when compiling.The specified Makefile value was not configured in your project's makefile or on the command line, and the nominated setting is required by one or more LUFA - * build system modules. Define the value in your project makefile and try again.
Error "Makefile {X} option cannot be blank" shown when compiling.The specified Makefile value was configured in your project's makefile or on the command line, but was set to an empty value. For the nominated configuration - * option, an empty value is not allowed. Define the nominated setting to a correct non-blank value and try again.
Error "Makefile {X} option must be Y or N" shown when compiling.The specified Makefile value was configured in your project's makefile or on the command line, but was set to a value other than a Y (for "Yes") or "N" (for "No"). - * This configuration option is required to be one of the aforementioned boolean values, and other values are invalid. Set this option to either Y or N and try again.
Error "Unknown input source file formats: {X}" shown when compiling.The nominated source files, specified in your project's makefile in the SRC configuration option, has an extension that the LUFA build system does not - * recognise. The file extensions are case sensitive, and must be one of the supported formats (*.c, *.cpp or *.S).
Error "Cannot build with OBJDIR parameter set - one or more object file name is not unique" shown when compiling.When a project is built with a non-empty OBJDIR object directory name set, all input source files must have unique names, excluding extension and path. - * This means that input files that are named identically and differ only by their path or extension are invalid when this mode is used.
Error "Source file does not exist: {X}" shown when compiling.The nominated input source file, specified in the user project's SRC parameter, could not be found. Ensure the source file exists and the absolute or - * relative path given in the user project makefile is correct and try again.
Error "Doxygen configuration file {X} does not exist" shown when upgrading a Doxygen configuration file.The nominated Doxygen configuration file, specified in the user project's DOXYGEN_CONF parameter, could not be found. Ensure the configuration file exists - * and the absolute or relative path given in the user project makefile is correct and try again, or run the appropriate makefile target to generate a new configuration - * file.
Error "avr-gcc: error: unrecognized option '{X}'" shown when compiling.An unrecognised option was supplied to the compiler, usually in the C_FLAGS, CPP_FLAGS, ASM_FLAGS or CC_FLAGS configuration - * options. The nominated compiler switch may be invalid, or unsupported by the version of AVR-GCC on the host system. Remove the unrecognised flag if invalid, or - * upgrade to the latest AVR-GCC. If the option is a valid linker option, use the prefix "-Wl," to ensure it is passed to the linker correctly.
Error "makefile:{X}: {Y}.mk: No such file or directory" shown when make is invoked.The path to the nominated makefile module was incorrect. This usually indicates that the makefile LUFA_PATH option is not set to a valid relative or - * absolute path to the LUFA library core.
Error "fatal error: LUFAConfig.h: No such file or directory" shown when compiling.The USE_LUFA_CONFIG_HEADER compile time option was set in the user project makefile, but the user supplied LUFAConfig.h header could not be - * found. Ensure that the directory that contains this configuration file is correctly passed to the compiler via the -I switch in the makefile CC_FLAGS - * parameter.
Error "ld.exe: section .apitable_trampolines loaded at {X} overlaps section .text" shown when compiling a bootloader.The bootloader is compiling too large for the given FLASH_SIZE_KB and BOOT_SECTION_SIZE_KB parameters set in the bootloader makefile. This - * usually indicates that these values are incorrect for the specified device the bootloader is targeting. If these values are correct, a newer version of the - * compiler may need to be used to ensure that the bootloader is built within the section size constraints of the target device.
Error "unknown MCU '{X}' specified" shown when compiling.The specified microcontroller device model name set in the user application's makefile as the MCU parameter is incorrect, or unsupported by the - * version of the compiler being used. Make sure the model name is correct, or upgrade to the latest Atmel Toolchain to obtain newer device support.
Error "undefined reference to `{X}'" shown when compiling.This is usually caused by a missing source file in the user application's SRC configuration parameter. If the indicated symbol is one from the LUFA - * library, you may be missing a LUFA source makefile module (see \ref Page_BuildModule_SOURCES).
- * - * For troubleshooting other errors you encounter, please see \ref Sec_ProjectHelp. - */ +/** \file + * + * This file contains special DoxyGen information for the generation of the main page and other special + * documentation pages. It is not a project source file. + */ + +/** \page Page_BuildSystem The LUFA Build System + * + * \section Sec_BuildSystem_Overview Overview of the LUFA Build System + * The LUFA build system is an attempt at making a set of re-usable, modular build make files which + * can be referenced in a LUFA powered project, to minimize the amount of code required in an + * application makefile. The system is written in GNU Make, and each module is independent of + * one-another. + * + * For details on the prerequisites needed for Linux and Windows machines to be able to use the LUFA + * build system, see \ref Sec_CompilingApps_Prerequisites. + * + * To use a LUFA build system module, simply add an include to your project makefile. All user projects + * should at a minimum include \ref Page_BuildModule_CORE for base functionality: + * \code + * include $(LUFA_PATH)/Build/lufa_core.mk + * \endcode + * + * Once included in your project makefile, the associated build module targets will be added to your + * project's build makefile targets automatically. To call a build target, run make {TARGET_NAME} + * from the command line, substituting in the appropriate target name. + * + * \see \ref Sec_ConfiguringApps_AppMakefileParams for a copy of the sample LUFA project makefile. + * + * Each build module may have one or more mandatory parameters (GNU Make variables) which must + * be supplied in the project makefile for the module to work, and one or more optional parameters which + * may be defined and which will assume a sensible default if not. + * + * \section SSec_BuildSystem_Modules Available Modules + * + * The following modules are included in this LUFA release: + * + * \li \subpage Page_BuildModule_ATPROGRAM - Device Programming + * \li \subpage Page_BuildModule_AVRDUDE - Device Programming + * \li \subpage Page_BuildModule_BUILD - Compiling/Assembling/Linking + * \li \subpage Page_BuildModule_CORE - Core Build System Functions + * \li \subpage Page_BuildModule_CPPCHECK - Static Code Analysis + * \li \subpage Page_BuildModule_DFU - Device Programming + * \li \subpage Page_BuildModule_DOXYGEN - Automated Source Code Documentation + * \li \subpage Page_BuildModule_HID - Device Programming + * \li \subpage Page_BuildModule_SOURCES - LUFA Module Source Code Variables + * + * If you have problems building using the LUFA build system, see \subpage Page_BuildTroubleshooting for resolution steps. + */ + + /** \page Page_BuildModule_BUILD The BUILD build module + * + * The BUILD LUFA build system module, providing targets for the compilation, + * assembling and linking of an application from source code into binary files + * suitable for programming into a target device, using the GCC compiler. + * + * To use this module in your application makefile, add the following code: + * \code + * include $(LUFA_PATH)/Build/lufa_build.mk + * \endcode + * + * \section SSec_BuildModule_BUILD_Requirements Requirements + * This module requires the the architecture appropriate binaries of the GCC compiler are available in your + * system's PATH variable. The GCC compiler and associated toolchain is distributed in Atmel AVR Studio + * 5.x and Atmel Studio 6.x installation directories, as well as in many third party distribution packages. + * + * \section SSec_BuildModule_BUILD_Targets Targets + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
sizeDisplay size of the compiled application FLASH and SRAM segments.
symbol-sizesDisplay a size-sorted list of symbols from the compiled application, in decimal bytes.
libBuild and archive all source files into a library A binary file.
allBuild and link the application into ELF debug and HEX binary files.
elfBuild and link the application into an ELF debug file.
binBuild and link the application and produce a BIN binary file.
hexBuild and link the application and produce HEX and EEP binary files.
lssBuild and link the application and produce a LSS source code/assembly code mixed listing file.
cleanRemove all intermediary files and binary output files.
mostlycleanRemove all intermediary files but preserve any binary output files.
<filename>.sCreate an assembly listing of a given input C/C++ source file.
+ * + * \section SSec_BuildModule_BUILD_MandatoryParams Mandatory Parameters + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
TARGETName of the application output file prefix (e.g. TestApplication).
ARCHArchitecture of the target processor (see \ref Page_DeviceSupport).
MCUName of the Atmel processor model (e.g. at90usb1287).
SRCList of relative or absolute paths to the application C (.c), C++ (.cpp) and Assembly (.S) source files.
F_USBSpeed in Hz of the input clock frequency to the target's USB controller.
LUFA_PATHPath to the LUFA library core, either relative or absolute (e.g. ../LUFA-000000/LUFA/).
+ * + * \section SSec_BuildModule_BUILD_OptionalParams Optional Parameters + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
BOARDLUFA board hardware drivers to use (see \ref Page_DeviceSupport).
OPTIMIZATIONOptimization level to use when compiling source files (see GCC manual).
C_STANDARDVersion of the C standard to apply when compiling C++ source files (see GCC manual).
CPP_STANDARDVersion of the C++ standard to apply when compiling C++ source files (see GCC manual).
DEBUG_FORMATFormat of the debug information to embed in the generated object files (see GCC manual).
DEBUG_LEVELLevel of the debugging information to embed in the generated object files (see GCC manual).
F_CPUSpeed of the processor CPU clock, in Hz.
C_FLAGSFlags to pass to the C compiler only, after the automatically generated flags.
CPP_FLAGSFlags to pass to the C++ compiler only, after the automatically generated flags.
ASM_FLAGSFlags to pass to the assembler only, after the automatically generated flags.
CC_FLAGSCommon flags to pass to the C/C++ compiler and assembler, after the automatically generated flags.
COMPILER_PATHDirectory where the C/C++ toolchain is located, if not available in the system PATH.
LD_FLAGSFlags to pass to the linker, after the automatically generated flags.
LINKER_RELAXATIONSEnables or disables linker relaxations when linking the application binary. This can reduce the total size + * of the application by replacing full \c CALL instructions with smaller \c RCALL instructions where possible. + * \note On some unpatched versions of binutils, this can cause link failures in some circumstances. If you + * receive a link error relocation truncated to fit: R_AVR_13_PCREL, disable this setting.
OBJDIRDirectory to place the generated object and dependency files. If set to "." the same folder as the source file will be used. + * \note When this option is enabled, all source filenames must be unique.
OBJECT_FILESList of additional object files that should be linked into the resulting binary.
+ * + * \section SSec_BuildModule_BUILD_ProvidedVariables Module Provided Variables + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_BUILD_ProvidedMacros Module Provided Macros + * + * + * + * + * + *
None
+ */ + +/** \page Page_BuildModule_CORE The CORE build module + * + * The core LUFA build system module, providing common build system help and information targets. + * + * To use this module in your application makefile, add the following code: + * \code + * include $(LUFA_PATH)/Build/lufa_core.mk + * \endcode + * + * \section SSec_BuildModule_CORE_Requirements Requirements + * This module has no requirements outside a standard *nix shell like environment; the sh + * shell, GNU make and *nix CoreUtils (echo, printf, etc.). + * + * \section SSec_BuildModule_CORE_Targets Targets + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
helpDisplay build system help and configuration information.
list_targetsList all available build targets from the build system.
list_modulesList all available build modules from the build system.
list_mandatoryList all mandatory parameters required by the included modules.
list_optionalList all optional parameters required by the included modules.
list_providedList all variables provided by the included modules.
list_macrosList all macros provided by the included modules.
+ * + * \section SSec_BuildModule_CORE_MandatoryParams Mandatory Parameters + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_CORE_OptionalParams Optional Parameters + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_CORE_ProvidedVariables Module Provided Variables + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_CORE_ProvidedMacros Module Provided Macros + * + * + * + * + * + *
None
+ */ + +/** \page Page_BuildModule_ATPROGRAM The ATPROGRAM build module + * + * The ATPROGRAM programming utility LUFA build system module, providing targets to reprogram an + * Atmel processor FLASH and EEPROM memories with a project's compiled binary output files. + * + * To use this module in your application makefile, add the following code: + * \code + * include $(LUFA_PATH)/Build/lufa_atprogram.mk + * \endcode + * + * \section SSec_BuildModule_ATPROGRAM_Requirements Requirements + * This module requires the atprogram.exe utility to be available in your system's PATH + * variable. The atprogram.exe utility is distributed in Atmel AVR Studio 5.x and Atmel Studio 6.x + * inside the application install folder's "\atbackend" subdirectory. + * + * \section SSec_BuildModule_ATPROGRAM_Targets Targets + * + * + * + * + * + * + * + * + * + * + *
atprogramProgram the device FLASH memory with the application's executable data.
atprogram-eeProgram the device EEPROM memory with the application's EEPROM data.
+ * + * \section SSec_BuildModule_ATPROGRAM_MandatoryParams Mandatory Parameters + * + * + * + * + * + * + * + * + * + * + *
MCUName of the Atmel processor model (e.g. at90usb1287).
TARGETName of the application output file prefix (e.g. TestApplication).
+ * + * \section SSec_BuildModule_ATPROGRAM_OptionalParams Optional Parameters + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
ATPROGRAM_PROGRAMMERName of the Atmel programmer or debugger tool to communicate with (e.g. jtagice3).
ATPROGRAM_INTERFACEName of the programming interface to use when programming the target (e.g. spi).
ATPROGRAM_PORTName of the communication port to use when when programming with a serially connected tool (e.g. COM2).
+ * + * \section SSec_BuildModule_ATPROGRAM_ProvidedVariables Module Provided Variables + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_ATPROGRAM_ProvidedMacros Module Provided Macros + * + * + * + * + * + *
None
+ */ + +/** \page Page_BuildModule_AVRDUDE The AVRDUDE build module + * + * The AVRDUDE programming utility LUFA build system module, providing targets to reprogram an + * Atmel processor FLASH and EEPROM memories with a project's compiled binary output files. + * + * To use this module in your application makefile, add the following code: + * \code + * include $(LUFA_PATH)/Build/lufa_avrdude.mk + * \endcode + * + * \section SSec_BuildModule_AVRDUDE_Requirements Requirements + * This module requires the avrdude utility to be available in your system's PATH + * variable. The avrdude utility is distributed in the old WinAVR project releases for + * Windows (http://winavr.sourceforge.net) or can be installed on *nix systems via the project's + * source code (https://savannah.nongnu.org/projects/avrdude) or through the package manager. + * + * \section SSec_BuildModule_AVRDUDE_Targets Targets + * + * + * + * + * + * + * + * + * + * + *
avrdudeProgram the device FLASH memory with the application's executable data.
avrdude-eeProgram the device EEPROM memory with the application's EEPROM data.
+ * + * \section SSec_BuildModule_AVRDUDE_MandatoryParams Mandatory Parameters + * + * + * + * + * + * + * + * + * + * + *
MCUName of the Atmel processor model (e.g. at90usb1287).
TARGETName of the application output file prefix (e.g. TestApplication).
+ * + * \section SSec_BuildModule_AVRDUDE_OptionalParams Optional Parameters + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
AVRDUDE_PROGRAMMERName of the programmer or debugger tool to communicate with (e.g. jtagicemkii).
AVRDUDE_PORTName of the communication port to use when when programming with the connected tool (e.g. COM2, /dev/ttyUSB0 or usb).
AVRDUDE_FLAGSAdditional flags to pass to avrdude when programming, applied after the automatically generated flags.
+ * + * \section SSec_BuildModule_AVRDUDE_ProvidedVariables Module Provided Variables + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_AVRDUDE_ProvidedMacros Module Provided Macros + * + * + * + * + * + *
None
+ */ + + /** \page Page_BuildModule_CPPCHECK The CPPCHECK build module + * + * The CPPCHECK programming utility LUFA build system module, providing targets to statically + * analyze C and C++ source code for errors and performance/style issues. + * + * To use this module in your application makefile, add the following code: + * \code + * include $(LUFA_PATH)/Build/lufa_cppcheck.mk + * \endcode + * + * \section SSec_BuildModule_CPPCHECK_Requirements Requirements + * This module requires the cppcheck utility to be available in your system's PATH + * variable. The cppcheck utility is distributed through the project's home page + * (http://cppcheck.sourceforge.net) for Windows, and can be installed on *nix systems via + * the project's source code or through the package manager. + * + * \section SSec_BuildModule_CPPCHECK_Targets Targets + * + * + * + * + * + * + * + * + * + * + *
cppcheckStatically analyze the project source code for issues.
cppcheck-configCheck the cppcheck configuration - scan source code and warn about missing header files and other issues.
+ * + * \section SSec_BuildModule_CPPCHECK_MandatoryParams Mandatory Parameters + * + * + * + * + * + * + *
SRCList of source files to statically analyze.
+ * + * \section SSec_BuildModule_CPPCHECK_OptionalParams Optional Parameters + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
CPPCHECK_INCLUDESPath of extra directories to check when attemting to resolve C/C++ header file includes.
CPPCHECK_EXCLUDESPaths or path fragments to exclude when analyzing.
CPPCHECK_MSG_TEMPLATEOutput message template to use when printing errors, warnings and information (see cppcheck documentation).
CPPCHECK_ENABLEAnalysis rule categories to enable (see cppcheck documentation).
CPPCHECK_SUPPRESSSpecific analysis rules to suppress (see cppcheck documentation).
CPPCHECK_FAIL_ON_WARNINGSet to Y to fail the analysis job with an error exit code if warnings are found, N to continue without failing.
CPPCHECK_QUIETSet to Y to suppress all output except warnings and errors, N to show verbose output information.
CPPCHECK_FLAGSExtra flags to pass to cppcheck, after the automatically generated flags.
+ * + * \section SSec_BuildModule_CPPCHECK_ProvidedVariables Module Provided Variables + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_CPPCHECK_ProvidedMacros Module Provided Macros + * + * + * + * + * + *
None
+ */ + + /** \page Page_BuildModule_DFU The DFU build module + * + * The DFU programming utility LUFA build system module, providing targets to reprogram an + * Atmel processor FLASH and EEPROM memories with a project's compiled binary output files. + * This module requires a DFU class bootloader to be running in the target, compatible with + * the DFU bootloader protocol as published by Atmel. + * + * To use this module in your application makefile, add the following code: + * \code + * include $(LUFA_PATH)/Build/lufa_dfu.mk + * \endcode + * + * \section SSec_BuildModule_DFU_Requirements Requirements + * This module requires either the batchisp utility from Atmel's FLIP utility, or the open + * source dfu-programmer utility (http://dfu-programmer.sourceforge.net/) to be + * available in your system's PATH variable. On *nix systems the dfu-programmer utility + * can be installed via the project's source code or through the package manager. + * + * \section SSec_BuildModule_DFU_Targets Targets + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
dfuProgram the device FLASH memory with the application's executable data using dfu-programmer.
dfu-eeProgram the device EEPROM memory with the application's EEPROM data using dfu-programmer.
flipProgram the device FLASH memory with the application's executable data using batchisp.
flip-eeProgram the device EEPROM memory with the application's EEPROM data using batchisp.
+ * + * \section SSec_BuildModule_DFU_MandatoryParams Mandatory Parameters + * + * + * + * + * + * + * + * + * + * + *
MCUName of the Atmel processor model (e.g. at90usb1287).
TARGETName of the application output file prefix (e.g. TestApplication).
+ * + * \section SSec_BuildModule_DFU_OptionalParams Optional Parameters + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_DFU_ProvidedVariables Module Provided Variables + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_DFU_ProvidedMacros Module Provided Macros + * + * + * + * + * + *
None
+ */ + + /** \page Page_BuildModule_DOXYGEN The DOXYGEN build module + * + * The DOXYGEN code documentation utility LUFA build system module, providing targets to generate + * project HTML and other format documentation from a set of source files that include special + * Doxygen comments. + * + * To use this module in your application makefile, add the following code: + * \code + * include $(LUFA_PATH)/Build/lufa_doxygen.mk + * \endcode + * + * \section SSec_BuildModule_DOXYGEN_Requirements Requirements + * This module requires the doxygen utility from the Doxygen website + * (http://www.doxygen.org/) to be available in your system's PATH variable. On *nix + * systems the doxygen utility can be installed via the project's source code or through + * the package manager. + * + * \section SSec_BuildModule_DOXYGEN_Targets Targets + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
doxygenGenerate project documentation.
doxygen_createCreate a new Doxygen configuration file using the latest template.
doxygen_upgradeUpgrade an existing Doxygen configuration file to the latest template
+ * + * \section SSec_BuildModule_DOXYGEN_MandatoryParams Mandatory Parameters + * + * + * + * + * + * + *
LUFA_PATHPath to the LUFA library core, either relative or absolute (e.g. ../LUFA-000000/LUFA/).
+ * + * \section SSec_BuildModule_DOXYGEN_OptionalParams Optional Parameters + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
DOXYGEN_CONFName and path of the base Doxygen configuration file for the project.
DOXYGEN_FAIL_ON_WARNINGSet to Y to fail the generation with an error exit code if warnings are found other than unsupported configuration parameters, N to continue without failing.
DOXYGEN_OVERRIDE_PARAMSExtra Doxygen configuration parameters to apply, overriding the corresponding config entry in the project's configuration file (e.g. QUIET=YES).
+ * + * \section SSec_BuildModule_DOXYGEN_ProvidedVariables Module Provided Variables + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_DOXYGEN_ProvidedMacros Module Provided Macros + * + * + * + * + * + *
None
+ */ + + /** \page Page_BuildModule_HID The HID build module + * + * The HID programming utility LUFA build system module, providing targets to reprogram an + * Atmel processor's FLASH memory with a project's compiled binary output file. This module + * requires a HID class bootloader to be running in the target, using a protocol compatible + * with the PJRC "HalfKay" protocol (http://www.pjrc.com/teensy/halfkay_protocol.html). + * + * To use this module in your application makefile, add the following code: + * \code + * include $(LUFA_PATH)/Build/lufa_hid.mk + * \endcode + * + * \section SSec_BuildModule_HID_Requirements Requirements + * This module requires either the hid_bootloader_cli utility from the included LUFA HID + * class bootloader API subdirectory, or the teensy_loader_cli utility from PJRC + * (http://www.pjrc.com/teensy/loader_cli.html) to be available in your system's PATH + * variable. + * + * \section SSec_BuildModule_HID_Targets Targets + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
hidProgram the device FLASH memory with the application's executable data using hid_bootloader_cli.
hid-eeProgram the device EEPROM memory with the application's EEPROM data using hid_bootloader_cli and + * a temporary AVR application programmed into the target's FLASH. + * \note This will erase the currently loaded application in the target.
teensyProgram the device FLASH memory with the application's executable data using teensy_loader_cli.
teensy-eeProgram the device EEPROM memory with the application's EEPROM data using teensy_loader_cli and + * a temporary AVR application programmed into the target's FLASH. + * \note This will erase the currently loaded application in the target.
+ * + * \section SSec_BuildModule_HID_MandatoryParams Mandatory Parameters + * + * + * + * + * + * + * + * + * + * + *
MCUName of the Atmel processor model (e.g. at90usb1287).
TARGETName of the application output file prefix (e.g. TestApplication).
+ * + * \section SSec_BuildModule_HID_OptionalParams Optional Parameters + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_HID_ProvidedVariables Module Provided Variables + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_HID_ProvidedMacros Module Provided Macros + * + * + * + * + * + *
None
+ */ + + /** \page Page_BuildModule_SOURCES The SOURCES build module + * + * The SOURCES LUFA build system module, providing variables listing the various LUFA source files + * required to be build by a project for a given LUFA module. This module gives a way to reference + * LUFA source files symbolically, so that changes to the library structure do not break the library + * makefile. + * + * To use this module in your application makefile, add the following code: + * \code + * include $(LUFA_PATH)/Build/lufa_sources.mk + * \endcode + * + * \section SSec_BuildModule_SOURCES_Requirements Requirements + * None. + * + * \section SSec_BuildModule_SOURCES_Targets Targets + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_SOURCES_MandatoryParams Mandatory Parameters + * + * + * + * + * + * + * + * + * + * + *
LUFA_PATHPath to the LUFA library core, either relative or absolute (e.g. ../LUFA-000000/LUFA/).
ARCHArchitecture of the target processor (see \ref Page_DeviceSupport).
+ * + * \section SSec_BuildModule_SOURCES_OptionalParams Optional Parameters + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_SOURCES_ProvidedVariables Module Provided Variables + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
LUFA_SRC_USBList of LUFA USB driver source files.
LUFA_SRC_USBCLASSList of LUFA USB Class driver source files.
LUFA_SRC_TEMPERATUREList of LUFA temperature sensor driver source files.
LUFA_SRC_SERIALList of LUFA Serial U(S)ART driver source files.
LUFA_SRC_TWIList of LUFA TWI driver source files.
LUFA_SRC_PLATFORMList of LUFA architecture specific platform management source files.
+ * + * \section SSec_BuildModule_SOURCES_ProvidedMacros Module Provided Macros + * + * + * + * + * + *
None
+ */ + +/** \page Page_BuildTroubleshooting Troubleshooting Information + * + * LUFA uses a lot of advanced features of the AVR-GCC compiler, linker, and surrounding binaries. This can sometimes lead to problems compiling applications if one of these + * features is buggy in the version of the tools used in a build environment. Missing utilities and incorrectly set makefile configuration options can also result in different + * errors being produced when compilation or other operations are attempted. The table below lists a set of commonly encountered errors and their resolutions. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
ProblemResolution
Error "relocation truncated to fit: R_AVR_13_PCREL against symbol {X}" shown when compiling.Try compiling with the setting LINKER_RELAXATIONS=N in your LUFA Build System 2.0 makefile, or remove the line -Wl,--relax + * from other makefiles. Alternatively, make sure you have the latest version of the Atmel Toolchain installed for your system.
Error "error: ld terminated with signal 11 [Segmentation fault]" shown when compiling.Try compiling with the setting DEBUG_LEVEL=2 in your LUFA Build System 2.0 makefile, or make sure you are using binutils version 2.22 or later.
Error "EMERGENCY ABORT: INFINITE RECURSION DETECTED" shown when compiling.Make sure you are using an up to date version of GNU Make when compiling. This error is a safety system added to the mid-level makefiles, to prevent an issue with + * GNU make or other variants of Make causing an infinitely recursive build.
Error "Unsupported architecture "{X}"" shown when compiling.Ensure your makefile's ARCH setting is set to one of the architecture names (case-sensitive) supported by the version of LUFA you are compiling against.
Error "Makefile {X} value not set" shown when compiling.The specified Makefile value was not configured in your project's makefile or on the command line, and the nominated setting is required by one or more LUFA + * build system modules. Define the value in your project makefile and try again.
Error "Makefile {X} option cannot be blank" shown when compiling.The specified Makefile value was configured in your project's makefile or on the command line, but was set to an empty value. For the nominated configuration + * option, an empty value is not allowed. Define the nominated setting to a correct non-blank value and try again.
Error "Makefile {X} option must be Y or N" shown when compiling.The specified Makefile value was configured in your project's makefile or on the command line, but was set to a value other than a Y (for "Yes") or "N" (for "No"). + * This configuration option is required to be one of the aforementioned boolean values, and other values are invalid. Set this option to either Y or N and try again.
Error "Unknown input source file formats: {X}" shown when compiling.The nominated source files, specified in your project's makefile in the SRC configuration option, has an extension that the LUFA build system does not + * recognise. The file extensions are case sensitive, and must be one of the supported formats (*.c, *.cpp or *.S).
Error "Cannot build with OBJDIR parameter set - one or more object file name is not unique" shown when compiling.When a project is built with a non-empty OBJDIR object directory name set, all input source files must have unique names, excluding extension and path. + * This means that input files that are named identically and differ only by their path or extension are invalid when this mode is used.
Error "Source file does not exist: {X}" shown when compiling.The nominated input source file, specified in the user project's SRC parameter, could not be found. Ensure the source file exists and the absolute or + * relative path given in the user project makefile is correct and try again.
Error "Doxygen configuration file {X} does not exist" shown when upgrading a Doxygen configuration file.The nominated Doxygen configuration file, specified in the user project's DOXYGEN_CONF parameter, could not be found. Ensure the configuration file exists + * and the absolute or relative path given in the user project makefile is correct and try again, or run the appropriate makefile target to generate a new configuration + * file.
Error "avr-gcc: error: unrecognized option '{X}'" shown when compiling.An unrecognised option was supplied to the compiler, usually in the C_FLAGS, CPP_FLAGS, ASM_FLAGS or CC_FLAGS configuration + * options. The nominated compiler switch may be invalid, or unsupported by the version of AVR-GCC on the host system. Remove the unrecognised flag if invalid, or + * upgrade to the latest AVR-GCC. If the option is a valid linker option, use the prefix "-Wl," to ensure it is passed to the linker correctly.
Error "makefile:{X}: {Y}.mk: No such file or directory" shown when make is invoked.The path to the nominated makefile module was incorrect. This usually indicates that the makefile LUFA_PATH option is not set to a valid relative or + * absolute path to the LUFA library core.
Error "fatal error: LUFAConfig.h: No such file or directory" shown when compiling.The USE_LUFA_CONFIG_HEADER compile time option was set in the user project makefile, but the user supplied LUFAConfig.h header could not be + * found. Ensure that the directory that contains this configuration file is correctly passed to the compiler via the -I switch in the makefile CC_FLAGS + * parameter.
Error "ld.exe: section .apitable_trampolines loaded at {X} overlaps section .text" shown when compiling a bootloader.The bootloader is compiling too large for the given FLASH_SIZE_KB and BOOT_SECTION_SIZE_KB parameters set in the bootloader makefile. This + * usually indicates that these values are incorrect for the specified device the bootloader is targeting. If these values are correct, a newer version of the + * compiler may need to be used to ensure that the bootloader is built within the section size constraints of the target device.
Error "unknown MCU '{X}' specified" shown when compiling.The specified microcontroller device model name set in the user application's makefile as the MCU parameter is incorrect, or unsupported by the + * version of the compiler being used. Make sure the model name is correct, or upgrade to the latest Atmel Toolchain to obtain newer device support.
Error "undefined reference to `{X}'" shown when compiling.This is usually caused by a missing source file in the user application's SRC configuration parameter. If the indicated symbol is one from the LUFA + * library, you may be missing a LUFA source makefile module (see \ref Page_BuildModule_SOURCES).
+ * + * For troubleshooting other errors you encounter, please see \ref Sec_ProjectHelp. + */ -- cgit v1.2.3