BLE - custom board configuration - DeviceTree, Kconfig...

Hi,
I have created my own hardware with nRF54L15 – 2xLED, 2xPWM, and Radio (BLE). I am trying to create a custom board using the graphical wizard.
LED and PWM seems to work – the project compiles, but I could not test it on hardware yet.

Now, I want to add BLE support - advertising and connection. How can I prepare my board in DeviceTree (DTS), or in the graphical wizard? Is there any step-by-step guide or tutorial for this?
Thank you very much for your help!


I found this gpio-radio-coex:
 


in prj.conf I added:

# BLE
CONFIG_BT=y
CONFIG_BT_DEVICE_NAME="ZGuard"
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_EXT_ADV=y
CONFIG_CLOCK_CONTROL_NRF=y
# LFCLK: (32.768 kHz)
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n
CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM=y


this is in my defconfig ..._cpuapp_defconfig:
CONFIG_ARM_MPU=y
CONFIG_HW_STACK_PROTECTION=y

CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y

CONFIG_CACHE_MANAGEMENT=y
CONFIG_EXTERNAL_CACHE=y

# Start SYSCOUNTER on driver init
CONFIG_NRF_GRTC_START_SYSCOUNTER=y

#Pro tickless režim - netikame každou 1 ms
CONFIG_TICKLESS_KERNEL=y
CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000

CONFIG_NRFX_POWER=y

# Enable RTT
CONFIG_USE_SEGGER_RTT=y
 
# enable GPIO
CONFIG_GPIO=y  

# enable uart driver
CONFIG_SERIAL=y  

# enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

# Použít externí 32 MHz krystal pro HFCLK – Zephyr nastavuje automaticky, pokud je dostupný
CONFIG_CLOCK_CONTROL_NRF=y
# LFCLK: použít interní RC oscilátor (32.768 kHz)
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n

# Přesnost RC oscilátoru
CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM=y


This is in my .dts:
/dts-v1/;
#include <nordic/nrf54l15_cpuapp.dtsi>
#include "ZoneGuard_HW_v2_0-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>

/ {
    model = "Main control board for ZoneGuard system with nRF54L15";
    compatible = "Ropixon,ZoneGuard-HW-v2-0-cpuapp";

    chosen {
        zephyr,code-partition = &slot0_partition;
        zephyr,sram = &cpuapp_sram;
        zephyr,flash = &cpuapp_rram;
        zephyr,console = &uart00;
        zephyr,uart-console = &uart00;
    };

    leds {
        compatible = "gpio-leds";
        led_red: led_red {
            label = "LED_RED";
            gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
        };
        led_green: led_green {
            label = "LED_GREEN";
            gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
        };
    };

    buttons {
        compatible = "gpio-keys";
        zg_button: zg_button {
            label = "BTN";
            gpios = <&gpio2 1 0>;
        };
    };

    pwm_ctrl {
        compatible = "pwm-leds";

        pwm_beep: pwm_beep {
            label = "BEEP";
            pwms = <&pwm20 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
        };

        pwm_shock: pwm_shock {
            label = "SHOCK";
            pwms = <&pwm20 1 PWM_MSEC(1) PWM_POLARITY_NORMAL>;
        };
    };

   
    aliases {
        led0 = &led_red;
        led1 = &led_green;
        button0 = &zg_button;
        buzzer = &pwm_beep;  //  teď už &pwm_beep je validní
    };

};

&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)>;
        };
    };
};

&gpio0 {
    status = "okay";
};

&gpio2 {
    status = "okay";
};

&gpio1 {
    status = "okay";
};

&uart00 {
    status = "okay";
    current-speed = <115200>;
    pinctrl-0 = <&uart00_default>;
    pinctrl-names = "default";
};

&pinctrl {
    uart00_default: uart00_default {
        group1 {
            psels = <NRF_PSEL(UART_TX, 1, 1)>, <NRF_PSEL(UART_RX, 1, 2)>;
        };
    };

    pwm20_default: pwm20_default {
        group1 {
            psels = <NRF_PSEL(PWM_OUT0, 0, 0)>, <NRF_PSEL(PWM_OUT1, 0, 1)>;
        };
    };
};

&pwm20 {
    status = "okay";
    pinctrl-0 = <&pwm20_default>;
    pinctrl-names = "default";
};

&gpiote20 {
    status = "okay";
};

&gpiote30 {
    status = "okay";
};

this is my .overlay:
&radio {
    status = "okay";
};

&bt_hci_controller {
    status = "okay";
};


Peripheral_lbs is my inspiration, but still see some errors:
[140/234] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/gatt.c.obj
In file included from c:\ncs\v3.0.0\zephyr\modules\hal_nordic\nrfx\nrfx_config.h:23,
from C:/ncs/v3.0.0/modules/hal/nordic/nrfx/nrfx.h:37,
from c:\ncs\v3.0.0\zephyr\soc\nordic\common\soc_nrf_common.h:14,
from c:\ncs\v3.0.0\zephyr\soc\nordic\nrf54l\soc.h:14,
from c:\ncs\v3.0.0\zephyr\modules\cmsis\cmsis_core_m.h:24,
from c:\ncs\v3.0.0\zephyr\modules\cmsis\cmsis_core.h:10,
from C:/ncs/v3.0.0/zephyr/include/zephyr/arch/arm/asm_inline_gcc.h:24,
from C:/ncs/v3.0.0/zephyr/include/zephyr/arch/arm/asm_inline.h:18,
from C:/ncs/v3.0.0/zephyr/include/zephyr/arch/arm/arch.h:30,
from C:/ncs/v3.0.0/zephyr/include/zephyr/arch/cpu.h:19,
from C:/ncs/v3.0.0/zephyr/include/zephyr/kernel_includes.h:36,
from C:/ncs/v3.0.0/zephyr/include/zephyr/kernel.h:17,
from C:/ncs/v3.0.0/zephyr/include/zephyr/net_buf.h:16,
from C:/ncs/v3.0.0/zephyr/include/zephyr/bluetooth/bluetooth.h:32,
from C:/ncs/v3.0.0/zephyr/include/zephyr/bluetooth/conn.h:23,
from C:/ncs/v3.0.0/zephyr/include/zephyr/bluetooth/att.h:21,
from C:/ncs/v3.0.0/zephyr/subsys/bluetooth/host/gatt.c:12:
c:\ncs\v3.0.0\zephyr\modules\hal_nordic\nrfx\nrfx_config_reserved_resources_ncs.h:85: warning: "NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR" redefined
85 | #define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC10_CHANNELS_USED_MASK
|
c:\ncs\v3.0.0\zephyr\modules\hal_nordic\nrfx\nrfx_config_reserved_resources_ncs.h:63: note: this is the location of the previous definition
63 | #define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS
|
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1:


Parents Reply Children
No Data
Related