mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-17 05:32:55 +08:00
revert to use __USE_LPCOPEN
properly init fpu on LPC M4
This commit is contained in:
parent
c7d2d0ae29
commit
1cee2da7b9
@ -3,9 +3,11 @@ CFLAGS += \
|
||||
-mthumb \
|
||||
-mabi=aapcs \
|
||||
-mcpu=cortex-m4 \
|
||||
-mfloat-abi=hard \
|
||||
-mfpu=fpv4-sp-d16 \
|
||||
-nostdlib \
|
||||
-DCORE_M4 \
|
||||
-D__USE_CMSIS \
|
||||
-D__USE_LPCOPEN \
|
||||
-DCFG_TUSB_MEM_SECTION='__attribute__((section(".data.$$RAM2")))' \
|
||||
-DCFG_TUSB_MCU=OPT_MCU_LPC40XX
|
||||
|
||||
@ -25,7 +27,8 @@ SRC_C += \
|
||||
$(MCU_DIR)/src/iocon_17xx_40xx.c \
|
||||
$(MCU_DIR)/src/sysctl_17xx_40xx.c \
|
||||
$(MCU_DIR)/src/sysinit_17xx_40xx.c \
|
||||
$(MCU_DIR)/src/uart_17xx_40xx.c
|
||||
$(MCU_DIR)/src/uart_17xx_40xx.c \
|
||||
$(MCU_DIR)/src/fpu_init.c
|
||||
|
||||
INC += \
|
||||
$(TOP)/$(MCU_DIR)/inc
|
||||
@ -35,7 +38,7 @@ VENDOR = nxp
|
||||
CHIP_FAMILY = lpc17_40
|
||||
|
||||
# For freeRTOS port source
|
||||
FREERTOS_PORT = ARM_CM3
|
||||
FREERTOS_PORT = ARM_CM4F
|
||||
|
||||
# For flash-jlink target
|
||||
JLINK_DEVICE = LPC4088
|
||||
|
@ -86,6 +86,16 @@ static const PINMUX_GRP_T pin_usb_mux[] =
|
||||
// Invoked by startup code
|
||||
void SystemInit(void)
|
||||
{
|
||||
#ifdef __USE_LPCOPEN
|
||||
extern void (* const g_pfnVectors[])(void);
|
||||
unsigned int *pSCB_VTOR = (unsigned int *) 0xE000ED08;
|
||||
*pSCB_VTOR = (unsigned int) &g_pfnVectors;
|
||||
|
||||
#if __FPU_USED == 1
|
||||
fpuInit();
|
||||
#endif
|
||||
#endif // __USE_LPCOPEN
|
||||
|
||||
Chip_IOCON_Init(LPC_IOCON);
|
||||
Chip_IOCON_SetPinMuxing(LPC_IOCON, pinmuxing, sizeof(pinmuxing) / sizeof(PINMUX_GRP_T));
|
||||
Chip_SetupXtalClocking();
|
||||
|
@ -7,7 +7,7 @@ CFLAGS += \
|
||||
-mfpu=fpv4-sp-d16 \
|
||||
-nostdlib \
|
||||
-DCORE_M4 \
|
||||
-D__USE_CMSIS \
|
||||
-D__USE_LPCOPEN \
|
||||
-DCFG_TUSB_MCU=OPT_MCU_LPC43XX
|
||||
|
||||
# mcu driver cause following warnings
|
||||
@ -26,7 +26,8 @@ SRC_C += \
|
||||
$(MCU_DIR)/src/sysinit_18xx_43xx.c \
|
||||
$(MCU_DIR)/src/i2c_18xx_43xx.c \
|
||||
$(MCU_DIR)/src/i2cm_18xx_43xx.c \
|
||||
$(MCU_DIR)/src/uart_18xx_43xx.c
|
||||
$(MCU_DIR)/src/uart_18xx_43xx.c \
|
||||
$(MCU_DIR)/src/fpu_init.c
|
||||
|
||||
INC += \
|
||||
$(TOP)/$(MCU_DIR)/inc \
|
||||
|
@ -85,6 +85,16 @@ static const PINMUX_GRP_T pinclockmuxing[] =
|
||||
// Invoked by startup code
|
||||
void SystemInit(void)
|
||||
{
|
||||
#ifdef __USE_LPCOPEN
|
||||
extern void (* const g_pfnVectors[])(void);
|
||||
unsigned int *pSCB_VTOR = (unsigned int *) 0xE000ED08;
|
||||
*pSCB_VTOR = (unsigned int) &g_pfnVectors;
|
||||
|
||||
#if __FPU_USED == 1
|
||||
fpuInit();
|
||||
#endif
|
||||
#endif // __USE_LPCOPEN
|
||||
|
||||
/* Setup system level pin muxing */
|
||||
Chip_SCU_SetPinMuxing(pinmuxing, sizeof(pinmuxing) / sizeof(PINMUX_GRP_T));
|
||||
|
||||
|
@ -5,7 +5,7 @@ CFLAGS += \
|
||||
-mcpu=cortex-m0 \
|
||||
-nostdlib \
|
||||
-DCORE_M0 \
|
||||
-D__USE_CMSIS \
|
||||
-D__USE_LPCOPEN \
|
||||
-DCFG_EXAMPLE_MSC_READONLY \
|
||||
-DCFG_TUSB_MCU=OPT_MCU_LPC11UXX \
|
||||
-DCFG_TUSB_MEM_SECTION='__attribute__((section(".data.$$RAM2")))' \
|
||||
|
@ -6,7 +6,7 @@ CFLAGS += \
|
||||
-nostdlib \
|
||||
-DCORE_M0PLUS \
|
||||
-D__VTOR_PRESENT=0 \
|
||||
-D__USE_CMSIS \
|
||||
-D__USE_LPCOPEN \
|
||||
-DCFG_TUSB_MCU=OPT_MCU_LPC11UXX \
|
||||
-DCFG_TUSB_MEM_SECTION='__attribute__((section(".data.$$RAM3")))' \
|
||||
-DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))'
|
||||
|
@ -5,7 +5,7 @@ CFLAGS += \
|
||||
-mcpu=cortex-m3 \
|
||||
-nostdlib \
|
||||
-DCORE_M3 \
|
||||
-D__USE_CMSIS \
|
||||
-D__USE_LPCOPEN \
|
||||
-DCFG_EXAMPLE_MSC_READONLY \
|
||||
-DCFG_TUSB_MCU=OPT_MCU_LPC13XX \
|
||||
-DCFG_TUSB_MEM_SECTION='__attribute__((section(".data.$$RAM2")))' \
|
||||
|
@ -5,7 +5,7 @@ CFLAGS += \
|
||||
-mcpu=cortex-m3 \
|
||||
-nostdlib \
|
||||
-DCORE_M3 \
|
||||
-D__USE_CMSIS \
|
||||
-D__USE_LPCOPEN \
|
||||
-DCFG_EXAMPLE_MSC_READONLY \
|
||||
-DCFG_TUSB_MCU=OPT_MCU_LPC15XX \
|
||||
-DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))'
|
||||
|
@ -5,7 +5,7 @@ CFLAGS += \
|
||||
-mcpu=cortex-m3 \
|
||||
-nostdlib \
|
||||
-DCORE_M3 \
|
||||
-D__USE_CMSIS \
|
||||
-D__USE_LPCOPEN \
|
||||
-DCFG_TUSB_MCU=OPT_MCU_LPC175X_6X \
|
||||
-DRTC_EV_SUPPORT=0
|
||||
|
||||
|
@ -89,9 +89,11 @@ static const PINMUX_GRP_T pin_usb_mux[] =
|
||||
// Invoked by startup code
|
||||
void SystemInit(void)
|
||||
{
|
||||
#ifdef __USE_LPCOPEN
|
||||
extern void (* const g_pfnVectors[])(void);
|
||||
unsigned int *pSCB_VTOR = (unsigned int *) 0xE000ED08;
|
||||
*pSCB_VTOR = (unsigned int) &g_pfnVectors;
|
||||
#endif
|
||||
|
||||
Chip_IOCON_Init(LPC_IOCON);
|
||||
Chip_IOCON_SetPinMuxing(LPC_IOCON, pinmuxing, sizeof(pinmuxing) / sizeof(PINMUX_GRP_T));
|
||||
|
@ -5,7 +5,7 @@ CFLAGS += \
|
||||
-mcpu=cortex-m3 \
|
||||
-nostdlib \
|
||||
-DCORE_M3 \
|
||||
-D__USE_CMSIS \
|
||||
-D__USE_LPCOPEN \
|
||||
-DCFG_TUSB_MCU=OPT_MCU_LPC175X_6X \
|
||||
-DRTC_EV_SUPPORT=0
|
||||
|
||||
|
@ -65,6 +65,12 @@ static const PINMUX_GRP_T pin_usb_mux[] =
|
||||
// Invoked by startup code
|
||||
void SystemInit(void)
|
||||
{
|
||||
#ifdef __USE_LPCOPEN
|
||||
extern void (* const g_pfnVectors[])(void);
|
||||
unsigned int *pSCB_VTOR = (unsigned int *) 0xE000ED08;
|
||||
*pSCB_VTOR = (unsigned int) &g_pfnVectors;
|
||||
#endif
|
||||
|
||||
Chip_IOCON_Init(LPC_IOCON);
|
||||
Chip_IOCON_SetPinMuxing(LPC_IOCON, pinmuxing, sizeof(pinmuxing) / sizeof(PINMUX_GRP_T));
|
||||
Chip_SetupXtalClocking();
|
||||
|
@ -5,7 +5,7 @@ CFLAGS += \
|
||||
-mcpu=cortex-m3 \
|
||||
-nostdlib \
|
||||
-DCORE_M3 \
|
||||
-D__USE_CMSIS \
|
||||
-D__USE_LPCOPEN \
|
||||
-DCFG_TUSB_MCU=OPT_MCU_LPC18XX
|
||||
|
||||
# mcu driver cause following warnings
|
||||
|
@ -112,6 +112,12 @@ static const PINMUX_GRP_T pinclockmuxing[] =
|
||||
// Invoked by startup code
|
||||
void SystemInit(void)
|
||||
{
|
||||
#ifdef __USE_LPCOPEN
|
||||
extern void (* const g_pfnVectors[])(void);
|
||||
unsigned int *pSCB_VTOR = (unsigned int *) 0xE000ED08;
|
||||
*pSCB_VTOR = (unsigned int) &g_pfnVectors;
|
||||
#endif
|
||||
|
||||
/* Setup system level pin muxing */
|
||||
Chip_SCU_SetPinMuxing(pinmuxing, sizeof(pinmuxing) / sizeof(PINMUX_GRP_T));
|
||||
|
||||
|
@ -7,7 +7,7 @@ CFLAGS += \
|
||||
-mfpu=fpv4-sp-d16 \
|
||||
-nostdlib \
|
||||
-DCORE_M4 \
|
||||
-D__USE_CMSIS \
|
||||
-D__USE_LPCOPEN \
|
||||
-DCFG_TUSB_MCU=OPT_MCU_LPC43XX
|
||||
|
||||
# mcu driver cause following warnings
|
||||
@ -24,7 +24,8 @@ SRC_C += \
|
||||
$(MCU_DIR)/src/clock_18xx_43xx.c \
|
||||
$(MCU_DIR)/src/gpio_18xx_43xx.c \
|
||||
$(MCU_DIR)/src/sysinit_18xx_43xx.c \
|
||||
$(MCU_DIR)/src/uart_18xx_43xx.c
|
||||
$(MCU_DIR)/src/uart_18xx_43xx.c \
|
||||
$(MCU_DIR)/src/fpu_init.c
|
||||
|
||||
INC += \
|
||||
$(TOP)/$(MCU_DIR)/inc \
|
||||
|
@ -71,11 +71,17 @@ static const PINMUX_GRP_T pinmuxing[] =
|
||||
};
|
||||
|
||||
// Invoked by startup code
|
||||
extern void (* const g_pfnVectors[])(void);
|
||||
void SystemInit(void)
|
||||
{
|
||||
// Remap isr vector
|
||||
*((uint32_t *) 0xE000ED08) = (uint32_t) &g_pfnVectors;
|
||||
#ifdef __USE_LPCOPEN
|
||||
extern void (* const g_pfnVectors[])(void);
|
||||
unsigned int *pSCB_VTOR = (unsigned int *) 0xE000ED08;
|
||||
*pSCB_VTOR = (unsigned int) &g_pfnVectors;
|
||||
|
||||
#if __FPU_USED == 1
|
||||
fpuInit();
|
||||
#endif
|
||||
#endif // __USE_LPCOPEN
|
||||
|
||||
// Set up pinmux
|
||||
Chip_SCU_SetPinMuxing(pinmuxing, sizeof(pinmuxing) / sizeof(PINMUX_GRP_T));
|
||||
|
Loading…
x
Reference in New Issue
Block a user