BLE DFU build fails

I can successfully build and run the DFU as described here:  Add DFU support to your application 

Now I'm trying to take the same steps with my own application and it fails in a weird way. I had to change /zephyr/subsys/mgmt/mcumgr/lib/cmd/img_mgmt/include/image.h a bit just to get anything to compile. Had to change __packed at the end of each struct to __attribute__ ((__packed__)). I'm not sure why this is - I suspected some compiler version thing or something but I don't know how to even check that. This error doesn't seem to be related to that however.

All this error tells me is that something is going wrong in the assembler. Unfortunately that is as far as I can go with this. Can you please help me? If I can't get help from here I will have to start again from the working DFU LBS sample and try to add everything my application needs on top of that. That would be very time consuming to do.

* Executing task: nRF Connect: Build: blindy_v3/build (active)

Building blindy_v3
west build --build-dir /home/tiit/code/blindy_v3/build /home/tiit/code/blindy_v3

[0/1] Re-running CMake...
Loading Zephyr default modules (Zephyr base (cached)).
-- Application: /home/tiit/code/blindy_v3
-- Cache files will be written to: /home/tiit/.cache/zephyr
-- Zephyr version: 3.2.99 (/home/tiit/ncs/v2.2.0-rc1/zephyr)
-- Found west (found suitable version "0.14.0", minimum required is "0.7.1")
-- Board: blindy_v4
-- Found host-tools: zephyr 0.15.1 (/home/tiit/ncs/toolchains/v2.2.0-rc1/opt/zephyr-sdk)
-- Found toolchain: zephyr 0.15.1 (/home/tiit/ncs/toolchains/v2.2.0-rc1/opt/zephyr-sdk)
-- Found BOARD.dts: /home/tiit/code/blindy_v3/boards/arm/blindy_v4/blindy_v4.dts
-- Generated zephyr.dts: /home/tiit/code/blindy_v3/build/zephyr/zephyr.dts
-- Generated devicetree_generated.h: /home/tiit/code/blindy_v3/build/zephyr/include/generated/devicetree_generated.h
-- Including generated dts.cmake file: /home/tiit/code/blindy_v3/build/zephyr/dts.cmake
Parsing /home/tiit/ncs/v2.2.0-rc1/zephyr/Kconfig
Loaded configuration '/home/tiit/code/blindy_v3/boards/arm/blindy_v4/blindy_v4_defconfig'
Merged configuration '/home/tiit/code/blindy_v3/prj.conf'
Configuration saved to '/home/tiit/code/blindy_v3/build/zephyr/.config'
Kconfig header saved to '/home/tiit/code/blindy_v3/build/zephyr/include/generated/autoconf.h'
CMake Warning at /home/tiit/ncs/v2.2.0-rc1/zephyr/subsys/usb/device/CMakeLists.txt:22 (message):
CONFIG_USB_DEVICE_VID has default value 0x2FE3.

This value is only for testing and MUST be configured for USB products.


-- Found Python3: /home/tiit/ncs/toolchains/v2.2.0-rc1/usr/local/bin/python3.8 (found version "3.8.2") found components: Interpreter

=== child image mcuboot - begin ===
loading initial cache file /home/tiit/code/blindy_v3/build/mcuboot/child_image_preload.cmake
Loading Zephyr default modules (Zephyr base).
-- Application: /home/tiit/ncs/v2.2.0-rc1/bootloader/mcuboot/boot/zephyr
-- Found Python3: /home/tiit/ncs/toolchains/v2.2.0-rc1/usr/local/bin/python3.8 (found suitable exact version "3.8.2") found components: Interpreter
-- Cache files will be written to: /home/tiit/.cache/zephyr
-- Zephyr version: 3.2.99 (/home/tiit/ncs/v2.2.0-rc1/zephyr)
-- Found west (found suitable version "0.14.0", minimum required is "0.7.1")
-- Board: blindy_v4
-- Found host-tools: zephyr 0.15.1 (/home/tiit/ncs/toolchains/v2.2.0-rc1/opt/zephyr-sdk)
-- Found toolchain: zephyr 0.15.1 (/home/tiit/ncs/toolchains/v2.2.0-rc1/opt/zephyr-sdk)
-- Found Dtc: /home/tiit/ncs/toolchains/v2.2.0-rc1/usr/bin/dtc (found suitable version "1.4.7", minimum required is "1.4.6")
-- Found BOARD.dts: /home/tiit/code/blindy_v3/boards/arm/blindy_v4/blindy_v4.dts
-- Found devicetree overlay: /home/tiit/ncs/v2.2.0-rc1/nrf/modules/mcuboot/usb.overlay
-- Found devicetree overlay: /home/tiit/ncs/v2.2.0-rc1/bootloader/mcuboot/boot/zephyr/dts.overlay
-- Generated zephyr.dts: /home/tiit/code/blindy_v3/build/mcuboot/zephyr/zephyr.dts
-- Generated devicetree_generated.h: /home/tiit/code/blindy_v3/build/mcuboot/zephyr/include/generated/devicetree_generated.h
-- Including generated dts.cmake file: /home/tiit/code/blindy_v3/build/mcuboot/zephyr/dts.cmake
Parsing /home/tiit/ncs/v2.2.0-rc1/bootloader/mcuboot/boot/zephyr/Kconfig
Loaded configuration '/home/tiit/code/blindy_v3/boards/arm/blindy_v4/blindy_v4_defconfig'
Merged configuration '/home/tiit/ncs/v2.2.0-rc1/bootloader/mcuboot/boot/zephyr/prj.conf'
Merged configuration '/home/tiit/ncs/v2.2.0-rc1/nrf/subsys/partition_manager/partition_manager_enabled.conf'
Merged configuration '/home/tiit/code/blindy_v3/build/mcuboot/zephyr/misc/generated/extra_kconfig_options.conf'
Configuration saved to '/home/tiit/code/blindy_v3/build/mcuboot/zephyr/.config'
Kconfig header saved to '/home/tiit/code/blindy_v3/build/mcuboot/zephyr/include/generated/autoconf.h'
-- The C compiler identification is GNU 12.1.0
-- The CXX compiler identification is GNU 12.1.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/tiit/ncs/toolchains/v2.2.0-rc1/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
CMake Warning at /home/tiit/ncs/v2.2.0-rc1/nrf/lib/flash_patch/CMakeLists.txt:8 (message):

----------------------------------------------------------
--- WARNING: To maintain the integrity of secure boot, ---
--- enable CONFIG_DISABLE_FLASH_PATCH in production. ---
----------------------------------------------------------


MCUBoot bootloader key file: /home/tiit/ncs/v2.2.0-rc1/bootloader/mcuboot/root-ec-p256.pem
-- Configuring done
-- Generating done
-- Build files have been written to: /home/tiit/code/blindy_v3/build/mcuboot
=== child image mcuboot - end ===

CMake Warning at /home/tiit/ncs/v2.2.0-rc1/nrf/modules/mcuboot/CMakeLists.txt:286 (message):

---------------------------------------------------------
--- WARNING: Using default MCUBoot key, it should not ---
--- be used for production. ---
---------------------------------------------------------

-- Configuring done
-- Generating done
-- Build files have been written to: /home/tiit/code/blindy_v3/build
[1/293] Creating directories for 'mcuboot_subimage'
[2/293] No download step for 'mcuboot_subimage'
[3/293] No update step for 'mcuboot_subimage'
[4/293] No patch step for 'mcuboot_subimage'
[5/293] No configure step for 'mcuboot_subimage'
[5/293] Performing build step for 'mcuboot_subimage'
[1/176] Preparing syscall dependency handling

[2/176] Generating include/generated/version.h
-- Zephyr version: 3.2.99 (/home/tiit/ncs/v2.2.0-rc1/zephyr), build: v3.2.99-ncs1-rc1
[3/176] Generating misc/generated/syscalls_subdirs.trigger
[4/176] Generating misc/generated/syscalls.json, misc/generated/struct_tags.json
[5/176] Generating include/generated/driver-validation.h
[6/176] Generating include/generated/kobj-types-enum.h, include/generated/otype-to-str.h, include/generated/otype-to-size.h
[7/176] Generating include/generated/syscall_dispatch.c, include/generated/syscall_list.h
[8/176] Building C object zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
[9/176] Generating include/generated/offsets.h
[10/176] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc32c_sw.c.obj
[11/176] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc32_sw.c.obj
[12/176] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/dec.c.obj
[13/176] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc7_sw.c.obj
[14/176] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc16_sw.c.obj
[15/176] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc8_sw.c.obj
[16/176] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/hex.c.obj
[17/176] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/fdtable.c.obj
[18/176] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/reboot.c.obj
[19/176] Generating zephyr/autogen-pubkey.c
[20/176] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/timeutil.c.obj
[21/176] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/sem.c.obj
[22/176] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/thread_entry.c.obj
[23/176] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/printk.c.obj
[24/176] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_packaged.c.obj
[25/176] Building C object CMakeFiles/app.dir/os.c.obj
[26/176] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/heap-validate.c.obj
[27/176] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/rb.c.obj
[28/176] Building C object CMakeFiles/app.dir/home/tiit/ncs/v2.2.0-rc1/bootloader/mcuboot/boot/bootutil/src/fault_injection_hardening.c.obj
[29/176] Building C object CMakeFiles/app.dir/keys.c.obj
[30/176] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/bitarray.c.obj
[31/176] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/heap.c.obj
[32/176] Building C object CMakeFiles/app.dir/flash_map_extended.c.obj
[33/176] Building C object CMakeFiles/app.dir/home/tiit/ncs/v2.2.0-rc1/bootloader/mcuboot/boot/bootutil/src/image_validate.c.obj
[34/176] Building C object CMakeFiles/app.dir/home/tiit/ncs/v2.2.0-rc1/bootloader/mcuboot/ext/mbedtls-asn1/src/platform_util.c.obj
[35/176] Building C object CMakeFiles/app.dir/main.c.obj
[36/176] Building C object CMakeFiles/app.dir/home/tiit/ncs/v2.2.0-rc1/bootloader/mcuboot/boot/bootutil/src/encrypted.c.obj
[37/176] Building C object CMakeFiles/app.dir/home/tiit/ncs/v2.2.0-rc1/bootloader/mcuboot/boot/bootutil/src/tlv.c.obj
[38/176] Building C object CMakeFiles/app.dir/home/tiit/ncs/v2.2.0-rc1/bootloader/mcuboot/boot/bootutil/src/image_ed25519.c.obj
[39/176] Building C object CMakeFiles/app.dir/home/tiit/ncs/v2.2.0-rc1/bootloader/mcuboot/boot/bootutil/src/image_rsa.c.obj
[40/176] Building C object CMakeFiles/app.dir/home/tiit/ncs/v2.2.0-rc1/bootloader/mcuboot/boot/bootutil/src/image_ec256.c.obj
[41/176] Building C object CMakeFiles/app.dir/zephyr/autogen-pubkey.c.obj
[42/176] Building C object CMakeFiles/app.dir/home/tiit/ncs/v2.2.0-rc1/bootloader/mcuboot/boot/bootutil/src/swap_misc.c.obj
[43/176] Building C object CMakeFiles/app.dir/home/tiit/ncs/v2.2.0-rc1/bootloader/mcuboot/boot/bootutil/src/bootutil_misc.c.obj
[44/176] Building C object CMakeFiles/app.dir/home/tiit/ncs/v2.2.0-rc1/bootloader/mcuboot/boot/bootutil/src/caps.c.obj
[45/176] Building C object CMakeFiles/app.dir/home/tiit/ncs/v2.2.0-rc1/bootloader/mcuboot/ext/mbedtls-asn1/src/asn1parse.c.obj
[46/176] Building C object CMakeFiles/app.dir/home/tiit/ncs/v2.2.0-rc1/bootloader/mcuboot/ext/nrf/cc310_glue.c.obj
[47/176] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/multi_heap.c.obj
[48/176] Building C object CMakeFiles/app.dir/home/tiit/ncs/v2.2.0-rc1/bootloader/mcuboot/boot/bootutil/src/swap_scratch.c.obj
[49/176] Building C object CMakeFiles/app.dir/nrf_cleanup.c.obj
[50/176] Building C object zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj
FAILED: zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj
ccache /home/tiit/ncs/toolchains/v2.2.0-rc1/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DKERNEL -DNRF52840_XXAA -DUSE_PARTITION_MANAGER=1 -D__PROGRAM_START -D__ZEPHYR__=1 -I/home/tiit/ncs/v2.2.0-rc1/zephyr/kernel/include -I/home/tiit/ncs/v2.2.0-rc1/zephyr/arch/arm/include -I/home/tiit/ncs/v2.2.0-rc1/zephyr/include -Izephyr/include/generated -I/home/tiit/ncs/v2.2.0-rc1/zephyr/soc/arm/nordic_nrf/nrf52 -I/home/tiit/ncs/v2.2.0-rc1/zephyr/soc/arm/nordic_nrf/common/. -I/home/tiit/ncs/v2.2.0-rc1/nrf/include -I/home/tiit/ncs/v2.2.0-rc1/modules/hal/cmsis/CMSIS/Core/Include -I/home/tiit/ncs/v2.2.0-rc1/modules/hal/nordic/nrfx -I/home/tiit/ncs/v2.2.0-rc1/modules/hal/nordic/nrfx/drivers/include -I/home/tiit/ncs/v2.2.0-rc1/modules/hal/nordic/nrfx/mdk -I/home/tiit/ncs/v2.2.0-rc1/zephyr/modules/hal_nordic/nrfx/. -I/home/tiit/ncs/v2.2.0-rc1/bootloader/mcuboot/boot/bootutil/zephyr/.. -I/home/tiit/ncs/v2.2.0-rc1/bootloader/mcuboot/boot/bootutil/zephyr/../include -I/home/tiit/ncs/v2.2.0-rc1/bootloader/mcuboot/boot/bootutil/zephyr/../../zephyr/include -I/home/tiit/ncs/v2.2.0-rc1/nrfxlib/crypto/nrf_cc310_bl/include -isystem /home/tiit/ncs/v2.2.0-rc1/zephyr/lib/libc/minimal/include -isystem /home/tiit/ncs/toolchains/v2.2.0-rc1/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/include -isystem /home/tiit/ncs/toolchains/v2.2.0-rc1/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/include-fixed -isystem /home/tiit/ncs/v2.2.0-rc1/nrfxlib/crypto/nrf_cc310_platform/include -fno-strict-aliasing -Os -imacros /home/tiit/code/blindy_v3/build/mcuboot/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mfp16-format=ieee --sysroot=/home/tiit/ncs/toolchains/v2.2.0-rc1/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros /home/tiit/ncs/v2.2.0-rc1/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=/home/tiit/ncs/v2.2.0-rc1/bootloader/mcuboot/boot/zephyr=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/tiit/ncs/v2.2.0-rc1/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/tiit/ncs/v2.2.0-rc1=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj -MF zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj.d -o zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj -c zephyr/misc/generated/configs.c
/tmp/ccetOlIq.s: Assembler messages:
/tmp/ccetOlIq.s:213: Error: missing expression
[51/176] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/assert.c.obj
[52/176] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf.c.obj
[53/176] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_nano.c.obj
[54/176] Building C object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/validate_enabled_instances.c.obj
[55/176] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/notify.c.obj
[56/176] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/onoff.c.obj
[57/176] Building C object CMakeFiles/app.dir/home/tiit/ncs/v2.2.0-rc1/bootloader/mcuboot/boot/bootutil/src/loader.c.obj
[58/176] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/log_minimal.c.obj
[59/176] Building C object CMakeFiles/app.dir/home/tiit/ncs/v2.2.0-rc1/bootloader/mcuboot/boot/bootutil/src/swap_move.c.obj
ninja: build stopped: subcommand failed.
[141/293] Linking C static library zephyr/soc/arm/common/cortex_m/libsoc__arm__common__cortex_m.a
FAILED: modules/mcuboot/mcuboot_subimage-prefix/src/mcuboot_subimage-stamp/mcuboot_subimage-build mcuboot/zephyr/zephyr.hex mcuboot/zephyr/zephyr.elf
cd /home/tiit/code/blindy_v3/build/mcuboot && /home/tiit/ncs/toolchains/v2.2.0-rc1/usr/local/lib/python3.8/site-packages/cmake/data/bin/cmake --build . --
[143/293] Linking C static library zephyr/subsys/bluetooth/common/libsubsys__bluetooth__common.a
[144/293] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/hci_common.c.obj
[145/293] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/buf.c.obj
[146/293] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/ecc.c.obj
[147/293] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/settings.c.obj
[148/293] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/adv.c.obj
[149/293] Building C object CMakeFiles/app.dir/src/main.c.obj
../src/main.c: In function 'main':
/home/tiit/code/blindy_v3/src/main.c:274:17: warning: unused variable 'dir' [-Wunused-variable]
274 | uint8_t dir = 1U;
| ^~~
/home/tiit/code/blindy_v3/src/main.c:273:18: warning: unused variable 'step' [-Wunused-variable]
273 | uint32_t step = 0;
| ^~~~
[150/293] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/id.c.obj
[151/293] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/hci_core.c.obj
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /home/tiit/ncs/toolchains/v2.2.0-rc1/usr/local/bin/cmake --build /home/tiit/code/blindy_v3/build

* The terminal process terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.

Parents
  • This seems to be caused by my custom board file somehow. If I try to build the working sample files on my custom board I get the same error. 

    This is my board dts file. Can you see anything I should change there to make this work?

    // Copyright (c) 2022 Nordic Semiconductor ASA
    // SPDX-License-Identifier: Apache-2.0
    
    /dts-v1/;
    #include <nordic/nrf52840_qiaa.dtsi>
    
    / {
    	zephyr,user {
    		io-channels = <&adc 0>, <&adc 1>;
    	};
    };
    
    &pinctrl {
    	pwm0_default: pwm0_default {
    		group1 {
    			psels = <NRF_PSEL(PWM_OUT0, 0, 27)>;
    			nordic,invert;
    		};
    	};
    
    	pwm0_sleep: pwm0_sleep {
    		group1 {
    			psels = <NRF_PSEL(PWM_OUT0, 0, 27)>;
    			low-power-enable;
    		};
    	};
    
    	pwm1_default: pwm1_default {
    		group1 {
    			psels = <NRF_PSEL(PWM_OUT1, 0, 6)>;
    			nordic,invert;
    		};
    	};
    
    	pwm1_sleep: pwm1_sleep {
    		group1 {
    			psels = <NRF_PSEL(PWM_OUT1, 0, 6)>;
    			low-power-enable;
    		};
    	};
    };
    
    / {
    	model = "Blindy v4";
    	compatible = "soma,blindy-v4";
    
    	chosen {
    		zephyr,sram = &sram0;
    		zephyr,flash = &flash0;
    		zephyr,code-partition = &slot0_partition;
    	};
    
    	aliases {
    		led0 = &led0;
    		led1 = &led1;
    		led2 = &led2;
    		moten = &mot_en_pin;
    		chgen = &chg_en_pin;
    		ah = &ah_pin;
    		al = &al_pin;
    		bh = &bh_pin;
    		bl = &bl_pin;
    		enc1 = &enc1;
    		enc2 = &enc2;
    	};
    
    	leds {
    		compatible = "gpio-leds";
    		led0: led_0 {
    			gpios = < &gpio0 22 GPIO_ACTIVE_LOW >;
    			label = "Blue led";
    		};
    		led1: led_1 {
    			gpios = < &gpio0 21 GPIO_ACTIVE_LOW >;
    			label = "Green led";
    		};
    		led2: led_2 {
    			gpios = < &gpio0 20 GPIO_ACTIVE_LOW >;
    			label = "Red led";
    		};
    	};
    
    	inputs {
    		compatible = "gpio-keys";
    		enc1: enc_1 {
    			gpios = <&gpio0 24 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
    			label = "Encoder 1";
    		};
    		enc2: enc_2 {
    			gpios = <&gpio1 12 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
    			label = "Encoder 2";
    		};
    	};
    
    	outputs {
    		compatible = "gpio-leds";
    		chg_en_pin: chg_en_pin {
    			gpios = < &gpio1 11 GPIO_ACTIVE_HIGH >;
    		};
    	};
    
    	motor_pins {
    		compatible = "gpio-leds";
    		mot_en_pin: mot_en_pin {
    			gpios = < &gpio1 10 GPIO_ACTIVE_HIGH >;
    		};
    		/*
    		ah_pin: ah_pin {
    			gpios = < &gpio0 27 GPIO_ACTIVE_HIGH >;
    		};
    		*/
    		al_pin: al_pin {
    			gpios = < &gpio0 26 GPIO_ACTIVE_LOW >;
    		};
    		/*
    		bh_pin: bh_pin {
    			gpios = < &gpio0 6 GPIO_ACTIVE_HIGH >;
    		};
    		*/
    		bl_pin: bl_pin {
    			gpios = < &gpio0 8 GPIO_ACTIVE_LOW >;
    		};
    	};
    
    	pwm_pins {
    		compatible = "pwm-leds";
    		ah_pin: ah_pin {
    			pwms = < &pwm0 0 PWM_USEC(50) PWM_POLARITY_NORMAL >;
    		};
    		bh_pin: bh_pin {
    			pwms = < &pwm1 1 PWM_USEC(50) PWM_POLARITY_NORMAL >;
    		};
    	};
    };
    
    zephyr_udc0: &usbd {
    	compatible = "nordic,nrf-usbd";
    	status = "okay";
    };
    
    &zephyr_udc0 {
    	cdc_acm_uart0 {
    		compatible = "zephyr,cdc-acm-uart";
    	};
    	status = "okay";
    };
    
    &flash0 {
    	partitions {
    		compatible = "fixed-partitions";
    		#address-cells = <1>;
    		#size-cells = <1>;
    
    		boot_partition: partition@0 {
    			label = "mcuboot";
    			reg = <0x0 0xc000>;
    		};
    		slot0_partition: partition@c000 {
    			label = "image-0";
    			reg = <0xc000 0x72000>;
    		};
    		slot1_partition: partition@7e000 {
    			label = "image-1";
    			reg = <0x7e000 0x72000>;
    		};
    		scratch_partition: partition@f0000 {
    			label = "image-scratch";
    			reg = <0xf0000 0xa000>;
    		};
    		storage_partition: partition@fa000 {
    			label = "storage";
    			reg = <0xfa000 0x6000>;
    		};
    	};
    };
    
    &gpio0 {
    	status = "okay";
    };
    
    &gpio1 {
    	status = "okay";
    };
    
    &pwm0 {
    	status = "okay";
    	pinctrl-0 = <&pwm0_default>;
    	pinctrl-1 = <&pwm0_sleep>;
    	pinctrl-names = "default", "sleep";
    };
    
    &pwm1 {
    	status = "okay";
    	pinctrl-0 = <&pwm1_default>;
    	pinctrl-1 = <&pwm1_sleep>;
    	pinctrl-names = "default", "sleep";
    };
    
    &adc {
    	#address-cells = <1>;
    	#size-cells = <0>;
    	status = "okay";
    
    	channel@0 { /* Touch ADC */
    		reg = <0>;
    		zephyr,gain = "ADC_GAIN_1_6";
    		zephyr,reference = "ADC_REF_INTERNAL";
    		zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
    		zephyr,input-positive = <NRF_SAADC_AIN0>; /* P0.02 */
    		zephyr,resolution = <12>;
    	};
    
    	channel@1 { /* BAT_POS */
    		reg = <1>;
    		zephyr,gain = "ADC_GAIN_1_3";
    		zephyr,reference = "ADC_REF_INTERNAL";
    		zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
    		zephyr,input-positive = <NRF_SAADC_AIN7>;
    		zephyr,resolution = <12>;
    		/*zephyr,oversampling = <8>;*/
    	};
    };

  • This board you built on was "blindy_v3" and this is "Blindy_v4"

    Also, can you successfully build your project for certain DK ?

    Which DK you used as basis for your custom board?

Reply Children
  • The blindy_v3 and blindy_v4 thing is confusing here I agree but that should not make a difference. We are in the process of preparing this for manufacture and PCB revisions come and go pretty fast. The only real differences are pin mappings and ADC setups. All that should have little to no effect on the BLE part as far as I can tell.

    I will try to compile this for the nrf52840 dev kit tomorrow but I will likely need to comment out parts of the code since I have added many new aliases into the dts file that will not be there for the DK. Or I can try to do the overlay thing - I haven't tried that yet. This is my first project with Zephyr and I've never worked with devicetree before so everything takes a while to get right still.

    My custom board uses a module from Raytac containing the nrf52840. The same code works on my board without the DFU part already. And I will try tomorrow but I'm confident the HRS or LBS samples also work on my board if they are compiled with the DTS files for the DK. The issue seems to be the DTS file for my board. DFU samples that work with the nrf52840 DK DTS file fail to build with the DTS file I copied above. Unfortunately the error message is very non-descriptive and I can't see what is wrong in my DTS file.

Related