creating a custom board for nRf52840

Hi there,

         I've been developing nicely with the nrf52840SDK board for a while now.

I am trying to create a custom board now for our development PCB using nRf52840 micro.

I created a new board with nrf52840 as the SoC and then created an overlay file with all my peripherals.

Seems to build ok, but when I try to get a pointer to a device node, GPIO, SPI etc I get errors such as...

FAILED: zephyr/drivers/spi/CMakeFiles/drivers__spi.dir/spi_nrfx_spim.c.obj 

c:\Temp\Wearable\Code\SB_wearableFW\build\zephyr\include\generated\devicetree_unfixed.h:11437:38: errorC:\ncs\v2.1.0\zephyr\include\zephyr\toolchain\gcc.h:77:36: error: static assertion failed: "/soc/spi@40004000 defined without required pin configuration"

'DT_N_S_soc_S_spi_40004000_P_sck_pin' undeclared here (not in a function); did you mean 'DT_N_S_soc_S_spi_40004000_P_status'?

C:\ncs\v2.1.0\zephyr\include\zephyr\toolchain\gcc.h:77:36: error: static assertion failed: "/soc/spi@40023000 defined without required pin configuration"

The devices seem to be picked up as shown here..

and they are included in the compiled device tree output file... 

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/dts-v1/;
/ {
#address-cells = <1>;
#size-cells = <1>;
model = "SB_Wearable";
compatible = "cubik-innovation-,sb-wearable01";
chosen {
zephyr,entropy = &cryptocell;
zephyr,flash-controller = &flash_controller;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
};
aliases {
key1 = &button0;
key2 = &button1;
backlightpwm = &pwm0;
hapticpwm = &pwm1;
buzzerpwm = &pwm2;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

in main.c I am trying to get pointers to device nodes..

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <zephyr/zephyr.h>
#include <zephyr/kernel.h>
#include <drivers/gpio.h>
#define DISPLAY_NODE DT_ALIAS(flashrst)
#define MYSPI_NODE DT_NODELABEL(spi1)
struct gpio_dt_spec display_reset = GPIO_DT_SPEC_GET(DISPLAY_NODE, gpios);
void main(void)
{
const struct device *spiDev; /* SPI device pointer*/
/* Get the SPI device handle*/
spiDev = DEVICE_DT_GET(MYSPI_NODE);
if(!device_is_ready(spiDev))
{
return;
}
//else
//{
/// printk("Device is ready %s\n");
//}
//printk("Hello World! %s\n", CONFIG_BOARD);
/* check devices are ready: Could make this a function?*/
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

but getting build errors.

When I look at the .dts file

it seems to have none of the nodes defined and gives me warnings for compatible property like so..

the file is below and has nothing after &flash0 node

I'm sure it should!!

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>
/ {
model = "SB_Wearable";
compatible = "cubik-innovation-,sb-wearable01";
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
};
};
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot_partition: partition@0 {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

What am I doing wrong please?

Many thanks

Duncan