diff --git a/bsp/lpc55sxx/Libraries/drivers/drv_uart.c b/bsp/lpc55sxx/Libraries/drivers/drv_uart.c index c9bf72eb8d..d62b676e87 100644 --- a/bsp/lpc55sxx/Libraries/drivers/drv_uart.c +++ b/bsp/lpc55sxx/Libraries/drivers/drv_uart.c @@ -135,7 +135,7 @@ static const struct lpc_uart uarts[] = kCLOCK_Flexcomm0, &serial0, - "uart", + "uart0", }, #endif #ifdef BSP_USING_UART1 diff --git a/bsp/lpc55sxx/lpc55s69_nxp_evk/.config b/bsp/lpc55sxx/lpc55s69_nxp_evk/.config index 882b4e7c2f..4e48518f54 100644 --- a/bsp/lpc55sxx/lpc55s69_nxp_evk/.config +++ b/bsp/lpc55sxx/lpc55s69_nxp_evk/.config @@ -74,7 +74,7 @@ CONFIG_RT_USING_DEVICE=y # CONFIG_RT_USING_INTERRUPT_INFO is not set CONFIG_RT_USING_CONSOLE=y CONFIG_RT_CONSOLEBUF_SIZE=128 -CONFIG_RT_CONSOLE_DEVICE_NAME="uart" +CONFIG_RT_CONSOLE_DEVICE_NAME="uart0" # CONFIG_RT_PRINTF_LONGLONG is not set CONFIG_RT_VER_NUM=0x40004 # CONFIG_RT_USING_CPU_FFS is not set @@ -117,6 +117,14 @@ CONFIG_FINSH_ARG_MAX=10 # Device virtual file system # # CONFIG_RT_USING_DFS is not set +# CONFIG_RT_DFS_ELM_USE_LFN_0 is not set +# CONFIG_RT_DFS_ELM_USE_LFN_1 is not set +# CONFIG_RT_DFS_ELM_USE_LFN_2 is not set +# CONFIG_RT_DFS_ELM_USE_LFN_3 is not set +# CONFIG_RT_DFS_ELM_LFN_UNICODE_0 is not set +# CONFIG_RT_DFS_ELM_LFN_UNICODE_1 is not set +# CONFIG_RT_DFS_ELM_LFN_UNICODE_2 is not set +# CONFIG_RT_DFS_ELM_LFN_UNICODE_3 is not set # # Device Drivers @@ -297,6 +305,9 @@ CONFIG_RT_USING_PIN=y # CONFIG_PKG_USING_AGILE_FTP is not set # CONFIG_PKG_USING_EMBEDDEDPROTO is not set # CONFIG_PKG_USING_RT_LINK_HW is not set +# CONFIG_PKG_USING_LORA_PKT_FWD is not set +# CONFIG_PKG_USING_LORA_GW_DRIVER_LIB is not set +# CONFIG_PKG_USING_LORA_PKT_SNIFFER is not set # CONFIG_PKG_USING_HM is not set # @@ -331,6 +342,13 @@ CONFIG_RT_USING_PIN=y # CONFIG_PKG_USING_NUEMWIN is not set # CONFIG_PKG_USING_MP3PLAYER is not set # CONFIG_PKG_USING_TINYJPEG is not set +# CONFIG_PKG_USING_UGUI is not set + +# +# U8G2: a monochrome graphic library +# +# CONFIG_PKG_USING_U8G2_OFFICIAL is not set +# CONFIG_PKG_USING_U8G2 is not set # # tools packages @@ -439,7 +457,6 @@ CONFIG_RT_USING_PIN=y # CONFIG_PKG_USING_AS7341 is not set # CONFIG_PKG_USING_STM32_SDIO is not set # CONFIG_PKG_USING_ICM20608 is not set -# CONFIG_PKG_USING_U8G2 is not set # CONFIG_PKG_USING_BUTTON is not set # CONFIG_PKG_USING_PCF8574 is not set # CONFIG_PKG_USING_SX12XX is not set @@ -501,6 +518,8 @@ CONFIG_RT_USING_PIN=y # CONFIG_PKG_USING_MCP23008 is not set # CONFIG_PKG_USING_BLUETRUM_SDK is not set # CONFIG_PKG_USING_MISAKA_AT24CXX is not set +# CONFIG_PKG_USING_MISAKA_RGB_BLING is not set +# CONFIG_PKG_USING_BL_MCU_SDK is not set # # AI packages diff --git a/bsp/lpc55sxx/lpc55s69_nxp_evk/applications/SConscript b/bsp/lpc55sxx/lpc55s69_nxp_evk/applications/SConscript index 6432d00362..89d07934b7 100644 --- a/bsp/lpc55sxx/lpc55s69_nxp_evk/applications/SConscript +++ b/bsp/lpc55sxx/lpc55s69_nxp_evk/applications/SConscript @@ -10,7 +10,10 @@ if rtconfig.CROSS_TOOL == 'gcc': CPPDEFINES = ['__START=entry'] else: CPPDEFINES = [] - + +if GetDepend('BSP_USING_SDIO'): + src += ['mnt.c'] + group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES=CPPDEFINES) Return('group') diff --git a/bsp/lpc55sxx/lpc55s69_nxp_evk/applications/mnt.c b/bsp/lpc55sxx/lpc55s69_nxp_evk/applications/mnt.c new file mode 100644 index 0000000000..57a6d8df72 --- /dev/null +++ b/bsp/lpc55sxx/lpc55s69_nxp_evk/applications/mnt.c @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2006-2021, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * sdio filesystem support + * Change Logs: + * Date Author Notes + * 2021-10-10 supperthomas first version + */ +#include "dfs_fs.h" +#include +#include + +#ifdef BSP_USING_SDIO + +/** + * @brief SDIO filesystem init + * @param void + * @retval 0: filesystem init success, -1: filesystem init failed + */ + +static int sdio_fs_init(void) +{ + int result = 0; + dfs_mount("sdcard0", "/", "elm", 0, 0); + return result; +} + +INIT_ENV_EXPORT(sdio_fs_init); + +#endif /* BSP_USING_SDIO */ diff --git a/bsp/lpc55sxx/lpc55s69_nxp_evk/board/Kconfig b/bsp/lpc55sxx/lpc55s69_nxp_evk/board/Kconfig index 158cad3c9a..a73ae472d7 100644 --- a/bsp/lpc55sxx/lpc55s69_nxp_evk/board/Kconfig +++ b/bsp/lpc55sxx/lpc55s69_nxp_evk/board/Kconfig @@ -135,6 +135,10 @@ menu "On-chip Peripheral Drivers" config BSP_USING_SDIO bool "Enable SDIO SD Card Interface" select RT_USING_SDIO + select RT_USING_DFS + select RT_USING_DFS_ELMFAT + select RT_USING_LIBC + select RT_LIBC_USING_TIME default y config BSP_USING_RTC diff --git a/bsp/lpc55sxx/lpc55s69_nxp_evk/board/board.c b/bsp/lpc55sxx/lpc55s69_nxp_evk/board/board.c index 0b71b508e7..f9b08f6270 100644 --- a/bsp/lpc55sxx/lpc55s69_nxp_evk/board/board.c +++ b/bsp/lpc55sxx/lpc55s69_nxp_evk/board/board.c @@ -74,7 +74,6 @@ void rt_hw_board_init() #endif //BOARD_BootClockFROHF96M(); - /* init systick 1 systick = 1/(100M / 100) 100个systick = 1s*/ SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND); /* set pend exception priority */ NVIC_SetPriority(PendSV_IRQn, (1 << __NVIC_PRIO_BITS) - 1); @@ -107,3 +106,33 @@ void MemManage_Handler(void) rt_kprintf("Memory Fault!\n"); HardFault_Handler(); } + +void rt_hw_us_delay(rt_uint32_t us) +{ + rt_uint32_t ticks; + rt_uint32_t told, tnow, tcnt = 0; + rt_uint32_t reload = SysTick->LOAD; + + ticks = us * reload / (1000000 / RT_TICK_PER_SECOND); + told = SysTick->VAL; + while (1) + { + tnow = SysTick->VAL; + if (tnow != told) + { + if (tnow < told) + { + tcnt += told - tnow; + } + else + { + tcnt += reload - tnow + told; + } + told = tnow; + if (tcnt >= ticks) + { + break; + } + } + } +} diff --git a/bsp/lpc55sxx/lpc55s69_nxp_evk/project.uvoptx b/bsp/lpc55sxx/lpc55s69_nxp_evk/project.uvoptx index df9b986715..2069450d61 100644 --- a/bsp/lpc55sxx/lpc55s69_nxp_evk/project.uvoptx +++ b/bsp/lpc55sxx/lpc55s69_nxp_evk/project.uvoptx @@ -198,7 +198,7 @@ Applications - 1 + 0 0 0 0 @@ -229,18 +229,6 @@ 0 0 0 - ..\..\..\libcpu\arm\common\backtrace.c - backtrace.c - 0 - 0 - - - 2 - 3 - 1 - 0 - 0 - 0 ..\..\..\libcpu\arm\common\showmem.c showmem.c 0 @@ -248,7 +236,7 @@ 2 - 4 + 3 1 0 0 @@ -260,19 +248,19 @@ 2 - 5 - 2 + 4 + 1 0 0 0 - ..\..\..\libcpu\arm\cortex-m4\context_rvds.S - context_rvds.S + ..\..\..\libcpu\arm\common\backtrace.c + backtrace.c 0 0 2 - 6 + 5 1 0 0 @@ -282,6 +270,18 @@ 0 0 + + 2 + 6 + 2 + 0 + 0 + 0 + ..\..\..\libcpu\arm\cortex-m4\context_rvds.S + context_rvds.S + 0 + 0 + @@ -321,30 +321,6 @@ 0 0 0 - ..\..\..\components\drivers\src\ringbuffer.c - ringbuffer.c - 0 - 0 - - - 3 - 10 - 1 - 0 - 0 - 0 - ..\..\..\components\drivers\src\ringblk_buf.c - ringblk_buf.c - 0 - 0 - - - 3 - 11 - 1 - 0 - 0 - 0 ..\..\..\components\drivers\src\waitqueue.c waitqueue.c 0 @@ -352,31 +328,7 @@ 3 - 12 - 1 - 0 - 0 - 0 - ..\..\..\components\drivers\src\pipe.c - pipe.c - 0 - 0 - - - 3 - 13 - 1 - 0 - 0 - 0 - ..\..\..\components\drivers\src\workqueue.c - workqueue.c - 0 - 0 - - - 3 - 14 + 10 1 0 0 @@ -388,7 +340,19 @@ 3 - 15 + 11 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\src\pipe.c + pipe.c + 0 + 0 + + + 3 + 12 1 0 0 @@ -398,6 +362,42 @@ 0 0 + + 3 + 13 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\src\ringbuffer.c + ringbuffer.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\src\workqueue.c + workqueue.c + 0 + 0 + + + 3 + 15 + 1 + 0 + 0 + 0 + ..\..\..\components\drivers\src\ringblk_buf.c + ringblk_buf.c + 0 + 0 + @@ -549,6 +549,18 @@ 0 0 0 + ..\..\..\src\irq.c + irq.c + 0 + 0 + + + 6 + 27 + 1 + 0 + 0 + 0 ..\..\..\src\object.c object.c 0 @@ -556,7 +568,19 @@ 6 - 27 + 28 + 1 + 0 + 0 + 0 + ..\..\..\src\kservice.c + kservice.c + 0 + 0 + + + 6 + 29 1 0 0 @@ -566,30 +590,6 @@ 0 0 - - 6 - 28 - 1 - 0 - 0 - 0 - ..\..\..\src\thread.c - thread.c - 0 - 0 - - - 6 - 29 - 1 - 0 - 0 - 0 - ..\..\..\src\device.c - device.c - 0 - 0 - 6 30 @@ -597,8 +597,8 @@ 0 0 0 - ..\..\..\src\clock.c - clock.c + ..\..\..\src\idle.c + idle.c 0 0 @@ -609,8 +609,8 @@ 0 0 0 - ..\..\..\src\idle.c - idle.c + ..\..\..\src\mempool.c + mempool.c 0 0 @@ -633,8 +633,8 @@ 0 0 0 - ..\..\..\src\timer.c - timer.c + ..\..\..\src\clock.c + clock.c 0 0 @@ -645,8 +645,8 @@ 0 0 0 - ..\..\..\src\kservice.c - kservice.c + ..\..\..\src\device.c + device.c 0 0 @@ -669,8 +669,8 @@ 0 0 0 - ..\..\..\src\mempool.c - mempool.c + ..\..\..\src\timer.c + timer.c 0 0 @@ -681,8 +681,8 @@ 0 0 0 - ..\..\..\src\irq.c - irq.c + ..\..\..\src\thread.c + thread.c 0 0 diff --git a/bsp/lpc55sxx/lpc55s69_nxp_evk/project.uvprojx b/bsp/lpc55sxx/lpc55s69_nxp_evk/project.uvprojx index 6ce9cac461..ad26c305f2 100644 --- a/bsp/lpc55sxx/lpc55s69_nxp_evk/project.uvprojx +++ b/bsp/lpc55sxx/lpc55s69_nxp_evk/project.uvprojx @@ -10,7 +10,7 @@ rtthread-lpc55s6x 0x4 ARM-ADS - 6160000::V6.16::ARMCLANG + 6120000::V6.12::.\ARMCLANG 1 @@ -393,11 +393,6 @@ CPU - - backtrace.c - 1 - ..\..\..\libcpu\arm\common\backtrace.c - showmem.c 1 @@ -409,15 +404,20 @@ ..\..\..\libcpu\arm\common\div0.c - context_rvds.S - 2 - ..\..\..\libcpu\arm\cortex-m4\context_rvds.S + backtrace.c + 1 + ..\..\..\libcpu\arm\common\backtrace.c cpuport.c 1 ..\..\..\libcpu\arm\cortex-m4\cpuport.c + + context_rvds.S + 2 + ..\..\..\libcpu\arm\cortex-m4\context_rvds.S + @@ -433,41 +433,41 @@ 1 ..\..\..\components\drivers\serial\serial.c - - ringbuffer.c - 1 - ..\..\..\components\drivers\src\ringbuffer.c - - - ringblk_buf.c - 1 - ..\..\..\components\drivers\src\ringblk_buf.c - waitqueue.c 1 ..\..\..\components\drivers\src\waitqueue.c - - pipe.c - 1 - ..\..\..\components\drivers\src\pipe.c - - - workqueue.c - 1 - ..\..\..\components\drivers\src\workqueue.c - completion.c 1 ..\..\..\components\drivers\src\completion.c + + pipe.c + 1 + ..\..\..\components\drivers\src\pipe.c + dataqueue.c 1 ..\..\..\components\drivers\src\dataqueue.c + + ringbuffer.c + 1 + ..\..\..\components\drivers\src\ringbuffer.c + + + workqueue.c + 1 + ..\..\..\components\drivers\src\workqueue.c + + + ringblk_buf.c + 1 + ..\..\..\components\drivers\src\ringblk_buf.c + @@ -533,55 +533,30 @@ Kernel + + irq.c + 1 + ..\..\..\src\irq.c + object.c 1 ..\..\..\src\object.c - - ipc.c - 1 - ..\..\..\src\ipc.c - - - thread.c - 1 - ..\..\..\src\thread.c - - - device.c - 1 - ..\..\..\src\device.c - - - clock.c - 1 - ..\..\..\src\clock.c - - - idle.c - 1 - ..\..\..\src\idle.c - - - scheduler.c - 1 - ..\..\..\src\scheduler.c - - - timer.c - 1 - ..\..\..\src\timer.c - kservice.c 1 ..\..\..\src\kservice.c - mem.c + ipc.c 1 - ..\..\..\src\mem.c + ..\..\..\src\ipc.c + + + idle.c + 1 + ..\..\..\src\idle.c mempool.c @@ -589,9 +564,34 @@ ..\..\..\src\mempool.c - irq.c + scheduler.c 1 - ..\..\..\src\irq.c + ..\..\..\src\scheduler.c + + + clock.c + 1 + ..\..\..\src\clock.c + + + device.c + 1 + ..\..\..\src\device.c + + + mem.c + 1 + ..\..\..\src\mem.c + + + timer.c + 1 + ..\..\..\src\timer.c + + + thread.c + 1 + ..\..\..\src\thread.c components.c diff --git a/bsp/lpc55sxx/lpc55s69_nxp_evk/rtconfig.h b/bsp/lpc55sxx/lpc55s69_nxp_evk/rtconfig.h index 8d43f792fd..041693aa1c 100644 --- a/bsp/lpc55sxx/lpc55s69_nxp_evk/rtconfig.h +++ b/bsp/lpc55sxx/lpc55s69_nxp_evk/rtconfig.h @@ -45,7 +45,7 @@ #define RT_USING_DEVICE #define RT_USING_CONSOLE #define RT_CONSOLEBUF_SIZE 128 -#define RT_CONSOLE_DEVICE_NAME "uart" +#define RT_CONSOLE_DEVICE_NAME "uart0" #define RT_VER_NUM 0x40004 #define ARCH_ARM_CORTEX_FPU @@ -142,6 +142,9 @@ /* multimedia packages */ +/* U8G2: a monochrome graphic library */ + + /* tools packages */