ERROR WHEN CREATE BLE ADVERTISING NRF54L15 CUSTOM BOARD

Hi everyone,
I tried to create BLE ad for customboard nrf54l15, but it doesn't seem to work.
I upload my code in the attached file:

when I buil project, I have an error:

 "undefined reference to `__device_dts_ord_92'"

I don't know to configure that.

Can you help me solution for this, please?

Thank for that,
#include <zephyr/kernel.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/gap.h>
#include <zephyr/sys/printk.h>

#define LED_NODE DT_ALIAS(led1)

// DEVICE_NAME CONFIG_BT_DEVICE_NAME
#define DEVICE_NAME "BL-TEST BY NKD"
#define DEVICE_NAME_LEN (sizeof(DEVICE_NAME) - 1)

static const struct bt_data ad[] = {
	BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
	BT_DATA(BT_DATA_NAME_COMPLETE, DEVICE_NAME, DEVICE_NAME_LEN),

};

static unsigned char url_data[] = { 0x17, '/', '/', 'a', 'c', 'a', 'd', 'e', 'm',
    'y',  '.', 'n', 'o', 'r', 'd', 'i', 'c', 's',
    'e',  'm', 'i', '.', 'c', 'o', 'm' };

static const struct bt_data sd[] = {
    /* 4.2.3 Include the URL data in the scan response packet */
    BT_DATA(BT_DATA_URI, url_data, sizeof(url_data)),
};


int ble_init(void)
{
    int err;
    err = bt_enable(NULL);
	if (err) {
		printk("Bluetooth init failed (err %d)\n", err);
		return -1;
	}

    err = bt_le_adv_start(BT_LE_ADV_NCONN, ad, ARRAY_SIZE(ad), sd, ARRAY_SIZE(sd));
	if (err) {
		printk("Advertising failed to start (err %d)\n", err);
		return -1;
	}
    return 0;
}
Parents
  • Hi,
    I have referred to the link you attached and error:
    "undefined reference to `__device_dts_ord_92' "
    92: /soc/peripheral@50000000/radio@8a000/bt_hci_sdc

    I updated bt_hci sdc (status = "okay") in devicetree but when I build the program, I still get the same error.
    the code in devicetree:

    /dts-v1/;
    #include <nordic/nrf54l15_cpuapp.dtsi>
    #include "nrf54l15_custom-pinctrl.dtsi"
    #include <zephyr/dt-bindings/input/input-event-codes.h>
    
    / {
    	model = "Custom Board auto generated by nRF Connect for VS Code";
    	compatible = "nrf54l15_customboard,nrf54l15-custom-cpuapp";
    
    	chosen {
    		zephyr,code-partition = &slot0_partition;
    		zephyr,sram = &cpuapp_sram;
    		zephyr,flash = &cpuapp_rram;
    		zephyr,flash-controller = &rram_controller;
    		zephyr,ieee802154 = &ieee802154;
    		zephyr,console = &uart20;
    		zephyr,shell-uart = &uart20;
    		zephyr,uart-mcumgr = &uart20;
    		zephyr,bt-mon-uart = &uart20;
            zephyr,bt-c2h-uart = &uart20;
    		zephyr,bt-hci = &bt_hci_sdc;
    	};
    	
    	leds {
    		compatible = "gpio-leds";
    		led0: led_0 {
    			gpios = <&gpio2 9 GPIO_ACTIVE_LOW>;
    			label = "Green LED 0";
    		};
    		led1: led_1 {
    			gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
    			label = "Green LED 1";
    		};
    		led2: led_2 {
    			gpios = <&gpio2 7 GPIO_ACTIVE_LOW>;
    			label = "Green LED 2";
    		};
    		led3: led_3 {
    			gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
    			label = "Green LED 3";
    		};
    	};
    
    	aliases {
    		led0 = &led0;
    		led1 = &led1;
    		led2 = &led2;
    		led3 = &led3;
    	};
    };
    
    &cpuapp_sram {
    	status = "okay";
    };
    
    &grtc {
    	owned-channels = <0 1 2 3 4 5 6 7 8 9 10 11>;
    	/* Channels 7-11 reserved for Zero Latency IRQs, 3-4 for FLPR */
    	child-owned-channels = <3 4 7 8 9 10 11>;
    	status = "okay";
    };
    
    &cpuapp_rram {
    	partitions {
    		compatible = "fixed-partitions";
    		#address-cells = <1>;
    		#size-cells = <1>;
    		boot_partition: partition@0 {
    			label = "mcuboot";
    			reg = <0x0 DT_SIZE_K(64)>;
    		};
    		slot0_partition: partition@10000 {
    			label = "image-0";
    			reg = <0x10000 DT_SIZE_K(324)>;
    		};
    		slot0_ns_partition: partition@61000 {
    			label = "image-0-nonsecure";
    			reg = <0x61000 DT_SIZE_K(324)>;
    		};
    		slot1_partition: partition@b2000 {
    			label = "image-1";
    			reg = <0xb2000 DT_SIZE_K(324)>;
    		};
    		slot1_ns_partition: partition@103000 {
    			label = "image-1-nonsecure";
    			reg = <0x103000 DT_SIZE_K(324)>;
    		};
    		/* 32k from 0x154000 to 0x15bfff reserved for TF-M partitions */
    		storage_partition: partition@15c000 {
    			label = "storage";
    			reg = <0x15c000 DT_SIZE_K(36)>;
    		};
    	};
    };
    
    &gpiote30 {
    	status = "okay";
    };
    
    &gpiote20 {
    	status = "okay";
    };
    
    &gpio0 {
    	status = "okay";
    };
    
    &gpio1 {
    	status = "okay";
    };
    
    &gpio2 {
    	status = "okay";
    };
    
    &uart20 {
    	compatible = "nordic,nrf-uarte";
    	status = "okay";
    	current-speed = <115200>;
    	pinctrl-0 = <&uart20_default>;
    	pinctrl-names = "default";
    };
    
    &uart30 {
    	compatible = "nordic,nrf-uarte";
    	status = "okay";
    	current-speed = <115200>;
    	pinctrl-0 = <&uart30_default>;
    	pinctrl-names = "default";
    };
    
    
    &radio {
    	status = "okay";
    };
    
    &ieee802154 {
    	status = "okay";
    };
    
    &bt_hci_sdc {
    	compatible = "nordic,bt-hci-sdc";
    	status = "okay";
    };
    
    
    

    "
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/host/libsubsys__bluetooth__host.a(hci_core.c.obj):(.data.bt_dev+0x134): undefined reference to `__device_dts_ord_92'
    collect2.exe: error: ld returned 1 exit status
    "

    Can you help me this my problems, please?

Reply
  • Hi,
    I have referred to the link you attached and error:
    "undefined reference to `__device_dts_ord_92' "
    92: /soc/peripheral@50000000/radio@8a000/bt_hci_sdc

    I updated bt_hci sdc (status = "okay") in devicetree but when I build the program, I still get the same error.
    the code in devicetree:

    /dts-v1/;
    #include <nordic/nrf54l15_cpuapp.dtsi>
    #include "nrf54l15_custom-pinctrl.dtsi"
    #include <zephyr/dt-bindings/input/input-event-codes.h>
    
    / {
    	model = "Custom Board auto generated by nRF Connect for VS Code";
    	compatible = "nrf54l15_customboard,nrf54l15-custom-cpuapp";
    
    	chosen {
    		zephyr,code-partition = &slot0_partition;
    		zephyr,sram = &cpuapp_sram;
    		zephyr,flash = &cpuapp_rram;
    		zephyr,flash-controller = &rram_controller;
    		zephyr,ieee802154 = &ieee802154;
    		zephyr,console = &uart20;
    		zephyr,shell-uart = &uart20;
    		zephyr,uart-mcumgr = &uart20;
    		zephyr,bt-mon-uart = &uart20;
            zephyr,bt-c2h-uart = &uart20;
    		zephyr,bt-hci = &bt_hci_sdc;
    	};
    	
    	leds {
    		compatible = "gpio-leds";
    		led0: led_0 {
    			gpios = <&gpio2 9 GPIO_ACTIVE_LOW>;
    			label = "Green LED 0";
    		};
    		led1: led_1 {
    			gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
    			label = "Green LED 1";
    		};
    		led2: led_2 {
    			gpios = <&gpio2 7 GPIO_ACTIVE_LOW>;
    			label = "Green LED 2";
    		};
    		led3: led_3 {
    			gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
    			label = "Green LED 3";
    		};
    	};
    
    	aliases {
    		led0 = &led0;
    		led1 = &led1;
    		led2 = &led2;
    		led3 = &led3;
    	};
    };
    
    &cpuapp_sram {
    	status = "okay";
    };
    
    &grtc {
    	owned-channels = <0 1 2 3 4 5 6 7 8 9 10 11>;
    	/* Channels 7-11 reserved for Zero Latency IRQs, 3-4 for FLPR */
    	child-owned-channels = <3 4 7 8 9 10 11>;
    	status = "okay";
    };
    
    &cpuapp_rram {
    	partitions {
    		compatible = "fixed-partitions";
    		#address-cells = <1>;
    		#size-cells = <1>;
    		boot_partition: partition@0 {
    			label = "mcuboot";
    			reg = <0x0 DT_SIZE_K(64)>;
    		};
    		slot0_partition: partition@10000 {
    			label = "image-0";
    			reg = <0x10000 DT_SIZE_K(324)>;
    		};
    		slot0_ns_partition: partition@61000 {
    			label = "image-0-nonsecure";
    			reg = <0x61000 DT_SIZE_K(324)>;
    		};
    		slot1_partition: partition@b2000 {
    			label = "image-1";
    			reg = <0xb2000 DT_SIZE_K(324)>;
    		};
    		slot1_ns_partition: partition@103000 {
    			label = "image-1-nonsecure";
    			reg = <0x103000 DT_SIZE_K(324)>;
    		};
    		/* 32k from 0x154000 to 0x15bfff reserved for TF-M partitions */
    		storage_partition: partition@15c000 {
    			label = "storage";
    			reg = <0x15c000 DT_SIZE_K(36)>;
    		};
    	};
    };
    
    &gpiote30 {
    	status = "okay";
    };
    
    &gpiote20 {
    	status = "okay";
    };
    
    &gpio0 {
    	status = "okay";
    };
    
    &gpio1 {
    	status = "okay";
    };
    
    &gpio2 {
    	status = "okay";
    };
    
    &uart20 {
    	compatible = "nordic,nrf-uarte";
    	status = "okay";
    	current-speed = <115200>;
    	pinctrl-0 = <&uart20_default>;
    	pinctrl-names = "default";
    };
    
    &uart30 {
    	compatible = "nordic,nrf-uarte";
    	status = "okay";
    	current-speed = <115200>;
    	pinctrl-0 = <&uart30_default>;
    	pinctrl-names = "default";
    };
    
    
    &radio {
    	status = "okay";
    };
    
    &ieee802154 {
    	status = "okay";
    };
    
    &bt_hci_sdc {
    	compatible = "nordic,bt-hci-sdc";
    	status = "okay";
    };
    
    
    

    "
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/host/libsubsys__bluetooth__host.a(hci_core.c.obj):(.data.bt_dev+0x134): undefined reference to `__device_dts_ord_92'
    collect2.exe: error: ld returned 1 exit status
    "

    Can you help me this my problems, please?

Children
Related