diff --git a/bsp/nrf5x/libraries/drivers/drv_uart.c b/bsp/nrf5x/libraries/drivers/drv_uart.c index 8ee6992f02..c0c50b736c 100644 --- a/bsp/nrf5x/libraries/drivers/drv_uart.c +++ b/bsp/nrf5x/libraries/drivers/drv_uart.c @@ -6,6 +6,7 @@ * Change Logs: * Date Author Notes * 2020-04-28 xckhmf Modify for + * 2021-06-26 supperthomas fix rt_hw_uart_init * */ #include @@ -236,7 +237,7 @@ static struct rt_uart_ops _uart_ops = { _uart_getc }; -void rt_hw_uart_init(void) +int rt_hw_uart_init(void) { struct serial_configure config = RT_SERIAL_CONFIG_DEFAULT; @@ -249,5 +250,5 @@ void 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 da37eff016..bdffc4463c 100644 --- a/bsp/nrf5x/libraries/drivers/drv_uart.h +++ b/bsp/nrf5x/libraries/drivers/drv_uart.h @@ -13,7 +13,6 @@ // #define USE_UART0_1 0 -void rt_hw_uart_init(void); #endif diff --git a/bsp/nrf5x/nrf52840/.config b/bsp/nrf5x/nrf52840/.config index 9612d30606..1f53828ede 100644 --- a/bsp/nrf5x/nrf52840/.config +++ b/bsp/nrf5x/nrf52840/.config @@ -3,6 +3,57 @@ # RT-Thread Configuration # +# +# Hardware Drivers Config +# +CONFIG_SOC_NRF52840=y +CONFIG_SOC_NORDIC=y +CONFIG_BSP_BOARD_PCA_10056=y +# CONFIG_BSP_BOARD_ARDUINO_NANO_33_BLE is not set + +# +# Onboard Peripheral Drivers +# +CONFIG_BSP_USING_JLINK_TO_USART=y +CONFIG_RT_BSP_LED_PIN=13 +# CONFIG_BSP_USING_QSPI_FLASH is not set + +# +# On-chip Peripheral Drivers +# +CONFIG_BSP_USING_GPIO=y +CONFIG_BSP_USING_UART=y +CONFIG_NRFX_USING_UART=y +# CONFIG_NRFX_USING_UARTE is not set +CONFIG_BSP_USING_UART0=y +CONFIG_BSP_UART0_RX_PIN=8 +CONFIG_BSP_UART0_TX_PIN=6 +# CONFIG_BSP_USING_SAADC is not set +# CONFIG_BSP_USING_I2C is not set +# CONFIG_BSP_USING_SPI is not set +# CONFIG_BSP_USING_PWM is not set +# CONFIG_BSP_USING_WDT is not set +# CONFIG_BSP_USING_ONCHIP_RTC is not set +# CONFIG_BSP_USING_ON_CHIP_FLASH is not set + +# +# MCU flash config +# +CONFIG_MCU_FLASH_START_ADDRESS=0x00000000 +CONFIG_MCU_FLASH_SIZE_KB=1024 +CONFIG_MCU_SRAM_START_ADDRESS=0x20000000 +CONFIG_MCU_SRAM_SIZE_KB=256 +CONFIG_MCU_FLASH_PAGE_SIZE=0x1000 +CONFIG_BLE_STACK_USING_NULL=y +# CONFIG_BSP_USING_SOFTDEVICE is not set +# CONFIG_BSP_USING_NIMBLE is not set +CONFIG_NRFX_CLOCK_ENABLED=1 +CONFIG_NRFX_CLOCK_DEFAULT_CONFIG_IRQ_PRIORITY=7 +CONFIG_NRFX_CLOCK_CONFIG_LF_SRC=1 +CONFIG_NRFX_UART_ENABLED=1 +CONFIG_NRFX_UART0_ENABLED=1 +CONFIG_NRFX_GPIOTE_ENABLED=1 + # # RT-Thread Kernel # @@ -541,52 +592,3 @@ CONFIG_PKG_NRFX_VER="latest" # CONFIG_PKG_USING_STATE_MACHINE is not set # CONFIG_PKG_USING_MCURSES is not set # CONFIG_PKG_USING_COWSAY is not set - -# -# Hardware Drivers Config -# -CONFIG_SOC_NRF52840=y -CONFIG_SOC_NORDIC=y -CONFIG_BSP_BOARD_PCA_10056=y - -# -# Onboard Peripheral Drivers -# -CONFIG_BSP_USING_JLINK_TO_USART=y -# CONFIG_BSP_USING_QSPI_FLASH is not set - -# -# On-chip Peripheral Drivers -# -CONFIG_BSP_USING_GPIO=y -CONFIG_BSP_USING_UART=y -CONFIG_NRFX_USING_UART=y -# CONFIG_NRFX_USING_UARTE is not set -CONFIG_BSP_USING_UART0=y -CONFIG_BSP_UART0_RX_PIN=8 -CONFIG_BSP_UART0_TX_PIN=6 -# CONFIG_BSP_USING_SAADC is not set -# CONFIG_BSP_USING_I2C is not set -# CONFIG_BSP_USING_SPI is not set -# CONFIG_BSP_USING_PWM is not set -# CONFIG_BSP_USING_WDT is not set -# CONFIG_BSP_USING_ONCHIP_RTC is not set -# CONFIG_BSP_USING_ON_CHIP_FLASH is not set - -# -# MCU flash config -# -CONFIG_MCU_FLASH_START_ADDRESS=0x00000000 -CONFIG_MCU_FLASH_SIZE_KB=1024 -CONFIG_MCU_SRAM_START_ADDRESS=0x20000000 -CONFIG_MCU_SRAM_SIZE_KB=256 -CONFIG_MCU_FLASH_PAGE_SIZE=0x1000 -CONFIG_BLE_STACK_USING_NULL=y -# CONFIG_BSP_USING_SOFTDEVICE is not set -# CONFIG_BSP_USING_NIMBLE is not set -CONFIG_NRFX_CLOCK_ENABLED=1 -CONFIG_NRFX_CLOCK_DEFAULT_CONFIG_IRQ_PRIORITY=7 -CONFIG_NRFX_CLOCK_CONFIG_LF_SRC=1 -CONFIG_NRFX_UART_ENABLED=1 -CONFIG_NRFX_UART0_ENABLED=1 -CONFIG_NRFX_GPIOTE_ENABLED=1 diff --git a/bsp/nrf5x/nrf52840/Kconfig b/bsp/nrf5x/nrf52840/Kconfig index 3640eaa0ed..56d486baed 100644 --- a/bsp/nrf5x/nrf52840/Kconfig +++ b/bsp/nrf5x/nrf52840/Kconfig @@ -14,8 +14,9 @@ config PKGS_DIR string option env="PKGS_ROOT" default "packages" - + +source "board/Kconfig" source "$RTT_DIR/Kconfig" source "$PKGS_DIR/Kconfig" -source "board/Kconfig" + diff --git a/bsp/nrf5x/nrf52840/applications/application.c b/bsp/nrf5x/nrf52840/applications/application.c index f2cae69ed1..791e2af007 100644 --- a/bsp/nrf5x/nrf52840/applications/application.c +++ b/bsp/nrf5x/nrf52840/applications/application.c @@ -6,25 +6,24 @@ * Change Logs: * Date Author Notes * 2020-04-29 supperthomas first version + * 2021-06-26 supperthomas fix led * */ #include #include -#define DK_BOARD_LED_1 13 -#define DK_BOARD_LED_2 14 int main(void) { int count = 1; - rt_pin_mode(DK_BOARD_LED_1, PIN_MODE_OUTPUT); + rt_pin_mode(RT_BSP_LED_PIN, PIN_MODE_OUTPUT); while (count++) { - rt_pin_write(DK_BOARD_LED_1, PIN_HIGH); + rt_pin_write(RT_BSP_LED_PIN, PIN_HIGH); rt_thread_mdelay(500); - rt_pin_write(DK_BOARD_LED_1, PIN_LOW); + rt_pin_write(RT_BSP_LED_PIN, PIN_LOW); rt_thread_mdelay(500); } return RT_EOK; diff --git a/bsp/nrf5x/nrf52840/board/Kconfig b/bsp/nrf5x/nrf52840/board/Kconfig index 8a2fe7d49d..0a332f8bf0 100644 --- a/bsp/nrf5x/nrf52840/board/Kconfig +++ b/bsp/nrf5x/nrf52840/board/Kconfig @@ -15,19 +15,32 @@ choice default BSP_BOARD_PCA_10056 config BSP_BOARD_PCA_10056 + select BSP_USING_UART + select BSP_USING_UART0 bool "NRF52840 pca10056 " - + + config BSP_BOARD_ARDUINO_NANO_33_BLE + bool "Arduino Nano 33 BLE (Sense)" endchoice menu "Onboard Peripheral Drivers" config BSP_USING_JLINK_TO_USART bool "Enable JLINK TO USART (uart0|RX_PIN:8|TX_PIN:6)" default y + depends on BSP_BOARD_PCA_10056 + + config RT_BSP_LED_PIN + int + default 13 if BSP_BOARD_PCA_10056 + default 16 if BSP_BOARD_ARDUINO_NANO_33_BLE + depends on BSP_USING_GPIO + menuconfig BSP_USING_QSPI_FLASH select PKG_USING_FAL bool "Enable QSPI FLASH(MX25R64 8MB)" default n + depends on BSP_BOARD_PCA_10056 if BSP_USING_QSPI_FLASH config NRFX_QSPI_ENABLED @@ -89,8 +102,6 @@ menu "On-chip Peripheral Drivers" endchoice endif if BSP_USING_UART&&NRFX_USING_UART - - config BSP_USING_UART0 bool "Enable UART0" default y diff --git a/bsp/nrf5x/nrf52840/board/board.c b/bsp/nrf5x/nrf52840/board/board.c index 2cb94fb6fa..961a027e95 100644 --- a/bsp/nrf5x/nrf52840/board/board.c +++ b/bsp/nrf5x/nrf52840/board/board.c @@ -6,6 +6,7 @@ * Change Logs: * Date Author Notes * 2020-04-29 supperthomas first version + * 2020-04-29 supperthomas fix component init * */ #include @@ -60,17 +61,14 @@ void rt_hw_board_init(void) rt_system_heap_init((void *)HEAP_BEGIN, (void *)HEAP_END); #endif -#ifdef RT_USING_SERIAL - rt_hw_uart_init(); +#ifdef RT_USING_COMPONENTS_INIT + rt_components_board_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; diff --git a/bsp/nrf5x/nrf52840/project.uvoptx b/bsp/nrf5x/nrf52840/project.uvoptx index 232521460c..7bc32642ff 100644 --- a/bsp/nrf5x/nrf52840/project.uvoptx +++ b/bsp/nrf5x/nrf52840/project.uvoptx @@ -73,7 +73,7 @@ 0 - 1 + 0 0 1 @@ -183,7 +183,7 @@ Applications - 1 + 0 0 0 0 @@ -214,18 +214,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 @@ -233,7 +221,7 @@ 2 - 4 + 3 1 0 0 @@ -245,19 +233,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 @@ -267,6 +255,18 @@ 0 0 + + 2 + 6 + 2 + 0 + 0 + 0 + ..\..\..\libcpu\arm\cortex-m4\context_rvds.S + context_rvds.S + 0 + 0 + @@ -306,8 +306,8 @@ 0 0 0 - ..\..\..\components\drivers\src\waitqueue.c - waitqueue.c + ..\..\..\components\drivers\src\workqueue.c + workqueue.c 0 0 @@ -318,8 +318,8 @@ 0 0 0 - ..\..\..\components\drivers\src\workqueue.c - workqueue.c + ..\..\..\components\drivers\src\ringblk_buf.c + ringblk_buf.c 0 0 @@ -342,8 +342,8 @@ 0 0 0 - ..\..\..\components\drivers\src\dataqueue.c - dataqueue.c + ..\..\..\components\drivers\src\waitqueue.c + waitqueue.c 0 0 @@ -354,8 +354,8 @@ 0 0 0 - ..\..\..\components\drivers\src\ringbuffer.c - ringbuffer.c + ..\..\..\components\drivers\src\pipe.c + pipe.c 0 0 @@ -366,8 +366,8 @@ 0 0 0 - ..\..\..\components\drivers\src\ringblk_buf.c - ringblk_buf.c + ..\..\..\components\drivers\src\dataqueue.c + dataqueue.c 0 0 @@ -378,8 +378,8 @@ 0 0 0 - ..\..\..\components\drivers\src\pipe.c - pipe.c + ..\..\..\components\drivers\src\ringbuffer.c + ringbuffer.c 0 0 @@ -387,7 +387,7 @@ Drivers - 1 + 0 0 0 0 @@ -442,8 +442,8 @@ 0 0 0 - ..\..\..\components\finsh\finsh_node.c - finsh_node.c + ..\..\..\components\finsh\finsh_vm.c + finsh_vm.c 0 0 @@ -454,35 +454,35 @@ 0 0 0 - ..\..\..\components\finsh\finsh_parser.c - finsh_parser.c - 0 - 0 - - - 5 - 21 - 1 - 0 - 0 - 0 - ..\..\..\components\finsh\cmd.c - cmd.c - 0 - 0 - - - 5 - 22 - 1 - 0 - 0 - 0 ..\..\..\components\finsh\msh.c msh.c 0 0 + + 5 + 21 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\finsh_parser.c + finsh_parser.c + 0 + 0 + + + 5 + 22 + 1 + 0 + 0 + 0 + ..\..\..\components\finsh\cmd.c + cmd.c + 0 + 0 + 5 23 @@ -490,8 +490,8 @@ 0 0 0 - ..\..\..\components\finsh\finsh_vm.c - finsh_vm.c + ..\..\..\components\finsh\finsh_node.c + finsh_node.c 0 0 @@ -606,42 +606,6 @@ 0 0 0 - ..\..\..\src\kservice.c - kservice.c - 0 - 0 - - - 6 - 33 - 1 - 0 - 0 - 0 - ..\..\..\src\clock.c - clock.c - 0 - 0 - - - 6 - 34 - 1 - 0 - 0 - 0 - ..\..\..\src\timer.c - timer.c - 0 - 0 - - - 6 - 35 - 1 - 0 - 0 - 0 ..\..\..\src\scheduler.c scheduler.c 0 @@ -649,7 +613,7 @@ 6 - 36 + 33 1 0 0 @@ -659,6 +623,42 @@ 0 0 + + 6 + 34 + 1 + 0 + 0 + 0 + ..\..\..\src\kservice.c + kservice.c + 0 + 0 + + + 6 + 35 + 1 + 0 + 0 + 0 + ..\..\..\src\mem.c + mem.c + 0 + 0 + + + 6 + 36 + 1 + 0 + 0 + 0 + ..\..\..\src\clock.c + clock.c + 0 + 0 + 6 37 @@ -666,8 +666,8 @@ 0 0 0 - ..\..\..\src\ipc.c - ipc.c + ..\..\..\src\timer.c + timer.c 0 0 @@ -690,8 +690,8 @@ 0 0 0 - ..\..\..\src\object.c - object.c + ..\..\..\src\ipc.c + ipc.c 0 0 @@ -714,8 +714,8 @@ 0 0 0 - ..\..\..\src\components.c - components.c + ..\..\..\src\object.c + object.c 0 0 @@ -738,8 +738,8 @@ 0 0 0 - ..\..\..\src\idle.c - idle.c + ..\..\..\src\components.c + components.c 0 0 @@ -750,8 +750,8 @@ 0 0 0 - ..\..\..\src\mem.c - mem.c + ..\..\..\src\idle.c + idle.c 0 0 @@ -770,8 +770,8 @@ 0 0 0 - packages\nrfx-latest\drivers\src\nrfx_qspi.c - nrfx_qspi.c + packages\nrfx-latest\drivers\src\nrfx_qdec.c + nrfx_qdec.c 0 0 @@ -782,8 +782,8 @@ 0 0 0 - packages\nrfx-latest\drivers\src\nrfx_spis.c - nrfx_spis.c + packages\nrfx-latest\drivers\src\nrfx_systick.c + nrfx_systick.c 0 0 @@ -794,8 +794,8 @@ 0 0 0 - packages\nrfx-latest\drivers\src\nrfx_usbd.c - nrfx_usbd.c + packages\nrfx-latest\drivers\src\nrfx_dppi.c + nrfx_dppi.c 0 0 @@ -806,8 +806,8 @@ 0 0 0 - packages\nrfx-latest\drivers\src\nrfx_qdec.c - nrfx_qdec.c + packages\nrfx-latest\drivers\src\nrfx_pdm.c + nrfx_pdm.c 0 0 @@ -818,8 +818,8 @@ 0 0 0 - packages\nrfx-latest\drivers\src\nrfx_adc.c - nrfx_adc.c + packages\nrfx-latest\drivers\src\nrfx_ipc.c + nrfx_ipc.c 0 0 @@ -830,8 +830,8 @@ 0 0 0 - packages\nrfx-latest\drivers\src\nrfx_power.c - nrfx_power.c + packages\nrfx-latest\drivers\src\nrfx_twi_twim.c + nrfx_twi_twim.c 0 0 @@ -854,8 +854,8 @@ 0 0 0 - packages\nrfx-latest\drivers\src\nrfx_twim.c - nrfx_twim.c + packages\nrfx-latest\drivers\src\nrfx_qspi.c + nrfx_qspi.c 0 0 @@ -866,8 +866,8 @@ 0 0 0 - packages\nrfx-latest\drivers\src\nrfx_nvmc.c - nrfx_nvmc.c + packages\nrfx-latest\drivers\src\nrfx_spis.c + nrfx_spis.c 0 0 @@ -878,23 +878,23 @@ 0 0 0 + packages\nrfx-latest\drivers\src\nrfx_lpcomp.c + nrfx_lpcomp.c + 0 + 0 + + + 7 + 55 + 1 + 0 + 0 + 0 packages\nrfx-latest\drivers\src\nrfx_temp.c nrfx_temp.c 0 0 - - 7 - 55 - 1 - 0 - 0 - 0 - packages\nrfx-latest\drivers\src\nrfx_comp.c - nrfx_comp.c - 0 - 0 - 7 56 @@ -902,8 +902,8 @@ 0 0 0 - packages\nrfx-latest\drivers\src\nrfx_dppi.c - nrfx_dppi.c + packages\nrfx-latest\drivers\src\nrfx_wdt.c + nrfx_wdt.c 0 0 @@ -914,74 +914,14 @@ 0 0 0 - packages\nrfx-latest\drivers\src\nrfx_uart.c - nrfx_uart.c + packages\nrfx-latest\drivers\src\nrfx_twim.c + nrfx_twim.c 0 0 7 58 - 1 - 0 - 0 - 0 - packages\nrfx-latest\drivers\src\nrfx_gpiote.c - nrfx_gpiote.c - 0 - 0 - - - 7 - 59 - 1 - 0 - 0 - 0 - packages\nrfx-latest\drivers\src\nrfx_systick.c - nrfx_systick.c - 0 - 0 - - - 7 - 60 - 1 - 0 - 0 - 0 - packages\nrfx-latest\drivers\src\nrfx_ipc.c - nrfx_ipc.c - 0 - 0 - - - 7 - 61 - 1 - 0 - 0 - 0 - packages\nrfx-latest\drivers\src\nrfx_pwm.c - nrfx_pwm.c - 0 - 0 - - - 7 - 62 - 1 - 0 - 0 - 0 - packages\nrfx-latest\drivers\src\nrfx_twi.c - nrfx_twi.c - 0 - 0 - - - 7 - 63 2 0 0 @@ -991,6 +931,66 @@ 0 0 + + 7 + 59 + 1 + 0 + 0 + 0 + packages\nrfx-latest\drivers\src\nrfx_power.c + nrfx_power.c + 0 + 0 + + + 7 + 60 + 1 + 0 + 0 + 0 + packages\nrfx-latest\drivers\src\nrfx_timer.c + nrfx_timer.c + 0 + 0 + + + 7 + 61 + 1 + 0 + 0 + 0 + packages\nrfx-latest\drivers\src\nrfx_nvmc.c + nrfx_nvmc.c + 0 + 0 + + + 7 + 62 + 1 + 0 + 0 + 0 + packages\nrfx-latest\drivers\src\nrfx_ppi.c + nrfx_ppi.c + 0 + 0 + + + 7 + 63 + 1 + 0 + 0 + 0 + packages\nrfx-latest\drivers\src\nrfx_spim.c + nrfx_spim.c + 0 + 0 + 7 64 @@ -998,23 +998,23 @@ 0 0 0 + packages\nrfx-latest\drivers\src\nrfx_comp.c + nrfx_comp.c + 0 + 0 + + + 7 + 65 + 1 + 0 + 0 + 0 packages\nrfx-latest\drivers\src\nrfx_rtc.c nrfx_rtc.c 0 0 - - 7 - 65 - 1 - 0 - 0 - 0 - packages\nrfx-latest\drivers\src\nrfx_twis.c - nrfx_twis.c - 0 - 0 - 7 66 @@ -1022,8 +1022,8 @@ 0 0 0 - packages\nrfx-latest\drivers\src\nrfx_nfct.c - nrfx_nfct.c + packages\nrfx-latest\drivers\src\nrfx_twi.c + nrfx_twi.c 0 0 @@ -1046,102 +1046,6 @@ 0 0 0 - packages\nrfx-latest\drivers\src\nrfx_rng.c - nrfx_rng.c - 0 - 0 - - - 7 - 69 - 1 - 0 - 0 - 0 - packages\nrfx-latest\drivers\src\nrfx_wdt.c - nrfx_wdt.c - 0 - 0 - - - 7 - 70 - 1 - 0 - 0 - 0 - packages\nrfx-latest\drivers\src\nrfx_ppi.c - nrfx_ppi.c - 0 - 0 - - - 7 - 71 - 1 - 0 - 0 - 0 - packages\nrfx-latest\drivers\src\nrfx_saadc.c - nrfx_saadc.c - 0 - 0 - - - 7 - 72 - 1 - 0 - 0 - 0 - packages\nrfx-latest\drivers\src\nrfx_spi.c - nrfx_spi.c - 0 - 0 - - - 7 - 73 - 1 - 0 - 0 - 0 - packages\nrfx-latest\mdk\system_nrf52840.c - system_nrf52840.c - 0 - 0 - - - 7 - 74 - 1 - 0 - 0 - 0 - packages\nrfx-latest\drivers\src\nrfx_lpcomp.c - nrfx_lpcomp.c - 0 - 0 - - - 7 - 75 - 1 - 0 - 0 - 0 - packages\nrfx-latest\drivers\src\nrfx_twi_twim.c - nrfx_twi_twim.c - 0 - 0 - - - 7 - 76 - 1 - 0 - 0 - 0 packages\nrfx-latest\drivers\src\nrfx_clock.c nrfx_clock.c 0 @@ -1149,19 +1053,7 @@ 7 - 77 - 1 - 0 - 0 - 0 - packages\nrfx-latest\drivers\src\nrfx_spim.c - nrfx_spim.c - 0 - 0 - - - 7 - 78 + 69 1 0 0 @@ -1171,6 +1063,114 @@ 0 0 + + 7 + 70 + 1 + 0 + 0 + 0 + packages\nrfx-latest\drivers\src\nrfx_twis.c + nrfx_twis.c + 0 + 0 + + + 7 + 71 + 1 + 0 + 0 + 0 + packages\nrfx-latest\drivers\src\nrfx_adc.c + nrfx_adc.c + 0 + 0 + + + 7 + 72 + 1 + 0 + 0 + 0 + packages\nrfx-latest\drivers\src\nrfx_rng.c + nrfx_rng.c + 0 + 0 + + + 7 + 73 + 1 + 0 + 0 + 0 + packages\nrfx-latest\drivers\src\nrfx_usbd.c + nrfx_usbd.c + 0 + 0 + + + 7 + 74 + 1 + 0 + 0 + 0 + packages\nrfx-latest\drivers\src\nrfx_uart.c + nrfx_uart.c + 0 + 0 + + + 7 + 75 + 1 + 0 + 0 + 0 + packages\nrfx-latest\mdk\system_nrf52840.c + system_nrf52840.c + 0 + 0 + + + 7 + 76 + 1 + 0 + 0 + 0 + packages\nrfx-latest\drivers\src\nrfx_saadc.c + nrfx_saadc.c + 0 + 0 + + + 7 + 77 + 1 + 0 + 0 + 0 + packages\nrfx-latest\drivers\src\nrfx_nfct.c + nrfx_nfct.c + 0 + 0 + + + 7 + 78 + 1 + 0 + 0 + 0 + packages\nrfx-latest\drivers\src\nrfx_gpiote.c + nrfx_gpiote.c + 0 + 0 + 7 79 @@ -1178,23 +1178,23 @@ 0 0 0 + packages\nrfx-latest\drivers\src\nrfx_spi.c + nrfx_spi.c + 0 + 0 + + + 7 + 80 + 1 + 0 + 0 + 0 packages\nrfx-latest\drivers\src\nrfx_uarte.c nrfx_uarte.c 0 0 - - 7 - 80 - 1 - 0 - 0 - 0 - packages\nrfx-latest\drivers\src\nrfx_pdm.c - nrfx_pdm.c - 0 - 0 - 7 81 @@ -1202,8 +1202,8 @@ 0 0 0 - packages\nrfx-latest\drivers\src\nrfx_timer.c - nrfx_timer.c + packages\nrfx-latest\drivers\src\nrfx_pwm.c + nrfx_pwm.c 0 0 diff --git a/bsp/nrf5x/nrf52840/project.uvprojx b/bsp/nrf5x/nrf52840/project.uvprojx index 7646c98bf2..69017ec490 100644 --- a/bsp/nrf5x/nrf52840/project.uvprojx +++ b/bsp/nrf5x/nrf52840/project.uvprojx @@ -10,7 +10,7 @@ rtthread 0x4 ARM-ADS - 5060960::V5.06 update 7 (build 960)::ARMCC + 5060422::V5.06 update 4 (build 422)::ARMCC 0 @@ -339,7 +339,7 @@ --reduce_paths NRF52840_XXAA, __RTTHREAD__, __CLK_TCK=RT_TICK_PER_SECOND - applications;.;..\libraries\cmsis\include;..\..\..\libcpu\arm\common;..\..\..\libcpu\arm\cortex-m4;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;board;..\libraries\drivers;..\..\..\components\finsh;.;..\..\..\include;..\..\..\components\libc\compilers\common;..\..\..\components\libc\compilers\common\none-gcc;packages\nrfx-latest;packages\nrfx-latest\drivers;packages\nrfx-latest\drivers\include;packages\nrfx-latest\mdk;packages\nrfx-latest\hal;..\..\..\examples\utest\testcases\kernel + applications;.;..\libraries\cmsis\include;..\..\..\libcpu\arm\common;..\..\..\libcpu\arm\cortex-m4;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;board;..\libraries\drivers;..\..\..\components\finsh;.;..\..\..\include;..\..\..\components\libc\compilers\common;..\..\..\components\libc\compilers\common\none-gcc;packages\nrfx-latest;packages\nrfx-latest\drivers;packages\nrfx-latest\drivers\include;packages\nrfx-latest\mdk;packages\nrfx-latest\hal;packages\SEGGER_RTT-v1.1.0;packages\SEGGER_RTT-v1.1.0\RTT;..\..\..\examples\utest\testcases\kernel @@ -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,21 +433,31 @@ 1 ..\..\..\components\drivers\serial\serial.c - - waitqueue.c - 1 - ..\..\..\components\drivers\src\waitqueue.c - workqueue.c 1 ..\..\..\components\drivers\src\workqueue.c + + ringblk_buf.c + 1 + ..\..\..\components\drivers\src\ringblk_buf.c + completion.c 1 ..\..\..\components\drivers\src\completion.c + + waitqueue.c + 1 + ..\..\..\components\drivers\src\waitqueue.c + + + pipe.c + 1 + ..\..\..\components\drivers\src\pipe.c + dataqueue.c 1 @@ -458,16 +468,6 @@ 1 ..\..\..\components\drivers\src\ringbuffer.c - - ringblk_buf.c - 1 - ..\..\..\components\drivers\src\ringblk_buf.c - - - pipe.c - 1 - ..\..\..\components\drivers\src\pipe.c - @@ -494,9 +494,14 @@ finsh - finsh_node.c + finsh_vm.c 1 - ..\..\..\components\finsh\finsh_node.c + ..\..\..\components\finsh\finsh_vm.c + + + msh.c + 1 + ..\..\..\components\finsh\msh.c finsh_parser.c @@ -509,14 +514,9 @@ ..\..\..\components\finsh\cmd.c - msh.c + finsh_node.c 1 - ..\..\..\components\finsh\msh.c - - - finsh_vm.c - 1 - ..\..\..\components\finsh\finsh_vm.c + ..\..\..\components\finsh\finsh_node.c shell.c @@ -563,11 +563,26 @@ Kernel + + scheduler.c + 1 + ..\..\..\src\scheduler.c + + + device.c + 1 + ..\..\..\src\device.c + kservice.c 1 ..\..\..\src\kservice.c + + mem.c + 1 + ..\..\..\src\mem.c + clock.c 1 @@ -579,14 +594,9 @@ ..\..\..\src\timer.c - scheduler.c + irq.c 1 - ..\..\..\src\scheduler.c - - - device.c - 1 - ..\..\..\src\device.c + ..\..\..\src\irq.c ipc.c @@ -594,9 +604,9 @@ ..\..\..\src\ipc.c - irq.c + mempool.c 1 - ..\..\..\src\irq.c + ..\..\..\src\mempool.c object.c @@ -604,35 +614,60 @@ ..\..\..\src\object.c - mempool.c + thread.c 1 - ..\..\..\src\mempool.c + ..\..\..\src\thread.c components.c 1 ..\..\..\src\components.c - - thread.c - 1 - ..\..\..\src\thread.c - idle.c 1 ..\..\..\src\idle.c - - mem.c - 1 - ..\..\..\src\mem.c - nrfx + + nrfx_qdec.c + 1 + packages\nrfx-latest\drivers\src\nrfx_qdec.c + + + nrfx_systick.c + 1 + packages\nrfx-latest\drivers\src\nrfx_systick.c + + + nrfx_dppi.c + 1 + packages\nrfx-latest\drivers\src\nrfx_dppi.c + + + nrfx_pdm.c + 1 + packages\nrfx-latest\drivers\src\nrfx_pdm.c + + + nrfx_ipc.c + 1 + packages\nrfx-latest\drivers\src\nrfx_ipc.c + + + nrfx_twi_twim.c + 1 + packages\nrfx-latest\drivers\src\nrfx_twi_twim.c + + + nrfx_egu.c + 1 + packages\nrfx-latest\drivers\src\nrfx_egu.c + nrfx_qspi.c 1 @@ -644,39 +679,9 @@ packages\nrfx-latest\drivers\src\nrfx_spis.c - nrfx_usbd.c + nrfx_lpcomp.c 1 - packages\nrfx-latest\drivers\src\nrfx_usbd.c - - - nrfx_qdec.c - 1 - packages\nrfx-latest\drivers\src\nrfx_qdec.c - - - nrfx_adc.c - 1 - packages\nrfx-latest\drivers\src\nrfx_adc.c - - - nrfx_power.c - 1 - packages\nrfx-latest\drivers\src\nrfx_power.c - - - nrfx_egu.c - 1 - packages\nrfx-latest\drivers\src\nrfx_egu.c - - - nrfx_twim.c - 1 - packages\nrfx-latest\drivers\src\nrfx_twim.c - - - nrfx_nvmc.c - 1 - packages\nrfx-latest\drivers\src\nrfx_nvmc.c + packages\nrfx-latest\drivers\src\nrfx_lpcomp.c nrfx_temp.c @@ -684,44 +689,14 @@ packages\nrfx-latest\drivers\src\nrfx_temp.c - nrfx_comp.c + nrfx_wdt.c 1 - packages\nrfx-latest\drivers\src\nrfx_comp.c + packages\nrfx-latest\drivers\src\nrfx_wdt.c - nrfx_dppi.c + nrfx_twim.c 1 - packages\nrfx-latest\drivers\src\nrfx_dppi.c - - - nrfx_uart.c - 1 - packages\nrfx-latest\drivers\src\nrfx_uart.c - - - nrfx_gpiote.c - 1 - packages\nrfx-latest\drivers\src\nrfx_gpiote.c - - - nrfx_systick.c - 1 - packages\nrfx-latest\drivers\src\nrfx_systick.c - - - nrfx_ipc.c - 1 - packages\nrfx-latest\drivers\src\nrfx_ipc.c - - - nrfx_pwm.c - 1 - packages\nrfx-latest\drivers\src\nrfx_pwm.c - - - nrfx_twi.c - 1 - packages\nrfx-latest\drivers\src\nrfx_twi.c + packages\nrfx-latest\drivers\src\nrfx_twim.c arm_startup_nrf52840.s @@ -729,34 +704,19 @@ packages\nrfx-latest\mdk\arm_startup_nrf52840.s - nrfx_rtc.c + nrfx_power.c 1 - packages\nrfx-latest\drivers\src\nrfx_rtc.c + packages\nrfx-latest\drivers\src\nrfx_power.c - nrfx_twis.c + nrfx_timer.c 1 - packages\nrfx-latest\drivers\src\nrfx_twis.c + packages\nrfx-latest\drivers\src\nrfx_timer.c - nrfx_nfct.c + nrfx_nvmc.c 1 - packages\nrfx-latest\drivers\src\nrfx_nfct.c - - - nrfx_usbreg.c - 1 - packages\nrfx-latest\drivers\src\nrfx_usbreg.c - - - nrfx_rng.c - 1 - packages\nrfx-latest\drivers\src\nrfx_rng.c - - - nrfx_wdt.c - 1 - packages\nrfx-latest\drivers\src\nrfx_wdt.c + packages\nrfx-latest\drivers\src\nrfx_nvmc.c nrfx_ppi.c @@ -764,59 +724,99 @@ packages\nrfx-latest\drivers\src\nrfx_ppi.c - nrfx_saadc.c + nrfx_spim.c 1 - packages\nrfx-latest\drivers\src\nrfx_saadc.c + packages\nrfx-latest\drivers\src\nrfx_spim.c - nrfx_spi.c + nrfx_comp.c 1 - packages\nrfx-latest\drivers\src\nrfx_spi.c + packages\nrfx-latest\drivers\src\nrfx_comp.c - system_nrf52840.c + nrfx_rtc.c 1 - packages\nrfx-latest\mdk\system_nrf52840.c + packages\nrfx-latest\drivers\src\nrfx_rtc.c - nrfx_lpcomp.c + nrfx_twi.c 1 - packages\nrfx-latest\drivers\src\nrfx_lpcomp.c + packages\nrfx-latest\drivers\src\nrfx_twi.c - nrfx_twi_twim.c + nrfx_usbreg.c 1 - packages\nrfx-latest\drivers\src\nrfx_twi_twim.c + packages\nrfx-latest\drivers\src\nrfx_usbreg.c nrfx_clock.c 1 packages\nrfx-latest\drivers\src\nrfx_clock.c - - nrfx_spim.c - 1 - packages\nrfx-latest\drivers\src\nrfx_spim.c - nrfx_i2s.c 1 packages\nrfx-latest\drivers\src\nrfx_i2s.c + + nrfx_twis.c + 1 + packages\nrfx-latest\drivers\src\nrfx_twis.c + + + nrfx_adc.c + 1 + packages\nrfx-latest\drivers\src\nrfx_adc.c + + + nrfx_rng.c + 1 + packages\nrfx-latest\drivers\src\nrfx_rng.c + + + nrfx_usbd.c + 1 + packages\nrfx-latest\drivers\src\nrfx_usbd.c + + + nrfx_uart.c + 1 + packages\nrfx-latest\drivers\src\nrfx_uart.c + + + system_nrf52840.c + 1 + packages\nrfx-latest\mdk\system_nrf52840.c + + + nrfx_saadc.c + 1 + packages\nrfx-latest\drivers\src\nrfx_saadc.c + + + nrfx_nfct.c + 1 + packages\nrfx-latest\drivers\src\nrfx_nfct.c + + + nrfx_gpiote.c + 1 + packages\nrfx-latest\drivers\src\nrfx_gpiote.c + + + nrfx_spi.c + 1 + packages\nrfx-latest\drivers\src\nrfx_spi.c + nrfx_uarte.c 1 packages\nrfx-latest\drivers\src\nrfx_uarte.c - nrfx_pdm.c + nrfx_pwm.c 1 - packages\nrfx-latest\drivers\src\nrfx_pdm.c - - - nrfx_timer.c - 1 - packages\nrfx-latest\drivers\src\nrfx_timer.c + packages\nrfx-latest\drivers\src\nrfx_pwm.c diff --git a/bsp/nrf5x/nrf52840/rtconfig.h b/bsp/nrf5x/nrf52840/rtconfig.h index 9d269d9391..df606fc98e 100644 --- a/bsp/nrf5x/nrf52840/rtconfig.h +++ b/bsp/nrf5x/nrf52840/rtconfig.h @@ -4,6 +4,41 @@ /* Automatically generated file; DO NOT EDIT. */ /* RT-Thread Configuration */ +/* Hardware Drivers Config */ + +#define SOC_NRF52840 +#define SOC_NORDIC +#define BSP_BOARD_PCA_10056 + +/* Onboard Peripheral Drivers */ + +#define BSP_USING_JLINK_TO_USART +#define RT_BSP_LED_PIN 13 + +/* On-chip Peripheral Drivers */ + +#define BSP_USING_GPIO +#define BSP_USING_UART +#define NRFX_USING_UART +#define BSP_USING_UART0 +#define BSP_UART0_RX_PIN 8 +#define BSP_UART0_TX_PIN 6 + +/* MCU flash config */ + +#define MCU_FLASH_START_ADDRESS 0x00000000 +#define MCU_FLASH_SIZE_KB 1024 +#define MCU_SRAM_START_ADDRESS 0x20000000 +#define MCU_SRAM_SIZE_KB 256 +#define MCU_FLASH_PAGE_SIZE 0x1000 +#define BLE_STACK_USING_NULL +#define NRFX_CLOCK_ENABLED 1 +#define NRFX_CLOCK_DEFAULT_CONFIG_IRQ_PRIORITY 7 +#define NRFX_CLOCK_CONFIG_LF_SRC 1 +#define NRFX_UART_ENABLED 1 +#define NRFX_UART0_ENABLED 1 +#define NRFX_GPIOTE_ENABLED 1 + /* RT-Thread Kernel */ #define RT_NAME_MAX 8 @@ -160,38 +195,4 @@ /* entertainment: terminal games and other interesting software packages */ -/* Hardware Drivers Config */ - -#define SOC_NRF52840 -#define SOC_NORDIC -#define BSP_BOARD_PCA_10056 - -/* Onboard Peripheral Drivers */ - -#define BSP_USING_JLINK_TO_USART - -/* On-chip Peripheral Drivers */ - -#define BSP_USING_GPIO -#define BSP_USING_UART -#define NRFX_USING_UART -#define BSP_USING_UART0 -#define BSP_UART0_RX_PIN 8 -#define BSP_UART0_TX_PIN 6 - -/* MCU flash config */ - -#define MCU_FLASH_START_ADDRESS 0x00000000 -#define MCU_FLASH_SIZE_KB 1024 -#define MCU_SRAM_START_ADDRESS 0x20000000 -#define MCU_SRAM_SIZE_KB 256 -#define MCU_FLASH_PAGE_SIZE 0x1000 -#define BLE_STACK_USING_NULL -#define NRFX_CLOCK_ENABLED 1 -#define NRFX_CLOCK_DEFAULT_CONFIG_IRQ_PRIORITY 7 -#define NRFX_CLOCK_CONFIG_LF_SRC 1 -#define NRFX_UART_ENABLED 1 -#define NRFX_UART0_ENABLED 1 -#define NRFX_GPIOTE_ENABLED 1 - #endif