Board files
Using Icarus SoM Board Files with Device Tree Overlays
Instead of using dedicated Icarus SoM DK v2 board files, you can use the Icarus SoM board files and add a device tree overlay in your Zephyr project. This approach provides flexibility and ensures compatibility with the latest Icarus SoM features while adding the specific peripherals available on the DK v2.
The device tree overlay allows you to extend the base Icarus SoM configuration with additional hardware components specific to the development kit, such as LEDs, buttons, and external flash memory.
Creating the Device Tree Overlay
To add an overlay for the Icarus SoM DK v2 peripherals, follow these steps:
1. Create the boards directory
Create a new directory in your project folder named boards
:
$ cd <your-project-directory>
$ mkdir boards
$ cd boards
2. Create the overlay file
Create an overlay file with the exact name of the board you're targeting:
# When building for a non-secure application
$ touch actinius_icarus_som_ns.overlay
# When building for a secure application
$ touch actinius_icarus_som.overlay
3. Add the overlay configuration
Add the following device tree configuration to your overlay file to include the Icarus SoM DK v2 specific peripherals:
// Icarus SoM DK v2 Device Tree Overlay
// This overlay adds support for the peripherals available on the
// Icarus SoM DK v2 development kit, while keeping the base Icarus SoM board files.
/ {
leds {
compatible = "gpio-leds";
blue_led: led_0 {
gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>;
label = "Blue LED";
};
};
buttons {
compatible = "gpio-keys";
user_button: button_0 {
gpios = <&gpio0 23 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
label = "User Button";
};
};
aliases {
led0 = &blue_led;
sw0 = &user_button;
};
};
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 22)>,
<NRF_PSEL(SPIM_MOSI, 0, 25)>,
<NRF_PSEL(SPIM_MISO, 0, 21)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 22)>,
<NRF_PSEL(SPIM_MOSI, 0, 25)>,
<NRF_PSEL(SPIM_MISO, 0, 21)>;
low-power-enable;
};
};
};
&spi3 {
status = "okay";
pinctrl-0 = <&spi3_default>;
pinctrl-1 = <&spi3_sleep>;
pinctrl-names = "default", "sleep";
cs-gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
w25q64: w25q64jv@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <80000000>;
jedec-id = [ef 40 17];
size = <0x4000000>;
has-dpd;
t-enter-dpd = <3500>;
t-exit-dpd = <3500>;
};
};
// SIM selection (choose eSIM or external SIM)
&sim_select {
sim = "esim"; // Use "esim" for eSIM or "external" for external nano SIM
};
Peripheral Configuration Details
The overlay configures the following peripherals specific to the Icarus SoM DK v2:
Blue LED
- Pin: P0.03 (nRF9160 GPIO)
- Type: Monochrome blue LED
- Configuration: Active high
- Device tree alias:
led0
User Button
- Pin: P0.23 (nRF9160 GPIO)
- Configuration: Active low with internal pull-up
- Device tree alias:
sw0
SPI NOR Flash
- Device: W25Q64JV (64 MBit / 8 MByte)
- Chip Select: P0.24
- Interface: SPI3
- Maximum frequency: 8 MHz (capped by the nRF9160 SPI peripheral capabilities)
SIM Selection
- Options: eSIM (
"esim"
) or external nano SIM ("external"
) - Configuration: Set via
&sim_select
node - Default: External SIM in the example above
Building Your Application
When building your application, specify the Icarus SoM as the target board. The overlay will automatically be applied:
# For non-secure applications
west build -b actinius_icarus_som_ns
# For secure applications
west build -b actinius_icarus_som
The Zephyr build system will automatically detect and apply the overlay file based on the board name, extending the base Icarus SoM configuration with your DK v2-specific peripherals.
Benefits of Using Overlays
This approach keeps your project compatible with the latest Icarus SoM board files while allowing you to easily adapt the overlay for other custom boards based on the Icarus SoM.