From 0acbc36e4a383b210b8a709cc8e6697b85d7d426 Mon Sep 17 00:00:00 2001 From: chenyingchun0312 Date: Mon, 28 Jun 2021 22:34:35 +0800 Subject: [PATCH] [bsp/nrf5x] update config file --- bsp/nrf5x/libraries/drivers/drv_uart.c | 1 - bsp/nrf5x/libraries/drivers/drv_uart.h | 3 +-- bsp/nrf5x/nrf52832/.config | 6 +++--- bsp/nrf5x/nrf52832/.vscode/launch.json | 15 ++++++++------- bsp/nrf5x/nrf52832/rtconfig.h | 2 +- bsp/nrf5x/nrf52832/rtconfig.py | 2 +- bsp/nrf5x/nrf52840/board/board.c | 8 ++++++-- 7 files changed, 20 insertions(+), 17 deletions(-) diff --git a/bsp/nrf5x/libraries/drivers/drv_uart.c b/bsp/nrf5x/libraries/drivers/drv_uart.c index c0c50b736c..217d5fc3db 100644 --- a/bsp/nrf5x/libraries/drivers/drv_uart.c +++ b/bsp/nrf5x/libraries/drivers/drv_uart.c @@ -250,5 +250,4 @@ int rt_hw_uart_init(void) #endif /* BSP_USING_UART0 */ } -INIT_BOARD_EXPORT(rt_hw_uart_init); #endif /* BSP_USING_UART */ diff --git a/bsp/nrf5x/libraries/drivers/drv_uart.h b/bsp/nrf5x/libraries/drivers/drv_uart.h index bdffc4463c..3bf9a2c9b6 100644 --- a/bsp/nrf5x/libraries/drivers/drv_uart.h +++ b/bsp/nrf5x/libraries/drivers/drv_uart.h @@ -11,8 +11,7 @@ #define UART0_RB_SIZE 1024 -// #define USE_UART0_1 0 - +int rt_hw_uart_init(void); #endif diff --git a/bsp/nrf5x/nrf52832/.config b/bsp/nrf5x/nrf52832/.config index eb4ea7ad34..61769240a8 100644 --- a/bsp/nrf5x/nrf52832/.config +++ b/bsp/nrf5x/nrf52832/.config @@ -383,9 +383,9 @@ CONFIG_RT_LIBC_FIXED_TIMEZONE=8 # CONFIG_PKG_USING_NRF5X_SDK is not set CONFIG_PKG_USING_NRFX=y CONFIG_PKG_NRFX_PATH="/packages/peripherals/nrfx" -CONFIG_PKG_USING_NRFX_V210=y -# CONFIG_PKG_USING_NRFX_LATEST_VERSION is not set -CONFIG_PKG_NRFX_VER="v2.1.0" +# CONFIG_PKG_USING_NRFX_V210 is not set +CONFIG_PKG_USING_NRFX_LATEST_VERSION=y +CONFIG_PKG_NRFX_VER="latest" # CONFIG_PKG_USING_WM_LIBRARIES is not set # CONFIG_PKG_USING_KENDRYTE_SDK is not set # CONFIG_PKG_USING_INFRARED is not set diff --git a/bsp/nrf5x/nrf52832/.vscode/launch.json b/bsp/nrf5x/nrf52832/.vscode/launch.json index c3a54b371b..9bcc1a8d86 100644 --- a/bsp/nrf5x/nrf52832/.vscode/launch.json +++ b/bsp/nrf5x/nrf52832/.vscode/launch.json @@ -2,14 +2,15 @@ "version": "0.2.0", "configurations": [ { - "type": "cortex-debug", - "request": "launch", - "servertype": "jlink", "cwd": "${workspaceRoot}", "executable": "rt-thread.elf", - "name": "Cortex Debug", - "device": "nrf52", - "interface": "swd" - } + "name": "Debug MAX", + "request": "launch", + "type": "cortex-debug", + "servertype": "jlink", + "interface": "swd", + "device": "NRF52832_XXAA", + "runToMain": true + }, ] } \ No newline at end of file diff --git a/bsp/nrf5x/nrf52832/rtconfig.h b/bsp/nrf5x/nrf52832/rtconfig.h index e61abfaeda..ee2691d102 100644 --- a/bsp/nrf5x/nrf52832/rtconfig.h +++ b/bsp/nrf5x/nrf52832/rtconfig.h @@ -149,7 +149,7 @@ /* peripheral libraries and drivers */ #define PKG_USING_NRFX -#define PKG_USING_NRFX_V210 +#define PKG_USING_NRFX_LATEST_VERSION /* miscellaneous packages */ diff --git a/bsp/nrf5x/nrf52832/rtconfig.py b/bsp/nrf5x/nrf52832/rtconfig.py index d065edfe02..805feeae54 100644 --- a/bsp/nrf5x/nrf52832/rtconfig.py +++ b/bsp/nrf5x/nrf52832/rtconfig.py @@ -13,7 +13,7 @@ if os.getenv('RTT_CC'): if CROSS_TOOL == 'gcc': PLATFORM = 'gcc' - EXEC_PATH = r'D:\RT-ThreadStudio\repo\Extract\ToolChain_Support_Packages\ARM\GNU_Tools_for_ARM_Embedded_Processors\5.4.1\bin' + EXEC_PATH = 'D:/SourceryGCC/bin' elif CROSS_TOOL == 'keil': PLATFORM = 'armcc' EXEC_PATH = 'C:/Keil_v5' diff --git a/bsp/nrf5x/nrf52840/board/board.c b/bsp/nrf5x/nrf52840/board/board.c index 961a027e95..7adafe36fe 100644 --- a/bsp/nrf5x/nrf52840/board/board.c +++ b/bsp/nrf5x/nrf52840/board/board.c @@ -61,14 +61,18 @@ void rt_hw_board_init(void) rt_system_heap_init((void *)HEAP_BEGIN, (void *)HEAP_END); #endif -#ifdef RT_USING_COMPONENTS_INIT - rt_components_board_init(); +#ifdef RT_USING_SERIAL + rt_hw_uart_init(); #endif #ifdef RT_USING_CONSOLE rt_console_set_device(RT_CONSOLE_DEVICE_NAME); #endif +#ifdef RT_USING_COMPONENTS_INIT + rt_components_board_init(); +#endif + #ifdef BSP_USING_SOFTDEVICE extern uint32_t Image$$RW_IRAM1$$Base;