boards: arm: Add support for Arduino Nicla Sense ME
This commit adds support for the Arduino Nicla Sense ME board. The board functionality has been tested using the samples: - hello_world - philosophers - peripheral_dis - spi_flash Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
This commit is contained in:
parent
92103b835b
commit
ab6f5cf077
11 changed files with 445 additions and 0 deletions
8
boards/arm/arduino_nicla_sense_me/Kconfig.board
Normal file
8
boards/arm/arduino_nicla_sense_me/Kconfig.board
Normal file
|
@ -0,0 +1,8 @@
|
|||
# Arduino Nicla Sense ME board configuration
|
||||
|
||||
# Copyright (c) 2022 Benjamin Björnsson <benjamin.bjornsson@gmail.com>.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
config BOARD_ARDUINO_NICLA_SENSE_ME
|
||||
bool "Arduino Nicla Sense ME"
|
||||
depends on SOC_NRF52832_QFAA
|
14
boards/arm/arduino_nicla_sense_me/Kconfig.defconfig
Normal file
14
boards/arm/arduino_nicla_sense_me/Kconfig.defconfig
Normal file
|
@ -0,0 +1,14 @@
|
|||
# Arduino Nicla Sense ME board configuration
|
||||
|
||||
# Copyright (c) 2022 Benjamin Björnsson <benjamin.bjornsson@gmail.com>.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if BOARD_ARDUINO_NICLA_SENSE_ME
|
||||
|
||||
config BOARD
|
||||
default "arduino_nicla_sense_me"
|
||||
|
||||
config BT_CTLR
|
||||
default BT
|
||||
|
||||
endif # BOARD_ARDUINO_NICLA_SENSE_ME
|
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* Copyright (c) 2022 Benjamin Björnsson <benjamin.bjornsson@gmail.com>.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
&pinctrl {
|
||||
uart0_default: uart0_default {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(UART_TX, 0, 20)>,
|
||||
<NRF_PSEL(UART_RX, 0, 9)>;
|
||||
};
|
||||
};
|
||||
|
||||
uart0_sleep: uart0_sleep {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(UART_TX, 0, 20)>,
|
||||
<NRF_PSEL(UART_RX, 0, 9)>;
|
||||
low-power-enable;
|
||||
};
|
||||
};
|
||||
|
||||
i2c0_default: i2c0_default {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(TWIM_SDA, 0, 15)>,
|
||||
<NRF_PSEL(TWIM_SCL, 0, 16)>;
|
||||
};
|
||||
};
|
||||
|
||||
i2c0_sleep: i2c0_sleep {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(TWIM_SDA, 0, 15)>,
|
||||
<NRF_PSEL(TWIM_SCL, 0, 16)>;
|
||||
low-power-enable;
|
||||
};
|
||||
};
|
||||
|
||||
i2c1_default: i2c1_default {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(TWIM_SDA, 0, 22)>,
|
||||
<NRF_PSEL(TWIM_SCL, 0, 23)>;
|
||||
};
|
||||
};
|
||||
|
||||
i2c1_sleep: i2c1_sleep {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(TWIM_SDA, 0, 22)>,
|
||||
<NRF_PSEL(TWIM_SCL, 0, 23)>;
|
||||
low-power-enable;
|
||||
};
|
||||
};
|
||||
|
||||
spi1_default: spi2_default {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(SPIM_SCK, 0, 11)>,
|
||||
<NRF_PSEL(SPIM_MOSI, 0, 27)>,
|
||||
<NRF_PSEL(SPIM_MISO, 0, 28)>;
|
||||
};
|
||||
};
|
||||
|
||||
spi1_sleep: spi2_sleep {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(SPIM_SCK, 0, 11)>,
|
||||
<NRF_PSEL(SPIM_MOSI, 0, 27)>,
|
||||
<NRF_PSEL(SPIM_MISO, 0, 28)>;
|
||||
low-power-enable;
|
||||
};
|
||||
};
|
||||
|
||||
spi2_default: spi2_default {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(SPIM_SCK, 0, 3)>,
|
||||
<NRF_PSEL(SPIM_MOSI, 0, 4)>,
|
||||
<NRF_PSEL(SPIM_MISO, 0, 5)>;
|
||||
};
|
||||
};
|
||||
|
||||
spi2_sleep: spi2_sleep {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(SPIM_SCK, 0, 3)>,
|
||||
<NRF_PSEL(SPIM_MOSI, 0, 4)>,
|
||||
<NRF_PSEL(SPIM_MISO, 0, 5)>;
|
||||
low-power-enable;
|
||||
};
|
||||
};
|
||||
};
|
138
boards/arm/arduino_nicla_sense_me/arduino_nicla_sense_me.dts
Normal file
138
boards/arm/arduino_nicla_sense_me/arduino_nicla_sense_me.dts
Normal file
|
@ -0,0 +1,138 @@
|
|||
/*
|
||||
* Copyright (c) 2022 Benjamin Björnsson <benjamin.bjornsson@gmail.com>.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
#include <nordic/nrf52832_qfaa.dtsi>
|
||||
#include "arduino_nicla_sense_me-pinctrl.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Arduino Nicla Sense ME";
|
||||
compatible = "arduino,arduino_nicla_sense_me";
|
||||
|
||||
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;
|
||||
};
|
||||
};
|
||||
|
||||
&adc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpiote {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
compatible = "nordic,nrf-uarte";
|
||||
status = "okay";
|
||||
current-speed = <115200>;
|
||||
pinctrl-0 = <&uart0_default>;
|
||||
pinctrl-1 = <&uart0_sleep>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
};
|
||||
|
||||
/* I2C0 in datasheet */
|
||||
&i2c0 {
|
||||
compatible = "nordic,nrf-twim";
|
||||
status = "okay";
|
||||
pinctrl-0 = <&i2c0_default>;
|
||||
pinctrl-1 = <&i2c0_sleep>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
};
|
||||
|
||||
/* I2C1 in datasheet */
|
||||
&i2c1 {
|
||||
compatible = "nordic,nrf-twim";
|
||||
/* Cannot be used together with spi1. */
|
||||
status = "okay";
|
||||
pinctrl-0 = <&i2c1_default>;
|
||||
pinctrl-1 = <&i2c1_sleep>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
};
|
||||
|
||||
/* SPI1 in datasheet */
|
||||
&spi1 {
|
||||
compatible = "nordic,nrf-spim";
|
||||
/* Cannot be used together with i2c1. */
|
||||
/* status = "okay"; */
|
||||
pinctrl-0 = <&spi1_default>;
|
||||
pinctrl-1 = <&spi1_sleep>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
};
|
||||
|
||||
/* SPI0 in datasheet */
|
||||
&spi2 {
|
||||
compatible = "nordic,nrf-spi";
|
||||
status = "okay";
|
||||
pinctrl-0 = <&spi2_default>;
|
||||
pinctrl-1 = <&spi2_sleep>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
cs-gpios = <&gpio0 26 GPIO_ACTIVE_LOW>;
|
||||
|
||||
mx25r1635f@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <80000000>;
|
||||
label = "MX25R16";
|
||||
jedec-id = [c2 28 15];
|
||||
size = <DT_SIZE_M(16)>;
|
||||
has-dpd;
|
||||
t-enter-dpd = <10000>;
|
||||
t-exit-dpd = <35000>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
logging_partition: partition@0 {
|
||||
label = "logging";
|
||||
reg = <0x00000000 DT_SIZE_M(16)>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&flash0 {
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
boot_partition: partition@0 {
|
||||
label = "sam-ba";
|
||||
reg = <0x00000000 0x00010000>;
|
||||
read-only;
|
||||
};
|
||||
slot0_partition: partition@10000 {
|
||||
label = "image-0";
|
||||
reg = <0x00010000 0x30000>;
|
||||
};
|
||||
slot1_partition: partition@40000 {
|
||||
label = "image-1";
|
||||
reg = <0x00040000 0x30000>;
|
||||
};
|
||||
scratch_partition: partition@70000 {
|
||||
label = "image-scratch";
|
||||
reg = <0x00070000 0xa000>;
|
||||
};
|
||||
storage_partition: partition@7a000 {
|
||||
label = "storage";
|
||||
reg = <0x0007a000 0x00006000>;
|
||||
};
|
||||
};
|
||||
};
|
|
@ -0,0 +1,19 @@
|
|||
identifier: arduino_nicla_sense_me
|
||||
name: Arduino Nicla Sense ME
|
||||
type: mcu
|
||||
arch: arm
|
||||
ram: 64
|
||||
flash: 512
|
||||
toolchain:
|
||||
- zephyr
|
||||
- gnuarmemb
|
||||
- xtools
|
||||
supported:
|
||||
- gpio
|
||||
- i2c
|
||||
- spi
|
||||
- shell
|
||||
- counter
|
||||
- nvs
|
||||
- pwm
|
||||
- watchdog
|
|
@ -0,0 +1,25 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
CONFIG_SOC_SERIES_NRF52X=y
|
||||
CONFIG_SOC_NRF52832_QFAA=y
|
||||
CONFIG_BOARD_ARDUINO_NICLA_SENSE_ME=y
|
||||
|
||||
# Enable MPU
|
||||
CONFIG_ARM_MPU=y
|
||||
CONFIG_HW_STACK_PROTECTION=y
|
||||
|
||||
# enable GPIO
|
||||
CONFIG_GPIO=y
|
||||
|
||||
# enable uart driver
|
||||
CONFIG_SERIAL=y
|
||||
|
||||
# enable console
|
||||
CONFIG_CONSOLE=y
|
||||
CONFIG_UART_CONSOLE=y
|
||||
|
||||
# additional board options
|
||||
CONFIG_GPIO_AS_PINRESET=y
|
||||
|
||||
# enable pin controller
|
||||
CONFIG_PINCTRL=y
|
4
boards/arm/arduino_nicla_sense_me/board.cmake
Normal file
4
boards/arm/arduino_nicla_sense_me/board.cmake
Normal file
|
@ -0,0 +1,4 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
board_runner_args(pyocd "--target=nrf52" "--frequency=400000")
|
||||
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
|
BIN
boards/arm/arduino_nicla_sense_me/doc/arduino_nicla_sense_me.png
Normal file
BIN
boards/arm/arduino_nicla_sense_me/doc/arduino_nicla_sense_me.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 256 KiB |
Binary file not shown.
After Width: | Height: | Size: 200 KiB |
146
boards/arm/arduino_nicla_sense_me/doc/index.rst
Normal file
146
boards/arm/arduino_nicla_sense_me/doc/index.rst
Normal file
|
@ -0,0 +1,146 @@
|
|||
.. _arduino_nicla_sense_me:
|
||||
|
||||
Arduino Nicla Sense ME
|
||||
######################
|
||||
|
||||
Overview
|
||||
********
|
||||
The `Arduino Nicla Sense ME`_ is designed around Nordic Semiconductor's
|
||||
nrf52832 ARM Cortex-M4F CPU. The board houses 4 low power industrial grade sensors
|
||||
that can measure rotation, acceleration, pressure, humidity, temperature, air quality
|
||||
and CO2 levels.
|
||||
|
||||
.. figure:: arduino_nicla_sense_me.png
|
||||
:width: 500px
|
||||
:align: center
|
||||
:alt: Arduino Nicla Sense ME
|
||||
|
||||
Arduino Nicla Sense ME (Credit: Arduino)
|
||||
|
||||
Hardware
|
||||
********
|
||||
|
||||
- nRF52832 ARM Cortex-M4 processor at 64 MHz
|
||||
- 512 kB flash memory, 64 kB SRAM
|
||||
- Bluetooth Low Energy
|
||||
- Micro USB (USB-B)
|
||||
- JST 3-pin 1.2 mm pitch battery connector
|
||||
- 10 Digital I/O pins
|
||||
- 2 Analog input pins
|
||||
- 12 PWM pins
|
||||
- One reset button
|
||||
- RGB LED (I2C)
|
||||
- On board sensors:
|
||||
|
||||
- Accelerometer/Gyroscope: Bosch BHI260AP
|
||||
- Gas/Pressure/Temperature/Humidity: Bosch BME688
|
||||
- Geomagnetic: Bosch BMM150
|
||||
- Digital Pressure: Bosch BMP390
|
||||
|
||||
Supported Features
|
||||
==================
|
||||
|
||||
+-----------+------------+----------------------+
|
||||
| Interface | Controller | Driver/Component |
|
||||
+===========+============+======================+
|
||||
| ADC | on-chip | adc |
|
||||
+-----------+------------+----------------------+
|
||||
| CLOCK | on-chip | clock_control |
|
||||
+-----------+------------+----------------------+
|
||||
| FLASH | on-chip | flash |
|
||||
+-----------+------------+----------------------+
|
||||
| GPIO | on-chip | gpio |
|
||||
+-----------+------------+----------------------+
|
||||
| I2C(M/S) | on-chip | i2c |
|
||||
+-----------+------------+----------------------+
|
||||
| MPU | on-chip | arch/arm |
|
||||
+-----------+------------+----------------------+
|
||||
| NVIC | on-chip | arch/arm |
|
||||
+-----------+------------+----------------------+
|
||||
| PWM | on-chip | pwm |
|
||||
+-----------+------------+----------------------+
|
||||
| RADIO | on-chip | Bluetooth Low Energy |
|
||||
+-----------+------------+----------------------+
|
||||
| RTC | on-chip | system clock |
|
||||
+-----------+------------+----------------------+
|
||||
| SPI(M/S) | on-chip | spi |
|
||||
+-----------+------------+----------------------+
|
||||
| UART | on-chip | serial |
|
||||
+-----------+------------+----------------------+
|
||||
| WDT | on-chip | watchdog |
|
||||
+-----------+------------+----------------------+
|
||||
|
||||
Connections and IOs
|
||||
===================
|
||||
|
||||
Available pins:
|
||||
---------------
|
||||
.. figure:: arduino_nicla_sense_me_pinout.png
|
||||
:width: 500px
|
||||
:align: center
|
||||
:height: 500px
|
||||
:alt: Arduino Nicla Sense ME pinout
|
||||
|
||||
Arduino Nicla Sense ME pinout (Credit: Arduino)
|
||||
|
||||
For more details please refer to the `datasheet`_, `full pinout`_ and the `schematics`_.
|
||||
|
||||
Programming and Debugging
|
||||
*************************
|
||||
|
||||
Applications for the ``arduino_nicla_sense_me`` board configuration can be built and
|
||||
flashed in the usual way (see :ref:`build_an_application` and
|
||||
:ref:`application_run` for more details).
|
||||
|
||||
Flashing
|
||||
========
|
||||
|
||||
First, connect the Arduino Nicla Sense ME board to your host computer using
|
||||
the USB port to prepare it for flashing. Then build and flash your application.
|
||||
|
||||
Here is an example for the :ref:`hello_world` application.
|
||||
|
||||
.. zephyr-app-commands::
|
||||
:zephyr-app: samples/hello_world
|
||||
:board: arduino_nicla_sense_me
|
||||
:goals: build flash
|
||||
|
||||
Run a serial host program to connect with your board:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ minicom -D /dev/ttyACM0
|
||||
|
||||
You should see the following message on the console:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
Hello World! arduino_nicla_sense_me
|
||||
|
||||
Debugging
|
||||
=========
|
||||
|
||||
You can debug an application in the usual way. Here is an example for the
|
||||
:ref:`hello_world` application.
|
||||
|
||||
.. zephyr-app-commands::
|
||||
:zephyr-app: samples/hello_world
|
||||
:board: arduino_nicla_sense_me
|
||||
:goals: debug
|
||||
|
||||
References
|
||||
**********
|
||||
|
||||
.. target-notes::
|
||||
|
||||
.. _Arduino Nicla Sense ME:
|
||||
https://docs.arduino.cc/hardware/nicla-sense-me
|
||||
|
||||
.. _datasheet:
|
||||
https://docs.arduino.cc/resources/datasheets/ABX00050-datasheet.pdf
|
||||
|
||||
.. _full pinout:
|
||||
https://docs.arduino.cc/static/60a076271ab009f7be1a7984fa14cf32/ABX00050-full-pinout.pdf
|
||||
|
||||
.. _schematics:
|
||||
https://docs.arduino.cc/static/aa5abe05aeec6f8b5fe6f3f605a986b5/ABX00050-schematics.pdf
|
|
@ -0,0 +1,5 @@
|
|||
# Copyright (c) 2022 Benjamin Björnsson <benjamin.bjornsson@gmail.com>.
|
||||
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
CONFIG_SPI_NOR=y
|
Loading…
Add table
Add a link
Reference in a new issue