Skip to content

Commit

Permalink
Tag the LUFA 120730 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
abcminiuser committed Jul 30, 2012
1 parent 56e792c commit d877743
Show file tree
Hide file tree
Showing 351 changed files with 12,981 additions and 18,709 deletions.
2 changes: 2 additions & 0 deletions Bootloaders/CDC/BootloaderAPI.c
Expand Up @@ -38,12 +38,14 @@
void BootloaderAPI_ErasePage(const uint32_t Address)
{
boot_page_erase_safe(Address);
boot_spm_busy_wait();
boot_rww_enable();
}

void BootloaderAPI_WritePage(const uint32_t Address)
{
boot_page_write_safe(Address);
boot_spm_busy_wait();
boot_rww_enable();
}

Expand Down
72 changes: 39 additions & 33 deletions Bootloaders/CDC/BootloaderAPITable.S
@@ -1,6 +1,6 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2011.
Copyright (C) Dean Camera, 2012.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
Expand Down Expand Up @@ -28,41 +28,44 @@
this software.
*/

; Bootloader API Jump Table
.section .apitable, "ax"

; Trampolines to actual API implementations if the target address is outside the
; range of a rjmp instruction (can happen with large bootloader sections)
.org 0
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
BootloaderAPU_UNUSED1:
ret
BootloaderAPU_UNUSED2:
ret
BootloaderAPU_UNUSED3:
ret
BootloaderAPU_UNUSED4:
ret
BootloaderAPU_UNUSED5:
ret
.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
BootloaderAPU_UNUSED1:
ret
BootloaderAPU_UNUSED2:
ret
BootloaderAPU_UNUSED3:
ret
BootloaderAPU_UNUSED4:
ret
BootloaderAPU_UNUSED5:
ret



; API function jump table
.org (96 - 32)
.section .apitable_jumptable, "ax"
.global BootloaderAPI_JumpTable
BootloaderAPI_JumpTable:

rjmp BootloaderAPI_ErasePage_Trampoline
rjmp BootloaderAPI_WritePage_Trampoline
rjmp BootloaderAPI_FillWord_Trampoline
Expand All @@ -76,10 +79,13 @@ BootloaderAPI_JumpTable:
rjmp BootloaderAPU_UNUSED4 ; UNUSED ENTRY 4
rjmp BootloaderAPU_UNUSED5 ; UNUSED ENTRY 5



; Bootloader table signatures and information
.org (96 - 8)
BootloaderAPI_Signatures:
.section .apitable_signatures, "ax"
.global BootloaderAPI_Signatures
BootloaderAPI_Signatures:

.long BOOT_START_ADDR ; Start address of the bootloader
.word 0xCDC1 ; Signature for the CDC class bootloader, V1
.word 0xDFB1 ; Signature for the DFU class bootloader, V1
.word 0xDCFB ; Signature for a LUFA class bootloader
23 changes: 22 additions & 1 deletion Bootloaders/CDC/BootloaderCDC.c
Expand Up @@ -61,7 +61,7 @@ static bool RunBootloader = true;
* low when the application attempts to start via a watchdog reset, the bootloader will re-start. If set to the value
* \ref MAGIC_BOOT_KEY the special init function \ref Application_Jump_Check() will force the application to start.
*/
uint32_t MagicBootKey ATTR_NO_INIT;
uint16_t MagicBootKey ATTR_NO_INIT;


/** Special startup routine to check if the bootloader was started via a watchdog reset, and if the magic application
Expand All @@ -70,8 +70,29 @@ uint32_t MagicBootKey ATTR_NO_INIT;
*/
void Application_Jump_Check(void)
{
bool JumpToApplication = false;

#if ((BOARD == BOARD_XPLAIN) || (BOARD == BOARD_XPLAIN_REV1))
/* Disable JTAG debugging */
JTAG_DISABLE();

/* Enable pull-up on the JTAG TCK pin so we can use it to select the mode */
PORTF |= (1 << 4);
Delay_MS(10);

/* If the TCK pin is not jumpered to ground, start the user application instead */
JumpToApplication |= ((PINF & (1 << 4)) != 0);

/* Re-enable JTAG debugging */
JTAG_ENABLE();
#endif

/* If the reset source was the bootloader and the key is correct, clear it and jump to the application */
if ((MCUSR & (1 << WDRF)) && (MagicBootKey == MAGIC_BOOT_KEY))
JumpToApplication |= true;

/* If a request has been made to jump to the user application, honor it */
if (JumpToApplication)
{
/* Turn off the watchdog */
MCUSR &= ~(1<<WDRF);
Expand Down
2 changes: 1 addition & 1 deletion Bootloaders/CDC/BootloaderCDC.h
Expand Up @@ -69,7 +69,7 @@
#define SOFTWARE_IDENTIFIER "LUFACDC"

/** Magic bootloader key to unlock forced application start mode. */
#define MAGIC_BOOT_KEY 0xDC42CACA
#define MAGIC_BOOT_KEY 0xDC42

/* Type Defines: */
/** Type define for a non-returning pointer to the start of the loaded application in flash memory. */
Expand Down
26 changes: 21 additions & 5 deletions Bootloaders/CDC/Descriptors.c
Expand Up @@ -57,8 +57,8 @@ const USB_Descriptor_Device_t DeviceDescriptor =
.ProductID = 0x204A,
.ReleaseNumber = VERSION_BCD(01.00),

.ManufacturerStrIndex = NO_DESCRIPTOR,
.ProductStrIndex = 0x01,
.ManufacturerStrIndex = 0x01,
.ProductStrIndex = 0x02,
.SerialNumStrIndex = NO_DESCRIPTOR,

.NumberOfConfigurations = FIXED_NUM_CONFIGURATIONS
Expand Down Expand Up @@ -185,15 +185,26 @@ const USB_Descriptor_String_t LanguageString =
.UnicodeString = {LANGUAGE_ID_ENG}
};

/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
* form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
* Descriptor.
*/
const USB_Descriptor_String_t PROGMEM ManufacturerString =
{
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},

.UnicodeString = L"Dean Camera"
};

/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
* and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
* Descriptor.
*/
const USB_Descriptor_String_t ProductString =
{
.Header = {.Size = USB_STRING_LEN(18), .Type = DTYPE_String},
.Header = {.Size = USB_STRING_LEN(19), .Type = DTYPE_String},

.UnicodeString = L"AVR CDC Bootloader"
.UnicodeString = L"LUFA CDC Bootloader"
};

/** This function is called by the library when in device mode, and must be overridden (see LUFA library "USB Descriptors"
Expand Down Expand Up @@ -228,7 +239,12 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
Address = &LanguageString;
Size = LanguageString.Header.Size;
}
else
else if (DescriptorNumber == 0x01)
{
Address = &ManufacturerString;
Size = ManufacturerString.Header.Size;
}
else if (DescriptorNumber == 0x02)
{
Address = &ProductString;
Size = ProductString.Header.Size;
Expand Down
10 changes: 4 additions & 6 deletions Bootloaders/CDC/Doxygen.conf
@@ -1,4 +1,4 @@
# Doxyfile 1.8.1
# Doxyfile 1.8.1.2

# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
Expand Down Expand Up @@ -588,7 +588,7 @@ FILE_VERSION_FILTER =

# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
# by doxygen. The layout file controls the global structure of the generated
# output files in an output format independent way. The create the layout file
# output files in an output format independent way. To create the layout file
# that represents doxygen's defaults, run doxygen with the -l option.
# You can optionally specify a file name after the option, if omitted
# DoxygenLayout.xml will be used as the name of the layout file.
Expand Down Expand Up @@ -804,7 +804,7 @@ INLINE_SOURCES = NO

# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
# doxygen to hide any special comment blocks from generated source code
# fragments. Normal C and C++ comments will always remain visible.
# fragments. Normal C, C++ and Fortran comments will always remain visible.

STRIP_CODE_COMMENTS = YES

Expand Down Expand Up @@ -956,9 +956,7 @@ HTML_TIMESTAMP = NO

# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
# page has loaded. For this to work a browser that supports
# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
# page has loaded.

HTML_DYNAMIC_SECTIONS = YES

Expand Down
84 changes: 19 additions & 65 deletions Bootloaders/CDC/LUFA CDC Bootloader.inf
@@ -1,78 +1,36 @@
;************************************************************
; Windows USB CDC ACM Setup File
; Copyright (c) 2000 Microsoft Corporation

;************************************************************

[Version]
Signature="$Windows NT$"
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
Provider=%MFGNAME%
LayoutFile=layout.inf
CatalogFile=%MFGFILENAME%.cat
DriverVer=11/15/2007,5.1.2600.0
DriverVer=7/1/2012,10.0.0.0

[Manufacturer]
%MFGNAME%=DeviceList, NTamd64

[DestinationDirs]
DefaultDestDir=12


;------------------------------------------------------------------------------
; Windows 2000/XP/Vista-32bit Sections
;------------------------------------------------------------------------------

[DriverInstall.nt]
include=mdmcpq.inf
CopyFiles=DriverCopyFiles.nt
AddReg=DriverInstall.nt.AddReg

[DriverCopyFiles.nt]
usbser.sys,,,0x20

[DriverInstall.nt.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,%DRIVERFILENAME%.sys
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
%MFGNAME%=DeviceList, NTx86, NTamd64, NTia64

[DriverInstall.nt.Services]
AddService=usbser, 0x00000002, DriverService.nt

[DriverService.nt]
DisplayName=%SERVICE%
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%\%DRIVERFILENAME%.sys

;------------------------------------------------------------------------------
; Vista-64bit Sections
;------------------------------------------------------------------------------

[DriverInstall.NTamd64]
include=mdmcpq.inf
CopyFiles=DriverCopyFiles.NTamd64
AddReg=DriverInstall.NTamd64.AddReg
[SourceDisksNames]

[DriverCopyFiles.NTamd64]
%DRIVERFILENAME%.sys,,,0x20
[SourceDisksFiles]

[DriverInstall.NTamd64.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,%DRIVERFILENAME%.sys
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
[DestinationDirs]
DefaultDestDir=12

[DriverInstall.NTamd64.Services]
AddService=usbser, 0x00000002, DriverService.NTamd64
[DriverInstall]
Include=mdmcpq.inf
CopyFiles=FakeModemCopyFileSection
AddReg=DriverInstall.AddReg

[DriverService.NTamd64]
DisplayName=%SERVICE%
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%\%DRIVERFILENAME%.sys
[DriverInstall.Services]
Include=mdmcpq.inf
AddService=usbser, 0x00000002, LowerFilter_Service_Inst

[DriverInstall.AddReg]
HKR,,EnumPropPages32,,"msports.dll,SerialPortPropPageProvider"

;------------------------------------------------------------------------------
; Vendor and Product ID Definitions
Expand All @@ -83,24 +41,20 @@ ServiceBinary=%12%\%DRIVERFILENAME%.sys
; Note: One INF file can be used for multiple devices with different VID and PIDs.
; For each supported device, append ",USB\VID_xxxx&PID_yyyy" to the end of the line.
;------------------------------------------------------------------------------
[SourceDisksFiles]
[SourceDisksNames]
[DeviceList]
%DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_204A

[DeviceList.NTamd64]
%DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_204A

[DeviceList.NTia64]
%DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_204A

;------------------------------------------------------------------------------
; String Definitions
;------------------------------------------------------------------------------
;Modify these strings to customize your device
;------------------------------------------------------------------------------
[Strings]
MFGFILENAME="CDC_vista"
DRIVERFILENAME ="usbser"
MFGNAME="http://www.lufa-lib.org"
INSTDISK="LUFA CDC Bootloader Driver Installer"
DESCRIPTION="Communications Port"
SERVICE="USB RS-232 Emulation Driver"
DESCRIPTION="LUFA CDC Class Bootloader"

0 comments on commit d877743

Please sign in to comment.