boards: croxel: Add CX1825 Bluetooth prototyping board

Basic support:
- Discrete LEDs
- Buttons
- Sensors
- Beeper

Not included support for:
- PDM Microphone
- RGB LEDs (charge-pump)

Signed-off-by: Luis Ubieda <luisf@croxel.com>
This commit is contained in:
Luis Ubieda 2024-04-24 21:05:51 -04:00 committed by Fabio Baltieri
commit e22fc1d7b0
13 changed files with 424 additions and 0 deletions

View file

@ -0,0 +1,16 @@
# Copyright (c) 2024 Luis Ubieda
# SPDX-License-Identifier: Apache-2.0
if BOARD_CROXEL_CX1825
config BOARD_ENABLE_DCDC
bool "DCDC mode"
select SOC_DCDC_NRF52X
default y
config BOARD_ENABLE_DCDC_HV
bool "High Voltage DCDC converter"
select SOC_DCDC_NRF52X_HV
default y
endif # BOARD_CROXEL_CX1825

View file

@ -0,0 +1,5 @@
# Copyright (c) 2024 Luis Ubieda
# SPDX-License-Identifier: Apache-2.0
config BOARD_CROXEL_CX1825
select SOC_NRF52840_QIAA

View file

@ -0,0 +1,9 @@
# Copyright (c) 2024 Luis Ubieda
# SPDX-License-Identifier: Apache-2.0
if BOARD_CROXEL_CX1825
config BT_CTLR
default BT
endif # BOARD_CROXEL_CX1825

View file

@ -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")
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
include(${ZEPHYR_BASE}/boards/common/nrfutil.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)

View file

@ -0,0 +1,5 @@
board:
name: croxel_cx1825
vendor: croxel
socs:
- name: nrf52840

View file

@ -0,0 +1,35 @@
/*
* Copyright (c) 2024 Luis Ubieda
* SPDX-License-Identifier: Apache-2.0
*/
&pinctrl {
i2c0_default: i2c0_default {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 27)>,
<NRF_PSEL(TWIM_SCL, 0, 26)>;
};
};
i2c0_sleep: i2c0_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 27)>,
<NRF_PSEL(TWIM_SCL, 0, 26)>;
low-power-enable;
};
};
pwm0_default: pwm0_default {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 1, 8)>;
};
};
pwm0_sleep: pwm0_sleep {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 1, 8)>;
low-power-enable;
};
};
};

View file

@ -0,0 +1,157 @@
/*
* Copyright (c) 2024 Luis Ubieda
*
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>
#include "croxel_cx1825_nrf52840-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>
/ {
model = "Croxel CX1825 NRF52840";
compatible = "croxel,cx1825-nrf52840";
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
zephyr,console = &cdc_acm_0;
zephyr,shell-uart = &cdc_acm_0;
};
leds {
compatible = "gpio-leds";
led0: led_0 {
gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
label = "Red LED";
};
led1: led_1 {
gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
label = "Green LED";
};
};
buttons {
compatible = "gpio-keys";
button0: button_0 {
gpios = <&gpio0 16 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
label = "Push button switch 0";
zephyr,code = <INPUT_KEY_0>;
};
};
/* These aliases are provided for compatibility with samples */
aliases {
led0 = &led0;
led1 = &led1;
sw0 = &button0;
bootloader-led0 = &led0;
mcuboot-button0 = &button0;
mcuboot-led0 = &led0;
watchdog0 = &wdt0;
};
};
&adc {
status = "okay";
};
&uicr {
gpio-as-nreset;
};
&gpiote {
status = "okay";
};
&gpio0 {
status = "okay";
};
&gpio1 {
status = "okay";
};
&pwm0 {
status = "okay";
pinctrl-0 = <&pwm0_default>;
pinctrl-1 = <&pwm0_sleep>;
pinctrl-names = "default", "sleep";
};
arduino_i2c: &i2c0 {
compatible = "nordic,nrf-twi";
status = "okay";
pinctrl-0 = <&i2c0_default>;
pinctrl-1 = <&i2c0_sleep>;
pinctrl-names = "default", "sleep";
hts221: hts221@5f {
compatible = "st,hts221";
status = "okay";
reg = <0x5f>;
drdy-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
};
lps22hb: lps22hb-press@5c {
compatible = "st,lps22hb-press";
status = "okay";
reg = <0x5c>;
};
apds9960: apds9960@39 {
compatible = "avago,apds9960";
status = "okay";
reg = <0x39>;
int-gpios = <&gpio0 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
};
lis3dh: lis3dh@18 {
compatible = "st,lis3dh", "st,lis2dh";
status = "okay";
reg = <0x18>;
irq-gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
};
};
zephyr_udc0: &usbd {
compatible = "nordic,nrf-usbd";
status = "okay";
cdc_acm_0: cdc_acm_0 {
compatible = "zephyr,cdc-acm-uart";
};
};
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 0x0000C000>;
};
slot0_partition: partition@c000 {
label = "image-0";
reg = <0x0000C000 0x00076000>;
};
slot1_partition: partition@82000 {
label = "image-1";
reg = <0x00082000 0x00076000>;
};
/*
* Storage partition will be used by FCB/LittleFS/NVS
* if enabled.
*/
storage_partition: partition@f8000 {
label = "storage";
reg = <0x000f8000 0x00008000>;
};
};
};

View file

@ -0,0 +1,19 @@
identifier: croxel_cx1825/nrf52840
name: Croxel-CX1825-NRF52840
type: mcu
arch: arm
ram: 256
flash: 1024
toolchain:
- zephyr
- gnuarmemb
- xtools
supported:
- arduino_gpio
- arduino_i2c
- ble
- counter
- gpio
- i2c
- watchdog
vendor: croxel

View file

@ -0,0 +1,22 @@
# Copyright (c) 2024 Luis Ubieda
# SPDX-License-Identifier: Apache-2.0
# Enable MPU
CONFIG_ARM_MPU=y
# Enable hardware stack protection
CONFIG_HW_STACK_PROTECTION=y
# enable GPIO
CONFIG_GPIO=y
# Assume we start console by default
CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=y
# Console over USB CDC-ACM
CONFIG_USB_DEVICE_STACK=y
CONFIG_SERIAL=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_UART_LINE_CTRL=y

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

View file

@ -0,0 +1,130 @@
.. _croxel_cx1825_nrf52840:
CX1825 nRF52840
###############
Overview
********
Croxel's `CX1825 Bluetooth Prototyping board`_ provides support for the Nordic
Semiconductor nRF52840 ARM Cortex-M4F CPU and the following devices:
* :abbr:`ADC (Analog to Digital Converter)`
* CLOCK
* FLASH
* :abbr:`GPIO (General Purpose Input Output)`
* :abbr:`I2C (Inter-Integrated Circuit)`
* :abbr:`MPU (Memory Protection Unit)`
* :abbr:`NVIC (Nested Vectored Interrupt Controller)`
* :abbr:`PWM (Pulse Width Modulation)`
* RADIO (Bluetooth Low Energy and 802.15.4)
* :abbr:`RTC (nRF RTC System Clock)`
* Segger RTT (RTT Console)
* :abbr:`SPI (Serial Peripheral Interface)`
* :abbr:`USB (Universal Serial Bus)`
* :abbr:`WDT (Watchdog Timer)`
.. figure:: img/cx1825_nrf52840.jpg
:align: center
:alt: CX1825
Croxel's CX1825 Bluetooth Prototyping board (Credit: Croxel)
Hardware
********
- Ezurio's BL654 (nRF52840 ARM Cortex-M4F processor at 64MHz)
- 1 MB flash memory and 256 KB of SRAM
- Coin-cell retainer for Lithium coincell batteries
- 2 Discrete LEDs (Red and Green)
- User Button
- Reset Button
- Accelerometer (LIS3DH)
- Ambient & RGB Light and Proximity Sensor (APDS9960)
- Temperature and Humidity Sensor (HTS221)
- Barometric Pressure sensor (LPS22H)
- Hall Effect Switch (MLX90248)
- RGB LED with Charge-Pump driver (LPS5521)
- Digital Microphone
- Beeper
- QWIIC connector supporting expansion for I2C devices
- USB Connector for data and power
- 16-pin Expansion connector
- SWD Connector
Supported Features
==================
- Discrete LEDs (red and green)
- Buttons (User and Reset)
- Sensors (Accelerometer, Light, Temperature and Humidity, Pressure and Hall-Effect sensors)
- Beeper
- Radio (Bluetooth, IEEE 802.15.4)
- SOC peripherals (ADC, Clock, Flash, GPIO, I2C, MPU, NVIC, PWM, Radio, RTC, SPI, USB, WDT)
Future Feature Support
======================
- RGB LED (Charge-Pump driver not implemented)
- Microphone
Connections and IOs
===================
Croxel's CX1825 Bluetooth Prototyping board has detailed information
about the board (`schematic`_)
LEDs
----
- LED1 (red) = P0.8
- LED2 (green) = P0.12
Digital Inputs
--------------
- User Button = P1.16
- Reset Button = P0.18
- Hall-Effect Switch = P0.15
Programming and Debugging
*************************
Applications for the ``croxel_cx1825/nrf52840`` board configuration
can be built and flashed in the usual way (see :ref:`build_an_application`
and :ref:`application_run` for more details).
Flashing
========
Flashing Zephyr onto the ``croxel_cx1825_nrf52840`` board requires
an external programmer. The programmer is attached to the SWD header.
Build the Zephyr kernel and the :zephyr:code-sample:`blinky` sample application.
.. zephyr-app-commands::
:zephyr-app: samples/basic/blinky
:board: croxel_cx1825/nrf52840
:goals: build
:compact:
Flash the image.
.. zephyr-app-commands::
:zephyr-app: samples/basic/blinky
:board: croxel_cx1825/nrf52840
:goals: flash
:compact:
You should see the red LED blink.
References
**********
.. target-notes::
.. _CX1825 Bluetooth Prototyping board:
https://croxel.com/ble
.. _schematic:
https://croxeldata.s3.amazonaws.com/cx1825/CX1825-01_SCH_200424A.PDF

View file

@ -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")

10
boards/croxel/index.rst Normal file
View file

@ -0,0 +1,10 @@
.. _boards-croxel:
Croxel
######
.. toctree::
:maxdepth: 1
:glob:
**/*