From eac8d92d49beed565d71432ea838a876372bd7e1 Mon Sep 17 00:00:00 2001 From: EvalZero Date: Tue, 9 Apr 2019 20:46:27 +0800 Subject: [PATCH] [bsp][nrf52832]Update and sync nrf52832 project --- bsp/nrf52832/Kconfig | 20 + bsp/nrf52832/applications/startup.c | 4 + bsp/nrf52832/board/board.c | 12 +- bsp/nrf52832/board/uart.c | 4 +- .../nRF5_SDK_13.0.0_04a0bfd/Sconscript | 2 +- bsp/nrf52832/project.uvoptx | 1035 +++++++++++++++++ bsp/nrf52832/project.uvprojx | 519 +++++---- bsp/nrf52832/rtconfig.h | 197 ++-- bsp/nrf52832/startups/arm/arm_startup_nrf52.s | 4 +- bsp/nrf52832/template.uvoptx | 171 +++ bsp/nrf52832/template.uvprojx | 3 +- 11 files changed, 1659 insertions(+), 312 deletions(-) create mode 100644 bsp/nrf52832/Kconfig create mode 100644 bsp/nrf52832/project.uvoptx create mode 100644 bsp/nrf52832/template.uvoptx diff --git a/bsp/nrf52832/Kconfig b/bsp/nrf52832/Kconfig new file mode 100644 index 0000000000..e23ec81e03 --- /dev/null +++ b/bsp/nrf52832/Kconfig @@ -0,0 +1,20 @@ +mainmenu "RT-Thread Project Configuration" + +config BSP_DIR + string + option env="BSP_ROOT" + default "." + +config RTT_DIR + string + option env="RTT_ROOT" + default "../.." + +config PKGS_DIR + string + option env="PKGS_ROOT" + default "packages" + +source "$RTT_DIR/Kconfig" +source "$PKGS_DIR/Kconfig" + diff --git a/bsp/nrf52832/applications/startup.c b/bsp/nrf52832/applications/startup.c index fe48118b34..a48524814c 100644 --- a/bsp/nrf52832/applications/startup.c +++ b/bsp/nrf52832/applications/startup.c @@ -64,6 +64,10 @@ void rtthread_startup(void) /* init scheduler system */ rt_system_scheduler_init(); +#ifdef RT_USING_COMPONENTS_INIT + rt_components_init(); +#endif + /* init application */ rt_application_init(); diff --git a/bsp/nrf52832/board/board.c b/bsp/nrf52832/board/board.c index 20c061fa96..6b1befe16f 100644 --- a/bsp/nrf52832/board/board.c +++ b/bsp/nrf52832/board/board.c @@ -104,21 +104,19 @@ void OSTick_Handler( void ) { uint32_t diff; + /* enter interrupt */ + rt_interrupt_enter(); diff = _tick_distance(); while((diff--) > 0) { if (rt_thread_self() != RT_NULL) { - /* enter interrupt */ - rt_interrupt_enter(); - - rt_tick_increase(); - - /* leave interrupt */ - rt_interrupt_leave(); + rt_tick_increase(); } } + /* leave interrupt */ + rt_interrupt_leave(); } static void _wakeup_tick_adjust(void) diff --git a/bsp/nrf52832/board/uart.c b/bsp/nrf52832/board/uart.c index 837ef2dc26..ae73dd246b 100644 --- a/bsp/nrf52832/board/uart.c +++ b/bsp/nrf52832/board/uart.c @@ -24,8 +24,8 @@ typedef struct UART_CFG_T uart0 = { .uart = NRF_DRV_UART_INSTANCE(0), #ifdef RT_USING_CONSOLE - .rx_pin = 3, - .tx_pin = 4 + .rx_pin = 8, + .tx_pin = 6 #else .rx_pin = 19, .tx_pin = 20 diff --git a/bsp/nrf52832/nRF5_SDK_13.0.0_04a0bfd/Sconscript b/bsp/nrf52832/nRF5_SDK_13.0.0_04a0bfd/Sconscript index 52d864a761..d98b02553c 100644 --- a/bsp/nrf52832/nRF5_SDK_13.0.0_04a0bfd/Sconscript +++ b/bsp/nrf52832/nRF5_SDK_13.0.0_04a0bfd/Sconscript @@ -16,7 +16,7 @@ BLE_SERVICE = Glob('./components/ble/ble_services/ble_nus/*.c') BLE_SRC = BLE_COMMON + BLE_GATT + BLE_SERVICE + BLE_ADVERTISING SOFTDEVICE = Glob('./components/softdevice/common/softdevice_handler/*.c') -SrcRemove(SOFTDEVICE, 'softdevice_handler_appsh.c') +SrcRemove(SOFTDEVICE, './components/softdevice/common/softdevice_handler/softdevice_handler_appsh.c') BLE_STACK_SRC = BLE_SRC + SOFTDEVICE diff --git a/bsp/nrf52832/project.uvoptx b/bsp/nrf52832/project.uvoptx new file mode 100644 index 0000000000..c5b3cf0246 --- /dev/null +++ b/bsp/nrf52832/project.uvoptx @@ -0,0 +1,1035 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj; *.o + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + rtthread + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\build\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 5 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 3 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + JL2CM3 + -U59401765 -O78 -S2 -ZTIFSpeedSel5000 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC4000 -FN2 -FF0nrf52xxx.flm -FS00 -FL0200000 -FP0($$Device:nRF52832_xxAA$Flash\nrf52xxx.flm) -FF1nrf52xxx_uicr.flm -FS110001000 -FL11000 -FP1($$Device:nRF52832_xxAA$Flash\nrf52xxx_uicr.flm) + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC4000 -FN2 -FF0nrf52xxx -FS00 -FL0200000 -FF1nrf52xxx_uicr -FS110001000 -FL11000 -FP0($$Device:nRF52832_xxAA$Flash\nrf52xxx.flm) -FP1($$Device:nRF52832_xxAA$Flash\nrf52xxx_uicr.flm)) + + + + + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + Kernel + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + ..\..\src\clock.c + clock.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + ..\..\src\components.c + components.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + ..\..\src\cpu.c + cpu.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 0 + ..\..\src\device.c + device.c + 0 + 0 + + + 1 + 5 + 1 + 0 + 0 + 0 + ..\..\src\idle.c + idle.c + 0 + 0 + + + 1 + 6 + 1 + 0 + 0 + 0 + ..\..\src\ipc.c + ipc.c + 0 + 0 + + + 1 + 7 + 1 + 0 + 0 + 0 + ..\..\src\irq.c + irq.c + 0 + 0 + + + 1 + 8 + 1 + 0 + 0 + 0 + ..\..\src\kservice.c + kservice.c + 0 + 0 + + + 1 + 9 + 1 + 0 + 0 + 0 + ..\..\src\mem.c + mem.c + 0 + 0 + + + 1 + 10 + 1 + 0 + 0 + 0 + ..\..\src\mempool.c + mempool.c + 0 + 0 + + + 1 + 11 + 1 + 0 + 0 + 0 + ..\..\src\object.c + object.c + 0 + 0 + + + 1 + 12 + 1 + 0 + 0 + 0 + ..\..\src\scheduler.c + scheduler.c + 0 + 0 + + + 1 + 13 + 1 + 0 + 0 + 0 + ..\..\src\signal.c + signal.c + 0 + 0 + + + 1 + 14 + 1 + 0 + 0 + 0 + ..\..\src\thread.c + thread.c + 0 + 0 + + + 1 + 15 + 1 + 0 + 0 + 0 + ..\..\src\timer.c + timer.c + 0 + 0 + + + + + Applications + 1 + 0 + 0 + 0 + + 2 + 16 + 1 + 0 + 0 + 0 + applications\application.c + application.c + 0 + 0 + + + 2 + 17 + 1 + 0 + 0 + 0 + applications\ble_nus_app.c + ble_nus_app.c + 0 + 0 + + + 2 + 18 + 1 + 0 + 0 + 0 + applications\startup.c + startup.c + 0 + 0 + + + + + Board + 1 + 0 + 0 + 0 + + 3 + 19 + 1 + 0 + 0 + 0 + board\board.c + board.c + 0 + 0 + + + 3 + 20 + 1 + 0 + 0 + 0 + board\uart.c + uart.c + 0 + 0 + + + + + BLE_STACK + 1 + 0 + 0 + 0 + + 4 + 21 + 1 + 0 + 0 + 0 + nRF5_SDK_13.0.0_04a0bfd\components\ble\common\ble_advdata.c + ble_advdata.c + 0 + 0 + + + 4 + 22 + 1 + 0 + 0 + 0 + nRF5_SDK_13.0.0_04a0bfd\components\ble\common\ble_conn_params.c + ble_conn_params.c + 0 + 0 + + + 4 + 23 + 1 + 0 + 0 + 0 + nRF5_SDK_13.0.0_04a0bfd\components\ble\common\ble_conn_state.c + ble_conn_state.c + 0 + 0 + + + 4 + 24 + 1 + 0 + 0 + 0 + nRF5_SDK_13.0.0_04a0bfd\components\ble\common\ble_srv_common.c + ble_srv_common.c + 0 + 0 + + + 4 + 25 + 1 + 0 + 0 + 0 + nRF5_SDK_13.0.0_04a0bfd\components\ble\nrf_ble_gatt\nrf_ble_gatt.c + nrf_ble_gatt.c + 0 + 0 + + + 4 + 26 + 1 + 0 + 0 + 0 + nRF5_SDK_13.0.0_04a0bfd\components\ble\ble_services\ble_nus\ble_nus.c + ble_nus.c + 0 + 0 + + + 4 + 27 + 1 + 0 + 0 + 0 + nRF5_SDK_13.0.0_04a0bfd\components\ble\ble_advertising\ble_advertising.c + ble_advertising.c + 0 + 0 + + + 4 + 28 + 1 + 0 + 0 + 0 + nRF5_SDK_13.0.0_04a0bfd\components\softdevice\common\softdevice_handler\softdevice_handler.c + softdevice_handler.c + 0 + 0 + + + + + Startup + 1 + 0 + 0 + 0 + + 5 + 29 + 1 + 0 + 0 + 0 + startups\system_nrf52.c + system_nrf52.c + 0 + 0 + + + 5 + 30 + 2 + 0 + 0 + 0 + startups\arm\arm_startup_nrf52.s + arm_startup_nrf52.s + 0 + 0 + + + + + NRF_DRIVERS + 0 + 0 + 0 + 0 + + 6 + 31 + 1 + 0 + 0 + 0 + nRF5_SDK_13.0.0_04a0bfd\components\drivers_nrf\hal\nrf_saadc.c + nrf_saadc.c + 0 + 0 + + + 6 + 32 + 1 + 0 + 0 + 0 + nRF5_SDK_13.0.0_04a0bfd\components\drivers_nrf\common\nrf_drv_common.c + nrf_drv_common.c + 0 + 0 + + + 6 + 33 + 1 + 0 + 0 + 0 + nRF5_SDK_13.0.0_04a0bfd\components\drivers_nrf\clock\nrf_drv_clock.c + nrf_drv_clock.c + 0 + 0 + + + 6 + 34 + 1 + 0 + 0 + 0 + nRF5_SDK_13.0.0_04a0bfd\components\drivers_nrf\gpiote\nrf_drv_gpiote.c + nrf_drv_gpiote.c + 0 + 0 + + + 6 + 35 + 1 + 0 + 0 + 0 + nRF5_SDK_13.0.0_04a0bfd\components\drivers_nrf\pwm\nrf_drv_pwm.c + nrf_drv_pwm.c + 0 + 0 + + + 6 + 36 + 1 + 0 + 0 + 0 + nRF5_SDK_13.0.0_04a0bfd\components\drivers_nrf\saadc\nrf_drv_saadc.c + nrf_drv_saadc.c + 0 + 0 + + + 6 + 37 + 1 + 0 + 0 + 0 + nRF5_SDK_13.0.0_04a0bfd\components\libraries\log\src\nrf_log_backend_serial.c + nrf_log_backend_serial.c + 0 + 0 + + + 6 + 38 + 1 + 0 + 0 + 0 + nRF5_SDK_13.0.0_04a0bfd\components\libraries\log\src\nrf_log_frontend.c + nrf_log_frontend.c + 0 + 0 + + + 6 + 39 + 1 + 0 + 0 + 0 + nRF5_SDK_13.0.0_04a0bfd\components\libraries\timer\app_timer_rtthread.c + app_timer_rtthread.c + 0 + 0 + + + 6 + 40 + 1 + 0 + 0 + 0 + nRF5_SDK_13.0.0_04a0bfd\components\libraries\util\app_error.c + app_error.c + 0 + 0 + + + 6 + 41 + 1 + 0 + 0 + 0 + nRF5_SDK_13.0.0_04a0bfd\components\libraries\util\app_error_weak.c + app_error_weak.c + 0 + 0 + + + 6 + 42 + 1 + 0 + 0 + 0 + nRF5_SDK_13.0.0_04a0bfd\components\libraries\util\app_util_platform.c + app_util_platform.c + 0 + 0 + + + 6 + 43 + 1 + 0 + 0 + 0 + nRF5_SDK_13.0.0_04a0bfd\components\libraries\util\nrf_assert.c + nrf_assert.c + 0 + 0 + + + 6 + 44 + 1 + 0 + 0 + 0 + nRF5_SDK_13.0.0_04a0bfd\components\libraries\util\sdk_mapped_flags.c + sdk_mapped_flags.c + 0 + 0 + + + 6 + 45 + 1 + 0 + 0 + 0 + nRF5_SDK_13.0.0_04a0bfd\components\libraries\fstorage\fstorage.c + fstorage.c + 0 + 0 + + + 6 + 46 + 1 + 0 + 0 + 0 + nRF5_SDK_13.0.0_04a0bfd\components\libraries\strerror\nrf_strerror.c + nrf_strerror.c + 0 + 0 + + + + + cpu + 0 + 0 + 0 + 0 + + 7 + 47 + 1 + 0 + 0 + 0 + ..\..\libcpu\arm\common\backtrace.c + backtrace.c + 0 + 0 + + + 7 + 48 + 1 + 0 + 0 + 0 + ..\..\libcpu\arm\common\div0.c + div0.c + 0 + 0 + + + 7 + 49 + 1 + 0 + 0 + 0 + ..\..\libcpu\arm\common\showmem.c + showmem.c + 0 + 0 + + + 7 + 50 + 1 + 0 + 0 + 0 + ..\..\libcpu\arm\cortex-m4\cpuport.c + cpuport.c + 0 + 0 + + + 7 + 51 + 2 + 0 + 0 + 0 + ..\..\libcpu\arm\cortex-m4\context_rvds.S + context_rvds.S + 0 + 0 + + + + + DeviceDrivers + 0 + 0 + 0 + 0 + + 8 + 52 + 1 + 0 + 0 + 0 + ..\..\components\drivers\misc\pin.c + pin.c + 0 + 0 + + + 8 + 53 + 1 + 0 + 0 + 0 + ..\..\components\drivers\serial\serial.c + serial.c + 0 + 0 + + + 8 + 54 + 1 + 0 + 0 + 0 + ..\..\components\drivers\src\completion.c + completion.c + 0 + 0 + + + 8 + 55 + 1 + 0 + 0 + 0 + ..\..\components\drivers\src\dataqueue.c + dataqueue.c + 0 + 0 + + + 8 + 56 + 1 + 0 + 0 + 0 + ..\..\components\drivers\src\pipe.c + pipe.c + 0 + 0 + + + 8 + 57 + 1 + 0 + 0 + 0 + ..\..\components\drivers\src\ringblk_buf.c + ringblk_buf.c + 0 + 0 + + + 8 + 58 + 1 + 0 + 0 + 0 + ..\..\components\drivers\src\ringbuffer.c + ringbuffer.c + 0 + 0 + + + 8 + 59 + 1 + 0 + 0 + 0 + ..\..\components\drivers\src\waitqueue.c + waitqueue.c + 0 + 0 + + + 8 + 60 + 1 + 0 + 0 + 0 + ..\..\components\drivers\src\workqueue.c + workqueue.c + 0 + 0 + + + + + finsh + 0 + 0 + 0 + 0 + + 9 + 61 + 1 + 0 + 0 + 0 + ..\..\components\finsh\shell.c + shell.c + 0 + 0 + + + 9 + 62 + 1 + 0 + 0 + 0 + ..\..\components\finsh\symbol.c + symbol.c + 0 + 0 + + + 9 + 63 + 1 + 0 + 0 + 0 + ..\..\components\finsh\cmd.c + cmd.c + 0 + 0 + + + 9 + 64 + 1 + 0 + 0 + 0 + ..\..\components\finsh\msh.c + msh.c + 0 + 0 + + + 9 + 65 + 1 + 0 + 0 + 0 + ..\..\components\finsh\msh_cmd.c + msh_cmd.c + 0 + 0 + + + 9 + 66 + 1 + 0 + 0 + 0 + ..\..\components\finsh\msh_file.c + msh_file.c + 0 + 0 + + + +
diff --git a/bsp/nrf52832/project.uvprojx b/bsp/nrf52832/project.uvprojx index 7bc9cd039d..4f1745de94 100644 --- a/bsp/nrf52832/project.uvprojx +++ b/bsp/nrf52832/project.uvprojx @@ -1,41 +1,45 @@ + 2.1 +
### uVision Project, (C) Keil Software
+ rtthread 0x4 ARM-ADS + 5060422::V5.06 update 4 (build 422)::ARMCC nRF52832_xxAA Nordic Semiconductor - NordicSemiconductor.nRF_DeviceFamilyPack.8.12.0 + NordicSemiconductor.nRF_DeviceFamilyPack.8.17.0 http://developer.nordicsemi.com/nRF5_SDK/pieces/nRF_DeviceFamilyPack/ IRAM(0x20000000,0x10000) IROM(0x00000000,0x80000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE - - + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC4000 -FN2 -FF0nrf52xxx -FS00 -FL0200000 -FF1nrf52xxx_uicr -FS110001000 -FL11000 -FP0($$Device:nRF52832_xxAA$Flash\nrf52xxx.flm) -FP1($$Device:nRF52832_xxAA$Flash\nrf52xxx_uicr.flm)) 0 $$Device:nRF52832_xxAA$Device\Include\nrf.h - - - - - - - - - + + + + + + + + + $$Device:nRF52832_xxAA$SVD\nrf52.svd 0 0 - - - - - + + + + + 0 0 @@ -57,8 +61,8 @@ 0 0 - - + + 0 0 0 @@ -67,8 +71,8 @@ 0 0 - - + + 0 0 0 @@ -78,14 +82,14 @@ 1 0 fromelf --bin !L --output rtthread.bin - + 0 0 0 0 0 - + 0 @@ -99,8 +103,8 @@ 0 0 3 - - + + 1 @@ -134,10 +138,10 @@ 1 BIN\UL2CM3.DLL "" () - - - - + + + + 0 @@ -170,7 +174,7 @@ 0 0 "Cortex-M4" - + 0 0 0 @@ -302,7 +306,7 @@ 0x0 - + 1 @@ -329,9 +333,9 @@ 0 --reduce_paths - NRF52_PAN_12, NRF52_PAN_15, NRF52_PAN_58, SWI_DISABLE0, NRF52_PAN_20, NRF52_PAN_54, NRF52, NRF52_PAN_51, NRF52_PAN_36, RTTHREAD, CONFIG_GPIO_AS_PINRESET, NRF52_PAN_64, NRF52_PAN_55, NRF52_PAN_74, NRF52832_XXAA, NRF52_PAN_31 - - applications;.;nRF5_SDK_13.0.0_04a0bfd/components;nRF5_SDK_13.0.0_04a0bfd/components/device;nRF5_SDK_13.0.0_04a0bfd/components/drivers_nrf/delay;nRF5_SDK_13.0.0_04a0bfd/components/drivers_nrf/uart;nRF5_SDK_13.0.0_04a0bfd/components/drivers_nrf/clock;nRF5_SDK_13.0.0_04a0bfd/components/drivers_nrf/gpiote;nRF5_SDK_13.0.0_04a0bfd/components/drivers_nrf/common;nRF5_SDK_13.0.0_04a0bfd/components/drivers_nrf/hal;nRF5_SDK_13.0.0_04a0bfd/components/drivers_nrf/pwm;nRF5_SDK_13.0.0_04a0bfd/components/drivers_nrf/saadc;nRF5_SDK_13.0.0_04a0bfd/components/libraries/util;nRF5_SDK_13.0.0_04a0bfd/components/libraries/timer;nRF5_SDK_13.0.0_04a0bfd/components/libraries/fstorage;nRF5_SDK_13.0.0_04a0bfd/components/libraries/experimental_section_vars;nRF5_SDK_13.0.0_04a0bfd/components/libraries/log;nRF5_SDK_13.0.0_04a0bfd/components/libraries/log/src;nRF5_SDK_13.0.0_04a0bfd/components/libraries/strerror;nRF5_SDK_13.0.0_04a0bfd/components/toolchain/cmsis/include;../../include;../../libcpu/arm/cortex-m4;../../libcpu/arm/common;../../components/drivers/include;../../components/drivers/include + NRF52_PAN_55, NRF52_PAN_12, NRF52_PAN_15, NRF52_PAN_58, SWI_DISABLE0, SOFTDEVICE_PRESENT, NRF52_PAN_54, NRF52, BLE_STACK_SUPPORT_REQD, NRF52_PAN_51, NRF52_PAN_36, RTTHREAD, CONFIG_GPIO_AS_PINRESET, NRF52_PAN_64, NRF52_PAN_20, NRF52_PAN_74, NRF52832_XXAA, S132, NRF_SD_BLE_API_VERSION=4, NRF52_PAN_31 + + .;..\..\include;applications;.;board;nRF5_SDK_13.0.0_04a0bfd\components;nRF5_SDK_13.0.0_04a0bfd\components\softdevice\common\softdevice_handler;nRF5_SDK_13.0.0_04a0bfd\components\softdevice\s132\headers;nRF5_SDK_13.0.0_04a0bfd\components\softdevice\s132\headers\nrf52;nRF5_SDK_13.0.0_04a0bfd\components\ble\common;nRF5_SDK_13.0.0_04a0bfd\components\ble\nrf_ble_gatt;nRF5_SDK_13.0.0_04a0bfd\components\ble\ble_advertising;nRF5_SDK_13.0.0_04a0bfd\components\ble\ble_services\ble_nus;startups;nRF5_SDK_13.0.0_04a0bfd\components;nRF5_SDK_13.0.0_04a0bfd\components\device;nRF5_SDK_13.0.0_04a0bfd\components\drivers_nrf\delay;nRF5_SDK_13.0.0_04a0bfd\components\drivers_nrf\uart;nRF5_SDK_13.0.0_04a0bfd\components\drivers_nrf\clock;nRF5_SDK_13.0.0_04a0bfd\components\drivers_nrf\gpiote;nRF5_SDK_13.0.0_04a0bfd\components\drivers_nrf\common;nRF5_SDK_13.0.0_04a0bfd\components\drivers_nrf\hal;nRF5_SDK_13.0.0_04a0bfd\components\drivers_nrf\pwm;nRF5_SDK_13.0.0_04a0bfd\components\drivers_nrf\saadc;nRF5_SDK_13.0.0_04a0bfd\components\libraries\util;nRF5_SDK_13.0.0_04a0bfd\components\libraries\timer;nRF5_SDK_13.0.0_04a0bfd\components\libraries\fstorage;nRF5_SDK_13.0.0_04a0bfd\components\libraries\experimental_section_vars;nRF5_SDK_13.0.0_04a0bfd\components\libraries\log;nRF5_SDK_13.0.0_04a0bfd\components\libraries\log\src;nRF5_SDK_13.0.0_04a0bfd\components\libraries\strerror;nRF5_SDK_13.0.0_04a0bfd\components\toolchain\cmsis\include;..\..\libcpu\arm\common;..\..\libcpu\arm\cortex-m4;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\finsh @@ -348,8 +352,8 @@ --cpreproc_opts=-DBLE_STACK_SUPPORT_REQD,-DNRF_SD_BLE_API_VERSION=4,-DS132,-DSOFTDEVICE_PRESENT,-DSWI_DISABLE0,-DCONFIG_GPIO_AS_PINRESET,-DNRF52,-DNRF52832_XXAA,-DNRF52_PAN_12,-DNRF52_PAN_15,-DNRF52_PAN_20,-DNRF52_PAN_31,-DNRF52_PAN_36,-DNRF52_PAN_51,-DNRF52_PAN_54,-DNRF52_PAN_55,-DNRF52_PAN_58,-DNRF52_PAN_64,-DNRF52_PAN_74 BLE_STACK_SUPPORT_REQD NRF_SD_BLE_API_VERSION=4 S132 SOFTDEVICE_PRESENT SWI_DISABLE0 CONFIG_GPIO_AS_PINRESET NRF52 NRF52832_XXAA NRF52_PAN_12 NRF52_PAN_15 NRF52_PAN_20 NRF52_PAN_31 NRF52_PAN_36 NRF52_PAN_51 NRF52_PAN_54 NRF52_PAN_55 NRF52_PAN_58 NRF52_PAN_64 NRF52_PAN_74 - - + + @@ -361,38 +365,189 @@ 0 0x00000000 0x20000000 - - - - - - - + + + + + + + + + Kernel + + + clock.c + 1 + ..\..\src\clock.c + + + components.c + 1 + ..\..\src\components.c + + + cpu.c + 1 + ..\..\src\cpu.c + + + device.c + 1 + ..\..\src\device.c + + + idle.c + 1 + ..\..\src\idle.c + + + ipc.c + 1 + ..\..\src\ipc.c + + + irq.c + 1 + ..\..\src\irq.c + + + kservice.c + 1 + ..\..\src\kservice.c + + + mem.c + 1 + ..\..\src\mem.c + + + mempool.c + 1 + ..\..\src\mempool.c + + + object.c + 1 + ..\..\src\object.c + + + scheduler.c + 1 + ..\..\src\scheduler.c + + + signal.c + 1 + ..\..\src\signal.c + + + thread.c + 1 + ..\..\src\thread.c + + + timer.c + 1 + ..\..\src\timer.c + + + Applications application.c 1 - applications/application.c + applications\application.c - - ble_nus_app.c 1 - applications/ble_nus_app.c + applications\ble_nus_app.c - - startup.c 1 - applications/startup.c + applications\startup.c + + + + + Board + + + board.c + 1 + board\board.c + + + uart.c + 1 + board\uart.c + + + + + BLE_STACK + + + ble_advdata.c + 1 + nRF5_SDK_13.0.0_04a0bfd\components\ble\common\ble_advdata.c + + + ble_conn_params.c + 1 + nRF5_SDK_13.0.0_04a0bfd\components\ble\common\ble_conn_params.c + + + ble_conn_state.c + 1 + nRF5_SDK_13.0.0_04a0bfd\components\ble\common\ble_conn_state.c + + + ble_srv_common.c + 1 + nRF5_SDK_13.0.0_04a0bfd\components\ble\common\ble_srv_common.c + + + nrf_ble_gatt.c + 1 + nRF5_SDK_13.0.0_04a0bfd\components\ble\nrf_ble_gatt\nrf_ble_gatt.c + + + ble_nus.c + 1 + nRF5_SDK_13.0.0_04a0bfd\components\ble\ble_services\ble_nus\ble_nus.c + + + ble_advertising.c + 1 + nRF5_SDK_13.0.0_04a0bfd\components\ble\ble_advertising\ble_advertising.c + + + softdevice_handler.c + 1 + nRF5_SDK_13.0.0_04a0bfd\components\softdevice\common\softdevice_handler\softdevice_handler.c + + + + + Startup + + + system_nrf52.c + 1 + startups\system_nrf52.c + + + arm_startup_nrf52.s + 2 + startups\arm\arm_startup_nrf52.s @@ -402,298 +557,208 @@ nrf_saadc.c 1 - nRF5_SDK_13.0.0_04a0bfd/components/drivers_nrf/hal/nrf_saadc.c + nRF5_SDK_13.0.0_04a0bfd\components\drivers_nrf\hal\nrf_saadc.c - - nrf_drv_common.c 1 - nRF5_SDK_13.0.0_04a0bfd/components/drivers_nrf/common/nrf_drv_common.c + nRF5_SDK_13.0.0_04a0bfd\components\drivers_nrf\common\nrf_drv_common.c - - nrf_drv_clock.c 1 - nRF5_SDK_13.0.0_04a0bfd/components/drivers_nrf/clock/nrf_drv_clock.c + nRF5_SDK_13.0.0_04a0bfd\components\drivers_nrf\clock\nrf_drv_clock.c - - nrf_drv_gpiote.c 1 - nRF5_SDK_13.0.0_04a0bfd/components/drivers_nrf/gpiote/nrf_drv_gpiote.c + nRF5_SDK_13.0.0_04a0bfd\components\drivers_nrf\gpiote\nrf_drv_gpiote.c - - nrf_drv_pwm.c 1 - nRF5_SDK_13.0.0_04a0bfd/components/drivers_nrf/pwm/nrf_drv_pwm.c + nRF5_SDK_13.0.0_04a0bfd\components\drivers_nrf\pwm\nrf_drv_pwm.c - - nrf_drv_saadc.c 1 - nRF5_SDK_13.0.0_04a0bfd/components/drivers_nrf/saadc/nrf_drv_saadc.c + nRF5_SDK_13.0.0_04a0bfd\components\drivers_nrf\saadc\nrf_drv_saadc.c - - nrf_log_backend_serial.c 1 - nRF5_SDK_13.0.0_04a0bfd/components/libraries/log/src/nrf_log_backend_serial.c + nRF5_SDK_13.0.0_04a0bfd\components\libraries\log\src\nrf_log_backend_serial.c - - nrf_log_frontend.c 1 - nRF5_SDK_13.0.0_04a0bfd/components/libraries/log/src/nrf_log_frontend.c + nRF5_SDK_13.0.0_04a0bfd\components\libraries\log\src\nrf_log_frontend.c - - app_timer_rtthread.c 1 - nRF5_SDK_13.0.0_04a0bfd/components/libraries/timer/app_timer_rtthread.c + nRF5_SDK_13.0.0_04a0bfd\components\libraries\timer\app_timer_rtthread.c - - app_error.c 1 - nRF5_SDK_13.0.0_04a0bfd/components/libraries/util/app_error.c + nRF5_SDK_13.0.0_04a0bfd\components\libraries\util\app_error.c - - app_error_weak.c 1 - nRF5_SDK_13.0.0_04a0bfd/components/libraries/util/app_error_weak.c + nRF5_SDK_13.0.0_04a0bfd\components\libraries\util\app_error_weak.c - - app_util_platform.c 1 - nRF5_SDK_13.0.0_04a0bfd/components/libraries/util/app_util_platform.c + nRF5_SDK_13.0.0_04a0bfd\components\libraries\util\app_util_platform.c - - nrf_assert.c 1 - nRF5_SDK_13.0.0_04a0bfd/components/libraries/util/nrf_assert.c + nRF5_SDK_13.0.0_04a0bfd\components\libraries\util\nrf_assert.c - - sdk_mapped_flags.c 1 - nRF5_SDK_13.0.0_04a0bfd/components/libraries/util/sdk_mapped_flags.c + nRF5_SDK_13.0.0_04a0bfd\components\libraries\util\sdk_mapped_flags.c - - fstorage.c 1 - nRF5_SDK_13.0.0_04a0bfd/components/libraries/fstorage/fstorage.c + nRF5_SDK_13.0.0_04a0bfd\components\libraries\fstorage\fstorage.c - - nrf_strerror.c 1 - nRF5_SDK_13.0.0_04a0bfd/components/libraries/strerror/nrf_strerror.c + nRF5_SDK_13.0.0_04a0bfd\components\libraries\strerror\nrf_strerror.c - Kernel - - - clock.c - 1 - ../../src/clock.c - - - - - device.c - 1 - ../../src/device.c - - - - - idle.c - 1 - ../../src/idle.c - - - - - ipc.c - 1 - ../../src/ipc.c - - - - - irq.c - 1 - ../../src/irq.c - - - - - kservice.c - 1 - ../../src/kservice.c - - - - - mem.c - 1 - ../../src/mem.c - - - - - object.c - 1 - ../../src/object.c - - - - - scheduler.c - 1 - ../../src/scheduler.c - - - - - signal.c - 1 - ../../src/signal.c - - - - - thread.c - 1 - ../../src/thread.c - - - - - timer.c - 1 - ../../src/timer.c - - - - - CORTEX-M4 - - - cpuport.c - 1 - ../../libcpu/arm/cortex-m4/cpuport.c - - - - - context_rvds.S - 2 - ../../libcpu/arm/cortex-m4/context_rvds.S - - + cpu backtrace.c 1 - ../../libcpu/arm/common/backtrace.c + ..\..\libcpu\arm\common\backtrace.c - - div0.c 1 - ../../libcpu/arm/common/div0.c + ..\..\libcpu\arm\common\div0.c - - showmem.c 1 - ../../libcpu/arm/common/showmem.c + ..\..\libcpu\arm\common\showmem.c + + + cpuport.c + 1 + ..\..\libcpu\arm\cortex-m4\cpuport.c + + + context_rvds.S + 2 + ..\..\libcpu\arm\cortex-m4\context_rvds.S DeviceDrivers + + pin.c + 1 + ..\..\components\drivers\misc\pin.c + serial.c 1 - ../../components/drivers/serial/serial.c + ..\..\components\drivers\serial\serial.c - - completion.c 1 - ../../components/drivers/src/completion.c + ..\..\components\drivers\src\completion.c - - dataqueue.c 1 - ../../components/drivers/src/dataqueue.c + ..\..\components\drivers\src\dataqueue.c - - pipe.c 1 - ../../components/drivers/src/pipe.c + ..\..\components\drivers\src\pipe.c + + + ringblk_buf.c + 1 + ..\..\components\drivers\src\ringblk_buf.c - - ringbuffer.c 1 - ../../components/drivers/src/ringbuffer.c + ..\..\components\drivers\src\ringbuffer.c - - waitqueue.c 1 - ../../components/drivers/src/waitqueue.c + ..\..\components\drivers\src\waitqueue.c - - workqueue.c 1 - ../../components/drivers/src/workqueue.c + ..\..\components\drivers\src\workqueue.c + + + + + finsh + + + shell.c + 1 + ..\..\components\finsh\shell.c + + + symbol.c + 1 + ..\..\components\finsh\symbol.c + + + cmd.c + 1 + ..\..\components\finsh\cmd.c + + + msh.c + 1 + ..\..\components\finsh\msh.c + + + msh_cmd.c + 1 + ..\..\components\finsh\msh_cmd.c + + + msh_file.c + 1 + ..\..\components\finsh\msh_file.c + - - - + + + +
diff --git a/bsp/nrf52832/rtconfig.h b/bsp/nrf52832/rtconfig.h index 64349ec531..62f01c65a6 100644 --- a/bsp/nrf52832/rtconfig.h +++ b/bsp/nrf52832/rtconfig.h @@ -1,97 +1,150 @@ -/* RT-Thread config file */ -#ifndef __RTTHREAD_CFG_H__ -#define __RTTHREAD_CFG_H__ +#ifndef RT_CONFIG_H__ +#define RT_CONFIG_H__ -/* RT_NAME_MAX*/ -#define RT_NAME_MAX 6 +/* Automatically generated file; DO NOT EDIT. */ +/* RT-Thread Project Configuration */ -/* RT_ALIGN_SIZE*/ -#define RT_ALIGN_SIZE 4 +/* RT-Thread Kernel */ -/* PRIORITY_MAX */ -#define RT_THREAD_PRIORITY_MAX 8 - -/* Tick per Second */ -#define RT_TICK_PER_SECOND 200 - -/* SECTION: RT_DEBUG */ -/* Thread Debug */ -// #define RT_DEBUG -//#define RT_DEBUG_INIT 1 -// #define RT_USING_OVERFLOW_CHECK - -/* Using Hook */ +#define RT_NAME_MAX 8 +#define RT_ALIGN_SIZE 4 +#define RT_THREAD_PRIORITY_32 +#define RT_THREAD_PRIORITY_MAX 32 +#define RT_TICK_PER_SECOND 100 +#define RT_USING_OVERFLOW_CHECK #define RT_USING_HOOK - -// #define RT_USING_IDLE_HOOK - -#define IDLE_THREAD_STACK_SIZE 384 - -/* Using Software Timer */ +#define RT_USING_IDLE_HOOK +#define RT_IDEL_HOOK_LIST_SIZE 4 +#define IDLE_THREAD_STACK_SIZE 256 #define RT_USING_TIMER_SOFT -#define RT_TIMER_THREAD_PRIO 1 -#define RT_TIMER_THREAD_STACK_SIZE 512 -#define RT_TIMER_TICK_PER_SECOND 200 +#define RT_TIMER_THREAD_PRIO 4 +#define RT_TIMER_THREAD_STACK_SIZE 512 +#define RT_DEBUG + +/* Inter-Thread communication */ -/* 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_MAILBOX #define RT_USING_MESSAGEQUEUE -/* SECTION: Memory Management */ -/* Using Memory Pool Management*/ -/* #define RT_USING_MEMPOOL */ +/* Memory Management */ -/* Using Dynamic Heap Management */ +#define RT_USING_MEMPOOL +#define RT_USING_SMALL_MEM #define RT_USING_HEAP -/* Using Small MM */ -#define RT_USING_SMALL_MEM -#define RT_USING_TINY_SIZE +/* Kernel Device Object */ -// -//#define RT_USING_COMPONENTS_INIT - -/* SECTION: Device System */ -/* Using Device System */ #define RT_USING_DEVICE -// +#define RT_USING_CONSOLE +#define RT_CONSOLEBUF_SIZE 128 +#define RT_CONSOLE_DEVICE_NAME "uart0" +#define RT_VER_NUM 0x40001 + +/* RT-Thread Components */ + +#define RT_USING_COMPONENTS_INIT + +/* C++ features */ + + +/* Command shell */ + +#define RT_USING_FINSH +#define FINSH_THREAD_NAME "tshell" +#define FINSH_USING_HISTORY +#define FINSH_HISTORY_LINES 5 +#define FINSH_USING_SYMTAB +#define FINSH_USING_DESCRIPTION +#define FINSH_THREAD_PRIORITY 20 +#define FINSH_THREAD_STACK_SIZE 4096 +#define FINSH_CMD_SIZE 80 +#define FINSH_USING_MSH +#define FINSH_USING_MSH_DEFAULT +#define FINSH_USING_MSH_ONLY +#define FINSH_ARG_MAX 10 + +/* Device virtual file system */ + + +/* Device Drivers */ + #define RT_USING_DEVICE_IPC -// +#define RT_PIPE_BUFSZ 512 #define RT_USING_SERIAL #define RT_SERIAL_USING_DMA +#define RT_SERIAL_RB_BUFSZ 64 +#define RT_USING_PIN -/* SECTION: Console options */ -#define RT_USING_CONSOLE -/* the buffer size of console*/ -#define RT_CONSOLEBUF_SIZE 128 -// -#define RT_CONSOLE_DEVICE_NAME "uart0" +/* Using WiFi */ -// #define RT_USING_SPI -/* SECTION: finsh, a C-Express shell */ -// #define RT_USING_FINSH -/* configure finsh parameters */ -#define FINSH_THREAD_PRIORITY 6 -#define FINSH_THREAD_STACK_SIZE 512 -#define FINSH_HISTORY_LINES 1 -/* Using symbol table */ -// #define FINSH_USING_SYMTAB -// #define FINSH_USING_DESCRIPTION +/* Using USB */ + + +/* POSIX layer and C standard library */ + + +/* Network */ + +/* Socket abstraction layer */ + + +/* light weight TCP/IP stack */ + + +/* Modbus master and slave stack */ + + +/* AT commands */ + + +/* VBUS(Virtual Software BUS) */ + + +/* Utilities */ + + +/* RT-Thread online packages */ + +/* IoT - internet of things */ + + +/* Wi-Fi */ + +/* Marvell WiFi */ + + +/* Wiced WiFi */ + + +/* IoT Cloud */ + + +/* security packages */ + + +/* language packages */ + + +/* multimedia packages */ + + +/* tools packages */ + + +/* system packages */ + + +/* peripheral libraries and drivers */ + + +/* miscellaneous packages */ + + +/* samples: kernel and components samples */ -// #define FINSH_USING_MSH -#define FINSH_USING_MSH_ONLY #endif diff --git a/bsp/nrf52832/startups/arm/arm_startup_nrf52.s b/bsp/nrf52832/startups/arm/arm_startup_nrf52.s index bd73f4342d..d00e5d10d0 100644 --- a/bsp/nrf52832/startups/arm/arm_startup_nrf52.s +++ b/bsp/nrf52832/startups/arm/arm_startup_nrf52.s @@ -28,7 +28,7 @@ Stack_Size EQU __STARTUP_CONFIG_STACK_SIZE ELIF :DEF: __STACK_SIZE Stack_Size EQU __STACK_SIZE ELSE -Stack_Size EQU 8096 +Stack_Size EQU 8192 ENDIF IF :DEF: __STARTUP_CONFIG @@ -46,7 +46,7 @@ Heap_Size EQU __STARTUP_CONFIG_HEAP_SIZE ELIF :DEF: __HEAP_SIZE Heap_Size EQU __HEAP_SIZE ELSE -Heap_Size EQU 0 +Heap_Size EQU 8192 ENDIF AREA HEAP, NOINIT, READWRITE, ALIGN=3 diff --git a/bsp/nrf52832/template.uvoptx b/bsp/nrf52832/template.uvoptx new file mode 100644 index 0000000000..cc6e259697 --- /dev/null +++ b/bsp/nrf52832/template.uvoptx @@ -0,0 +1,171 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj; *.o + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + rtthread + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\build\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 0 + 0 + 1 + + 5 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 3 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + JL2CM3 + -U59401765 -O78 -S2 -ZTIFSpeedSel5000 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC4000 -FN2 -FF0nrf52xxx.flm -FS00 -FL0200000 -FP0($$Device:nRF52832_xxAA$Flash\nrf52xxx.flm) -FF1nrf52xxx_uicr.flm -FS110001000 -FL11000 -FP1($$Device:nRF52832_xxAA$Flash\nrf52xxx_uicr.flm) + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC4000 -FN2 -FF0nrf52xxx -FS00 -FL0200000 -FF1nrf52xxx_uicr -FS110001000 -FL11000 -FP0($$Device:nRF52832_xxAA$Flash\nrf52xxx.flm) -FP1($$Device:nRF52832_xxAA$Flash\nrf52xxx_uicr.flm)) + + + + + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + +
diff --git a/bsp/nrf52832/template.uvprojx b/bsp/nrf52832/template.uvprojx index db615bfa8b..7f7e673e17 100644 --- a/bsp/nrf52832/template.uvprojx +++ b/bsp/nrf52832/template.uvprojx @@ -10,11 +10,12 @@ rtthread 0x4 ARM-ADS + 5060422::V5.06 update 4 (build 422)::ARMCC nRF52832_xxAA Nordic Semiconductor - NordicSemiconductor.nRF_DeviceFamilyPack.8.12.0 + NordicSemiconductor.nRF_DeviceFamilyPack.8.17.0 http://developer.nordicsemi.com/nRF5_SDK/pieces/nRF_DeviceFamilyPack/ IRAM(0x20000000,0x10000) IROM(0x00000000,0x80000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE