From 40d0ff99605f6b50e0120cb61e2f3234ae567c7f Mon Sep 17 00:00:00 2001 From: tanek liang Date: Thu, 16 Nov 2017 10:37:14 +0800 Subject: [PATCH] [bsp] add iar support for lpc54608 and fix sdram bug --- bsp/AE210P/application.c | 272 +- bsp/AE210P/board.c | 190 +- bsp/AE210P/board/uart_dev.c | 424 +-- bsp/AE210P/rtconfig.h | 398 +-- bsp/AE210P/startup.c | 226 +- .../LPC54608J512_flash.icf | 122 + .../applications/SConscript | 8 +- .../applications/startup.c | 2 +- bsp/lpc54608-LPCXpresso/drivers/drt_mpu.c | 93 + bsp/lpc54608-LPCXpresso/drivers/drt_mpu.h | 29 + bsp/lpc54608-LPCXpresso/drivers/drv_sram.c | 2 +- bsp/lpc54608-LPCXpresso/project.ewd | 2818 ++++++++++++++++ bsp/lpc54608-LPCXpresso/project.ewt | 2925 +++++++++++++++++ bsp/lpc54608-LPCXpresso/template.ewp | 1819 ++++++++++ 14 files changed, 8570 insertions(+), 758 deletions(-) create mode 100644 bsp/lpc54608-LPCXpresso/LPC54608J512_flash.icf create mode 100644 bsp/lpc54608-LPCXpresso/drivers/drt_mpu.c create mode 100644 bsp/lpc54608-LPCXpresso/drivers/drt_mpu.h create mode 100644 bsp/lpc54608-LPCXpresso/project.ewd create mode 100644 bsp/lpc54608-LPCXpresso/project.ewt create mode 100644 bsp/lpc54608-LPCXpresso/template.ewp diff --git a/bsp/AE210P/application.c b/bsp/AE210P/application.c index 7680506e9..44e346507 100644 --- a/bsp/AE210P/application.c +++ b/bsp/AE210P/application.c @@ -1,136 +1,136 @@ -/* - * File : application.c - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006, RT-Thread Development Team - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE - * - * Change Logs: - * Date Author Notes - * 2009-01-05 Bernard the first version - * 2013-07-12 aozima update for auto initial. - */ - -/** - * @addtogroup STM32 - */ -/*@{*/ - -#include -#include -#include - -#ifdef RT_USING_COMPONENTS_INIT -#include -#endif /* RT_USING_COMPONENTS_INIT */ - -#ifdef RT_USING_DFS -/* dfs filesystem:ELM filesystem init */ -#include -/* dfs Filesystem APIs */ -#include -#endif - -#ifdef RT_USING_RTGUI -#include -#include -#include -#include -#include -#endif - -void rt_init_thread_entry(void* parameter) -{ -#ifdef RT_USING_COMPONENTS_INIT - /* initialization RT-Thread Components */ - rt_components_init(); -#endif - - /* Filesystem Initialization */ -#if defined(RT_USING_DFS) && defined(RT_USING_DFS_ELMFAT) - /* mount sd card fat partition 1 as root directory */ - if (dfs_mount("sd0", "/", "elm", 0, 0) == 0) - { - rt_kprintf("File System initialized!\n"); - } - else - rt_kprintf("File System initialzation failed!\n"); -#endif /* RT_USING_DFS */ - -#ifdef RT_USING_RTGUI - { - extern void rt_hw_lcd_init(); - extern void rtgui_touch_hw_init(void); - - rt_device_t lcd; - - /* init lcd */ - rt_hw_lcd_init(); - - /* init touch panel */ - rtgui_touch_hw_init(); - - /* find lcd device */ - lcd = rt_device_find("lcd"); - - /* set lcd device as rtgui graphic driver */ - rtgui_graphic_set_device(lcd); - -#ifndef RT_USING_COMPONENTS_INIT - /* init rtgui system server */ - rtgui_system_server_init(); -#endif - - calibration_set_restore(cali_setup); - calibration_set_after(cali_store); - calibration_init(); - } -#endif /* #ifdef RT_USING_RTGUI */ -} - -//#include "debug.h" -// -//rt_thread_t test_thread[2]; -// -//void rt_test_thread_entry(void *parameter) -//{ -// uint32_t num = (uint32_t)parameter; -// uint32_t schedule_times = 0; -// -// while (1) -// { -// DEBUG(1, 0, "%d:%d\r\n", num, schedule_times++); -// rt_thread_delay(1); -// } -//} - -int rt_application_init(void) -{ - rt_thread_t init_thread; - -#if (RT_THREAD_PRIORITY_MAX == 32) - init_thread = rt_thread_create("init", - rt_init_thread_entry, RT_NULL, - 2048, 8, 20); -#else - init_thread = rt_thread_create("init", - rt_init_thread_entry, RT_NULL, - 2048, 80, 20); -#endif - - if (init_thread != RT_NULL) - rt_thread_startup(init_thread); - -// test_thread[0] = rt_thread_create("t1", rt_test_thread_entry, (void *)1, 1024, 26, 5); -// test_thread[1] = rt_thread_create("t2", rt_test_thread_entry, (void *)2, 1024, 26, 5); -// if (test_thread[0] != RT_NULL) -// rt_thread_startup(test_thread[0]); -// if (test_thread[1] != RT_NULL) -// rt_thread_startup(test_thread[1]); - - return 0; -} - -/*@}*/ +/* + * File : application.c + * This file is part of RT-Thread RTOS + * COPYRIGHT (C) 2006, RT-Thread Development Team + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rt-thread.org/license/LICENSE + * + * Change Logs: + * Date Author Notes + * 2009-01-05 Bernard the first version + * 2013-07-12 aozima update for auto initial. + */ + +/** + * @addtogroup STM32 + */ +/*@{*/ + +#include +#include +#include + +#ifdef RT_USING_COMPONENTS_INIT +#include +#endif /* RT_USING_COMPONENTS_INIT */ + +#ifdef RT_USING_DFS +/* dfs filesystem:ELM filesystem init */ +#include +/* dfs Filesystem APIs */ +#include +#endif + +#ifdef RT_USING_RTGUI +#include +#include +#include +#include +#include +#endif + +void rt_init_thread_entry(void* parameter) +{ +#ifdef RT_USING_COMPONENTS_INIT + /* initialization RT-Thread Components */ + rt_components_init(); +#endif + + /* Filesystem Initialization */ +#if defined(RT_USING_DFS) && defined(RT_USING_DFS_ELMFAT) + /* mount sd card fat partition 1 as root directory */ + if (dfs_mount("sd0", "/", "elm", 0, 0) == 0) + { + rt_kprintf("File System initialized!\n"); + } + else + rt_kprintf("File System initialzation failed!\n"); +#endif /* RT_USING_DFS */ + +#ifdef RT_USING_RTGUI + { + extern void rt_hw_lcd_init(); + extern void rtgui_touch_hw_init(void); + + rt_device_t lcd; + + /* init lcd */ + rt_hw_lcd_init(); + + /* init touch panel */ + rtgui_touch_hw_init(); + + /* find lcd device */ + lcd = rt_device_find("lcd"); + + /* set lcd device as rtgui graphic driver */ + rtgui_graphic_set_device(lcd); + +#ifndef RT_USING_COMPONENTS_INIT + /* init rtgui system server */ + rtgui_system_server_init(); +#endif + + calibration_set_restore(cali_setup); + calibration_set_after(cali_store); + calibration_init(); + } +#endif /* #ifdef RT_USING_RTGUI */ +} + +//#include "debug.h" +// +//rt_thread_t test_thread[2]; +// +//void rt_test_thread_entry(void *parameter) +//{ +// uint32_t num = (uint32_t)parameter; +// uint32_t schedule_times = 0; +// +// while (1) +// { +// DEBUG(1, 0, "%d:%d\r\n", num, schedule_times++); +// rt_thread_delay(1); +// } +//} + +int rt_application_init(void) +{ + rt_thread_t init_thread; + +#if (RT_THREAD_PRIORITY_MAX == 32) + init_thread = rt_thread_create("init", + rt_init_thread_entry, RT_NULL, + 2048, 8, 20); +#else + init_thread = rt_thread_create("init", + rt_init_thread_entry, RT_NULL, + 2048, 80, 20); +#endif + + if (init_thread != RT_NULL) + rt_thread_startup(init_thread); + +// test_thread[0] = rt_thread_create("t1", rt_test_thread_entry, (void *)1, 1024, 26, 5); +// test_thread[1] = rt_thread_create("t2", rt_test_thread_entry, (void *)2, 1024, 26, 5); +// if (test_thread[0] != RT_NULL) +// rt_thread_startup(test_thread[0]); +// if (test_thread[1] != RT_NULL) +// rt_thread_startup(test_thread[1]); + + return 0; +} + +/*@}*/ diff --git a/bsp/AE210P/board.c b/bsp/AE210P/board.c index ee0222141..d086bd63b 100644 --- a/bsp/AE210P/board.c +++ b/bsp/AE210P/board.c @@ -1,95 +1,95 @@ -/* - * File : board.c - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2009 RT-Thread Develop Team - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE - * - * Change Logs: - * Date Author Notes - * 2009-01-05 Bernard first implementation - * 2013-07-12 aozima update for auto initial. - */ - -#include -#include - -#include "nds32.h" -#include "bsp_hal.h" -#include "ae210p.h" -#include "debug.h" -//#include "uart/uart.h" -#include "uart_dev.h" - -#include "board.h" -#include "rtconfig.h" - -/** - * This is the timer interrupt service routine. - * - */ -void SysTick_Handler(void) -{ - /* clean timer device pending*/ - hal_timer_irq_clear(1); - - /* enter interrupt */ - rt_interrupt_enter(); - - rt_tick_increase(); - - /* leave interrupt */ - rt_interrupt_leave(); -} - -/*********************************************************** - * Set timer 1 as system tick by default - ***********************************************************/ - -void BSP_Tmr_TickInit(uint32_t tmrId, uint32_t period, uint32_t vecId, void *isr) -{ - /* set tick period */ - hal_timer_set_period(tmrId, period); - - /* enable timer1 interrupt */ - hal_timer_irq_control(tmrId, 1); - - /****************************** - * tick ISR init - ******************************/ - /* init trigger mode */ - /* Set edge trigger, falling edge */ - hal_intc_irq_config(vecId, 1, 0); - /* clean pending */ - hal_intc_irq_clean(vecId); - /* enable timer interrupt */ - hal_intc_irq_enable(vecId); - - if (isr) - OS_CPU_Vector_Table[vecId] = isr; - else - DEBUG(1, 1, "Invalid tick handler!!\r\n"); - - /* start timer */ - hal_timer_start(tmrId); -} - -/* - * Setup system tick for OS required. - */ -void bsp_init(void) -{ - /* disable interrupt first */ - rt_hw_interrupt_disable(); - -// drv_uart_init(); - rt_hw_usart_init(); - rt_console_set_device(RT_CONSOLE_DEVICE_NAME); - - /* System tick init */ - BSP_Tmr_TickInit(0x1, (MB_PCLK / RT_TICK_PER_SECOND), IRQ_SYS_TICK_VECTOR, SysTick_Handler); -} - -/*@}*/ +/* + * File : board.c + * This file is part of RT-Thread RTOS + * COPYRIGHT (C) 2009 RT-Thread Develop Team + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rt-thread.org/license/LICENSE + * + * Change Logs: + * Date Author Notes + * 2009-01-05 Bernard first implementation + * 2013-07-12 aozima update for auto initial. + */ + +#include +#include + +#include "nds32.h" +#include "bsp_hal.h" +#include "ae210p.h" +#include "debug.h" +//#include "uart/uart.h" +#include "uart_dev.h" + +#include "board.h" +#include "rtconfig.h" + +/** + * This is the timer interrupt service routine. + * + */ +void SysTick_Handler(void) +{ + /* clean timer device pending*/ + hal_timer_irq_clear(1); + + /* enter interrupt */ + rt_interrupt_enter(); + + rt_tick_increase(); + + /* leave interrupt */ + rt_interrupt_leave(); +} + +/*********************************************************** + * Set timer 1 as system tick by default + ***********************************************************/ + +void BSP_Tmr_TickInit(uint32_t tmrId, uint32_t period, uint32_t vecId, void *isr) +{ + /* set tick period */ + hal_timer_set_period(tmrId, period); + + /* enable timer1 interrupt */ + hal_timer_irq_control(tmrId, 1); + + /****************************** + * tick ISR init + ******************************/ + /* init trigger mode */ + /* Set edge trigger, falling edge */ + hal_intc_irq_config(vecId, 1, 0); + /* clean pending */ + hal_intc_irq_clean(vecId); + /* enable timer interrupt */ + hal_intc_irq_enable(vecId); + + if (isr) + OS_CPU_Vector_Table[vecId] = isr; + else + DEBUG(1, 1, "Invalid tick handler!!\r\n"); + + /* start timer */ + hal_timer_start(tmrId); +} + +/* + * Setup system tick for OS required. + */ +void bsp_init(void) +{ + /* disable interrupt first */ + rt_hw_interrupt_disable(); + +// drv_uart_init(); + rt_hw_usart_init(); + rt_console_set_device(RT_CONSOLE_DEVICE_NAME); + + /* System tick init */ + BSP_Tmr_TickInit(0x1, (MB_PCLK / RT_TICK_PER_SECOND), IRQ_SYS_TICK_VECTOR, SysTick_Handler); +} + +/*@}*/ diff --git a/bsp/AE210P/board/uart_dev.c b/bsp/AE210P/board/uart_dev.c index 7d0f251b7..8aa4cd176 100644 --- a/bsp/AE210P/board/uart_dev.c +++ b/bsp/AE210P/board/uart_dev.c @@ -1,212 +1,212 @@ -/* - * File : uart_dev.c - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006-2013, RT-Thread Development Team - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE - * - * Change Logs: - * Date Author Notes - * 2009-01-05 Bernard the first version - * 2010-03-29 Bernard remove interrupt Tx and DMA Rx mode - * 2013-05-13 aozima update for kehong-lingtai. - */ - -#include "uart/uart.h" -#include "uart_dev.h" -#include "ae210p.h" -#include "board.h" -#include "bsp_hal.h" - -#include "rtdevice.h" - -#include "serial.h" - -#define UART_ENABLE_IRQ(n) hal_intc_irq_enable(n) -#define UART_DISABLE_IRQ(n) hal_intc_irq_disable(n) - -struct uart_device -{ - uint32_t uart_base; - uint32_t irq; -}; - -static rt_err_t __uart_configure(struct rt_serial_device *serial, struct serial_configure *cfg) -{ - struct uart_device *uartDev = RT_NULL; - - RT_ASSERT(serial != RT_NULL); - RT_ASSERT(cfg != RT_NULL); - - uartDev = (struct uart_device *)serial->parent.user_data; - - __drv_uart_init(uartDev->uart_base, cfg->baud_rate); - - // todo : enable FIFO threshold, enable rx & rx timeout(threshold) interrupt - - return RT_EOK; -} - -static rt_err_t __uart_control(struct rt_serial_device *serial, int cmd, void *arg) -{ - struct uart_device *uartDev = RT_NULL; - - RT_ASSERT(serial != RT_NULL); - uartDev = (struct uart_device *)serial->parent.user_data; - - switch (cmd) - { - case RT_DEVICE_CTRL_CLR_INT: /* disable rx irq */ - UART_DISABLE_IRQ(uartDev->irq); - break; - - case RT_DEVICE_CTRL_SET_INT: /* enable rx irq */ - UART_ENABLE_IRQ(uartDev->irq); - break; - - default: - break; - } - - return RT_EOK; -} - -static int __uart_putc(struct rt_serial_device *serial, char c) -{ - struct uart_device *uartDev = RT_NULL; - - RT_ASSERT(serial != RT_NULL); - - uartDev = (struct uart_device *)serial->parent.user_data; - - __drv_uart_put_char(uartDev->uart_base, c); // Transmit Data - - return 1; -} - -static int __uart_getc(struct rt_serial_device *serial) -{ - int ch = -1; - struct uart_device *uartDev = RT_NULL; - - RT_ASSERT(serial != RT_NULL); - uartDev = (struct uart_device *)serial->parent.user_data; - - ch = -1; - - if (__drv_uart_is_kbd_hit(uartDev->uart_base)) - { - ch = __drv_uart_get_char(uartDev->uart_base) & 0x00FF; - } - - return ch; -} - -static const struct rt_uart_ops __uart_ops = -{ - __uart_configure, - __uart_control, - __uart_putc, - __uart_getc, - RT_NULL -}; - -#if RT_USING_UART01 -struct uart_device uartDev01 = -{ // UART01 device driver structure - UART1_BASE, - IRQ_UART1_VECTOR -}; - -struct rt_serial_device serial01; - -void URT01_IRQHandler(void) -{ - struct uart_device *uartDev = RT_NULL; - - uartDev = &uartDev01; - - rt_interrupt_enter(); /* enter interrupt */ - -// if (uart->uart_device->Interrupt & ((1 << bsUART_TIMEOUT_INTENAB) | (1 << bsUART_RECEIVE_INTENAB))) // RX -// { -// rt_hw_serial_isr(&serial01, RT_SERIAL_EVENT_RX_IND); -// } -// -// if (uart->uart_device->Interrupt & (1 << bsUART_TRANSMIT_INTENAB)) // TX -// { -// ; -// } -// -// /* clear all interrupt */ -// uart->uart_device->IntClear = (1 << bsUART_RECEIVE_INTENAB) -// | (1 << bsUART_TRANSMIT_INTENAB) -// | (1 << bsUART_TIMEOUT_INTENAB); - - rt_interrupt_leave(); /* leave interrupt */ -} -#endif /* RT_USING_UART01 */ - -#if RT_USING_UART02 -struct uart_device uartDev02 = -{ // UART02 device driver structure - UART2_BASE, - IRQ_UATR2_VECTOR -}; - -struct rt_serial_device serial02; - -void URT02_IRQHandler(void) -{ - struct uart_device *uartDev = RT_NULL; - - uartDev = &uartDev02; - - rt_interrupt_enter(); /* enter interrupt */ - - uartDev = uartDev; - - rt_interrupt_leave(); /* leave interrupt */ -} -#endif /* RT_USING_UART02 */ - -void rt_hw_usart_init(void) -{ - struct uart_device *uartDev = RT_NULL; - struct serial_configure config = RT_SERIAL_CONFIG_DEFAULT; - -#if RT_USING_UART01 - uart = &uartDev01; - config.baud_rate = BAUD_RATE_38400; - - serial01.ops = &__uart_ops; - serial01.config = config; - - // set interrupt priority level - // disable interrupt - - // register UART01 device - rt_hw_serial_register(&serial01, "uart01", - RT_DEVICE_FLAG_RDWR /*| RT_DEVICE_FLAG_INT_RX*/, - uartDev); -#endif /* RT_USING_UART01 */ - -#if RT_USING_UART02 - uartDev = &uartDev02; - - config.baud_rate = BAUD_RATE_38400; - serial02.ops = &__uart_ops; - serial02.config = config; - - // set interrupt priority level - // disable interrupt - - /* register UART02 device */ - rt_hw_serial_register(&serial02, "uart02", - RT_DEVICE_FLAG_RDWR /*| RT_DEVICE_FLAG_INT_RX*/, - uartDev); - #endif /* RT_USING_UART02 */ -} - +/* + * File : uart_dev.c + * This file is part of RT-Thread RTOS + * COPYRIGHT (C) 2006-2013, RT-Thread Development Team + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rt-thread.org/license/LICENSE + * + * Change Logs: + * Date Author Notes + * 2009-01-05 Bernard the first version + * 2010-03-29 Bernard remove interrupt Tx and DMA Rx mode + * 2013-05-13 aozima update for kehong-lingtai. + */ + +#include "uart/uart.h" +#include "uart_dev.h" +#include "ae210p.h" +#include "board.h" +#include "bsp_hal.h" + +#include "rtdevice.h" + +#include "serial.h" + +#define UART_ENABLE_IRQ(n) hal_intc_irq_enable(n) +#define UART_DISABLE_IRQ(n) hal_intc_irq_disable(n) + +struct uart_device +{ + uint32_t uart_base; + uint32_t irq; +}; + +static rt_err_t __uart_configure(struct rt_serial_device *serial, struct serial_configure *cfg) +{ + struct uart_device *uartDev = RT_NULL; + + RT_ASSERT(serial != RT_NULL); + RT_ASSERT(cfg != RT_NULL); + + uartDev = (struct uart_device *)serial->parent.user_data; + + __drv_uart_init(uartDev->uart_base, cfg->baud_rate); + + // todo : enable FIFO threshold, enable rx & rx timeout(threshold) interrupt + + return RT_EOK; +} + +static rt_err_t __uart_control(struct rt_serial_device *serial, int cmd, void *arg) +{ + struct uart_device *uartDev = RT_NULL; + + RT_ASSERT(serial != RT_NULL); + uartDev = (struct uart_device *)serial->parent.user_data; + + switch (cmd) + { + case RT_DEVICE_CTRL_CLR_INT: /* disable rx irq */ + UART_DISABLE_IRQ(uartDev->irq); + break; + + case RT_DEVICE_CTRL_SET_INT: /* enable rx irq */ + UART_ENABLE_IRQ(uartDev->irq); + break; + + default: + break; + } + + return RT_EOK; +} + +static int __uart_putc(struct rt_serial_device *serial, char c) +{ + struct uart_device *uartDev = RT_NULL; + + RT_ASSERT(serial != RT_NULL); + + uartDev = (struct uart_device *)serial->parent.user_data; + + __drv_uart_put_char(uartDev->uart_base, c); // Transmit Data + + return 1; +} + +static int __uart_getc(struct rt_serial_device *serial) +{ + int ch = -1; + struct uart_device *uartDev = RT_NULL; + + RT_ASSERT(serial != RT_NULL); + uartDev = (struct uart_device *)serial->parent.user_data; + + ch = -1; + + if (__drv_uart_is_kbd_hit(uartDev->uart_base)) + { + ch = __drv_uart_get_char(uartDev->uart_base) & 0x00FF; + } + + return ch; +} + +static const struct rt_uart_ops __uart_ops = +{ + __uart_configure, + __uart_control, + __uart_putc, + __uart_getc, + RT_NULL +}; + +#if RT_USING_UART01 +struct uart_device uartDev01 = +{ // UART01 device driver structure + UART1_BASE, + IRQ_UART1_VECTOR +}; + +struct rt_serial_device serial01; + +void URT01_IRQHandler(void) +{ + struct uart_device *uartDev = RT_NULL; + + uartDev = &uartDev01; + + rt_interrupt_enter(); /* enter interrupt */ + +// if (uart->uart_device->Interrupt & ((1 << bsUART_TIMEOUT_INTENAB) | (1 << bsUART_RECEIVE_INTENAB))) // RX +// { +// rt_hw_serial_isr(&serial01, RT_SERIAL_EVENT_RX_IND); +// } +// +// if (uart->uart_device->Interrupt & (1 << bsUART_TRANSMIT_INTENAB)) // TX +// { +// ; +// } +// +// /* clear all interrupt */ +// uart->uart_device->IntClear = (1 << bsUART_RECEIVE_INTENAB) +// | (1 << bsUART_TRANSMIT_INTENAB) +// | (1 << bsUART_TIMEOUT_INTENAB); + + rt_interrupt_leave(); /* leave interrupt */ +} +#endif /* RT_USING_UART01 */ + +#if RT_USING_UART02 +struct uart_device uartDev02 = +{ // UART02 device driver structure + UART2_BASE, + IRQ_UATR2_VECTOR +}; + +struct rt_serial_device serial02; + +void URT02_IRQHandler(void) +{ + struct uart_device *uartDev = RT_NULL; + + uartDev = &uartDev02; + + rt_interrupt_enter(); /* enter interrupt */ + + uartDev = uartDev; + + rt_interrupt_leave(); /* leave interrupt */ +} +#endif /* RT_USING_UART02 */ + +void rt_hw_usart_init(void) +{ + struct uart_device *uartDev = RT_NULL; + struct serial_configure config = RT_SERIAL_CONFIG_DEFAULT; + +#if RT_USING_UART01 + uart = &uartDev01; + config.baud_rate = BAUD_RATE_38400; + + serial01.ops = &__uart_ops; + serial01.config = config; + + // set interrupt priority level + // disable interrupt + + // register UART01 device + rt_hw_serial_register(&serial01, "uart01", + RT_DEVICE_FLAG_RDWR /*| RT_DEVICE_FLAG_INT_RX*/, + uartDev); +#endif /* RT_USING_UART01 */ + +#if RT_USING_UART02 + uartDev = &uartDev02; + + config.baud_rate = BAUD_RATE_38400; + serial02.ops = &__uart_ops; + serial02.config = config; + + // set interrupt priority level + // disable interrupt + + /* register UART02 device */ + rt_hw_serial_register(&serial02, "uart02", + RT_DEVICE_FLAG_RDWR /*| RT_DEVICE_FLAG_INT_RX*/, + uartDev); + #endif /* RT_USING_UART02 */ +} + diff --git a/bsp/AE210P/rtconfig.h b/bsp/AE210P/rtconfig.h index 01a94682a..3308aab8a 100644 --- a/bsp/AE210P/rtconfig.h +++ b/bsp/AE210P/rtconfig.h @@ -1,199 +1,199 @@ -/* RT-Thread config file */ -#ifndef __RTTHREAD_CFG_H__ -#define __RTTHREAD_CFG_H__ - -/* RT_NAME_MAX*/ -#define RT_NAME_MAX 8 - -/* RT_ALIGN_SIZE*/ -#define RT_ALIGN_SIZE 4 - -/* PRIORITY_MAX */ -#define RT_THREAD_PRIORITY_MAX 32 - -/* Tick per Second */ -#define RT_TICK_PER_SECOND (100) - -/* SECTION: RT_DEBUG */ -/* Thread Debug */ -#define RT_DEBUG -#define RT_THREAD_DEBUG - -#define RT_USING_OVERFLOW_CHECK - -/* Using Hook */ -#define RT_USING_HOOK - -/* Using Software Timer */ -/* #define RT_USING_TIMER_SOFT */ -#define RT_TIMER_THREAD_PRIO 4 -#define RT_TIMER_THREAD_STACK_SIZE 512 -#define RT_TIMER_TICK_PER_SECOND 10 - -//#define RT_PRINTF_LONGLONG - -/* SECTION: IPC */ -/* Using Semaphore*/ -#define RT_USING_SEMAPHORE - -/* Using Mutex */ -#define RT_USING_MUTEX - -/* Using Event */ -#define RT_USING_EVENT - -/* Using MailBox */ -#define RT_USING_MAILBOX - -/* Using Message Queue */ -#define RT_USING_MESSAGEQUEUE - -/* SECTION: Memory Management */ -/* Using Memory Pool Management*/ -//#define RT_USING_MEMPOOL - -/* Using Dynamic Heap Management */ -#define RT_USING_HEAP - -/* Using Small MM */ -#define RT_USING_SMALL_MEM - -// -#define RT_USING_COMPONENTS_INIT - -/* SECTION: Device System */ -/* Using Device System */ -#define RT_USING_DEVICE -// -#define RT_USING_DEVICE_IPC -// -#define RT_USING_SERIAL - -/* SECTION: Console options */ -#define RT_USING_CONSOLE -//#define RT_KPRINTF -/* the buffer size of console*/ -#define RT_CONSOLEBUF_SIZE 260 -// -#define RT_CONSOLE_DEVICE_NAME "uart02" - -/* SECTION: finsh, a C-Express shell */ -#define RT_USING_FINSH -/* Using symbol table */ -#define FINSH_USING_SYMTAB -#define FINSH_USING_DESCRIPTION - -/* SECTION: MSH, a bash shell */ -#define FINSH_USING_MSH -#define FINSH_USING_MSH_DEFAULT - -/* SECTION: MXCLI, modified base-on MSH */ -//#define FINSH_USING_MXCLI - -/* SECTION: device filesystem */ -//#define RT_USING_DFS -//#define DFS_USING_WORKDIR -//#define RT_USING_DFS_DEVFS - -//#define RT_USING_DFS_JFFS2 -/* Reentrancy (thread safe) of the FatFs module. */ -#define RT_DFS_ELM_REENTRANT -/* Number of volumes (logical drives) to be used. */ -#define RT_DFS_ELM_DRIVES 2 -/* #define RT_DFS_ELM_USE_LFN 1 */ -/* #define RT_DFS_ELM_CODE_PAGE 936 */ -#define RT_DFS_ELM_MAX_LFN 255 -/* Maximum sector size to be handled. */ -#define RT_DFS_ELM_MAX_SECTOR_SIZE 512 - -/* the max number of mounted filesystem */ -#define DFS_FILESYSTEMS_MAX 2 -/* the max number of opened files */ -#define DFS_FD_MAX 4 - -/* SECTION: lwip, a lighwight TCP/IP protocol stack */ -/* #define RT_USING_LWIP */ -/* LwIP uses RT-Thread Memory Management */ -#define RT_LWIP_USING_RT_MEM -/* Enable ICMP protocol*/ -#define RT_LWIP_ICMP -/* Enable UDP protocol*/ -#define RT_LWIP_UDP -/* Enable TCP protocol*/ -#define RT_LWIP_TCP -/* Enable DNS */ -#define RT_LWIP_DNS - -/* the number of simulatenously active TCP connections*/ -#define RT_LWIP_TCP_PCB_NUM 5 - -/* Using DHCP */ -/* #define RT_LWIP_DHCP */ - -/* ip address of target*/ -#define RT_LWIP_IPADDR0 192 -#define RT_LWIP_IPADDR1 168 -#define RT_LWIP_IPADDR2 1 -#define RT_LWIP_IPADDR3 30 - -/* gateway address of target*/ -#define RT_LWIP_GWADDR0 192 -#define RT_LWIP_GWADDR1 168 -#define RT_LWIP_GWADDR2 1 -#define RT_LWIP_GWADDR3 1 - -/* mask address of target*/ -#define RT_LWIP_MSKADDR0 255 -#define RT_LWIP_MSKADDR1 255 -#define RT_LWIP_MSKADDR2 255 -#define RT_LWIP_MSKADDR3 0 - -/* tcp thread options */ -#define RT_LWIP_TCPTHREAD_PRIORITY 12 -#define RT_LWIP_TCPTHREAD_MBOX_SIZE 10 -#define RT_LWIP_TCPTHREAD_STACKSIZE 1024 - -/* ethernet if thread options */ -#define RT_LWIP_ETHTHREAD_PRIORITY 15 -#define RT_LWIP_ETHTHREAD_MBOX_SIZE 10 -#define RT_LWIP_ETHTHREAD_STACKSIZE 512 - -/* TCP sender buffer space */ -#define RT_LWIP_TCP_SND_BUF 8192 -/* TCP receive window. */ -#define RT_LWIP_TCP_WND 8192 - -/* SECTION: RT-Thread/GUI */ -/* #define RT_USING_RTGUI */ - -/* name length of RTGUI object */ -#define RTGUI_NAME_MAX 12 -/* support 16 weight font */ -#define RTGUI_USING_FONT16 -/* support Chinese font */ -#define RTGUI_USING_FONTHZ -/* use DFS as file interface */ -#define RTGUI_USING_DFS_FILERW -/* use font file as Chinese font */ -#define RTGUI_USING_HZ_FILE -/* use Chinese bitmap font */ -#define RTGUI_USING_HZ_BMP -/* use small size in RTGUI */ -#define RTGUI_USING_SMALL_SIZE -/* use mouse cursor */ -/* #define RTGUI_USING_MOUSE_CURSOR */ -/* default font size in RTGUI */ -#define RTGUI_DEFAULT_FONT_SIZE 16 - -/* image support */ -/* #define RTGUI_IMAGE_XPM */ -/* #define RTGUI_IMAGE_BMP */ - -// -// #define RT_USING_CMSIS_OS -// -#define RT_USING_RTT_CMSIS -// -// #define RT_USING_BSP_CMSIS - -#endif +/* RT-Thread config file */ +#ifndef __RTTHREAD_CFG_H__ +#define __RTTHREAD_CFG_H__ + +/* RT_NAME_MAX*/ +#define RT_NAME_MAX 8 + +/* RT_ALIGN_SIZE*/ +#define RT_ALIGN_SIZE 4 + +/* PRIORITY_MAX */ +#define RT_THREAD_PRIORITY_MAX 32 + +/* Tick per Second */ +#define RT_TICK_PER_SECOND (100) + +/* SECTION: RT_DEBUG */ +/* Thread Debug */ +#define RT_DEBUG +#define RT_THREAD_DEBUG + +#define RT_USING_OVERFLOW_CHECK + +/* Using Hook */ +#define RT_USING_HOOK + +/* Using Software Timer */ +/* #define RT_USING_TIMER_SOFT */ +#define RT_TIMER_THREAD_PRIO 4 +#define RT_TIMER_THREAD_STACK_SIZE 512 +#define RT_TIMER_TICK_PER_SECOND 10 + +//#define RT_PRINTF_LONGLONG + +/* SECTION: IPC */ +/* Using Semaphore*/ +#define RT_USING_SEMAPHORE + +/* Using Mutex */ +#define RT_USING_MUTEX + +/* Using Event */ +#define RT_USING_EVENT + +/* Using MailBox */ +#define RT_USING_MAILBOX + +/* Using Message Queue */ +#define RT_USING_MESSAGEQUEUE + +/* SECTION: Memory Management */ +/* Using Memory Pool Management*/ +//#define RT_USING_MEMPOOL + +/* Using Dynamic Heap Management */ +#define RT_USING_HEAP + +/* Using Small MM */ +#define RT_USING_SMALL_MEM + +// +#define RT_USING_COMPONENTS_INIT + +/* SECTION: Device System */ +/* Using Device System */ +#define RT_USING_DEVICE +// +#define RT_USING_DEVICE_IPC +// +#define RT_USING_SERIAL + +/* SECTION: Console options */ +#define RT_USING_CONSOLE +//#define RT_KPRINTF +/* the buffer size of console*/ +#define RT_CONSOLEBUF_SIZE 260 +// +#define RT_CONSOLE_DEVICE_NAME "uart02" + +/* SECTION: finsh, a C-Express shell */ +#define RT_USING_FINSH +/* Using symbol table */ +#define FINSH_USING_SYMTAB +#define FINSH_USING_DESCRIPTION + +/* SECTION: MSH, a bash shell */ +#define FINSH_USING_MSH +#define FINSH_USING_MSH_DEFAULT + +/* SECTION: MXCLI, modified base-on MSH */ +//#define FINSH_USING_MXCLI + +/* SECTION: device filesystem */ +//#define RT_USING_DFS +//#define DFS_USING_WORKDIR +//#define RT_USING_DFS_DEVFS + +//#define RT_USING_DFS_JFFS2 +/* Reentrancy (thread safe) of the FatFs module. */ +#define RT_DFS_ELM_REENTRANT +/* Number of volumes (logical drives) to be used. */ +#define RT_DFS_ELM_DRIVES 2 +/* #define RT_DFS_ELM_USE_LFN 1 */ +/* #define RT_DFS_ELM_CODE_PAGE 936 */ +#define RT_DFS_ELM_MAX_LFN 255 +/* Maximum sector size to be handled. */ +#define RT_DFS_ELM_MAX_SECTOR_SIZE 512 + +/* the max number of mounted filesystem */ +#define DFS_FILESYSTEMS_MAX 2 +/* the max number of opened files */ +#define DFS_FD_MAX 4 + +/* SECTION: lwip, a lighwight TCP/IP protocol stack */ +/* #define RT_USING_LWIP */ +/* LwIP uses RT-Thread Memory Management */ +#define RT_LWIP_USING_RT_MEM +/* Enable ICMP protocol*/ +#define RT_LWIP_ICMP +/* Enable UDP protocol*/ +#define RT_LWIP_UDP +/* Enable TCP protocol*/ +#define RT_LWIP_TCP +/* Enable DNS */ +#define RT_LWIP_DNS + +/* the number of simulatenously active TCP connections*/ +#define RT_LWIP_TCP_PCB_NUM 5 + +/* Using DHCP */ +/* #define RT_LWIP_DHCP */ + +/* ip address of target*/ +#define RT_LWIP_IPADDR0 192 +#define RT_LWIP_IPADDR1 168 +#define RT_LWIP_IPADDR2 1 +#define RT_LWIP_IPADDR3 30 + +/* gateway address of target*/ +#define RT_LWIP_GWADDR0 192 +#define RT_LWIP_GWADDR1 168 +#define RT_LWIP_GWADDR2 1 +#define RT_LWIP_GWADDR3 1 + +/* mask address of target*/ +#define RT_LWIP_MSKADDR0 255 +#define RT_LWIP_MSKADDR1 255 +#define RT_LWIP_MSKADDR2 255 +#define RT_LWIP_MSKADDR3 0 + +/* tcp thread options */ +#define RT_LWIP_TCPTHREAD_PRIORITY 12 +#define RT_LWIP_TCPTHREAD_MBOX_SIZE 10 +#define RT_LWIP_TCPTHREAD_STACKSIZE 1024 + +/* ethernet if thread options */ +#define RT_LWIP_ETHTHREAD_PRIORITY 15 +#define RT_LWIP_ETHTHREAD_MBOX_SIZE 10 +#define RT_LWIP_ETHTHREAD_STACKSIZE 512 + +/* TCP sender buffer space */ +#define RT_LWIP_TCP_SND_BUF 8192 +/* TCP receive window. */ +#define RT_LWIP_TCP_WND 8192 + +/* SECTION: RT-Thread/GUI */ +/* #define RT_USING_RTGUI */ + +/* name length of RTGUI object */ +#define RTGUI_NAME_MAX 12 +/* support 16 weight font */ +#define RTGUI_USING_FONT16 +/* support Chinese font */ +#define RTGUI_USING_FONTHZ +/* use DFS as file interface */ +#define RTGUI_USING_DFS_FILERW +/* use font file as Chinese font */ +#define RTGUI_USING_HZ_FILE +/* use Chinese bitmap font */ +#define RTGUI_USING_HZ_BMP +/* use small size in RTGUI */ +#define RTGUI_USING_SMALL_SIZE +/* use mouse cursor */ +/* #define RTGUI_USING_MOUSE_CURSOR */ +/* default font size in RTGUI */ +#define RTGUI_DEFAULT_FONT_SIZE 16 + +/* image support */ +/* #define RTGUI_IMAGE_XPM */ +/* #define RTGUI_IMAGE_BMP */ + +// +// #define RT_USING_CMSIS_OS +// +#define RT_USING_RTT_CMSIS +// +// #define RT_USING_BSP_CMSIS + +#endif diff --git a/bsp/AE210P/startup.c b/bsp/AE210P/startup.c index c46085397..1891d24a8 100644 --- a/bsp/AE210P/startup.c +++ b/bsp/AE210P/startup.c @@ -1,113 +1,113 @@ -/* - * File : startup.c - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006, RT-Thread Develop Team - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://openlab.rt-thread.com/license/LICENSE - * - * Change Logs: - * Date Author Notes - * 2006-08-31 Bernard first implementation - */ - -#include -#include - -#ifdef RT_USING_COMPONENTS_INIT -#include -#endif /* RT_USING_COMPONENTS_INIT */ - -#include "board.h" - -extern int rt_application_init(void); // define in application/application.c - -#ifdef __CC_ARM -extern int Image$$RW_IRAM1$$ZI$$Limit; -#elif __ICCARM__ -#pragma section="HEAP" -#else -extern int __bss_end; -extern int _stack; -#endif - -/******************************************************************************* -* Function Name : assert_failed -* Description : Reports the name of the source file and the source line number -* where the assert error has occurred. -* Input : - file: pointer to the source file name -* - line: assert error line source number -* Output : None -* Return : None -*******************************************************************************/ -void assert_failed(char* file, int line) -{ - rt_kprintf("\n\r Wrong parameter value detected on\r\n"); - rt_kprintf(" file %s\r\n", file); - rt_kprintf(" line %d\r\n", line); - - while (1) ; -} - -/** - * This function will startup RT-Thread RTOS. - */ -void rtthread_startup(void) -{ - /* show version */ - rt_show_version(); - -#ifdef RT_USING_HEAP -#if STM32_EXT_SRAM - rt_system_heap_init((void*)STM32_EXT_SRAM_BEGIN, (void*)STM32_EXT_SRAM_END); -#else -#ifdef __CC_ARM - rt_system_heap_init((void*)&Image$$RW_IRAM1$$ZI$$Limit, (void*)MXT_IRAM_END); -#elif __ICCARM__ - rt_system_heap_init(__segment_end("HEAP"), (void*)STM32_SRAM_END); -#else - /* init memory system */ - rt_system_heap_init((void *)0x00250000, (void *)0x00280000); -#endif -#endif /* STM32_EXT_SRAM */ -#endif /* RT_USING_HEAP */ - -#ifdef RT_USING_COMPONENTS_INIT - rt_components_board_init(); -#endif - - /* init scheduler system */ - rt_system_scheduler_init(); - - /* initialize timer */ - rt_system_timer_init(); - - /* init timer thread */ - rt_system_timer_thread_init(); - - /* init application */ - rt_application_init(); - - /* init idle thread */ - rt_thread_idle_init(); - - /* start scheduler */ - rt_system_scheduler_start(); - - /* never reach here */ - return ; -} - -//int main(void) -//{ -// /* disable interrupt first */ -// rt_hw_interrupt_disable(); -// -// /* startup RT-Thread RTOS */ -// rtthread_startup(); -// -// return 0; -//} - -/*@}*/ +/* + * File : startup.c + * This file is part of RT-Thread RTOS + * COPYRIGHT (C) 2006, RT-Thread Develop Team + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://openlab.rt-thread.com/license/LICENSE + * + * Change Logs: + * Date Author Notes + * 2006-08-31 Bernard first implementation + */ + +#include +#include + +#ifdef RT_USING_COMPONENTS_INIT +#include +#endif /* RT_USING_COMPONENTS_INIT */ + +#include "board.h" + +extern int rt_application_init(void); // define in application/application.c + +#ifdef __CC_ARM +extern int Image$$RW_IRAM1$$ZI$$Limit; +#elif __ICCARM__ +#pragma section="HEAP" +#else +extern int __bss_end; +extern int _stack; +#endif + +/******************************************************************************* +* Function Name : assert_failed +* Description : Reports the name of the source file and the source line number +* where the assert error has occurred. +* Input : - file: pointer to the source file name +* - line: assert error line source number +* Output : None +* Return : None +*******************************************************************************/ +void assert_failed(char* file, int line) +{ + rt_kprintf("\n\r Wrong parameter value detected on\r\n"); + rt_kprintf(" file %s\r\n", file); + rt_kprintf(" line %d\r\n", line); + + while (1) ; +} + +/** + * This function will startup RT-Thread RTOS. + */ +void rtthread_startup(void) +{ + /* show version */ + rt_show_version(); + +#ifdef RT_USING_HEAP +#if STM32_EXT_SRAM + rt_system_heap_init((void*)STM32_EXT_SRAM_BEGIN, (void*)STM32_EXT_SRAM_END); +#else +#ifdef __CC_ARM + rt_system_heap_init((void*)&Image$$RW_IRAM1$$ZI$$Limit, (void*)MXT_IRAM_END); +#elif __ICCARM__ + rt_system_heap_init(__segment_end("HEAP"), (void*)STM32_SRAM_END); +#else + /* init memory system */ + rt_system_heap_init((void *)0x00250000, (void *)0x00280000); +#endif +#endif /* STM32_EXT_SRAM */ +#endif /* RT_USING_HEAP */ + +#ifdef RT_USING_COMPONENTS_INIT + rt_components_board_init(); +#endif + + /* init scheduler system */ + rt_system_scheduler_init(); + + /* initialize timer */ + rt_system_timer_init(); + + /* init timer thread */ + rt_system_timer_thread_init(); + + /* init application */ + rt_application_init(); + + /* init idle thread */ + rt_thread_idle_init(); + + /* start scheduler */ + rt_system_scheduler_start(); + + /* never reach here */ + return ; +} + +//int main(void) +//{ +// /* disable interrupt first */ +// rt_hw_interrupt_disable(); +// +// /* startup RT-Thread RTOS */ +// rtthread_startup(); +// +// return 0; +//} + +/*@}*/ diff --git a/bsp/lpc54608-LPCXpresso/LPC54608J512_flash.icf b/bsp/lpc54608-LPCXpresso/LPC54608J512_flash.icf new file mode 100644 index 000000000..e508e859f --- /dev/null +++ b/bsp/lpc54608-LPCXpresso/LPC54608J512_flash.icf @@ -0,0 +1,122 @@ +/* +** ################################################################### +** Processors: LPC54608J512BD208 +** LPC54608J512ET180 +** +** Compiler: IAR ANSI C/C++ Compiler for ARM +** Reference manual: LPC54S60x/LPC5460x User manual Rev.0.9 7 Nov 2016 +** Version: rev. 1.1, 2016-11-25 +** Build: b161227 +** +** Abstract: +** Linker file for the IAR ANSI C/C++ Compiler for ARM +** +** Copyright (c) 2016 Freescale Semiconductor, Inc. +** Copyright 2016 - 2017 NXP +** Redistribution and use in source and binary forms, with or without modification, +** are permitted provided that the following conditions are met: +** +** o Redistributions of source code must retain the above copyright notice, this list +** of conditions and the following disclaimer. +** +** o Redistributions in binary form must reproduce the above copyright notice, this +** list of conditions and the following disclaimer in the documentation and/or +** other materials provided with the distribution. +** +** o Neither the name of the copyright holder nor the names of its +** contributors may be used to endorse or promote products derived from this +** software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +** ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +** +** http: www.nxp.com +** mail: support@nxp.com +** +** ################################################################### +*/ + +define symbol __ram_vector_table_size__ = isdefinedsymbol(__ram_vector_table__) ? 0x00000400 : 0; +define symbol __ram_vector_table_offset__ = isdefinedsymbol(__ram_vector_table__) ? 0x000003FF : 0; + +define symbol m_interrupts_start = 0x00000000; +define symbol m_interrupts_end = 0x000003FF; + +define symbol m_text_start = 0x00000400; +define symbol m_text_end = 0x0007FFFF; + +define symbol m_interrupts_ram_start = 0x20000000; +define symbol m_interrupts_ram_end = 0x20000000 + __ram_vector_table_offset__; + +define symbol m_data_start = m_interrupts_ram_start + __ram_vector_table_size__; +define symbol m_data_end = 0x20027FFF; + +define symbol m_usb_sram_start = 0x40100000; +define symbol m_usb_sram_end = 0x40101FFF; + +/* USB BDT size */ +define symbol usb_bdt_size = 0x0; +/* Sizes */ +if (isdefinedsymbol(__stack_size__)) { + define symbol __size_cstack__ = __stack_size__; +} else { + define symbol __size_cstack__ = 0x0400; +} + +if (isdefinedsymbol(__heap_size__)) { + define symbol __size_heap__ = __heap_size__; +} else { + define symbol __size_heap__ = 0x0400; +} + +define exported symbol __VECTOR_TABLE = m_interrupts_start; +define exported symbol __VECTOR_RAM = isdefinedsymbol(__ram_vector_table__) ? m_interrupts_ram_start : m_interrupts_start; +define exported symbol __RAM_VECTOR_TABLE_SIZE = __ram_vector_table_size__; + +define memory mem with size = 4G; +define region TEXT_region = mem:[from m_interrupts_start to m_interrupts_end] + | mem:[from m_text_start to m_text_end]; +define region DATA_region = mem:[from m_data_start to m_data_end-__size_cstack__]; +define region CSTACK_region = mem:[from m_data_end-__size_cstack__+1 to m_data_end]; +define region m_interrupts_ram_region = mem:[from m_interrupts_ram_start to m_interrupts_ram_end]; + +define block CSTACK with alignment = 8, size = __size_cstack__ { }; +define block HEAP with alignment = 8, size = __size_heap__ { }; +define block RW { readwrite }; +define block ZI { zi }; +define block RTT_INIT_FUNC with fixed order { readonly section .rti_fn* }; + +/* regions for USB */ +define region USB_BDT_region = mem:[from m_usb_sram_start to m_usb_sram_start + usb_bdt_size - 1]; +define region USB_SRAM_region = mem:[from m_usb_sram_start + usb_bdt_size to m_usb_sram_end]; +place in USB_BDT_region { section m_usb_bdt }; +place in USB_SRAM_region { section m_usb_global }; + +initialize by copy { readwrite, section .textrw }; + +if (isdefinedsymbol(__USE_DLIB_PERTHREAD)) +{ + /* Required in a multi-threaded application */ + initialize by copy with packing = none { section __DLIB_PERTHREAD }; +} + +do not initialize { section .noinit, section m_usb_bdt, section m_usb_global }; + +keep { section FSymTab }; +keep { section VSymTab }; +keep { section .rti_fn* }; +keep { section RTMSymTab }; + +place at address mem: m_interrupts_start { readonly section .intvec }; +place in TEXT_region { readonly, block RTT_INIT_FUNC }; +place in DATA_region { block RW , block ZI, block CSTACK, last block HEAP}; +place in m_interrupts_ram_region { section m_interrupts_ram }; + diff --git a/bsp/lpc54608-LPCXpresso/applications/SConscript b/bsp/lpc54608-LPCXpresso/applications/SConscript index 01eb940df..ce2232217 100644 --- a/bsp/lpc54608-LPCXpresso/applications/SConscript +++ b/bsp/lpc54608-LPCXpresso/applications/SConscript @@ -6,6 +6,12 @@ cwd = os.path.join(str(Dir('#')), 'applications') src = Glob('*.c') CPPPATH = [cwd, str(Dir('#'))] -group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH) +# add for startup script +if rtconfig.CROSS_TOOL == 'iar': + CPPDEFINES = ['_TIMESPEC_DEFINED'] +else: + CPPDEFINES = [] + +group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES=CPPDEFINES) Return('group') diff --git a/bsp/lpc54608-LPCXpresso/applications/startup.c b/bsp/lpc54608-LPCXpresso/applications/startup.c index 8dc848e69..1015c5ae2 100644 --- a/bsp/lpc54608-LPCXpresso/applications/startup.c +++ b/bsp/lpc54608-LPCXpresso/applications/startup.c @@ -41,7 +41,7 @@ void rtthread_startup(void) rt_show_version(); #ifdef RT_USING_HEAP -#if LPC_EXT_SDRAM +#ifdef BSP_DRV_SDRAM rt_kprintf(" heap: [0x%08x - 0x%08x]\n", LPC_EXT_SDRAM_BEGIN, LPC_EXT_SDRAM_END); rt_system_heap_init((void *)LPC_EXT_SDRAM_BEGIN, (void *)LPC_EXT_SDRAM_END); sram_init(); diff --git a/bsp/lpc54608-LPCXpresso/drivers/drt_mpu.c b/bsp/lpc54608-LPCXpresso/drivers/drt_mpu.c new file mode 100644 index 000000000..e587948ca --- /dev/null +++ b/bsp/lpc54608-LPCXpresso/drivers/drt_mpu.c @@ -0,0 +1,93 @@ +/* + * File : application.c + * COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Change Logs: + * Date Author Notes + * 2017-11-14 Tanek porting from stm32f429-apollo + */ + +#include +#include + +#include + +#define DEBUG + +#ifdef DEBUG +#define MPU_PRINT(...) rt_kprintf(__VA_ARGS__) +#else +#define MPU_PRINT((...)) +#endif + +/* initialize for gui driver */ +int rt_hw_mpu_init(void) +{ + uint32_t rbar; + uint32_t rasr; + + MPU_PRINT("\nnumber of regions: %d\n", (MPU->TYPE & MPU_TYPE_DREGION_Msk) >> MPU_TYPE_DREGION_Pos); + + /* Disable MPU */ + ARM_MPU_Disable(); + + /* - Region 0: 0x00000000 - 0x0007FFFF --- on-chip non-volatile memory + * + Size: 512kB + * + Acess permission: full access + */ + rbar = ARM_MPU_RBAR(0, 0x00000000); + rasr = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_512KB); + ARM_MPU_SetRegion(rbar, rasr); + + /* - Region 1:0x20000000 - 0x20027FFF --- on chip SRAM + * + Size: 160kB + * + Access permission: full access + */ + rbar = ARM_MPU_RBAR(1, 0x20000000); + rasr = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_256KB); + ARM_MPU_SetRegion(rbar, rasr); + + /* - Region 2: 0x40000000 - 0x43FFFFFF --- APB peripheral + * + Size: 64MB + * + Access permission: full access + */ + rbar = ARM_MPU_RBAR(2, 0x40000000); + rasr = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_64MB); + ARM_MPU_SetRegion(rbar, rasr); + + /* - Region 3: 0xA0000000 - 0xA0800000 --- External SDRAM + * + Size: 8MB + * + AP=b011: full access + */ + rbar = ARM_MPU_RBAR(3, 0xA0000000); + rasr = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_8MB); + ARM_MPU_SetRegion(rbar, rasr); + + /* - Region 4: 0xE0000000 - 0xE00FFFFF --- System control + * + Size: 1MB + * + Access permission: full access + */ + rbar = ARM_MPU_RBAR(4, 0xE0000000); + rasr = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_1MB); + ARM_MPU_SetRegion(rbar, rasr); + + ARM_MPU_Enable(MPU_CTRL_PRIVDEFENA_Msk); + + return 0; +} +INIT_BOARD_EXPORT(rt_hw_mpu_init); + diff --git a/bsp/lpc54608-LPCXpresso/drivers/drt_mpu.h b/bsp/lpc54608-LPCXpresso/drivers/drt_mpu.h new file mode 100644 index 000000000..5f38ae2eb --- /dev/null +++ b/bsp/lpc54608-LPCXpresso/drivers/drt_mpu.h @@ -0,0 +1,29 @@ +/* + * File : application.c + * COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Change Logs: + * Date Author Notes + * 2017-11-14 Tanek the first version + */ + +#ifndef __DRV_MPU_H__ +#define __DRV_MPU_H__ + +void rt_hw_mpu_init(void); + +#endif diff --git a/bsp/lpc54608-LPCXpresso/drivers/drv_sram.c b/bsp/lpc54608-LPCXpresso/drivers/drv_sram.c index d09d04c91..fb3266b2c 100644 --- a/bsp/lpc54608-LPCXpresso/drivers/drv_sram.c +++ b/bsp/lpc54608-LPCXpresso/drivers/drv_sram.c @@ -17,7 +17,7 @@ #include -#if LPC_EXT_SDRAM +#ifdef BSP_DRV_SDRAM struct rt_memheap system_heap; void sram_init(void) diff --git a/bsp/lpc54608-LPCXpresso/project.ewd b/bsp/lpc54608-LPCXpresso/project.ewd new file mode 100644 index 000000000..2c88b00f9 --- /dev/null +++ b/bsp/lpc54608-LPCXpresso/project.ewd @@ -0,0 +1,2818 @@ + + + 3 + + Debug + + ARM + + 1 + + C-SPY + 2 + + 28 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + CADI_ID + 2 + + 0 + 1 + 1 + + + + + + + + + CMSISDAP_ID + 2 + + 4 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IJET_ID + 2 + + 8 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + PEMICRO_ID + 2 + + 3 + 1 + 1 + + + + + + + + STLINK_ID + 2 + + 4 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + TIFET_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + XDS100_ID + 2 + + 6 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Mbed\MbedArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + Release + + ARM + + 0 + + C-SPY + 2 + + 28 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 0 + + + + + + + + CADI_ID + 2 + + 0 + 1 + 0 + + + + + + + + + CMSISDAP_ID + 2 + + 4 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 0 + + + + + + + + + + + IJET_ID + 2 + + 8 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 16 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 0 + + + + + + + + + + PEMICRO_ID + 2 + + 3 + 1 + 0 + + + + + + + + STLINK_ID + 2 + + 4 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 0 + + + + + + + + TIFET_ID + 2 + + 1 + 1 + 0 + + + + + + + + + + + + + + + + + + + XDS100_ID + 2 + + 6 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Mbed\MbedArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + diff --git a/bsp/lpc54608-LPCXpresso/project.ewt b/bsp/lpc54608-LPCXpresso/project.ewt new file mode 100644 index 000000000..de78292e6 --- /dev/null +++ b/bsp/lpc54608-LPCXpresso/project.ewt @@ -0,0 +1,2925 @@ + + + 3 + + Debug + + ARM + + 1 + + C-STAT + 260 + + 260 + + 0 + + 1 + 600 + 0 + 2 + 0 + 1 + 100 + + + 1.4.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Release + + ARM + + 0 + + C-STAT + 260 + + 260 + + 0 + + 1 + 600 + 0 + 2 + 0 + 1 + 100 + + + 1.4.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + Applications + + $PROJ_DIR$\applications\application.c + + + $PROJ_DIR$\applications\mnt.c + + + $PROJ_DIR$\applications\startup.c + + + + CMSIS + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\iar\startup_LPC54608.s + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\system_LPC54608.c + + + + CORTEX-M4 + + $PROJ_DIR$\..\..\libcpu\arm\common\backtrace.c + + + $PROJ_DIR$\..\..\libcpu\arm\cortex-m4\context_iar.S + + + $PROJ_DIR$\..\..\libcpu\arm\cortex-m4\cpuport.c + + + $PROJ_DIR$\..\..\libcpu\arm\common\div0.c + + + $PROJ_DIR$\..\..\libcpu\arm\common\showmem.c + + + + CPlusPlus + + $PROJ_DIR$\..\..\components\cplusplus\crt.cpp + + + $PROJ_DIR$\..\..\components\cplusplus\crt_init.c + + + $PROJ_DIR$\..\..\components\cplusplus\Mutex.cpp + + + $PROJ_DIR$\..\..\components\cplusplus\Semaphore.cpp + + + $PROJ_DIR$\..\..\components\cplusplus\Thread.cpp + + + + DeviceDrivers + + $PROJ_DIR$\..\..\components\drivers\sdio\block_dev.c + + + $PROJ_DIR$\..\..\components\drivers\src\completion.c + + + $PROJ_DIR$\..\..\components\drivers\src\dataqueue.c + + + $PROJ_DIR$\..\..\components\drivers\spi\enc28j60.c + + + $PROJ_DIR$\..\..\components\drivers\i2c\i2c-bit-ops.c + + + $PROJ_DIR$\..\..\components\drivers\i2c\i2c_core.c + + + $PROJ_DIR$\..\..\components\drivers\i2c\i2c_dev.c + + + $PROJ_DIR$\..\..\components\drivers\sdio\mmc.c + + + $PROJ_DIR$\..\..\components\drivers\sdio\mmcsd_core.c + + + $PROJ_DIR$\..\..\components\drivers\mtd\mtd_nand.c + + + $PROJ_DIR$\..\..\components\drivers\misc\pin.c + + + $PROJ_DIR$\..\..\components\drivers\src\pipe.c + + + $PROJ_DIR$\..\..\components\drivers\src\ringbuffer.c + + + $PROJ_DIR$\..\..\components\drivers\rtc\rtc.c + + + $PROJ_DIR$\..\..\components\drivers\sdio\sd.c + + + $PROJ_DIR$\..\..\components\drivers\sdio\sdio.c + + + $PROJ_DIR$\..\..\components\drivers\serial\serial.c + + + $PROJ_DIR$\..\..\components\drivers\spi\spi_core.c + + + $PROJ_DIR$\..\..\components\drivers\spi\spi_dev.c + + + $PROJ_DIR$\..\..\components\drivers\src\waitqueue.c + + + $PROJ_DIR$\..\..\components\drivers\src\workqueue.c + + + + dlib + + $PROJ_DIR$\..\..\components\libc\compilers\dlib\environ.c + + + $PROJ_DIR$\..\..\components\libc\compilers\dlib\libc.c + + + $PROJ_DIR$\..\..\components\libc\compilers\dlib\rmtx.c + + + $PROJ_DIR$\..\..\components\libc\compilers\dlib\stdio.c + + + $PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_close.c + + + $PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_lseek.c + + + $PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_mem.c + + + $PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_open.c + + + $PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_read.c + + + $PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_remove.c + + + $PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_write.c + + + + Drivers + + $PROJ_DIR$\drivers\board.c + + + $PROJ_DIR$\drivers\clock_config.c + + + $PROJ_DIR$\drivers\drt_mpu.c + + + $PROJ_DIR$\drivers\drv_emac.c + + + $PROJ_DIR$\drivers\drv_ft5406.c + + + $PROJ_DIR$\drivers\drv_i2c.c + + + $PROJ_DIR$\drivers\drv_lcd.c + + + $PROJ_DIR$\drivers\drv_sd.c + + + $PROJ_DIR$\drivers\drv_sdram.c + + + $PROJ_DIR$\drivers\drv_sram.c + + + $PROJ_DIR$\drivers\drv_uart.c + + + $PROJ_DIR$\drivers\fsl_phy.c + + + + Filesystem + + $PROJ_DIR$\..\..\components\dfs\src\dfs.c + + + $PROJ_DIR$\..\..\components\dfs\filesystems\elmfat\dfs_elm.c + + + $PROJ_DIR$\..\..\components\dfs\src\dfs_file.c + + + $PROJ_DIR$\..\..\components\dfs\src\dfs_fs.c + + + $PROJ_DIR$\..\..\components\dfs\src\dfs_posix.c + + + $PROJ_DIR$\..\..\components\dfs\filesystems\elmfat\ff.c + + + + finsh + + $PROJ_DIR$\..\..\components\finsh\cmd.c + + + $PROJ_DIR$\..\..\components\finsh\finsh_compiler.c + + + $PROJ_DIR$\..\..\components\finsh\finsh_error.c + + + $PROJ_DIR$\..\..\components\finsh\finsh_heap.c + + + $PROJ_DIR$\..\..\components\finsh\finsh_init.c + + + $PROJ_DIR$\..\..\components\finsh\finsh_node.c + + + $PROJ_DIR$\..\..\components\finsh\finsh_ops.c + + + $PROJ_DIR$\..\..\components\finsh\finsh_parser.c + + + $PROJ_DIR$\..\..\components\finsh\finsh_token.c + + + $PROJ_DIR$\..\..\components\finsh\finsh_var.c + + + $PROJ_DIR$\..\..\components\finsh\finsh_vm.c + + + $PROJ_DIR$\..\..\components\finsh\msh.c + + + $PROJ_DIR$\..\..\components\finsh\msh_cmd.c + + + $PROJ_DIR$\..\..\components\finsh\msh_file.c + + + $PROJ_DIR$\..\..\components\finsh\shell.c + + + $PROJ_DIR$\..\..\components\finsh\symbol.c + + + + Kernel + + $PROJ_DIR$\..\..\src\clock.c + + + $PROJ_DIR$\..\..\src\components.c + + + $PROJ_DIR$\..\..\src\device.c + + + $PROJ_DIR$\..\..\src\idle.c + + + $PROJ_DIR$\..\..\src\ipc.c + + + $PROJ_DIR$\..\..\src\irq.c + + + $PROJ_DIR$\..\..\src\kservice.c + + + $PROJ_DIR$\..\..\src\mem.c + + + $PROJ_DIR$\..\..\src\memheap.c + + + $PROJ_DIR$\..\..\src\mempool.c + + + $PROJ_DIR$\..\..\src\module.c + + + $PROJ_DIR$\..\..\src\object.c + + + $PROJ_DIR$\..\..\src\scheduler.c + + + $PROJ_DIR$\..\..\src\signal.c + + + $PROJ_DIR$\..\..\src\thread.c + + + $PROJ_DIR$\..\..\src\timer.c + + + + Libraries + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_adc.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_clock.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_common.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_crc.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_ctimer.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\utilities\fsl_debug_console.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_dma.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_dmic.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_dmic_dma.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_eeprom.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_emc.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_enet.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_flashiap.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_flexcomm.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_fmc.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_fmeas.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_gint.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_gpio.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\sdmmc_2.1.2\src\fsl_host.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_i2c.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_i2c_dma.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_i2s.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_i2s_dma.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_inputmux.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_lcdc.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_mcan.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_mrt.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_pint.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_power.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_reset.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_rit.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_rtc.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_sctimer.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\sdmmc_2.1.2\src\fsl_sd.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\sdmmc_2.1.2\src\fsl_sd_event.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_sdif.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\sdmmc_2.1.2\src\fsl_sdmmc.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_spi.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_spi_dma.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_spifi.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_spifi_dma.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_usart.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_usart_dma.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_utick.c + + + $PROJ_DIR$\SDK_2.2_LPCXpresso54608\devices\LPC54608\drivers\fsl_wwdt.c + + + + lwIP + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\api\api_lib.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\api\api_msg.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\ipv4\autoip.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\def.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\ipv4\dhcp.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\dns.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\api\err.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\ipv4\etharp.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\netif\ethernet.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\netif\ethernetif.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\ipv4\icmp.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\ipv4\igmp.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\inet_chksum.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\init.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\ip.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\ipv4\ip4.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\ipv4\ip4_addr.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\ipv4\ip4_frag.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\netif\lowpan6.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\memp.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\api\netbuf.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\api\netdb.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\netif.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\api\netifapi.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\pbuf.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\raw.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\api\sockets.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\stats.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\sys.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\arch\sys_arch.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\tcp.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\tcp_in.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\tcp_out.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\api\tcpip.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\timeouts.c + + + $PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\udp.c + + + + pthreads + + $PROJ_DIR$\..\..\components\libc\pthreads\clock_time.c + + + $PROJ_DIR$\..\..\components\libc\pthreads\mqueue.c + + + $PROJ_DIR$\..\..\components\libc\pthreads\pthread.c + + + $PROJ_DIR$\..\..\components\libc\pthreads\pthread_attr.c + + + $PROJ_DIR$\..\..\components\libc\pthreads\pthread_barrier.c + + + $PROJ_DIR$\..\..\components\libc\pthreads\pthread_cond.c + + + $PROJ_DIR$\..\..\components\libc\pthreads\pthread_mutex.c + + + $PROJ_DIR$\..\..\components\libc\pthreads\pthread_rwlock.c + + + $PROJ_DIR$\..\..\components\libc\pthreads\pthread_spin.c + + + $PROJ_DIR$\..\..\components\libc\pthreads\pthread_tls.c + + + $PROJ_DIR$\..\..\components\libc\pthreads\sched.c + + + $PROJ_DIR$\..\..\components\libc\pthreads\semaphore.c + + + diff --git a/bsp/lpc54608-LPCXpresso/template.ewp b/bsp/lpc54608-LPCXpresso/template.ewp new file mode 100644 index 000000000..90abcb415 --- /dev/null +++ b/bsp/lpc54608-LPCXpresso/template.ewp @@ -0,0 +1,1819 @@ + + + + 2 + + Debug + + ARM + + 1 + + General + 3 + + 21 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 28 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 8 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 14 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Release + + ARM + + 0 + + General + 3 + + 21 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 28 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 8 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 0 + + + + + + + + + CUSTOM + 3 + + + + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 14 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 0 + + + + + + + BILINK + 0 + + + + + +