The 'NCS-SPI-Master-Slave-Example' cannot be built

Hello

I'm attempting to get the following example to work on a nRF5340DK using 'nRF Connect for VS Code' as a first attempt to use SPI on a Nordic controller:

https://github.com/too1/ncs-spi-master-slave-example 

I've started the project with 'basic/blinky' and copied the following code from the example to project:

"nrf52840dk_nrf52840.overlay",

- "prj.conf" and

- "main.c"

I initially attempted to build with nRF Connect SDK v2.2.0 and subsequently on v2.1.1 (as per the "README.rst") and on both attempts this failed to build with the following errors :

C:\ncs\v2.1.1\zephyr\include\zephyr\drivers\pinctrl.h:89:10: error: 'PINCTRL_STATE_DT_N_S_soc_S_peripheral_50000000_S_spi_b000_PINCTRL_IDX_0_UPPER_TOKEN' undeclared here (not in a function); did you mean 'DT_N_S_soc_S_peripheral_50000000_S_spi_a000_PINCTRL_IDX_0_UPPER_TOKEN'?

   89 |  _CONCAT(PINCTRL_STATE_,             \

      |          ^~~~~~~~~~~~~~

  

C:\ncs\v2.1.1\zephyr\include\zephyr\drivers\pinctrl.h:89:10: error: 'PINCTRL_STATE_DT_N_S_soc_S_peripheral_50000000_S_spi_b000_PINCTRL_IDX_1_UPPER_TOKEN' undeclared here (not in a function); did you mean 'DT_N_S_soc_S_peripheral_50000000_S_spi_a000_PINCTRL_IDX_1_UPPER_TOKEN'?

   89 |  _CONCAT(PINCTRL_STATE_,             \

      |          ^~~~~~~~~~~~~~

Looking at the following "zephyr.dts" extract below am I right to assume that spi@b000 (the slave SPI) has not been set up correctly so is offering the master instead? If so, how do I overcome this? (Has something in the background changed since the example has been saved?)

        peripheral@50000000 {
            #address-cells = < 0x1 >;
            #size-cells = < 0x1 >;
            ranges = < 0x0 0x50000000 0x10000000 >;
            dcnf: dcnf@0 {
                compatible = "nordic,nrf-dcnf";
                reg = < 0x0 0x1000 >;
                status = "okay";
            };
.
.
.
            spi4: arduino_spi: my_spi_master: spi@a000 {
                compatible = "nordic,nrf-spim";
                #address-cells = < 0x1 >;
                #size-cells = < 0x0 >;
                reg = < 0xa000 0x1000 >;
                interrupts = < 0xa 0x1 >;
                max-frequency = < 0x1e84800 >;
                rx-delay-supported;
                rx-delay = < 0x2 >;
                status = "okay";
                cs-gpios = < &gpio0 0xb 0x1 >;
                pinctrl-0 = < &spi_master_default >;
                pinctrl-1 = < &spi_master_sleep >;
                pinctrl-names = "default", "sleep";
                reg_my_spi_master: spi-dev-a@0 {
                    reg = < 0x0 >;
                };
            };
.
.
.
            spi2: my_spi_slave: spi@b000 {
                compatible = "nordic,nrf-spis";
                #address-cells = < 0x1 >;
                #size-cells = < 0x0 >;
                reg = < 0xb000 0x1000 >;
                interrupts = < 0xb 0x1 >;
                max-frequency = < 0x7a1200 >;
                status = "okay";
                pinctrl-0 = < &spi2_default >;
                pinctrl-1 = < &spi2_sleep >;
                def-char = < 0x0 >;
            };

I'll be grateful for any suggestions on how to overcome this build issue.

Thanks

RoW

Parents Reply Children
No Data
Related