From b5f2a4e576a677252eb5741fdbdeb641089d9bb0 Mon Sep 17 00:00:00 2001 From: Dean Date: Sun, 5 Feb 2012 16:00:48 +0000 Subject: Add new tag for the LUFA-120219-BETA release. git-svn-id: http://lufa-lib.googlecode.com/svn/tags/LUFA-120219-BETA@2033 d5102386-fcda-11dd-9fdb-3debd5008f28 --- Bootloaders/CDC/BootloaderAPI.c | 5 ++--- Bootloaders/CDC/BootloaderAPI.h | 4 ++-- Bootloaders/CDC/BootloaderAPITable.S | 19 ++++++++++++------- Bootloaders/CDC/BootloaderCDC.aps | 2 +- Bootloaders/CDC/BootloaderCDC.c | 10 +++++----- Bootloaders/CDC/BootloaderCDC.h | 8 ++++---- Bootloaders/CDC/BootloaderCDC.txt | 12 ++++++++++++ Bootloaders/CDC/Descriptors.c | 8 ++++---- Bootloaders/CDC/Descriptors.h | 4 ++-- Bootloaders/CDC/makefile | 5 +++++ 10 files changed, 49 insertions(+), 28 deletions(-) (limited to 'Bootloaders/CDC') diff --git a/Bootloaders/CDC/BootloaderAPI.c b/Bootloaders/CDC/BootloaderAPI.c index 326adb4d..60b2d94b 100644 --- a/Bootloaders/CDC/BootloaderAPI.c +++ b/Bootloaders/CDC/BootloaderAPI.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2011. + Copyright (C) Dean Camera, 2012. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2012 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 @@ -71,4 +71,3 @@ void BootloaderAPI_WriteLock(const uint8_t LockBits) { boot_lock_bits_set_safe(LockBits); } - diff --git a/Bootloaders/CDC/BootloaderAPI.h b/Bootloaders/CDC/BootloaderAPI.h index 9d652c84..bd721842 100644 --- a/Bootloaders/CDC/BootloaderAPI.h +++ b/Bootloaders/CDC/BootloaderAPI.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2011. + Copyright (C) Dean Camera, 2012. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2012 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 diff --git a/Bootloaders/CDC/BootloaderAPITable.S b/Bootloaders/CDC/BootloaderAPITable.S index 7f015f20..b1d1b057 100644 --- a/Bootloaders/CDC/BootloaderAPITable.S +++ b/Bootloaders/CDC/BootloaderAPITable.S @@ -32,12 +32,17 @@ .section .apitable, "ax" .org 0 +; API function jump table .global BootloaderAPI_JumpTable BootloaderAPI_JumpTable: - jmp BootloaderAPI_ErasePage - jmp BootloaderAPI_WritePage - jmp BootloaderAPI_FillWord - jmp BootloaderAPI_ReadSignature - jmp BootloaderAPI_ReadFuse - jmp BootloaderAPI_ReadLock - jmp BootloaderAPI_WriteLock + rjmp BootloaderAPI_ErasePage + rjmp BootloaderAPI_WritePage + rjmp BootloaderAPI_FillWord + rjmp BootloaderAPI_ReadSignature + rjmp BootloaderAPI_ReadFuse + rjmp BootloaderAPI_ReadLock + rjmp BootloaderAPI_WriteLock + +; Bootloader table signature +.org 30 + .word 0xDCFB diff --git a/Bootloaders/CDC/BootloaderCDC.aps b/Bootloaders/CDC/BootloaderCDC.aps index a3934059..3141c59c 100644 --- a/Bootloaders/CDC/BootloaderCDC.aps +++ b/Bootloaders/CDC/BootloaderCDC.aps @@ -1 +1 @@ -BootloaderCDC13-Jul-2010 14:41:2513-Jul-2010 14:42:12241013-Jul-2010 14:41:2544, 18, 0, 685AVR GCCBootloaderCDC.elfC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Bootloaders\CDC\falseR00R01R02R03R04R05R06R07R08R09R10R11R12R13R14R15R16R17R18R19R20R21R22R23R24R25R26R27R28R29R30R31000BootloaderCDC.cDescriptors.cBootloaderCDC.hDescriptors.hmakefiledefaultYESmakefileatmega128111BootloaderCDC.elfdefault\1-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enumsdefault1C:\WinAVR-20100110\bin\avr-gcc.exeC:\WinAVR-20100110\utils\bin\make.exeC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Bootloaders\CDC\BootloaderCDC.hC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Bootloaders\CDC\Descriptors.hC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Bootloaders\CDC\BootloaderCDC.cC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Bootloaders\CDC\Descriptors.c +BootloaderCDC13-Jul-2010 14:41:2513-Jul-2010 14:42:12241013-Jul-2010 14:41:2544, 18, 0, 685AVR GCCBootloaderCDC.elfC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Bootloaders\CDC\falseR00R01R02R03R04R05R06R07R08R09R10R11R12R13R14R15R16R17R18R19R20R21R22R23R24R25R26R27R28R29R30R31000BootloaderAPITable.SBootloaderCDC.cDescriptors.cBootloaderCDC.hDescriptors.hmakefiledefaultYESmakefileatmega128111BootloaderCDC.elfdefault\1-Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enumsdefault1C:\WinAVR-20100110\bin\avr-gcc.exeC:\WinAVR-20100110\utils\bin\make.exeC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Bootloaders\CDC\BootloaderCDC.hC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Bootloaders\CDC\Descriptors.hC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Bootloaders\CDC\BootloaderCDC.cC:\Users\Dean\Documents\Electronics\Projects\WORK\LUFAWORK\Bootloaders\CDC\Descriptors.c diff --git a/Bootloaders/CDC/BootloaderCDC.c b/Bootloaders/CDC/BootloaderCDC.c index 0e7920a1..e9ea8ae3 100644 --- a/Bootloaders/CDC/BootloaderCDC.c +++ b/Bootloaders/CDC/BootloaderCDC.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2011. + Copyright (C) Dean Camera, 2012. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2012 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 @@ -88,7 +88,7 @@ int main(void) } /** Configures all hardware required for the bootloader. */ -void SetupHardware(void) +static void SetupHardware(void) { /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); @@ -101,7 +101,7 @@ void SetupHardware(void) MCUCR = (1 << IVCE); MCUCR = (1 << IVSEL); - /* Initialize USB Subsystem */ + /* Initialize the USB and other board hardware drivers */ USB_Init(); LEDs_Init(); @@ -350,7 +350,7 @@ static void WriteNextResponseByte(const uint8_t Response) /** Task to read in AVR910 commands from the CDC data OUT endpoint, process them, perform the required actions * and send the appropriate response back to the host. */ -void CDC_Task(void) +static void CDC_Task(void) { /* Select the OUT endpoint */ Endpoint_SelectEndpoint(CDC_RX_EPNUM); diff --git a/Bootloaders/CDC/BootloaderCDC.h b/Bootloaders/CDC/BootloaderCDC.h index bfc8af58..4b9e7d6d 100644 --- a/Bootloaders/CDC/BootloaderCDC.h +++ b/Bootloaders/CDC/BootloaderCDC.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2011. + Copyright (C) Dean Camera, 2012. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2012 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 @@ -72,8 +72,8 @@ typedef void (*AppPtr_t)(void) ATTR_NO_RETURN; /* Function Prototypes: */ - void CDC_Task(void); - void SetupHardware(void); + static void CDC_Task(void); + static void SetupHardware(void); void EVENT_USB_Device_ConfigurationChanged(void); diff --git a/Bootloaders/CDC/BootloaderCDC.txt b/Bootloaders/CDC/BootloaderCDC.txt index ab45ad1b..a3027a9f 100644 --- a/Bootloaders/CDC/BootloaderCDC.txt +++ b/Bootloaders/CDC/BootloaderCDC.txt @@ -103,14 +103,26 @@ * uint8_t (*BootloaderAPI_ReadFuse)(uint16_t Address) = BOOTLOADER_API_START(4); * uint8_t (*BootloaderAPI_ReadLock)(void) = BOOTLOADER_API_START(5); * void (*BootloaderAPI_WriteLock)(uint8_t LockBits) = BOOTLOADER_API_START(6); + * + * #define BOOTLOADER_SIG_START (FLASHEND - 32) + * #define BOOTLOADER_SIGNATURE 0xDCFB * \endcode * + * Bootloaders reporting a device release revision number of 1.00 or greater are bootloader API enabled. From the application + * the API support of the bootloader can be detected by reading the FLASH memory bytes located at address \c BOOTLOADER_SIG_START + * and comparing them to the value \c BOOTLOADER_SIGNATURE. + * * \section Sec_Options Project Options * * The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value. * * * + * + * + * + * + * * * *
Define Name:Location:Description:
NO_BLOCK_SUPPORTMakefile LUFA_OPTSDefine to disable memory block read/write support in the bootloader, requiring all reads and writes to be made diff --git a/Bootloaders/CDC/Descriptors.c b/Bootloaders/CDC/Descriptors.c index 327f361b..4bf3eced 100644 --- a/Bootloaders/CDC/Descriptors.c +++ b/Bootloaders/CDC/Descriptors.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2011. + Copyright (C) Dean Camera, 2012. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2012 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 @@ -55,7 +55,7 @@ const USB_Descriptor_Device_t DeviceDescriptor = .VendorID = 0x03EB, .ProductID = 0x204A, - .ReleaseNumber = VERSION_BCD(00.01), + .ReleaseNumber = VERSION_BCD(01.00), .ManufacturerStrIndex = NO_DESCRIPTOR, .ProductStrIndex = 0x01, @@ -81,7 +81,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor = .ConfigurationNumber = 1, .ConfigurationStrIndex = NO_DESCRIPTOR, - .ConfigAttributes = USB_CONFIG_ATTR_BUSPOWERED, + .ConfigAttributes = USB_CONFIG_ATTR_RESERVED, .MaxPowerConsumption = USB_CONFIG_POWER_MA(100) }, diff --git a/Bootloaders/CDC/Descriptors.h b/Bootloaders/CDC/Descriptors.h index 842f22c2..e5ef6410 100644 --- a/Bootloaders/CDC/Descriptors.h +++ b/Bootloaders/CDC/Descriptors.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2011. + Copyright (C) Dean Camera, 2012. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2012 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 diff --git a/Bootloaders/CDC/makefile b/Bootloaders/CDC/makefile index f98372df..850d9dfc 100644 --- a/Bootloaders/CDC/makefile +++ b/Bootloaders/CDC/makefile @@ -96,6 +96,11 @@ F_USB = $(F_CPU) # bytes, and so will need to be doubled to obtain the byte address needed by AVR-GCC. FLASH_SIZE_KB = 128 BOOT_SECTION_SIZE_KB = 4 + + +# Formulas used to calculate the starting address of the Bootloader section, and the User Application +# API jump table (for more information on the latter, see the bootloader documentation). These formulas +# should not need to be altered - modify the FLASH_SIZE_KB and BOOT_SECTION_KB values above instead. BOOT_START = 0x$(shell echo "obase=16; ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024" | bc) BOOT_API_TABLESTART = 0x$(shell echo "obase=16; (($(FLASH_SIZE_KB) * 1024) - 32)" | bc) -- cgit v1.2.3