Skip to content

Commit

Permalink
boards: norik: Add support for Norik Octopus SoM
Browse files Browse the repository at this point in the history
Add support for Norik Systems Octopus SoM based on nRF9160 SiP.

Supported features:
 - LTE-M/NB-IoT
 - GPS
 - LED
 - 3-axis accelerometer

Signed-off-by: Florijan Plohl <[email protected]>
  • Loading branch information
FPlohl committed Oct 14, 2024
1 parent 9335644 commit 954ce4c
Show file tree
Hide file tree
Showing 19 changed files with 534 additions and 0 deletions.
10 changes: 10 additions & 0 deletions boards/norik/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _boards-norik:

Norik Systems
#############

.. toctree::
:maxdepth: 1
:glob:

**/*
5 changes: 5 additions & 0 deletions boards/norik/octopus_som/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2024 Norik Systems
# SPDX-License-Identifier: Apache-2.0

zephyr_library()
zephyr_library_sources(board.c)
15 changes: 15 additions & 0 deletions boards/norik/octopus_som/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright (c) 2024 Norik Systems
# SPDX-License-Identifier: Apache-2.0

config BOARD_OCTOPUS_SOM
select PINCTRL

config OCTOPUS_SOM_CONTROL_INIT_PRIORITY
int "Init priority"
default 99
help
Init priority for board control.

module = OCTOPUS_SOM_CONTROL
module-str = Board Control
source "subsys/logging/Kconfig.template.log_config"
33 changes: 33 additions & 0 deletions boards/norik/octopus_som/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright (c) 2024 Norik Systems
# SPDX-License-Identifier: Apache-2.0

if BOARD_OCTOPUS_SOM

# For the secure version of the board the firmware is linked at the beginning
# of the flash, or into the code-partition defined in DT if it is intended to
# be loaded by MCUboot. If the secure firmware is to be combined with a non-
# secure image (TRUSTED_EXECUTION_SECURE=y), the secure FW image shall always
# be restricted to the size of its code partition.
# For the non-secure version of the board, the firmware
# must be linked into the code-partition (non-secure) defined in DT, regardless.
# Apply this configuration below by setting the Kconfig symbols used by
# the linker according to the information extracted from DT partitions.

# Workaround for not being able to have commas in macro arguments
DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition

config FLASH_LOAD_SIZE
default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
depends on BOARD_OCTOPUS_SOM && TRUSTED_EXECUTION_SECURE

if BOARD_OCTOPUS_SOM_NRF9160_NS

config FLASH_LOAD_OFFSET
default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION))

config FLASH_LOAD_SIZE
default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))

endif # BOARD_OCTOPUS_SOM_NRF9160_NS

endif # BOARD_OCTOPUS_SOM
5 changes: 5 additions & 0 deletions boards/norik/octopus_som/Kconfig.octopus_som
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2024 Norik Systems
# SPDX-License-Identifier: Apache-2.0

config BOARD_OCTOPUS_SOM
select SOC_NRF9160_SICA
38 changes: 38 additions & 0 deletions boards/norik/octopus_som/board.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright (c) 2024 Norik Systems
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/init.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/logging/log.h>
#include <zephyr/drivers/charger.h>
#include <zephyr/drivers/i2c.h>

LOG_MODULE_REGISTER(board_control, CONFIG_OCTOPUS_SOM_CONTROL_LOG_LEVEL);

#define SIM_SELECT_NODE DT_PATH(sim_select)

static int octopus_som_init(void)
{
const struct gpio_dt_spec simctrl = GPIO_DT_SPEC_GET(DT_PATH(sim_select), sim_gpios);

if (!gpio_is_ready_dt(&simctrl)) {
LOG_ERR("SIM select GPIO not available");
return -ENODEV;
}

if (DT_ENUM_IDX(SIM_SELECT_NODE, sim) == 0) {
(void)gpio_pin_configure_dt(&simctrl, GPIO_OUTPUT_LOW);
LOG_INF("On-board SIM selected");
} else {
(void)gpio_pin_configure_dt(&simctrl, GPIO_OUTPUT_HIGH);
LOG_INF("External SIM selected");
}

return 0;
}

SYS_INIT(octopus_som_init, POST_KERNEL, CONFIG_OCTOPUS_SOM_CONTROL_INIT_PRIORITY);
6 changes: 6 additions & 0 deletions boards/norik/octopus_som/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (c) 2024 Norik Systems
# SPDX-License-Identifier: Apache-2.0

board_runner_args(jlink "--device=nRF9160_xxAA" "--speed=4000")
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
7 changes: 7 additions & 0 deletions boards/norik/octopus_som/board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
board:
name: octopus_som
vendor: norik
socs:
- name: nrf9160
variants:
- name: 'ns'
Binary file not shown.
126 changes: 126 additions & 0 deletions boards/norik/octopus_som/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
.. _octopus_som:

Norik Octopus SOM
#################

Overview
********

Octopus SoM is a System on Module (SoM) built around the nRF9160 SiP
offering NB-IoT and LTE-M connectivity, GPS and accelerometer.
It supports on board eSIM and external nano SIM connector. It's purpose
is to provide flexible hardware platform for IoT applications.

nRF9160 SiP contains ARM Cortex-M33 application processor 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)`
* :abbr:`RTC (nRF RTC System Clock)`
* Segger RTT (RTT Console)
* :abbr:`SPI (Serial Peripheral Interface)`
* :abbr:`UARTE (Universal asynchronous receiver-transmitter with EasyDMA)`
* :abbr:`WDT (Watchdog Timer)`
* :abbr:`IDAU (Implementation Defined Attribution Unit)`

.. figure:: img/Norik_Octopus_SoM_front.webp
:align: center
:alt: Norik Octopus SOM front view

Norik Octopus SoM

Hardware
********

The ``octopus_som/nrf9160`` and ``octopus_som/nrf9160/ns`` board targets support the
following hardware features:

+-----------+------------+----------------------+
| Interface | Controller | Driver/Component |
+===========+============+======================+
| ADC | on-chip | adc |
+-----------+------------+----------------------+
| CLOCK | on-chip | clock_control |
+-----------+------------+----------------------+
| FLASH | on-chip | flash |
+-----------+------------+----------------------+
| GPIO | on-chip | gpio |
+-----------+------------+----------------------+
| I2C(M) | on-chip | i2c |
+-----------+------------+----------------------+
| MPU | on-chip | arch/arm |
+-----------+------------+----------------------+
| NVIC | on-chip | arch/arm |
+-----------+------------+----------------------+
| PWM | on-chip | pwm |
+-----------+------------+----------------------+
| RTC | on-chip | system clock |
+-----------+------------+----------------------+
| RTT | Segger | console |
+-----------+------------+----------------------+
| SPI(M/S) | on-chip | spi |
+-----------+------------+----------------------+
| SPU | on-chip | system protection |
+-----------+------------+----------------------+
| UARTE | on-chip | serial |
+-----------+------------+----------------------+
| WDT | on-chip | watchdog |
+-----------+------------+----------------------+
| ACCEL | Analog | adxl362 |
+-----------+------------+----------------------+

Connections and IOs
===================

Accelerometer
-------------
* MISO = P0.05
* MOSI = P0.09
* SCK = P0.10
* CS = P0.05
* INT1 = P0.12

LED
---
* LED1 (green) = P0.07

SIM select switch
-----------------
* Select = P0.25

Programming and Debugging
*************************

Norik Octopus SoM can be programmed and debugged using the exposed SWD pins.

Building an application
=======================

In most case you'll need to use ``octopus_som/nrf9160/ns`` target for building examples.
Some examples don't require non secure mode and can be built with ``octopus_som/nrf9160`` target.

Flashing
========
Refer to the instruction in the :ref:`nordic_segger` page to install and
configure all the necessary software.

Use the :zephyr:code-sample:`blinky` sample to test if Zephyr is running correctly on your board.

.. zephyr-app-commands::
:zephyr-app: samples/basic/blinky
:board: octopus_som/nrf9160
:goals: build flash

Debugging
=========
Refer to the instruction in the :ref:`nordic_segger` page for information on
debugging.

References
**********
26 changes: 26 additions & 0 deletions boards/norik/octopus_som/dts/bindings/norik,sim_select.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright (c) 2024 Norik Systems
# SPDX-License-Identifier: Apache-2.0

description: |
The Octopus SoM provides the user 2 options for connecting
a SIM card to the nRF9160. Option one is to use on-board eSIM or
external nano SIM. Which SIM is used can be selected using the 'sim'
property of the 'sim_select' dt node.
compatible: "norik,sim_select"

include: base.yaml

properties:
sim-gpios:
type: phandle-array
required: true
description: Pin used to select which SIM is used

sim:
type: string
required: true
enum:
- "on-board"
- "external"
description: SIM choice (on-board eSIM or external nano SIM)
51 changes: 51 additions & 0 deletions boards/norik/octopus_som/octopus_som_common-pinctrl.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright (c) 2024 Norik Systems
* SPDX-License-Identifier: Apache-2.0
*/

&pinctrl {
uart0_default: uart0_default {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 23)>,
<NRF_PSEL(UART_RX, 0, 24)>;
};
};

uart0_sleep: uart0_sleep {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 23)>,
<NRF_PSEL(UART_RX, 0, 24)>;
low-power-enable;
};
};

pwm0_default: pwm0_default {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 0, 7)>;
};
};

pwm0_sleep: pwm0_sleep {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 0, 7)>;
low-power-enable;
};
};

spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 10)>,
<NRF_PSEL(SPIM_MISO, 0, 8)>,
<NRF_PSEL(SPIM_MOSI, 0, 9)>;
};
};

spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 10)>,
<NRF_PSEL(SPIM_MISO, 0, 8)>,
<NRF_PSEL(SPIM_MOSI, 0, 9)>;
low-power-enable;
};
};
};
Loading

0 comments on commit 954ce4c

Please sign in to comment.