diff --git a/demos/device/device_os_none/.cproject b/demos/device/device_os_none/.cproject
index 2cdd9dff..e94e019e 100644
--- a/demos/device/device_os_none/.cproject
+++ b/demos/device/device_os_none/.cproject
@@ -121,7 +121,7 @@
-
+
-
+
@@ -155,7 +155,7 @@
-
+
@@ -212,7 +212,7 @@
-
+
-
+
@@ -248,7 +248,7 @@
-
+
@@ -307,7 +307,7 @@
-
+
-
+
@@ -340,7 +340,7 @@
-
+
@@ -398,7 +398,7 @@
-
+
-
+
@@ -434,7 +434,7 @@
-
+
@@ -493,7 +493,7 @@
-
+
-
+
@@ -529,7 +529,7 @@
-
+
@@ -568,86 +568,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<TargetConfig>
-<Properties property_0="" property_2="LPC18x7_43x7_2x512_BootA.cfx" property_3="NXP" property_4="LPC4357" property_count="5" version="60100"/>
-<infoList vendor="NXP"><info chip="LPC4357" flash_driver="LPC18x7_43x7_2x512_BootA.cfx" match_id="0x0" name="LPC4357" resetscript="LPC18LPC43InternalFLASHBootResetscript.scp" stub="crt_emu_lpc18_43_nxp"><chip><name>LPC4357</name>
-<family>LPC43xx</family>
+<Properties property_0="" property_3="NXP" property_4="LPC1347" property_count="5" version="1"/>
+<infoList vendor="NXP"><info chip="LPC1347" match_id="0x08020543" name="LPC1347" stub="crt_emu_lpc11_13_nxp"><chip><name>LPC1347</name>
+<family>LPC13xx (12bit ADC)</family>
<vendor>NXP (formerly Philips)</vendor>
<reset board="None" core="Real" sys="Real"/>
-<clock changeable="TRUE" freq="20MHz" is_accurate="TRUE"/>
+<clock changeable="TRUE" freq="12MHz" is_accurate="TRUE"/>
<memory can_program="true" id="Flash" is_ro="true" type="Flash"/>
<memory id="RAM" type="RAM"/>
<memory id="Periph" is_volatile="true" type="Peripheral"/>
-<memoryInstance derived_from="Flash" id="MFlashA512" location="0x1a000000" size="0x80000"/>
-<memoryInstance derived_from="Flash" id="MFlashB512" location="0x1b000000" size="0x80000"/>
-<memoryInstance derived_from="RAM" id="RamLoc32" location="0x10000000" size="0x8000"/>
-<memoryInstance derived_from="RAM" id="RamLoc40" location="0x10080000" size="0xa000"/>
-<memoryInstance derived_from="RAM" id="RamAHB32" location="0x20000000" size="0x8000"/>
-<memoryInstance derived_from="RAM" id="RamAHB16" location="0x20008000" size="0x4000"/>
-<memoryInstance derived_from="RAM" id="RamAHB_ETB16" location="0x2000c000" size="0x4000"/>
-<prog_flash blocksz="0x2000" location="0x1a000000" maxprgbuff="0x400" progwithcode="TRUE" size="0x10000"/>
-<prog_flash blocksz="0x10000" location="0x1a010000" maxprgbuff="0x400" progwithcode="TRUE" size="0x70000"/>
-<prog_flash blocksz="0x2000" location="0x1b000000" maxprgbuff="0x400" progwithcode="TRUE" size="0x10000"/>
-<prog_flash blocksz="0x10000" location="0x1b010000" maxprgbuff="0x400" progwithcode="TRUE" size="0x70000"/>
-<peripheralInstance derived_from="V7M_MPU" determined="infoFile" id="MPU" location="0xe000ed90"/>
-<peripheralInstance derived_from="V7M_NVIC" determined="infoFile" id="NVIC" location="0xe000e000"/>
-<peripheralInstance derived_from="V7M_DCR" determined="infoFile" id="DCR" location="0xe000edf0"/>
-<peripheralInstance derived_from="V7M_ITM" determined="infoFile" id="ITM" location="0xe0000000"/>
-<peripheralInstance derived_from="SCT" determined="infoFile" id="SCT" location="0x40000000"/>
-<peripheralInstance derived_from="GPDMA" determined="infoFile" id="GPDMA" location="0x40002000"/>
-<peripheralInstance derived_from="SPIFI" determined="infoFile" id="SPIFI" location="0x40003000"/>
-<peripheralInstance derived_from="SDMMC" determined="infoFile" id="SDMMC" location="0x40004000"/>
-<peripheralInstance derived_from="EMC" determined="infoFile" id="EMC" location="0x40005000"/>
-<peripheralInstance derived_from="USB0" determined="infoFile" id="USB0" location="0x40006000"/>
-<peripheralInstance derived_from="USB1" determined="infoFile" id="USB1" location="0x40007000"/>
-<peripheralInstance derived_from="LCD" determined="infoFile" id="LCD" location="0x40008000"/>
-<peripheralInstance derived_from="EEPROM" determined="infoFile" id="EEPROM" location="0x4000e000"/>
-<peripheralInstance derived_from="ETHERNET" determined="infoFile" id="ETHERNET" location="0x40010000"/>
-<peripheralInstance derived_from="ATIMER" determined="infoFile" id="ATIMER" location="0x40040000"/>
-<peripheralInstance derived_from="REGFILE" determined="infoFile" id="REGFILE" location="0x40041000"/>
-<peripheralInstance derived_from="PMC" determined="infoFile" id="PMC" location="0x40042000"/>
-<peripheralInstance derived_from="CREG" determined="infoFile" id="CREG" location="0x40043000"/>
-<peripheralInstance derived_from="EVENTROUTER" determined="infoFile" id="EVENTROUTER" location="0x40044000"/>
-<peripheralInstance derived_from="RTC" determined="infoFile" id="RTC" location="0x40046000"/>
-<peripheralInstance derived_from="CGU" determined="infoFile" id="CGU" location="0x40050000"/>
-<peripheralInstance derived_from="CCU1" determined="infoFile" id="CCU1" location="0x40051000"/>
-<peripheralInstance derived_from="CCU2" determined="infoFile" id="CCU2" location="0x40052000"/>
-<peripheralInstance derived_from="RGU" determined="infoFile" id="RGU" location="0x40053000"/>
-<peripheralInstance derived_from="WWDT" determined="infoFile" id="WWDT" location="0x40080000"/>
-<peripheralInstance derived_from="USART0" determined="infoFile" id="USART0" location="0x40081000"/>
-<peripheralInstance derived_from="USART2" determined="infoFile" id="USART2" location="0x400c1000"/>
-<peripheralInstance derived_from="USART3" determined="infoFile" id="USART3" location="0x400c2000"/>
-<peripheralInstance derived_from="UART1" determined="infoFile" id="UART1" location="0x40082000"/>
-<peripheralInstance derived_from="SSP0" determined="infoFile" id="SSP0" location="0x40083000"/>
-<peripheralInstance derived_from="SSP1" determined="infoFile" id="SSP1" location="0x400c5000"/>
-<peripheralInstance derived_from="TIMER0" determined="infoFile" id="TIMER0" location="0x40084000"/>
-<peripheralInstance derived_from="TIMER1" determined="infoFile" id="TIMER1" location="0x40085000"/>
-<peripheralInstance derived_from="TIMER2" determined="infoFile" id="TIMER2" location="0x400c3000"/>
-<peripheralInstance derived_from="TIMER3" determined="infoFile" id="TIMER3" location="0x400c4000"/>
-<peripheralInstance derived_from="SCU" determined="infoFile" id="SCU" location="0x40086000"/>
-<peripheralInstance derived_from="GPIO-PIN-INT" determined="infoFile" id="GPIO-PIN-INT" location="0x40087000"/>
-<peripheralInstance derived_from="GPIO-GROUP-INT0" determined="infoFile" id="GPIO-GROUP-INT0" location="0x40088000"/>
-<peripheralInstance derived_from="GPIO-GROUP-INT1" determined="infoFile" id="GPIO-GROUP-INT1" location="0x40089000"/>
-<peripheralInstance derived_from="MCPWM" determined="infoFile" id="MCPWM" location="0x400a0000"/>
-<peripheralInstance derived_from="I2C0" determined="infoFile" id="I2C0" location="0x400a1000"/>
-<peripheralInstance derived_from="I2C1" determined="infoFile" id="I2C1" location="0x400e0000"/>
-<peripheralInstance derived_from="I2S0" determined="infoFile" id="I2S0" location="0x400a2000"/>
-<peripheralInstance derived_from="I2S1" determined="infoFile" id="I2S1" location="0x400a3000"/>
-<peripheralInstance derived_from="C-CAN1" determined="infoFile" id="C-CAN1" location="0x400a4000"/>
-<peripheralInstance derived_from="RITIMER" determined="infoFile" id="RITIMER" location="0x400c0000"/>
-<peripheralInstance derived_from="QEI" determined="infoFile" id="QEI" location="0x400c6000"/>
-<peripheralInstance derived_from="GIMA" determined="infoFile" id="GIMA" location="0x400c7000"/>
-<peripheralInstance derived_from="DAC" determined="infoFile" id="DAC" location="0x400e1000"/>
-<peripheralInstance derived_from="C-CAN0" determined="infoFile" id="C-CAN0" location="0x400e2000"/>
-<peripheralInstance derived_from="ADC0" determined="infoFile" id="ADC0" location="0x400e3000"/>
-<peripheralInstance derived_from="ADC1" determined="infoFile" id="ADC1" location="0x400e4000"/>
-<peripheralInstance derived_from="GPIO-PORT" determined="infoFile" id="GPIO-PORT" location="0x400f4000"/>
-<peripheralInstance derived_from="SPI" determined="infoFile" id="SPI" location="0x40100000"/>
-<peripheralInstance derived_from="SGPIO" determined="infoFile" id="SGPIO" location="0x40101000"/>
+<memoryInstance derived_from="Flash" id="MFlash64" location="0x0" size="0x10000"/>
+<memoryInstance derived_from="RAM" id="RamLoc8" location="0x10000000" size="0x2000"/>
+<memoryInstance derived_from="RAM" id="RamUsb2" location="0x20004000" size="0x800"/>
+<memoryInstance derived_from="RAM" id="RamPeriph2" location="0x20000000" size="0x800"/>
+<prog_flash blocksz="0x1000" location="0x0" maxprgbuff="0x400" progwithcode="TRUE" size="0x10000"/>
+<peripheralInstance derived_from="V7M_MPU" id="MPU" location="0xe000ed90"/>
+<peripheralInstance derived_from="V7M_NVIC" id="NVIC" location="0xe000e000"/>
+<peripheralInstance derived_from="V7M_DCR" id="DCR" location="0xe000edf0"/>
+<peripheralInstance derived_from="V7M_ITM" id="ITM" location="0xe0000000"/>
+<peripheralInstance derived_from="I2C" id="I2C" location="0x40000000"/>
+<peripheralInstance derived_from="WWDT" id="WWDT" location="0x40004000"/>
+<peripheralInstance derived_from="USART" id="USART" location="0x40008000"/>
+<peripheralInstance derived_from="CT16B0" id="CT16B0" location="0x4000c000"/>
+<peripheralInstance derived_from="CT16B1" id="CT16B1" location="0x40010000"/>
+<peripheralInstance derived_from="CT32B0" id="CT32B0" location="0x40014000"/>
+<peripheralInstance derived_from="CT32B1" id="CT32B1" location="0x40018000"/>
+<peripheralInstance derived_from="ADC" id="ADC" location="0x4001c000"/>
+<peripheralInstance derived_from="PMU" id="PMU" location="0x40038000"/>
+<peripheralInstance derived_from="FLASHCTRL" id="FLASHCTRL" location="0x4003c000"/>
+<peripheralInstance derived_from="SSP0" id="SSP0" location="0x40040000"/>
+<peripheralInstance derived_from="IOCON" id="IOCON" location="0x40044000"/>
+<peripheralInstance derived_from="SYSCON" id="SYSCON" location="0x40048000"/>
+<peripheralInstance derived_from="GPIO-PIN-INT" id="GPIO-PIN-INT" location="0x4004c000"/>
+<peripheralInstance derived_from="SSP1" id="SSP1" location="0x40058000"/>
+<peripheralInstance derived_from="GPIO-GROUP-INT0" id="GPIO-GROUP-INT0" location="0x4005c000"/>
+<peripheralInstance derived_from="GPIO-GROUP-INT1" id="GPIO-GROUP-INT1" location="0x40060000"/>
+<peripheralInstance derived_from="RITIMER" id="RITIMER" location="0x40064000"/>
+<peripheralInstance derived_from="USB" id="USB" location="0x40080000"/>
+<peripheralInstance derived_from="GPIO-PORT" id="GPIO-PORT" location="0x50000000"/>
</chip>
-<processor><name gcc_name="cortex-m4">Cortex-M4</name>
+<processor><name gcc_name="cortex-m3">Cortex-M3</name>
<family>Cortex-M</family>
</processor>
-<link href="nxp_lpc43xx_peripheral.xme" show="embed" type="simple"/>
+<link href="nxp_lpc13Uxx_peripheral.xme" show="embed" type="simple"/>
</info>
</infoList>
</TargetConfig>
diff --git a/demos/device/src/cdcd_app.c b/demos/device/src/cdcd_app.c
index e29590a2..90b38e21 100644
--- a/demos/device/src/cdcd_app.c
+++ b/demos/device/src/cdcd_app.c
@@ -57,8 +57,8 @@ OSAL_SEM_DEF(cdcd_semaphore);
static osal_semaphore_handle_t sem_hdl;
-TUSB_CFG_ATTR_USBRAM ATTR_USB_MIN_ALIGNMENT static uint8_t serial_rx_buffer[CDCD_APP_BUFFER_SIZE];
-TUSB_CFG_ATTR_USBRAM ATTR_USB_MIN_ALIGNMENT static uint8_t serial_tx_buffer[CDCD_APP_BUFFER_SIZE];
+TUSB_CFG_ATTR_USBRAM static uint8_t serial_rx_buffer[CDCD_APP_BUFFER_SIZE];
+TUSB_CFG_ATTR_USBRAM static uint8_t serial_tx_buffer[CDCD_APP_BUFFER_SIZE];
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
diff --git a/demos/device/src/keyboardd_app.c b/demos/device/src/keyboardd_app.c
index 3b1819da..0fa73aa5 100644
--- a/demos/device/src/keyboardd_app.c
+++ b/demos/device/src/keyboardd_app.c
@@ -52,7 +52,7 @@
//--------------------------------------------------------------------+
OSAL_TASK_DEF(keyboardd_app_task, 128, KEYBOARDD_APP_TASK_PRIO);
-TUSB_CFG_ATTR_USBRAM ATTR_USB_MIN_ALIGNMENT hid_keyboard_report_t keyboard_report;
+TUSB_CFG_ATTR_USBRAM hid_keyboard_report_t keyboard_report;
//--------------------------------------------------------------------+
// tinyusb Callbacks
diff --git a/demos/device/src/moused_app.c b/demos/device/src/moused_app.c
index 6aed296c..e123e1bb 100644
--- a/demos/device/src/moused_app.c
+++ b/demos/device/src/moused_app.c
@@ -52,7 +52,7 @@
//--------------------------------------------------------------------+
OSAL_TASK_DEF(moused_app_task, 128, MOUSED_APP_TASK_PRIO);
-TUSB_CFG_ATTR_USBRAM ATTR_USB_MIN_ALIGNMENT hid_mouse_report_t mouse_report;
+TUSB_CFG_ATTR_USBRAM hid_mouse_report_t mouse_report;
//--------------------------------------------------------------------+
// tinyusb Callbacks
diff --git a/demos/device/src/mscd_app.c b/demos/device/src/mscd_app.c
index c2763932..316cb18f 100644
--- a/demos/device/src/mscd_app.c
+++ b/demos/device/src/mscd_app.c
@@ -46,7 +46,7 @@
//--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF
//--------------------------------------------------------------------+
-TUSB_CFG_ATTR_USBRAM ATTR_USB_MIN_ALIGNMENT
+TUSB_CFG_ATTR_USBRAM
static scsi_inquiry_data_t mscd_inquiry_data =
{
.is_removable = 1,
@@ -57,14 +57,14 @@ static scsi_inquiry_data_t mscd_inquiry_data =
.product_revision = "0.01"
};
-TUSB_CFG_ATTR_USBRAM ATTR_USB_MIN_ALIGNMENT
+TUSB_CFG_ATTR_USBRAM
static scsi_read_capacity10_data_t mscd_read_capacity10_data =
{
.last_lba = ENDIAN_BE(DISK_BLOCK_NUM-1), // read capacity
.block_size = ENDIAN_BE(DISK_BLOCK_SIZE)
};
-TUSB_CFG_ATTR_USBRAM ATTR_USB_MIN_ALIGNMENT
+TUSB_CFG_ATTR_USBRAM
scsi_sense_fixed_data_t mscd_sense_data =
{
.response_code = 0x70,
@@ -72,7 +72,7 @@ scsi_sense_fixed_data_t mscd_sense_data =
.additional_sense_len = sizeof(scsi_sense_fixed_data_t) - 8
};
-TUSB_CFG_ATTR_USBRAM ATTR_USB_MIN_ALIGNMENT
+TUSB_CFG_ATTR_USBRAM
static scsi_read_format_capacity_data_t mscd_format_capacity_data =
{
.list_length = 8,
@@ -81,7 +81,7 @@ static scsi_read_format_capacity_data_t mscd_format_capacity_data =
.block_size_u16 = ENDIAN_BE16(DISK_BLOCK_SIZE)
};
-TUSB_CFG_ATTR_USBRAM ATTR_USB_MIN_ALIGNMENT
+TUSB_CFG_ATTR_USBRAM
static scsi_mode_parameters_t msc_dev_mode_para =
{
.mode_data_length = 3,
diff --git a/demos/device/src/mscd_app_ramdisk.c b/demos/device/src/mscd_app_ramdisk.c
index 36f9beed..b4fde39c 100644
--- a/demos/device/src/mscd_app_ramdisk.c
+++ b/demos/device/src/mscd_app_ramdisk.c
@@ -47,7 +47,7 @@
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
-TUSB_CFG_ATTR_USBRAM ATTR_USB_MIN_ALIGNMENT
+TUSB_CFG_ATTR_USBRAM
uint8_t mscd_app_ramdisk[DISK_BLOCK_NUM][DISK_BLOCK_SIZE] =
{
//------------- Boot Sector -------------//
diff --git a/demos/device/src/mscd_app_romdisk.c b/demos/device/src/mscd_app_romdisk.c
index 6001bb90..a4a22a6b 100644
--- a/demos/device/src/mscd_app_romdisk.c
+++ b/demos/device/src/mscd_app_romdisk.c
@@ -91,7 +91,7 @@ const uint8_t mscd_app_rommdisk[DISK_BLOCK_NUM][DISK_BLOCK_SIZE] =
[3] = README_CONTENTS
};
-ATTR_USB_MIN_ALIGNMENT TUSB_CFG_ATTR_USBRAM
+TUSB_CFG_ATTR_USBRAM
static uint8_t sector_buffer[DISK_BLOCK_SIZE];
//--------------------------------------------------------------------+
diff --git a/demos/device/src/tusb_config.h b/demos/device/src/tusb_config.h
index 295e3d69..63399b1c 100644
--- a/demos/device/src/tusb_config.h
+++ b/demos/device/src/tusb_config.h
@@ -59,11 +59,11 @@
#define TUSB_CFG_DEVICE_FULLSPEED 1 // TODO refractor, remove
//------------- CLASS -------------//
-#define TUSB_CFG_DEVICE_HID_KEYBOARD 1
+#define TUSB_CFG_DEVICE_HID_KEYBOARD 0
#define TUSB_CFG_DEVICE_HID_MOUSE 1
#define TUSB_CFG_DEVICE_HID_GENERIC 0 // not supported yet
-#define TUSB_CFG_DEVICE_MSC 0
-#define TUSB_CFG_DEVICE_CDC 1
+#define TUSB_CFG_DEVICE_MSC 1
+#define TUSB_CFG_DEVICE_CDC 0
//--------------------------------------------------------------------+
// COMMON CONFIGURATION
@@ -80,7 +80,7 @@
#ifdef __CODE_RED // compiled with lpcxpresso
#if (TUSB_CFG_MCU == MCU_LPC11UXX) || (TUSB_CFG_MCU == MCU_LPC13UXX)
- #define TUSB_CFG_ATTR_USBRAM ATTR_SECTION(.data.$RAM2)
+ #define TUSB_CFG_ATTR_USBRAM ATTR_SECTION(.data.$RAM2) ATTR_ALIGNED(64) // lp11u & lp13u requires data to be 64 byte aligned
#elif TUSB_CFG_MCU == MCU_LPC175X_6X
#define TUSB_CFG_ATTR_USBRAM // LPC17xx USB DMA can access all
#elif (TUSB_CFG_MCU == MCU_LPC43XX)
@@ -90,21 +90,21 @@
#elif defined __CC_ARM // Compiled with Keil armcc, USBRAM_SECTION is defined in scatter files
#if (TUSB_CFG_MCU == MCU_LPC11UXX) || (TUSB_CFG_MCU == MCU_LPC13UXX)
- #define TUSB_CFG_ATTR_USBRAM ATTR_SECTION(USBRAM_SECTION)
- #elif (TUSB_CFG_MCU == MCU_LPC43XX)
- #define TUSB_CFG_ATTR_USBRAM // Use keil tool configure to have AHB SRAM as default memory
+ #define TUSB_CFG_ATTR_USBRAM ATTR_SECTION(USBRAM_SECTION) ATTR_ALIGNED(64) // lp11u & lp13u requires data to be 64 byte aligned
#elif (TUSB_CFG_MCU == MCU_LPC175X_6X)
#define TUSB_CFG_ATTR_USBRAM
+ #elif (TUSB_CFG_MCU == MCU_LPC43XX)
+ #define TUSB_CFG_ATTR_USBRAM // Use keil tool configure to have AHB SRAM as default memory
#endif
#elif defined __ICCARM__ // compiled with IAR
- #if (TUSB_CFG_MCU == MCU_LPC43XX)
- #define TUSB_CFG_ATTR_USBRAM _Pragma("location=\".ahb_sram1\"")
+ #if (TUSB_CFG_MCU == MCU_LPC11UXX) || (TUSB_CFG_MCU == MCU_LPC13UXX)
+ #define TUSB_CFG_ATTR_USBRAM _Pragma("location=\"USB_PACKET_MEMORY\"") ATTR_ALIGNED(64)
#elif (TUSB_CFG_MCU == MCU_LPC175X_6X)
#define TUSB_CFG_ATTR_USBRAM
- #elif (TUSB_CFG_MCU == MCU_LPC11UXX) || (TUSB_CFG_MCU == MCU_LPC13UXX)
- #define TUSB_CFG_ATTR_USBRAM _Pragma("location=\"USB_PACKET_MEMORY\"")
+ #elif (TUSB_CFG_MCU == MCU_LPC43XX)
+ #define TUSB_CFG_ATTR_USBRAM _Pragma("location=\".ahb_sram1\"")
#endif
#else
diff --git a/demos/device/src/tusb_descriptors.c b/demos/device/src/tusb_descriptors.c
index 4ab5b011..5e8c0ad0 100644
--- a/demos/device/src/tusb_descriptors.c
+++ b/demos/device/src/tusb_descriptors.c
@@ -42,7 +42,7 @@
// Keyboard Report Descriptor
//--------------------------------------------------------------------+
#if TUSB_CFG_DEVICE_HID_KEYBOARD
-ATTR_USB_MIN_ALIGNMENT TUSB_CFG_ATTR_USBRAM
+TUSB_CFG_ATTR_USBRAM
uint8_t desc_keyboard_report[] = {
HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ),
HID_USAGE ( HID_USAGE_DESKTOP_KEYBOARD ),
@@ -89,7 +89,7 @@ uint8_t desc_keyboard_report[] = {
// Mouse Report Descriptor
//--------------------------------------------------------------------+
#if TUSB_CFG_DEVICE_HID_MOUSE
-ATTR_USB_MIN_ALIGNMENT TUSB_CFG_ATTR_USBRAM
+TUSB_CFG_ATTR_USBRAM
uint8_t desc_mouse_report[] = {
HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ),
HID_USAGE ( HID_USAGE_DESKTOP_MOUSE ),
@@ -137,7 +137,7 @@ uint8_t desc_mouse_report[] = {
//--------------------------------------------------------------------+
// USB DEVICE DESCRIPTOR
//--------------------------------------------------------------------+
-ATTR_USB_MIN_ALIGNMENT TUSB_CFG_ATTR_USBRAM
+TUSB_CFG_ATTR_USBRAM
tusb_descriptor_device_t desc_device =
{
.bLength = sizeof(tusb_descriptor_device_t),
@@ -171,7 +171,7 @@ tusb_descriptor_device_t desc_device =
//--------------------------------------------------------------------+
// USB COFNIGURATION DESCRIPTOR
//--------------------------------------------------------------------+
-ATTR_USB_MIN_ALIGNMENT TUSB_CFG_ATTR_USBRAM
+TUSB_CFG_ATTR_USBRAM
app_descriptor_configuration_t desc_configuration =
{
.configuration =
@@ -410,28 +410,28 @@ app_descriptor_configuration_t desc_configuration =
#define STRING_LEN_UNICODE(n) (2 + (2*(n))) // also includes 2 byte header
#define ENDIAN_BE16_FROM( high, low) ENDIAN_BE16(high << 8 | low)
-ATTR_USB_MIN_ALIGNMENT TUSB_CFG_ATTR_USBRAM
+TUSB_CFG_ATTR_USBRAM
uint16_t desc_string_language[] =
{
ENDIAN_BE16_FROM( STRING_LEN_UNICODE(1), TUSB_DESC_TYPE_STRING ),
0x0409
};
-ATTR_USB_MIN_ALIGNMENT TUSB_CFG_ATTR_USBRAM
+TUSB_CFG_ATTR_USBRAM
uint16_t desc_string_manufacturer[] =
{
ENDIAN_BE16_FROM( STRING_LEN_UNICODE(11), TUSB_DESC_TYPE_STRING),
't', 'i', 'n', 'y', 'u', 's', 'b', '.', 'o', 'r', 'g' // len = 11
};
-ATTR_USB_MIN_ALIGNMENT TUSB_CFG_ATTR_USBRAM
+TUSB_CFG_ATTR_USBRAM
uint16_t desc_string_product[] =
{
ENDIAN_BE16_FROM( STRING_LEN_UNICODE(14), TUSB_DESC_TYPE_STRING),
't', 'i', 'n', 'y', 'u', 's', 'b', ' ', 'D', 'e', 'v', 'i', 'c', 'e' // len = 14
};
-ATTR_USB_MIN_ALIGNMENT TUSB_CFG_ATTR_USBRAM
+TUSB_CFG_ATTR_USBRAM
uint16_t desc_string_serial[] =
{
ENDIAN_BE16_FROM( STRING_LEN_UNICODE(4), TUSB_DESC_TYPE_STRING),
@@ -457,7 +457,7 @@ tusbd_descriptor_pointer_t tusbd_descriptor_pointers =
.p_hid_keyboard_report = desc_keyboard_report,
#endif
- #if TUSB_CFG_DEVICE_HID_KEYBOARD
+ #if TUSB_CFG_DEVICE_HID_MOUSE
.p_hid_mouse_report = desc_mouse_report,
#endif
};
diff --git a/demos/host/host_os_none/host_os_none.uvopt b/demos/host/host_os_none/host_os_none.uvopt
index d67fa8cb..a95d6ed6 100644
--- a/demos/host/host_os_none/host_os_none.uvopt
+++ b/demos/host/host_os_none/host_os_none.uvopt
@@ -1114,7 +1114,7 @@
0
0
0
- 35
+ 36
38
0
..\..\..\tinyusb\hal\hal_lpc175x_6x.c
@@ -1162,7 +1162,7 @@
0
0
0
- 18
+ 19
34
0
..\..\..\tinyusb\class\cdc_host.c
@@ -1306,7 +1306,7 @@
0
15
0
- 6
+ 7
10
0
..\..\..\tinyusb\host\ohci\ohci.c
@@ -1438,7 +1438,7 @@
boards
- 0
+ 1
0
0
0
@@ -1754,7 +1754,7 @@
0
35
0
- 77
+ 78
86
0
..\..\..\mcu\lpc175x_6x\LPC17xx_DriverLib\source\lpc17xx_clkpwr.c
diff --git a/tinyusb/class/cdc_device.c b/tinyusb/class/cdc_device.c
index 332e33ea..40509540 100644
--- a/tinyusb/class/cdc_device.c
+++ b/tinyusb/class/cdc_device.c
@@ -50,7 +50,7 @@
//--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF
//--------------------------------------------------------------------+
-TUSB_CFG_ATTR_USBRAM ATTR_USB_MIN_ALIGNMENT
+TUSB_CFG_ATTR_USBRAM
static cdc_line_coding_t cdcd_line_coding[CONTROLLER_DEVICE_NUMBER];
typedef struct {
diff --git a/tinyusb/class/hid_device.c b/tinyusb/class/hid_device.c
index 1adf035b..1f266da2 100644
--- a/tinyusb/class/hid_device.c
+++ b/tinyusb/class/hid_device.c
@@ -101,10 +101,8 @@ static hidd_class_driver_t const hidd_class_driver[HIDD_NUMBER_OF_SUBCLASS] =
#endif
};
-
// TODO [HID] generic
-TUSB_CFG_ATTR_USBRAM ATTR_USB_MIN_ALIGNMENT
-uint8_t m_control_data[ MAX_OF(sizeof(hid_keyboard_report_t), sizeof(hid_mouse_report_t)) ];
+TUSB_CFG_ATTR_USBRAM uint8_t m_control_data[ MAX_OF(sizeof(hid_keyboard_report_t), sizeof(hid_mouse_report_t)) ];
//--------------------------------------------------------------------+
// KEYBOARD APPLICATION API
diff --git a/tinyusb/class/msc_device.c b/tinyusb/class/msc_device.c
index d8f64f16..5f66e64b 100644
--- a/tinyusb/class/msc_device.c
+++ b/tinyusb/class/msc_device.c
@@ -69,7 +69,7 @@ typedef struct {
endpoint_handle_t edpt_in, edpt_out;
}mscd_interface_t;
-ATTR_USB_MIN_ALIGNMENT TUSB_CFG_ATTR_USBRAM STATIC_VAR mscd_interface_t mscd_data;
+TUSB_CFG_ATTR_USBRAM STATIC_VAR mscd_interface_t mscd_data;
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
diff --git a/tinyusb/device/dcd_lpc_11uxx_13uxx.c b/tinyusb/device/dcd_lpc_11uxx_13uxx.c
index 8ff68281..1abe4912 100644
--- a/tinyusb/device/dcd_lpc_11uxx_13uxx.c
+++ b/tinyusb/device/dcd_lpc_11uxx_13uxx.c
@@ -141,7 +141,13 @@ typedef struct {
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
-TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(256) static dcd_11u_13u_data_t dcd_data;
+// TUSB_CFG_ATTR_USBRAM must have ATTR_ALIGNED(64) for lpc11u & lpc13u
+#ifdef __ICCARM__
+ATTR_ALIGNED(256) TUSB_CFG_ATTR_USBRAM // for IAR the first ATTR_ALIGNED takes effect
+#else
+TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(256) // GCC & Keil the last ATTR_ALIGNED takes effect
+#endif
+static dcd_11u_13u_data_t dcd_data;
static inline uint16_t addr_offset(void const * p_buffer) ATTR_CONST ATTR_ALWAYS_INLINE;
static inline uint16_t addr_offset(void const * p_buffer)