Code commpiles for custom bparasite_nrf52840 board
This commit is contained in:
parent
2779fe9af6
commit
a639343b6e
10 changed files with 133 additions and 61 deletions
9
code/nrf-connect/boards/arm/bparasite_nrf52840/Kconfig
Normal file
9
code/nrf-connect/boards/arm/bparasite_nrf52840/Kconfig
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
|
||||
if BOARD_BPARASITE_NRF52840
|
||||
|
||||
config BOARD_ENABLE_DCDC
|
||||
bool "DCDC mode"
|
||||
select SOC_DCDC_NRF52X
|
||||
default y
|
||||
|
||||
endif # BOARD_BPARASITE_NRF52840
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
|
||||
config BOARD_BPARASITE_NRF52840
|
||||
bool "b-parasite nRF52840 board"
|
||||
depends on SOC_NRF52840_QIAA
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
if BOARD_BPARASITE_NRF52840
|
||||
|
||||
config BOARD
|
||||
default "bparasite_nrf52840"
|
||||
|
||||
config BT_CTLR
|
||||
default BT
|
||||
|
||||
endif # BOARD_BPARASITE_NRF52840
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
board_runner_args(jlink "--device=nRF52840_xxAA" "--speed=4000")
|
||||
board_runner_args(pyocd "--target=nrf52840" "--frequency=4000000")
|
||||
# set(OPENOCD_NRF5_SUBFAMILY "nrf52")
|
||||
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
|
||||
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
|
||||
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
|
||||
include(${ZEPHYR_BASE}/boards/common/openocd-nrf5.board.cmake)
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
|
||||
&pinctrl {
|
||||
uart0_default: uart0_default {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(UART_TX, 0, 25)>,
|
||||
<NRF_PSEL(UART_RX, 0, 23)>;
|
||||
};
|
||||
};
|
||||
|
||||
uart0_sleep: uart0_sleep {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(UART_TX, 0, 25)>,
|
||||
<NRF_PSEL(UART_RX, 0, 23)>;
|
||||
low-power-enable;
|
||||
};
|
||||
};
|
||||
|
||||
/* Configure pwm0 instance to use pin 5. */
|
||||
pwm0_default: pwm0_default {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(PWM_OUT0, 0, 5)>;
|
||||
nordic,invert;
|
||||
};
|
||||
};
|
||||
|
||||
pwm0_sleep: pwm0_sleep {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(PWM_OUT0, 0, 5)>;
|
||||
low-power-enable;
|
||||
};
|
||||
};
|
||||
|
||||
/* Configure i2c0 instance to use pins 24 (SDA) & 13 (SCL). */
|
||||
i2c0_default: i2c0_default {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(TWIM_SDA, 0, 24)>,
|
||||
<NRF_PSEL(TWIM_SCL, 0, 13)>;
|
||||
};
|
||||
};
|
||||
|
||||
i2c0_sleep: i2c0_sleep {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(TWIM_SDA, 0, 24)>,
|
||||
<NRF_PSEL(TWIM_SCL, 0, 13)>;
|
||||
low-power-enable;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
@ -1,37 +1,52 @@
|
|||
/dts-v1/;
|
||||
#include <nordic/nrf52840_qiaa.dtsi>
|
||||
#include "bparasite_nrf52840-pinctrl.dtsi"
|
||||
|
||||
&pinctrl {
|
||||
/* Configure pwm0 instance to use pin 5. */
|
||||
pwm0_default: pwm0_default {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(PWM_OUT0, 0, 5)>;
|
||||
nordic,invert;
|
||||
};
|
||||
/ {
|
||||
model = "A soil moisture sensor based on Nordic's nRF52840";
|
||||
compatible = "rbaron,bparasite_nrf52840";
|
||||
|
||||
chosen {
|
||||
// zephyr,console = &uart0;
|
||||
// zephyr,shell-uart = &uart0;
|
||||
// zephyr,uart-mcumgr = &uart0;
|
||||
// zephyr,bt-mon-uart = &uart0;
|
||||
// zephyr,bt-c2h-uart = &uart0;
|
||||
zephyr,sram = &sram0;
|
||||
zephyr,flash = &flash0;
|
||||
zephyr,code-partition = &slot0_partition;
|
||||
};
|
||||
|
||||
pwm0_sleep: pwm0_sleep {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(PWM_OUT0, 0, 5)>;
|
||||
low-power-enable;
|
||||
};
|
||||
zephyr,user {
|
||||
io-channels = <&adc 0>, <&adc 1>, <&adc 2>;
|
||||
};
|
||||
|
||||
/* Configure i2c0 instance to use pins 24 (SDA) & 13 (SCL). */
|
||||
i2c0_default: i2c0_default {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(TWIM_SDA, 0, 24)>,
|
||||
<NRF_PSEL(TWIM_SCL, 0, 13)>;
|
||||
};
|
||||
soil_pwm: soil_pwm {
|
||||
compatible = "pwm-fixed";
|
||||
pwms = <&pwm0 0 PWM_MSEC(100) PWM_POLARITY_INVERTED>;
|
||||
pulse = <PWM_MSEC(50)>;
|
||||
};
|
||||
};
|
||||
|
||||
i2c0_sleep: i2c0_sleep {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(TWIM_SDA, 0, 24)>,
|
||||
<NRF_PSEL(TWIM_SCL, 0, 13)>;
|
||||
low-power-enable;
|
||||
};
|
||||
};
|
||||
&gpiote {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
compatible = "nordic,nrf-uart";
|
||||
status = "okay";
|
||||
current-speed = <115200>;
|
||||
pinctrl-0 = <&uart0_default>;
|
||||
pinctrl-1 = <&uart0_sleep>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
};
|
||||
|
||||
&i2c0 {
|
||||
|
|
@ -130,22 +145,3 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
/ {
|
||||
|
||||
model = "A soil moisture sensor";
|
||||
compatible = "rbaron,b-parasite";
|
||||
|
||||
zephyr,user {
|
||||
io-channels = <&adc 0>, <&adc 1>, <&adc 2>;
|
||||
zephyr,sram = &sram0;
|
||||
zephyr,flash = &flash0;
|
||||
zephyr,code-partition = &slot0_partition;
|
||||
};
|
||||
|
||||
soil_pwm: soil_pwm {
|
||||
compatible = "pwm-fixed";
|
||||
pwms = <&pwm0 0 PWM_MSEC(100) PWM_POLARITY_INVERTED>;
|
||||
pulse = <PWM_MSEC(50)>;
|
||||
};
|
||||
};
|
||||
|
|
@ -2,26 +2,26 @@
|
|||
|
||||
CONFIG_SOC_SERIES_NRF52X=y
|
||||
CONFIG_SOC_NRF52840_QIAA=y
|
||||
# CONFIG_BOARD_NRF52840DK_NRF52840=y
|
||||
CONFIG_BOARD_BPARASITE_NRF52840=y
|
||||
|
||||
# # Enable MPU
|
||||
CONFIG_ARM_MPU=y
|
||||
|
||||
# # Enable hardware stack protection
|
||||
CONFIG_HW_STACK_PROTECTION=y
|
||||
# CONFIG_HW_STACK_PROTECTION=y
|
||||
|
||||
# # Enable RTT
|
||||
CONFIG_USE_SEGGER_RTT=y
|
||||
# CONFIG_USE_SEGGER_RTT=y
|
||||
|
||||
# # enable GPIO
|
||||
CONFIG_GPIO=y
|
||||
|
||||
# # enable uart driver
|
||||
CONFIG_SERIAL=y
|
||||
# CONFIG_SERIAL=y
|
||||
|
||||
# # enable console
|
||||
CONFIG_CONSOLE=y
|
||||
CONFIG_UART_CONSOLE=y
|
||||
# CONFIG_CONSOLE=y
|
||||
# CONFIG_UART_CONSOLE=y
|
||||
|
||||
# # additional board options
|
||||
CONFIG_GPIO_AS_PINRESET=y
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# Copyright (c) 2022 Nordic Semiconductor
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# Suppress "unique_unit_address_if_enabled" to handle the following overlaps:
|
||||
# - power@40000000 & clock@40000000 & bprot@40000000
|
||||
# - acl@4001e000 & flash-controller@4001e000
|
||||
list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled")
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
|
||||
config BOARD_B_PARASITE
|
||||
bool "b-parasite board"
|
||||
depends on SOC_NRF52840_QIAA
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
|
||||
if BOARD_PARASITE
|
||||
|
||||
config BOARD
|
||||
default "parasite"
|
||||
|
||||
endif # BOARD_PARASITE
|
||||
Loading…
Add table
Reference in a new issue