Browse Source

boards: sparkfun: Add micromod nrf52840 board and asset tracker shield

Initial support of Sparkfun Micromod ecosystem with micromod nrf52840
board, asset tracker shield and micromod header definition.

Signed-off-by: Jeronimo Agullo <jeronimoagullo97@gmail.com>
pull/74262/head
Jeronimo Agullo 1 year ago committed by Alberto Escolar
parent
commit
436f56646b
  1. 21
      boards/shields/sparkfun_carrier_asset_tracker/Kconfig.defconfig
  2. 5
      boards/shields/sparkfun_carrier_asset_tracker/Kconfig.shield
  3. BIN
      boards/shields/sparkfun_carrier_asset_tracker/doc/img/sparkfun_carrier_asset_tracker.webp
  4. 117
      boards/shields/sparkfun_carrier_asset_tracker/doc/index.rst
  5. 50
      boards/shields/sparkfun_carrier_asset_tracker/sparkfun_carrier_asset_tracker.overlay
  6. 19
      boards/sparkfun/micromod/Kconfig
  7. 11
      boards/sparkfun/micromod/Kconfig.defconfig
  8. 5
      boards/sparkfun/micromod/Kconfig.micromod
  9. 9
      boards/sparkfun/micromod/board.cmake
  10. 5
      boards/sparkfun/micromod/board.yml
  11. BIN
      boards/sparkfun/micromod/doc/img/sparkfun_micromod.webp
  12. 204
      boards/sparkfun/micromod/doc/index.rst
  13. 116
      boards/sparkfun/micromod/micromod_nrf52840-pinctrl.dtsi
  14. 200
      boards/sparkfun/micromod/micromod_nrf52840.dts
  15. 26
      boards/sparkfun/micromod/micromod_nrf52840.yaml
  16. 19
      boards/sparkfun/micromod/micromod_nrf52840_defconfig
  17. 7
      boards/sparkfun/micromod/pre_dt_board.cmake
  18. 51
      dts/bindings/gpio/sparkfun,micromod-gpio.yaml
  19. 7
      tests/drivers/adc/adc_api/boards/micromod_nrf52840.overlay

21
boards/shields/sparkfun_carrier_asset_tracker/Kconfig.defconfig

@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
# Copyright (c) 2024 Jerónimo Agulló <jeronimoagullo97@gmail.com>
# SPDX-License-Identifier: Apache-2.0
if SHIELD_SPARKFUN_CARRIER_ASSET_TRACKER
config SERIAL
default y
config UART_INTERRUPT_DRIVEN
default y
config UART_ASYNC_API
default y
config I2C
default y
config SPI
default y
endif # SHIELD_SPARKFUN_CARRIER_ASSET_TRACKER

5
boards/shields/sparkfun_carrier_asset_tracker/Kconfig.shield

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
# Copyright (c) 2024 Jerónimo Agulló <jeronimoagullo97@gmail.com>
# SPDX-License-Identifier: Apache-2.0
config SHIELD_SPARKFUN_CARRIER_ASSET_TRACKER
def_bool $(shields_list_contains,sparkfun_carrier_asset_tracker)

BIN
boards/shields/sparkfun_carrier_asset_tracker/doc/img/sparkfun_carrier_asset_tracker.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

117
boards/shields/sparkfun_carrier_asset_tracker/doc/index.rst

@ -0,0 +1,117 @@ @@ -0,0 +1,117 @@
.. _sparkfun_carrier_asset_tracker:
Sparkfun SparkFun MicroMod Asset Tracker Shield
###############################################
Overview
********
The SparkFun MicroMod Asset Tracker Carrier Shield is part of the Sparkfun
Micromod standard, a modular interface ecosystem that uses the M.2 standard
to mix and match your choice of processor with specific Functions Boards.
The Asset Tracker Carrier Shield is built around the u-blox SARA-R510M8S
module, which offers Secure Cloud LTE-M and NB-IoT data communication for
multi-regional use and GNSS capabilities via an integrated u-blox M8 GNSS
receiver for accurate positioning information.
Besides, this shield has an integrated ICM-20948 Inertial Measurement Unit
(IMU) for Nine Degree-Of-Freedom, a built-in micro-SD card socket for data
logging as well as a nano SIM card port.
.. figure:: img/sparkfun_carrier_asset_tracker.webp
:align: center
:alt: Sparkfun SparkFun MicroMod Asset Tracker Shield
Sparkfun SparkFun MicroMod Asset Tracker Shield (Credit: Sparkfun)
More information about the shield can be found at the `SparkFun MicroMod
Asset Tracker guide website`_.
Pins Assignment of Sparkfun SparkFun MicroMod Asset Tracker Shield
==================================================================
The SparkFun MicroMod Asset Tracker Carrier Shield uses a 76 pins M.2
connector. The following table depicts the interfaces and pins supported:
by Zephyr:
+-----------------------+---------------------------------+
| Shield Connector Pin | Function |
+=======================+=================================+
| micromod_1_uart alias | UART 1 (with CTS and RTS pins) |
+-----------------------+---------------------------------+
| micromod_2_uart alias | UART 2 |
+-----------------------+---------------------------------+
| micromod_0_i2c alias | i2c 0 |
+-----------------------+---------------------------------+
| micromod_1_i2c alias | i2c 1 |
+-----------------------+---------------------------------+
| micromod_0_spi alias | SPI 0 |
+-----------------------+---------------------------------+
| A0 | Analog pin |
+-----------------------+---------------------------------+
| A1 | Analog pin |
+-----------------------+---------------------------------+
| D0 | Digital pin |
+-----------------------+---------------------------------+
| D1/CAM_TRIG | Digital pin |
+-----------------------+---------------------------------+
| I2C_INT# | i2c interrupt pin |
+-----------------------+---------------------------------+
| G0/BUS0 | General purpose pin |
+-----------------------+---------------------------------+
| G1/BUS1 | General purpose pin |
+-----------------------+---------------------------------+
| G2/BUS2 | General purpose pin |
+-----------------------+---------------------------------+
| G3/BUS3 | General purpose pin |
+-----------------------+---------------------------------+
| G4/BUS4 | General purpose pin |
+-----------------------+---------------------------------+
| G5/BUS5 | General purpose pin |
+-----------------------+---------------------------------+
| G6/BUS6 | General purpose pin |
+-----------------------+---------------------------------+
| G7/BUS7 | General purpose pin |
+-----------------------+---------------------------------+
| G8 | General purpose pin |
+-----------------------+---------------------------------+
| G9/ADC_D-/CAM_HSYNC | General purpose pin |
+-----------------------+---------------------------------+
| G10/ADC_D+/CAM_VSYNC | General purpose pin |
+-----------------------+---------------------------------+
| G11/SWO | General purpose pin |
+-----------------------+---------------------------------+
| SPI_CS | General purpose pin |
+-----------------------+---------------------------------+
A detailed definition of the Micromod standard can be found on the
`Micromod specification website`_
Requirements
************
This shield can only be used with a board which provides a configuration for
Micromod connectors and defines node aliases for UART, I2C and SPI interfaces (see
:ref:`shields` for more details).
Programming
***********
Set ``-DSHIELD=sparkfun_carrier_asset_tracker`` when you invoke ``west build``. For
example:
.. zephyr-app-commands::
:zephyr-app: samples/net/cellular_modem/
:board: micromod/nrf52840
:shield: sparkfun_carrier_asset_tracker
:goals: build
References
**********
.. target-notes::
.. _SparkFun MicroMod Asset Tracker guide website:
https://learn.sparkfun.com/tutorials/micromod-asset-tracker-carrier-board-hookup-guide
.. _Micromod specification website:
https://www.sparkfun.com/micromod

50
boards/shields/sparkfun_carrier_asset_tracker/sparkfun_carrier_asset_tracker.overlay

@ -0,0 +1,50 @@ @@ -0,0 +1,50 @@
/*
* Copyright (c) 2024 Jerónimo Agulló <jeronimoagullo97@gmail.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
/ {
aliases {
modem-uart = &micromod_1_uart;
modem = &modem;
};
};
&micromod_1_uart {
current-speed = <115200>;
hw-flow-control;
status = "okay";
modem: sara_r5 {
compatible = "u-blox,sara-r5";
mdm-power-gpios = <&micromod_header 7 0>; /* G2 */
mdm-reset-gpios = <&micromod_header 12 0>; /* D6 */
status = "okay";
};
};
&micromod_0_spi {
status = "okay";
/* G0 (SD_CS) */
cs-gpios = <&micromod_header 5 GPIO_ACTIVE_LOW>;
sdhc0: sdhc@0 {
compatible = "zephyr,sdhc-spi-slot";
reg = <0>;
status = "okay";
mmc {
compatible = "zephyr,sdmmc-disk";
status = "okay";
};
spi-max-frequency = <DT_FREQ_M(8)>;
};
};
&micromod_0_i2c {
max17048: max17048@36 {
compatible = "maxim,max17048";
reg = <0x36>;
status = "okay";
};
};

19
boards/sparkfun/micromod/Kconfig

@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
# Sparkfun micromod board configuration
# Copyright (c) 2024 Jerónimo Agulló <jeronimoagullo97@gmail.com>
# SPDX-License-Identifier: Apache-2.0
if BOARD_MICROMOD_NRF52840
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
depends on SOC_NRF52840_QIAA
endif # BOARD_MICROMOD_NRF52840

11
boards/sparkfun/micromod/Kconfig.defconfig

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
# Sparkfun micromod board configuration
# Copyright (c) 2024 Jerónimo Agulló <jeronimoagullo97@gmail.com>
# SPDX-License-Identifier: Apache-2.0
if BOARD_MICROMOD_NRF52840
config BT_CTLR
default BT
endif # BOARD_MICROMOD_NRF52840

5
boards/sparkfun/micromod/Kconfig.micromod

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
# Copyright (c) 2024 Jerónimo Agulló <jeronimoagullo97@gmail.com>
# SPDX-License-Identifier: Apache-2.0
config BOARD_MICROMOD
select SOC_NRF52840_QIAA if BOARD_MICROMOD_NRF52840

9
boards/sparkfun/micromod/board.cmake

@ -0,0 +1,9 @@ @@ -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/openocd-nrf5.board.cmake)
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

5
boards/sparkfun/micromod/board.yml

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
board:
name: micromod
vendor: sparkfun
socs:
- name: nrf52840

BIN
boards/sparkfun/micromod/doc/img/sparkfun_micromod.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

204
boards/sparkfun/micromod/doc/index.rst

@ -0,0 +1,204 @@ @@ -0,0 +1,204 @@
.. _boardname_linkname:
SparkFun MicroMod board Processor
#################################
Overview
********
MicroMod is a solderless, modular interface ecosystem that uses the M.2 standard
to mix and match your choice of processor with specific Function Boards or
stand-alone Carrier Boards. A MicroMod processor board is approximately 22x22 mm,
and can insert into any MicroMod carrier board. More information can be found in
the `Micromod specification website`_.
All Micromod board targets support the following hardware features:
- USB host mode compliant to 2.0 specification
- GPIO
- 2 UART
- 2 I2C
- 2 SPI
- 2 ADC
- 2 PWM
- Watchdog Timer (WDT)
.. figure:: img/sparkfun_micromod.webp
:align: center
:alt: Sparkfun Micromod board
Sparkfun Micromod board (Credit: https://www.sparkfun.com)
Zephyr currently supports the following SoCs:
- ``micromod/nrf52840``
SparkFun MicroMod nRF52840 board Processor
##########################################
Overview
********
The ``micromod/nrf52840`` board target features the nRF52840 SoC
from Nordic Semiconductor, the SparkFun MicroMod nRF52840 Processor offers
a powerful combination of ARM Cortex-M4 CPU and 2.4 GHz Bluetooth transceiver
in the MicroMod form-factor. More information can be found in
the `Micromod nRF52840 guide`_.
Hardware
********
The ``micromod/nrf52840`` board target supports the following
hardware features:
- ARM Cortex-M4 CPU with floating point unit (FPU)
- 1MB internal Flash
- 256kB internal RAM
- Integrated 2.4GHz radio with support for Bluetooth Low Energy (BLE) and ieee802154
- USB 2.0 full speed (12 Mbps) controller
- QSPI with 128Mb flash memory
- ARM TrustZone Cryptocell 310 security subsystem
- USB host mode compliant to 2.0 specification
- GPIO
- 2 UART
- 2 I2C
- 2 SPI
- 2 ADC
- 2 PWM
- Watchdog Timer (WDT)
Supported Features
==================
The Zephyr ``micromod/nrf52840`` board target supports the following hardware
features:
+-----------+------------+-------------------------------------+
| Interface | Controller | Driver/Component |
+===========+============+=====================================+
| NVIC | on-chip | nested vector interrupt controller |
+-----------+------------+-------------------------------------+
| SYSTICK | on-chip | system clock |
+-----------+------------+-------------------------------------+
| RADIO | on-chip | Bluetooth, |
| | | ieee802154 |
+-----------+------------+-------------------------------------+
| UART | on-chip | serial port |
+-----------+------------+-------------------------------------+
| GPIO | on-chip | gpio |
+-----------+------------+-------------------------------------+
| PINMUX | on-chip | pinmux |
+-----------+------------+-------------------------------------+
| FLASH | on-chip | flash |
+-----------+------------+-------------------------------------+
| SPI | on-chip | spi |
+-----------+------------+-------------------------------------+
| I2C | on-chip | i2c |
+-----------+------------+-------------------------------------+
| USB | on-chip | usb |
+-----------+------------+-------------------------------------+
| QSPI | on-chip | nordic,nrf-qspi |
+-----------+------------+-------------------------------------+
Connections and IOs
===================
LED
---
* Led0 (blue) = P0.13
Micromod header
---------------
* micromod_1_uart = uart0
* micromod_2_uart = uart1
* micromod_0_i2c = i2c0
* micromod_1_i2c = i2c1
* micromod_0_spi = spi2
* micromod_header compatible with ``sparkfun,micromod-gpio``
Programming and Debugging
*************************
Applications for the ``micromod/nrf52840`` board target can be
built, flashed, and debugged in the usual way. See
:ref:`build_an_application` and :ref:`application_run` for more details on
building and running.
Flashing
========
Follow the instructions in the :ref:`nordic_segger` page to install
and configure all the necessary software. Further information can be
found in :ref:`nordic_segger_flashing`. Then build and flash
applications as usual (see :ref:`build_an_application` and
:ref:`application_run` for more details).
The flashing tool will depend on the carrier used along with the board.
In the case of `Sparkfun asset tracking carrier`, it is possible to use
the SWD interface along with a J-Link.
Here is an example for the :ref:`hello_world` application.
First, run your favorite terminal program to listen for output.
.. code-block:: console
$ minicom -D <tty_device> -b 115200
Replace :code:`<tty_device>` with the port where the board nRF52840 DK
can be found. For example, under Linux, :code:`/dev/ttyACM0`.
Then build and flash the application in the usual way.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: micromod/nrf52840
:goals: build flash
Debugging
=========
Refer to the :ref:`nordic_segger` page to learn about debugging Nordic boards with a
Segger IC.
In case of using a Nordic Segger Jlink, it is possible to configure the app to use Segger Real
Time Transfer (RTT) for debugging. In this case, build your app with the
:ref:`RTT snippet <snippet-rtt-console>`.
Testing the on-board LED
************************
There is a sample that allow you to test the LED on the board is working properly
with Zephyr:
* :zephyr:code-sample:`blinky`
You can build and flash the example to make sure Zephyr is running correctly on
your board. The button and LED definitions can be found in
:zephyr_file:`boards/sparkfun/micromod/micromod_nrf52840.dts`.
Testing the 128Mb qspi memory flash
***********************************
The ``micromod/nrf52840`` board target has a built-in NOR flash memory connected
to the qspi interface. It can be tested with the samples/drivers/jesd216 app.
.. zephyr-app-commands::
:zephyr-app: samples/drivers/jesd216
:board: micromod/nrf52840
:goals: build flash
References
**********
.. target-notes::
.. _Micromod specification website: https://www.sparkfun.com/micromod
.. _Micromod nRF52840 guide: https://learn.sparkfun.com/tutorials/micromod-nrf52840-processor-hookup-guide
.. _J-Link Software and documentation pack: https://www.segger.com/jlink-software.html
.. _nRF52840 Product Specification: http://infocenter.nordicsemi.com/pdf/nRF52840_PS_v1.0.pdf

116
boards/sparkfun/micromod/micromod_nrf52840-pinctrl.dtsi

@ -0,0 +1,116 @@ @@ -0,0 +1,116 @@
/*
* Copyright (c) 2024 Jerónimo Agulló <jeronimoagullo97@gmail.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
&pinctrl {
uart0_default: uart0_default {
group1 {
psels = <NRF_PSEL(UART_TX, 1, 3)>,
<NRF_PSEL(UART_RX, 1, 10)>,
<NRF_PSEL(UART_RTS, 1, 2)>,
<NRF_PSEL(UART_CTS, 1, 9)>;
};
};
uart0_sleep: uart0_sleep {
group1 {
psels = <NRF_PSEL(UART_TX, 1, 3)>,
<NRF_PSEL(UART_RX, 1, 10)>,
<NRF_PSEL(UART_RTS, 1, 2)>,
<NRF_PSEL(UART_CTS, 1, 9)>;
low-power-enable;
};
};
uart1_default: uart1_default {
group1 {
psels = <NRF_PSEL(UART_TX, 1, 7)>,
<NRF_PSEL(UART_RX, 1, 5)>;
};
};
uart1_sleep: uart1_sleep {
group1 {
psels = <NRF_PSEL(UART_TX, 1, 7)>,
<NRF_PSEL(UART_RX, 1, 5)>;
low-power-enable;
};
};
i2c0_default: i2c0_default {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 8)>,
<NRF_PSEL(TWIM_SCL, 0, 11)>;
};
};
i2c0_sleep: i2c0_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 8)>,
<NRF_PSEL(TWIM_SCL, 0, 11)>;
low-power-enable;
};
};
i2c1_default: i2c1_default {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 1, 1)>,
<NRF_PSEL(TWIM_SCL, 0, 24)>;
};
};
i2c1_sleep: i2c1_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 1, 1)>,
<NRF_PSEL(TWIM_SCL, 0, 24)>;
low-power-enable;
};
};
spi0_default: spi0_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 28)>,
<NRF_PSEL(SPIM_MOSI, 0, 31)>,
<NRF_PSEL(SPIM_MISO, 0, 2)>;
};
};
spi0_sleep: spi0_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 28)>,
<NRF_PSEL(SPIM_MOSI, 0, 31)>,
<NRF_PSEL(SPIM_MISO, 0, 2)>;
low-power-enable;
};
};
qspi_default: qspi_default {
group1 {
psels = <NRF_PSEL(QSPI_SCK, 0, 19)>,
<NRF_PSEL(QSPI_IO0, 0, 14)>,
<NRF_PSEL(QSPI_IO1, 0, 21)>,
<NRF_PSEL(QSPI_IO2, 0, 23)>,
<NRF_PSEL(QSPI_IO3, 1, 0)>,
<NRF_PSEL(QSPI_CSN, 0, 12)>;
nordic,drive-mode = <NRF_DRIVE_H0H1>;
};
};
qspi_sleep: qspi_sleep {
group1 {
psels = <NRF_PSEL(QSPI_SCK, 0, 19)>,
<NRF_PSEL(QSPI_IO0, 0, 14)>,
<NRF_PSEL(QSPI_IO1, 0, 21)>,
<NRF_PSEL(QSPI_IO2, 0, 23)>,
<NRF_PSEL(QSPI_IO3, 1, 0)>;
low-power-enable;
};
group2 {
psels = <NRF_PSEL(QSPI_CSN, 0, 12)>;
low-power-enable;
bias-pull-up;
};
};
};

200
boards/sparkfun/micromod/micromod_nrf52840.dts

@ -0,0 +1,200 @@ @@ -0,0 +1,200 @@
/*
* Copyright (c) 2024 Jerónimo Agulló <jeronimoagullo97@gmail.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>
#include "micromod_nrf52840-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>
/ {
model = "Sparkfun Micrmod nRF52840 board";
compatible = "sparkfun,micromod-nrf52840";
chosen {
zephyr,console = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
zephyr,ieee802154 = &ieee802154;
};
/* These aliases are provided for compatibility with samples */
aliases {
led0 = &led0;
watchdog0 = &wdt0;
};
leds {
compatible = "gpio-leds";
led0: led_0 {
gpios = <&gpio0 13 0>;
label = "Blue LED";
};
};
micromod_header: connector {
compatible = "sparkfun,micromod-gpio";
#gpio-cells = <2>;
gpio-map-mask = <0xffffffff 0xffffffc0>;
gpio-map-pass-thru = <0 0x3f>;
gpio-map = <0 0 &gpio0 4 0>, /* A0 */
<1 0 &gpio0 5 0>, /* A1 */
<2 0 &gpio0 27 0>, /* D0 */
<3 0 &gpio1 8 0>, /* D1/CAM_TRIG */
<4 0 &gpio0 15 0>, /* I2C_INT# */
<5 0 &gpio0 29 0>, /* G0/BUS0 */
<6 0 &gpio0 3 0>, /* G1/BUS1 */
<7 0 &gpio1 13 0>, /* G2/BUS2 */
<8 0 &gpio1 12 0>, /* G3/BUS3 */
<9 0 &gpio1 11 0>, /* G4/BUS4 */
<10 0 &gpio0 17 0>, /* G5/BUS5 */
<11 0 &gpio1 6 0>, /* G6/BUS6 */
<12 0 &gpio1 4 0>, /* G7/BUS7 */
<13 0 &gpio1 14 0>, /* G8 */
<14 0 &gpio0 9 0>, /* G9/ADC_D-/CAM_HSYNC */
<15 0 &gpio0 10 0>, /* G10/ADC_D+/CAM_VSYNC */
//<16 NO CONNECTED /* G11/SWO */
<17 0 &gpio0 20 0>; /* SPI_CS */
};
};
&adc {
status = "okay";
};
&gpiote {
status = "okay";
};
&gpio0 {
status = "okay";
};
&gpio1 {
status = "okay";
};
&uicr {
nfct-pins-as-gpios;
gpio-as-nreset;
};
&uart0 {
compatible = "nordic,nrf-uarte";
current-speed = <115200>;
status = "okay";
pinctrl-0 = <&uart0_default>;
pinctrl-1 = <&uart0_sleep>;
pinctrl-names = "default", "sleep";
};
&uart1 {
compatible = "nordic,nrf-uarte";
current-speed = <115200>;
status = "okay";
pinctrl-0 = <&uart1_default>;
pinctrl-1 = <&uart1_sleep>;
pinctrl-names = "default", "sleep";
};
&i2c0 {
compatible = "nordic,nrf-twi";
status = "okay";
pinctrl-0 = <&i2c0_default>;
pinctrl-1 = <&i2c0_sleep>;
pinctrl-names = "default", "sleep";
};
&i2c1 {
compatible = "nordic,nrf-twi";
status = "okay";
pinctrl-0 = <&i2c1_default>;
pinctrl-1 = <&i2c1_sleep>;
pinctrl-names = "default", "sleep";
};
&spi2 {
compatible = "nordic,nrf-spi";
status = "okay";
cs-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
pinctrl-0 = <&spi0_default>;
pinctrl-1 = <&spi0_sleep>;
pinctrl-names = "default", "sleep";
};
&qspi {
status = "okay";
pinctrl-0 = <&qspi_default>;
pinctrl-1 = <&qspi_sleep>;
pinctrl-names = "default", "sleep";
w25q128jv: w25q128jv@0 {
status="okay";
compatible = "nordic,qspi-nor";
reg = <0>;
writeoc = "pp4io";
readoc = "read4io";
sck-frequency = <DT_FREQ_M(32)>;
jedec-id = [ef 70 18];
size = <DT_SIZE_M(128)>;
has-dpd;
t-enter-dpd = <3000>;
t-exit-dpd = <3000>;
};
};
&ieee802154 {
status = "okay";
};
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 0x00010000>;
};
slot0_partition: partition@10000 {
label = "image-0";
reg = <0x00010000 0x00076000>;
};
slot1_partition: partition@86000 {
label = "image-1";
reg = <0x00086000 0x00074000>;
};
/*
* The flash starting at 0x000f8000 and ending at
* 0x000fffff is reserved for use by the application.
*/
/*
* Storage partition will be used by FCB/LittleFS/NVS
* if enabled.
*/
storage_partition: partition@fA000 {
label = "storage";
reg = <0x000fA000 0x00006000>;
};
};
};
zephyr_udc0: &usbd {
compatible = "nordic,nrf-usbd";
status = "okay";
};
// Sparkfun Micromod compatible pins
micromod_1_uart: &uart0 {};
micromod_2_uart: &uart1 {};
micromod_0_i2c: &i2c0 {};
micromod_1_i2c: &i2c1 {};
micromod_0_spi: &spi2 {};

26
boards/sparkfun/micromod/micromod_nrf52840.yaml

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
identifier: micromod/nrf52840
name: Sparkfun Micromod nRF52840 board
type: mcu
arch: arm
ram: 256
flash: 1024
toolchain:
- zephyr
- gnuarmemb
- xtools
supported:
- ble
- gpio
- spi
- qspi
- i2c
- pwm
- adc
- usb_device
- usb_cdc
- watchdog
- micromod_gpio
- micromod_uart
- micromod_i2c
- micromod_spi
vendor: Sparkfun

19
boards/sparkfun/micromod/micromod_nrf52840_defconfig

@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
# SPDX-License-Identifier: Apache-2.0
# Enable MPU
CONFIG_ARM_MPU=y
# Enable hardware stack protection
CONFIG_HW_STACK_PROTECTION=y
# Enable RTT
CONFIG_USE_SEGGER_RTT=y
# Enable GPIO
CONFIG_GPIO=y
# Enable console
CONFIG_CONSOLE=y
# Enable UART
CONFIG_SERIAL=y

7
boards/sparkfun/micromod/pre_dt_board.cmake

@ -0,0 +1,7 @@ @@ -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")

51
dts/bindings/gpio/sparkfun,micromod-gpio.yaml

@ -0,0 +1,51 @@ @@ -0,0 +1,51 @@
# Copyright (c) 2024 Jerónimo Agulló
# SPDX-License-Identifier: Apache-2.0
description: |
GPIO pins exposed on micromod headers.
The micromod standard leverages the M.2 connector with 76 pins for
swap between a myriad of supported boards and carriers.
The micromod standard consists of two lanes with the following
supported buses:
* An 6-pin Power Supply header. No pins on this header are exposed
by this binding.
* Reset, Boot pins and SWD pins not exposed by this binding.
* 2 UART buses. First with RTS and CTS pins, while the 2nd with only
RX and TX pins. Neither of them are exposed by this binding.
* 2 i2c buses. Only the corresponding interrupt pin is exposed by
this binding.
* 2 SPI buses not exposed by this binding. Only SPI CS control pin
is exposed by this binding.
* Audio line not exposed by this binding.
* 2 analog pins (A0 and A1).
* 2 digital pins (D0 and D1).
* 12 General purpose pins (G0 - G11).
This binding provides a nexus mapping for the analog, digital and
general purpose gpios in the order depicted below:
- 00 -> A0 PIN 34
- 01 -> A1 PIN 38
- 02 -> D0 PIN 10
- 03 -> D1/CAM_TRIG PIN 18
- 04 -> I2C_INT# PIN 16
- 05 -> G0/BUS0 PIN 40
- 06 -> G1/BUS1 PIN 42
- 07 -> G2/BUS2 PIN 44
- 08 -> G3/BUS3 PIN 46
- 09 -> G4/BUS4 PIN 48
- 10 -> G5/BUS5 PIN 73
- 11 -> G6/BUS6 PIN 71
- 12 -> G7/BUS7 PIN 69
- 13 -> G8 PIN 67
- 14 -> G9/ADC_D-/CAM_HSYNC PIN 65
- 15 -> G10/ADC_D+/CAM_VSYNC PIN 63
- 16 -> G11/SWO PIN 8
- 17 -> SPI_CS PIN 55
compatible: "sparkfun,micromod-gpio"
include: [gpio-nexus.yaml, base.yaml]

7
tests/drivers/adc/adc_api/boards/micromod_nrf52840.overlay

@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright (c) 2024 Jerónimo Agulló <jeronimoagullo97@gmail.com>
*/
#include "nordic,nrf-saadc-common.dtsi"
Loading…
Cancel
Save