Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

SDK intermediate: building exercise 1 lesson 5 error: 'DT_N_NODELABEL_bme280_P_spi_max_frequency' undeclared here (not in a function)

Hi, trying to directly build the solution for the exercise i get this error at the end.

The whole log-output:

Building l5_e1_sol
west build --build-dir /mnt/df01dc22-f3bf-40d5-9858-752a58c9832d/devprojects/nordicsemi/intermediate/l5_e1_sol/build_sol /mnt/df01dc22-f3bf-40d5-9858-752a58c9832d/devprojects/nordicsemi/intermediate/l5_e1_sol --pristine --board nrf52dk/nrf52810 -- -DCONFIG_DEBUG_THREAD_INFO=y -DCONF_FILE="prj.conf"

-- west build: generating a build system
Loading Zephyr module(s) (Zephyr base): sysbuild_default
-- Found Python3: /home/thomas/ncs/toolchains/43683a87ea/usr/local/bin/python3.12 (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter 
-- Cache files will be written to: /home/thomas/.cache/zephyr
-- Found west (found suitable version "1.4.0", minimum required is "0.14.0")
-- Board: nrf52dk, qualifiers: nrf52810
Parsing /home/thomas/ncs/v3.2.0/zephyr/share/sysbuild/Kconfig
Loaded configuration '/mnt/df01dc22-f3bf-40d5-9858-752a58c9832d/devprojects/nordicsemi/intermediate/l5_e1_sol/build_sol/_sysbuild/empty.conf'
Merged configuration '/mnt/df01dc22-f3bf-40d5-9858-752a58c9832d/devprojects/nordicsemi/intermediate/l5_e1_sol/build_sol/_sysbuild/empty.conf'
Configuration saved to '/mnt/df01dc22-f3bf-40d5-9858-752a58c9832d/devprojects/nordicsemi/intermediate/l5_e1_sol/build_sol/zephyr/.config'
Kconfig header saved to '/mnt/df01dc22-f3bf-40d5-9858-752a58c9832d/devprojects/nordicsemi/intermediate/l5_e1_sol/build_sol/_sysbuild/autoconf.h'
-- 
   *******************************
   * Running CMake for l5_e1_sol *
   *******************************

Loading Zephyr default modules (Zephyr base).
-- Application: /mnt/df01dc22-f3bf-40d5-9858-752a58c9832d/devprojects/nordicsemi/intermediate/l5_e1_sol
-- CMake version: 3.21.0
-- Found Python3: /home/thomas/ncs/toolchains/43683a87ea/usr/local/bin/python (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter 
-- Cache files will be written to: /home/thomas/.cache/zephyr
-- Zephyr version: 4.2.99 (/home/thomas/ncs/v3.2.0/zephyr)
-- Found west (found suitable version "1.4.0", minimum required is "0.14.0")
-- Board: nrf52dk, qualifiers: nrf52810
-- Found host-tools: zephyr 0.17.0 (/home/thomas/ncs/toolchains/43683a87ea/opt/zephyr-sdk)
-- Found toolchain: zephyr 0.17.0 (/home/thomas/ncs/toolchains/43683a87ea/opt/zephyr-sdk)
-- Found Dtc: /home/thomas/ncs/toolchains/43683a87ea/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6") 
-- Found BOARD.dts: /home/thomas/ncs/v3.2.0/zephyr/boards/nordic/nrf52dk/nrf52dk_nrf52810.dts
-- Generated zephyr.dts: /mnt/df01dc22-f3bf-40d5-9858-752a58c9832d/devprojects/nordicsemi/intermediate/l5_e1_sol/build_sol/l5_e1_sol/zephyr/zephyr.dts
-- Generated pickled edt: /mnt/df01dc22-f3bf-40d5-9858-752a58c9832d/devprojects/nordicsemi/intermediate/l5_e1_sol/build_sol/l5_e1_sol/zephyr/edt.pickle
-- Generated devicetree_generated.h: /mnt/df01dc22-f3bf-40d5-9858-752a58c9832d/devprojects/nordicsemi/intermediate/l5_e1_sol/build_sol/l5_e1_sol/zephyr/include/generated/zephyr/devicetree_generated.h
Parsing /home/thomas/ncs/v3.2.0/zephyr/Kconfig
Loaded configuration '/home/thomas/ncs/v3.2.0/zephyr/boards/nordic/nrf52dk/nrf52dk_nrf52810_defconfig'
Merged configuration '/mnt/df01dc22-f3bf-40d5-9858-752a58c9832d/devprojects/nordicsemi/intermediate/l5_e1_sol/prj.conf'
Merged configuration '/mnt/df01dc22-f3bf-40d5-9858-752a58c9832d/devprojects/nordicsemi/intermediate/l5_e1_sol/build_sol/l5_e1_sol/zephyr/misc/generated/extra_kconfig_options.conf'
Merged configuration '/mnt/df01dc22-f3bf-40d5-9858-752a58c9832d/devprojects/nordicsemi/intermediate/l5_e1_sol/build_sol/l5_e1_sol/zephyr/.config.sysbuild'
Configuration saved to '/mnt/df01dc22-f3bf-40d5-9858-752a58c9832d/devprojects/nordicsemi/intermediate/l5_e1_sol/build_sol/l5_e1_sol/zephyr/.config'
Kconfig header saved to '/mnt/df01dc22-f3bf-40d5-9858-752a58c9832d/devprojects/nordicsemi/intermediate/l5_e1_sol/build_sol/l5_e1_sol/zephyr/include/generated/zephyr/autoconf.h'
-- Found GnuLd: /home/thomas/ncs/toolchains/43683a87ea/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version "2.38") 
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/thomas/ncs/toolchains/43683a87ea/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
-- Using ccache: /home/thomas/ncs/toolchains/43683a87ea/usr/bin/ccache
-- Found gen_kobject_list: /home/thomas/ncs/v3.2.0/zephyr/scripts/build/gen_kobject_list.py
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/df01dc22-f3bf-40d5-9858-752a58c9832d/devprojects/nordicsemi/intermediate/l5_e1_sol/build_sol/l5_e1_sol
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/df01dc22-f3bf-40d5-9858-752a58c9832d/devprojects/nordicsemi/intermediate/l5_e1_sol/build_sol
-- west build: building application
[5/10] Performing build step for 'l5_e1_sol'
[1/171] Preparing syscall dependency handling

[5/171] Generating include/generated/zephyr/version.h
-- Zephyr version: 4.2.99 (/home/thomas/ncs/v3.2.0/zephyr), build: ncs-v3.2.0
[7/171] Generating include/generated/zephyr/syscall_dispatch.c, include/generated/zephyr/syscall_exports_llext.c, syscall_weakdefs_llext.c, include/generated/zephy[9/171] Generating include/generated/zephyr/syscall_dispatch.c, include/generated/zephyr/syscall_exports_llext.c, syscall_weakdefs_llext.c, include/generated/zephy[110/171] Building C object modules/hal_nordic/modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/home/thomas/ncs/v3.2.0/modules/hal/nordic/nrfx/bsp/[111/171] Building C object CMakeFiles/app.dir/src/main.c.obj
FAILED: CMakeFiles/app.dir/src/main.c.obj 
ccache /home/thomas/ncs/toolchains/43683a87ea/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DDEVELOP_IN_NRF52832 -DKERNEL -DK_HEAP_MEM_POOL_SIZE=0 -DNRF52810_XXAA -DNRF54L_CONFIGURATION_56_ENABLE=0 -DNRFX_COREDEP_DELAY_US_LOOP_CYCLES=3 -DPICOLIBC_DOUBLE_PRINTF_SCANF -DUSE_PARTITION_MANAGER=1 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -I/mnt/df01dc22-f3bf-40d5-9858-752a58c9832d/devprojects/nordicsemi/intermediate/l5_e1_sol/build_sol/l5_e1_sol/zephyr/include/generated/zephyr -I/home/thomas/ncs/v3.2.0/zephyr/include -I/mnt/df01dc22-f3bf-40d5-9858-752a58c9832d/devprojects/nordicsemi/intermediate/l5_e1_sol/build_sol/l5_e1_sol/zephyr/include/generated -I/home/thomas/ncs/v3.2.0/zephyr/soc/nordic -I/home/thomas/ncs/v3.2.0/zephyr/soc/nordic/nrf52/. -I/home/thomas/ncs/v3.2.0/zephyr/soc/nordic/common/. -I/home/thomas/ncs/v3.2.0/nrf/include -I/home/thomas/ncs/v3.2.0/nrf/tests/include -I/home/thomas/ncs/v3.2.0/modules/hal/cmsis_6/CMSIS/Core/Include -I/home/thomas/ncs/v3.2.0/zephyr/modules/cmsis_6/. -I/home/thomas/ncs/v3.2.0/nrf/modules/hal_nordic/. -I/home/thomas/ncs/v3.2.0/modules/hal/nordic/nrfx -I/home/thomas/ncs/v3.2.0/modules/hal/nordic/nrfx/drivers/include -I/home/thomas/ncs/v3.2.0/modules/hal/nordic/nrfx/bsp/stable -I/home/thomas/ncs/v3.2.0/modules/hal/nordic/nrfx/bsp/stable/templates -I/home/thomas/ncs/v3.2.0/zephyr/modules/hal_nordic/nrfx/. -isystem /home/thomas/ncs/v3.2.0/zephyr/lib/libc/common/include -fno-strict-aliasing -Os -imacros /mnt/df01dc22-f3bf-40d5-9858-752a58c9832d/devprojects/nordicsemi/intermediate/l5_e1_sol/build_sol/l5_e1_sol/zephyr/include/generated/zephyr/autoconf.h -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee -mtp=soft --sysroot=/home/thomas/ncs/toolchains/43683a87ea/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros /home/thomas/ncs/v3.2.0/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wdouble-promotion -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=/mnt/df01dc22-f3bf-40d5-9858-752a58c9832d/devprojects/nordicsemi/intermediate/l5_e1_sol=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/thomas/ncs/v3.2.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/thomas/ncs/v3.2.0=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=picolibc.specs -std=c99 -MD -MT CMakeFiles/app.dir/src/main.c.obj -MF CMakeFiles/app.dir/src/main.c.obj.d -o CMakeFiles/app.dir/src/main.c.obj -c /mnt/df01dc22-f3bf-40d5-9858-752a58c9832d/devprojects/nordicsemi/intermediate/l5_e1_sol/src/main.c
In file included from /home/thomas/ncs/v3.2.0/zephyr/include/zephyr/toolchain/gcc.h:98,
                 from /home/thomas/ncs/v3.2.0/zephyr/include/zephyr/toolchain.h:52,
                 from /home/thomas/ncs/v3.2.0/zephyr/include/zephyr/kernel_includes.h:23,
                 from /home/thomas/ncs/v3.2.0/zephyr/include/zephyr/kernel.h:17,
                 from /mnt/df01dc22-f3bf-40d5-9858-752a58c9832d/devprojects/nordicsemi/intermediate/l5_e1_sol/src/main.c:7:

Confusing is that no (extra) overlay file should be configured for the build, despite a new overlay created?

Adding the overlay file leads to error that "&spi1" is undefined.

Any idea/hint on this?

Thanks for any hint

Parents Reply Children
  • Hi,

    I see what is happening. You are building to the target board "nrf52dk/nrf52810" but this application only has the overlay for the "nrf52/nrf52832". Which explain why the overlay is not taken. You can either try to build your application for the "nrf52/nrf52832" or make a custom overlay file for the nrf52810. I would recommend building for the "nrf52/nrf52832" as it is the intended way for this lesson.

    Of course, if you want to try to make the custom overlay, you are welcome to share any issue you have with it here.

    Best regards,

    Simon D-M

  • Hi,

    building the solution for nrf52832 overlay as intended worked fine.

    So how should an overlay for the nrf52810.overlay look like?

    The example is for nrf52DK only, doesn't seem valid for the nrf52810.

    Regards,

  • Hi,

    the difference between the two chips is that the nRF52810 only has one SPI peripheral (nRF52832 has 3) so we have to change to using spi0 instead of spi1 in our overlay file.

    It should result in something like this :

    nrf52dk_nrf52810.overlay

    /* STEP 2.1 - Add the SPI peripheral to spi0 */
    &i2c0 {	status = "disabled";};
    	
    &spi0 {
        compatible = "nordic,nrf-spi"; //using SPI as per ERRATA 58 - I believe we have to keep that as we are only emulating the nrf52810 but we are still on a nrf52832 (not sure tho)
    	status = "okay";
    	pinctrl-0 = <&spi0_default>;
    	pinctrl-1 = <&spi0_sleep>;
    	pinctrl-names = "default", "sleep";
    	cs-gpios = <&gpio0 30 GPIO_ACTIVE_LOW>;
    	bme280: bme280@0 {
    		compatible = "bosch,bme280";
    		reg = <0>;
    		spi-max-frequency = <1000000>; 
    	};
    };
    
    /* STEP 2.2 - Change the pin configuration */
    &pinctrl {
    	spi0_default: spi0_default {
    		group1 {
    				psels = <NRF_PSEL(SPIM_SCK, 0, 28)>,
    						<NRF_PSEL(SPIM_MOSI, 0, 29)>,
    						<NRF_PSEL(SPIM_MISO, 0, 31)>;
    		};
    	};
    
    	spi0_sleep: spi0_sleep {
    		group1 {
    				psels = <NRF_PSEL(SPIM_SCK, 0, 28)>,
    						<NRF_PSEL(SPIM_MOSI, 0, 29)>,
    						<NRF_PSEL(SPIM_MISO, 0, 31)>;
    				low-power-enable;
    		};
    	};
    };
    

    I didn't test the code I sent. So it might not work directly.

    Best regards,

    Simon D-M

  • Hi, the lacking spi1 is the key, requires to read the datasheet of both i guess ;) as it isn't obvious.

    I was able to compile the code.....and will verify the answer after testing.

    Thanks for that.

Related