diff --git a/boards/lpcxpresso/board_lpcxpresso1347.h b/boards/lpcxpresso/board_lpcxpresso1347.h
index 8e59bc970..fb62d5b0b 100644
--- a/boards/lpcxpresso/board_lpcxpresso1347.h
+++ b/boards/lpcxpresso/board_lpcxpresso1347.h
@@ -51,8 +51,8 @@
#endif
#include "LPC13Uxx.h"
-#include "lpc13uxx/LPC13Uxx_DriverLib/inc/gpio.h"
-#include "lpc13uxx/LPC13Uxx_DriverLib/inc/uart.h"
+#include "gpio.h"
+#include "uart.h"
#define CFG_PRINTF_TARGET PRINTF_TARGET_UART
diff --git a/boards/microbuilder/board_rf1ghznode.h b/boards/microbuilder/board_rf1ghznode.h
index f73c49101..9ad9778cd 100644
--- a/boards/microbuilder/board_rf1ghznode.h
+++ b/boards/microbuilder/board_rf1ghznode.h
@@ -51,8 +51,8 @@
#endif
#include "LPC11Uxx.h"
-#include "lpc11uxx/LPC11Uxx_DriverLib/lpc11uxx_gpio.h"
-#include "lpc11uxx/LPC11Uxx_DriverLib/lpc11uxx_uart.h"
+#include "lpc11uxx_gpio.h"
+#include "lpc11uxx_uart.h"
//#define CFG_PRINTF_TARGET PRINTF_TARGET_SEMIHOST
#define CFG_PRINTF_TARGET PRINTF_TARGET_UART
diff --git a/demos/device/device_os_none/.cproject b/demos/device/device_os_none/.cproject
index cc39c4394..79e8deaba 100644
--- a/demos/device/device_os_none/.cproject
+++ b/demos/device/device_os_none/.cproject
@@ -30,7 +30,7 @@
-
+
@@ -55,7 +55,7 @@
-
+
@@ -63,7 +63,7 @@
-
+
@@ -84,7 +84,7 @@
-
+
@@ -121,7 +121,7 @@
-
+
@@ -146,7 +147,7 @@
-
+
@@ -154,7 +155,7 @@
-
+
@@ -174,7 +175,7 @@
-
+
@@ -211,7 +212,7 @@
-
+
@@ -238,7 +239,7 @@
-
+
@@ -247,7 +248,7 @@
-
+
@@ -269,7 +270,7 @@
-
+
@@ -306,7 +307,7 @@
-
+
@@ -332,7 +332,7 @@
-
+
@@ -340,7 +340,7 @@
-
+
@@ -361,7 +361,7 @@
-
+
@@ -398,7 +398,7 @@
-
+
@@ -425,7 +425,7 @@
-
+
@@ -434,7 +434,7 @@
-
+
@@ -456,7 +456,7 @@
-
+
@@ -493,7 +493,7 @@
-
+
@@ -520,7 +520,7 @@
-
+
@@ -529,7 +529,7 @@
-
+
@@ -551,7 +551,7 @@
-
+
@@ -568,45 +568,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<TargetConfig>
-<Properties property_0="" property_3="NXP" property_4="LPC11U37/401" property_count="5" version="1"/>
-<infoList vendor="NXP"><info chip="LPC11U37/401" match_id="0x00017C40" name="LPC11U37/401" stub="crt_emu_lpc11_13_nxp"><chip><name>LPC11U37/401</name>
-<family>LPC11Uxx</family>
+<Properties property_0="" property_2="LPC18x7_43x7_2x512_BootA.cfx" property_3="NXP" property_4="LPC4357" property_count="5" version="1"/>
+<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>
<vendor>NXP (formerly Philips)</vendor>
<reset board="None" core="Real" sys="Real"/>
-<clock changeable="TRUE" freq="12MHz" is_accurate="TRUE"/>
+<clock changeable="TRUE" freq="20MHz" 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="MFlash128" location="0x0" size="0x20000"/>
-<memoryInstance derived_from="RAM" id="RamLoc8" location="0x10000000" size="0x2000"/>
-<memoryInstance derived_from="RAM" id="RamUsb2" location="0x20004000" size="0x800"/>
-<prog_flash blocksz="0x1000" location="0x0" maxprgbuff="0x400" progwithcode="TRUE" size="0x20000"/>
-<peripheralInstance derived_from="CM0_NVIC" id="NVIC" location="0xe000e000"/>
-<peripheralInstance derived_from="LPC11U_GPIO" id="GPIO" location="0x50000000"/>
-<peripheralInstance derived_from="LPC11U_USBDEV" id="USB" location="0x40080000"/>
-<peripheralInstance derived_from="CM0_DCR" id="DCR" location="0xe000edf0"/>
-<peripheralInstance derived_from="LPC11U_GPIO_GROUP_INT" id="GPIOGROUP0INT" location="0x40060000"/>
-<peripheralInstance derived_from="LPC11U_GPIO_GROUP_INT" id="GPIOGROUP1INT" location="0x4005c000"/>
-<peripheralInstance derived_from="LPC11U_GPIO_INT" id="GPIOINT" location="0x4004c000"/>
-<peripheralInstance derived_from="LPC11_13_SSP" id="SSP1" location="0x40058000"/>
-<peripheralInstance derived_from="LPC11U_FMC" id="FMC" location="0x4003c000"/>
-<peripheralInstance derived_from="LPC11U_SYSCTL" id="SYSCTL" location="0x40048000"/>
-<peripheralInstance derived_from="LPC11U_IOCON" id="IOCON" location="0x40044000"/>
-<peripheralInstance derived_from="LPC11_13_SSP" id="SSP0" location="0x40040000"/>
-<peripheralInstance derived_from="LPC11_13_PMU" id="PMU" location="0x40038000"/>
-<peripheralInstance derived_from="LPC11_13_ADC" id="ADC" location="0x4001c000"/>
-<peripheralInstance derived_from="LPC11_13_TIMER32" id="TIMER1" location="0x40018000"/>
-<peripheralInstance derived_from="LPC11_13_TIMER32" id="TIMER0" location="0x40014000"/>
-<peripheralInstance derived_from="LPC11_13_TIMER16" id="TMR161" location="0x40010000"/>
-<peripheralInstance derived_from="LPC11_13_TIMER16" id="TMR160" location="0x4000c000"/>
-<peripheralInstance derived_from="LPC1xxx_UART_MODEM" id="UART0" location="0x40008000"/>
-<peripheralInstance derived_from="LPC11_13_WDT" id="WDT" location="0x40004000"/>
-<peripheralInstance derived_from="LPC11_13_I2C" id="I2C0" location="0x40000000"/>
+<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" 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="SCT" id="SCT" location="0x40000000"/>
+<peripheralInstance derived_from="GPDMA" id="GPDMA" location="0x40002000"/>
+<peripheralInstance derived_from="SPIFI" id="SPIFI" location="0x40003000"/>
+<peripheralInstance derived_from="SDMMC" id="SDMMC" location="0x40004000"/>
+<peripheralInstance derived_from="EMC" id="EMC" location="0x40005000"/>
+<peripheralInstance derived_from="USB0" id="USB0" location="0x40006000"/>
+<peripheralInstance derived_from="USB1" id="USB1" location="0x40007000"/>
+<peripheralInstance derived_from="LCD" id="LCD" location="0x40008000"/>
+<peripheralInstance derived_from="EEPROM" id="EEPROM" location="0x4000e000"/>
+<peripheralInstance derived_from="ETHERNET" id="ETHERNET" location="0x40010000"/>
+<peripheralInstance derived_from="ATIMER" id="ATIMER" location="0x40040000"/>
+<peripheralInstance derived_from="REGFILE" id="REGFILE" location="0x40041000"/>
+<peripheralInstance derived_from="PMC" id="PMC" location="0x40042000"/>
+<peripheralInstance derived_from="CREG" id="CREG" location="0x40043000"/>
+<peripheralInstance derived_from="EVENTROUTER" id="EVENTROUTER" location="0x40044000"/>
+<peripheralInstance derived_from="RTC" id="RTC" location="0x40046000"/>
+<peripheralInstance derived_from="CGU" id="CGU" location="0x40050000"/>
+<peripheralInstance derived_from="CCU1" id="CCU1" location="0x40051000"/>
+<peripheralInstance derived_from="CCU2" id="CCU2" location="0x40052000"/>
+<peripheralInstance derived_from="RGU" id="RGU" location="0x40053000"/>
+<peripheralInstance derived_from="WWDT" id="WWDT" location="0x40080000"/>
+<peripheralInstance derived_from="USART0" id="USART0" location="0x40081000"/>
+<peripheralInstance derived_from="USART2" id="USART2" location="0x400c1000"/>
+<peripheralInstance derived_from="USART3" id="USART3" location="0x400c2000"/>
+<peripheralInstance derived_from="UART1" id="UART1" location="0x40082000"/>
+<peripheralInstance derived_from="SSP0" id="SSP0" location="0x40083000"/>
+<peripheralInstance derived_from="SSP1" id="SSP1" location="0x400c5000"/>
+<peripheralInstance derived_from="TIMER0" id="TIMER0" location="0x40084000"/>
+<peripheralInstance derived_from="TIMER1" id="TIMER1" location="0x40085000"/>
+<peripheralInstance derived_from="TIMER2" id="TIMER2" location="0x400c3000"/>
+<peripheralInstance derived_from="TIMER3" id="TIMER3" location="0x400c4000"/>
+<peripheralInstance derived_from="SCU" id="SCU" location="0x40086000"/>
+<peripheralInstance derived_from="GPIO-PIN-INT" id="GPIO-PIN-INT" location="0x40087000"/>
+<peripheralInstance derived_from="GPIO-GROUP-INT0" id="GPIO-GROUP-INT0" location="0x40088000"/>
+<peripheralInstance derived_from="GPIO-GROUP-INT1" id="GPIO-GROUP-INT1" location="0x40089000"/>
+<peripheralInstance derived_from="MCPWM" id="MCPWM" location="0x400a0000"/>
+<peripheralInstance derived_from="I2C0" id="I2C0" location="0x400a1000"/>
+<peripheralInstance derived_from="I2C1" id="I2C1" location="0x400e0000"/>
+<peripheralInstance derived_from="I2S0" id="I2S0" location="0x400a2000"/>
+<peripheralInstance derived_from="I2S1" id="I2S1" location="0x400a3000"/>
+<peripheralInstance derived_from="C-CAN1" id="C-CAN1" location="0x400a4000"/>
+<peripheralInstance derived_from="RITIMER" id="RITIMER" location="0x400c0000"/>
+<peripheralInstance derived_from="QEI" id="QEI" location="0x400c6000"/>
+<peripheralInstance derived_from="GIMA" id="GIMA" location="0x400c7000"/>
+<peripheralInstance derived_from="DAC" id="DAC" location="0x400e1000"/>
+<peripheralInstance derived_from="C-CAN0" id="C-CAN0" location="0x400e2000"/>
+<peripheralInstance derived_from="ADC0" id="ADC0" location="0x400e3000"/>
+<peripheralInstance derived_from="ADC1" id="ADC1" location="0x400e4000"/>
+<peripheralInstance derived_from="GPIO-PORT" id="GPIO-PORT" location="0x400f4000"/>
+<peripheralInstance derived_from="SPI" id="SPI" location="0x40100000"/>
+<peripheralInstance derived_from="SGPIO" id="SGPIO" location="0x40101000"/>
</chip>
-<processor><name gcc_name="cortex-m0">Cortex-M0</name>
+<processor><name gcc_name="cortex-m4">Cortex-M4</name>
<family>Cortex-M</family>
</processor>
-<link href="nxp_lpc11_13_peripheral.xme" show="embed" type="simple"/>
+<link href="nxp_lpc43xx_peripheral.xme" show="embed" type="simple"/>
</info>
</infoList>
</TargetConfig>
diff --git a/demos/device/device_os_none/.project b/demos/device/device_os_none/.project
index 0f6eb4734..406c4de7c 100644
--- a/demos/device/device_os_none/.project
+++ b/demos/device/device_os_none/.project
@@ -81,9 +81,14 @@
- bsp
+ boards
2
- PARENT-2-PROJECT_LOC/bsp
+ PARENT-3-PROJECT_LOC/boards
+
+
+ mcu
+ 2
+ PARENT-3-PROJECT_LOC/mcu
src
@@ -98,7 +103,7 @@
- 1387876593819
+ 1394632197708
26
@@ -107,7 +112,7 @@
- 1387876593840
+ 1394632197724
26
diff --git a/demos/device/src/cdcd_app.h b/demos/device/src/cdcd_app.h
index 7c259ea1d..6f5df7b9d 100644
--- a/demos/device/src/cdcd_app.h
+++ b/demos/device/src/cdcd_app.h
@@ -46,7 +46,7 @@
#ifndef _TUSB_CDCD_APP_H_
#define _TUSB_CDCD_APP_H_
-#include "boards/board.h"
+#include "board.h"
#include "tusb.h"
#ifdef __cplusplus
diff --git a/demos/device/src/keyboardd_app.h b/demos/device/src/keyboardd_app.h
index 78d1fa6d6..a6af1220b 100644
--- a/demos/device/src/keyboardd_app.h
+++ b/demos/device/src/keyboardd_app.h
@@ -46,7 +46,7 @@
#ifndef _TUSB_KEYBOARDD_APP_H_
#define _TUSB_KEYBOARDD_APP_H_
-#include "boards/board.h"
+#include "board.h"
#include "tusb.h"
#ifdef __cplusplus
diff --git a/demos/device/src/main.c b/demos/device/src/main.c
index 914c97217..9e9be2a7d 100644
--- a/demos/device/src/main.c
+++ b/demos/device/src/main.c
@@ -43,7 +43,7 @@
#include
#include
-#include "boards/board.h"
+#include "board.h"
#include "tusb.h"
#include "mscd_app.h"
diff --git a/demos/device/src/moused_app.h b/demos/device/src/moused_app.h
index 2b49d4373..9561680fe 100644
--- a/demos/device/src/moused_app.h
+++ b/demos/device/src/moused_app.h
@@ -46,7 +46,7 @@
#ifndef _TUSB_MOUSED_APP_H_
#define _TUSB_MOUSED_APP_H_
-#include "boards/board.h"
+#include "board.h"
#include "tusb.h"
#ifdef __cplusplus
diff --git a/demos/device/src/mscd_app.h b/demos/device/src/mscd_app.h
index f9f1d20bc..203e05d2d 100644
--- a/demos/device/src/mscd_app.h
+++ b/demos/device/src/mscd_app.h
@@ -46,7 +46,7 @@
#ifndef _TUSB_MSCD_APP_H_
#define _TUSB_MSCD_APP_H_
-#include "boards/board.h"
+#include "board.h"
#include "tusb.h"
#ifdef __cplusplus
diff --git a/demos/device/src/tusb_config.h b/demos/device/src/tusb_config.h
index 4bba991bf..e9124e1d8 100644
--- a/demos/device/src/tusb_config.h
+++ b/demos/device/src/tusb_config.h
@@ -88,27 +88,21 @@
//--------------------------------------------------------------------+
#ifdef __CODE_RED // compiled with lpcxpresso
#if (TUSB_CFG_MCU == MCU_LPC11UXX) || (TUSB_CFG_MCU == MCU_LPC13UXX)
- #define TUSB_RAM_SECTION ".data.$RAM2"
+ #define TUSB_CFG_ATTR_USBRAM ATTR_SECTION(.data.$RAM2)
#elif TUSB_CFG_MCU == MCU_LPC175X_6X
- #define TUSB_RAM_SECTION // LPC17xx USB DMA can access all
+ #define TUSB_CFG_ATTR_USBRAM // LPC17xx USB DMA can access all
#elif (TUSB_CFG_MCU == MCU_LPC43XX)
- #define TUSB_RAM_SECTION ".data.$RAM3"
- #else
- #error Please define USB RAM section
+ #define TUSB_CFG_ATTR_USBRAM ATTR_SECTION(.data.$RAM3)
#endif
- #define TUSB_CFG_ATTR_USBRAM __attribute__ ((section(TUSB_RAM_SECTION)))
-
#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 __attribute__ ((section("USBRAM_SECTION"))) // TODO Keil linker file
+ #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
#elif (TUSB_CFG_MCU == MCU_LPC175X_6X)
#define TUSB_CFG_ATTR_USBRAM
- #else
- #error Please define USB RAM section
#endif
#elif defined __ICCARM__ // compiled with IAR
diff --git a/tinyusb/common/compiler/compiler_gcc.h b/tinyusb/common/compiler/compiler_gcc.h
index 188ae271d..ab3ced5d3 100644
--- a/tinyusb/common/compiler/compiler_gcc.h
+++ b/tinyusb/common/compiler/compiler_gcc.h
@@ -55,7 +55,7 @@
#define ALIGN_OF(x) __alignof__(x)
/// Normally, the compiler places the objects it generates in sections like data or bss & function in text. Sometimes, however, you need additional sections, or you need certain particular variables to appear in special sections, for example to map to special hardware. The section attribute specifies that a variable (or function) lives in a particular section
-#define ATTR_SECTION(section) __attribute__ ((#section))
+#define ATTR_SECTION(sec_name) __attribute__ (( section(#sec_name) ))
/// If this attribute is used on a function declaration and a call to such a function is not eliminated through dead code elimination or other optimizations, an error that includes message is diagnosed. This is useful for compile-time checking
#define ATTR_ERROR(Message) __attribute__ ((error(Message)))