mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-03-27 01:10:20 +08:00
[bsp/nrf5x] add the bsp ble_nano_33
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
|
||||
@@ -6,25 +6,24 @@
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2020-04-29 supperthomas first version
|
||||
* 2021-06-26 supperthomas fix led
|
||||
*
|
||||
*/
|
||||
|
||||
#include <rtthread.h>
|
||||
#include <rtdevice.h>
|
||||
#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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2020-04-29 supperthomas first version
|
||||
* 2020-04-29 supperthomas fix component init
|
||||
*
|
||||
*/
|
||||
#include <rtthread.h>
|
||||
@@ -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;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user