How to set Transmit Power of my Advertisement Packet in nRF Connect SDK 2.5.1

Hello,

I want to set the transmitting power of the advertising packet. How can I set the TX power?

I am using nRF Connect SDK 2.5.1 in Visual Studio Code.

Regards,

Sri

Parents Reply Children
  • PFA the contents of the custom board file and the config file of the project. 

    File Name: Kconfig
    Contents: 
    # nRF52833 board configuration
    
    config BOARD_ENABLE_DCDC
        bool "DCDC Mode"
        select SOC_DCDC_NRF52X
        default y
        depends on BOARD_BEACON_NRF52833
    --------------------------------------------------------------------------------------------------------------------
    File Name: Kconfig.board
    Contents:
    # Copyright (c) 2024 Nordic Semiconductor ASA
    # SPDX-License-Identifier: Apache-2.0
    
    config BOARD_BEACON_NRF52833
    	bool "BEACON"
    	depends on SOC_NRF52833_QIAA
    ----------------------------------------------------------------------------------------------------------------------
    File Name: Kconfig.defconfig
    Contents:
    # Copyright (c) 2024 Nordic Semiconductor ASA
    # SPDX-License-Identifier: Apache-2.0
    
    if BOARD_BEACON_NRF52833
    
    config BOARD
    	default "beacon_nrf52833"
    
    config BT_CTLR
       default BT
    
    
    endif
    --------------------------------------------------------------------------------------------------------------------------
    File Name: beacon_nrf52833.dts
    Contents:
    // Copyright (c) 2024 Nordic Semiconductor ASA
    // SPDX-License-Identifier: Apache-2.0
    
    /dts-v1/;
    #include <nordic/nrf52833_qiaa.dtsi>
    #include "beacon_nrf52833-pinctrl.dtsi"
    
    
    / {
    	model = "BEACON";
    	compatible = "ust,beacon-nrf52833";
    
    	chosen {
    		zephyr,sram = &sram0;
    		zephyr,flash = &flash0;
    		zephyr,code-partition = &slot0_partition;
    		zephyr,console =  &uart0 ;
    		zephyr,shell-uart =  &uart0 ;
    		zephyr,uart-mcumgr = &uart0;
    	};
    
    	leds {
    		compatible = "gpio-leds";
    		LED0: led_0 {
    			label = "RED LED";
    			gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
    		};
    		LED1: led_1 {
    			label = "GREEN LED";
    			gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
    		};
    		LED2: led_2 {
    			label = "BLUE LED";
    			gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
    		};
    		LED3: led_3 {
    			label = "IR LED";
    			gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
    		};
    	};
    
    	buttons {
    		compatible = "gpio-keys";
    		btn0: user_btn {
    			label = "USER BUTTON";
    			gpios = <&gpio1 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
    		};
    	};
    	aliases {
    		led0 = &LED0;
    		led1 = &LED1;
    		led2 = &LED2;
    		sw0 = &btn0;
    		watchdog0 = &wdt0;
    	};
    };
    
    &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 0x32000>;
    		};
    		slot1_partition: partition@3e000 {
    			label = "image-1";
    			reg = <0x3e000 0x32000>;
    		};
    		scratch_partition: partition@70000 {
    			label = "image-scratch";
    			reg = <0x70000 0xa000>;
    		};
    		storage_partition: partition@7a000 {
    			label = "storage";
    			reg = <0x7a000 0x6000>;
    		};
    	};
    };
    
    &uart0 {
    	status = "okay";
    	current-speed = <115200>;
    	pinctrl-0 = <&uart0_default>;
    	pinctrl-1 = <&uart0_sleep>;
    	pinctrl-names = "default", "sleep";
    };
    
    &gpio0 {
    	status = "okay";
    };
    
    &gpio1 {
    	status = "okay";
    };
    
    &gpiote {
    	status = "okay";
    };
    
    &nfct {
    	status = "disabled";
    };
    
    &acl {
    	status = "disabled";
    };
    ---------------------------------------------------------------------------------------------------------------------------------
    File Name: beacon_nrf52833.yaml 
    Contents: 
    # Copyright (c) 2024 Nordic Semiconductor ASA
    # SPDX-License-Identifier: Apache-2.0
    
    identifier: beacon_nrf52833
    name: BEACON
    type: mcu
    arch: arm
    ram: 128
    flash: 512
    toolchain:
      - zephyr
      - gnuarmemb
      - xtools
    ---------------------------------------------------------------------------------------------------------------------------------
    File Name: beacon_nrf52833_defconfig
    Contents:
    # Copyright (c) 2024 Nordic Semiconductor ASA
    # SPDX-License-Identifier: Apache-2.0
    
    CONFIG_SOC_SERIES_NRF52X=y
    CONFIG_SOC_NRF52833_QIAA=y
    CONFIG_BOARD_BEACON_NRF52833=y
    
    # Enable MPU
    CONFIG_ARM_MPU=y
    
    # Enable hardware stack protection
    CONFIG_HW_STACK_PROTECTION=y
    
    # Enable GPIO
    CONFIG_GPIO=n
    
    # Enable UART
    CONFIG_SERIAL=n
    
    # Enable Console
    CONFIG_CONSOLE=n
    CONFIG_UART_CONSOLE=n
    
    # Enable Pin Control subsystem
    CONFIG_PINCTRL=y
    ---------------------------------------------------------------------------------------------------------------------------------
    File Name: beacon_nrf52833-pinctrl.dtsi
    Contents:
    /*
     * Copyright (c) 2022 Nordic Semiconductor
     * SPDX-License-Identifier: Apache-2.0
     */
    
    &pinctrl {
        uart0_default: uart0_default{
            group1 {
                psels = <NRF_PSEL(UART_TX,0,6)>;
            };
            group2 {
                psels = <NRF_PSEL(UART_RX,0,8)>;
                bias-pull-up;
            };
        };
        uart0_sleep: uart0_sleep {
            group1 {
                psels = <NRF_PSEL(UART_TX, 0, 6)>,
                        <NRF_PSEL(UART_RX, 0, 8)>;
                low-power-enable;
            };
        };
        
        i2c0_default: i2c0_default {
            group1 {
                psels = <NRF_PSEL(TWIM_SDA, 0, 26)>,
                        <NRF_PSEL(TWIM_SCL, 0, 12)>;
            };
        };
    
        i2c0_sleep: i2c0_sleep {
            group1 {
                psels = <NRF_PSEL(TWIM_SDA, 0, 26)>,
                        <NRF_PSEL(TWIM_SCL, 0, 12)>;
                low-power-enable;
            };
        };
    };
    ---------------------------------------------------------------------------------------------------------------------------------
    File Name: board.cmake
    Contents:
    # Copyright (c) 2024 Nordic Semiconductor ASA
    # SPDX-License-Identifier: Apache-2.0
    
    board_runner_args(jlink "--device=nrf52833_xxaa" "--speed=4000")
    board_runner_args(pyocd "--target=nrf52833" "--frequency=4000000")
    
    include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
    include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
    include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
    File Name: prj.conf
    Contents:
    # Logger module
    CONFIG_LOG=n
    
    # GPIO Library
    CONFIG_GPIO=n
    
    # Include BLE stack in project
    CONFIG_BT=y
    
    # Set device Name
    CONFIG_BT_DEVICE_NAME="UBC0001"
    
    # Increase stack size for the main thread and System Workqueue
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    CONFIG_MAIN_STACK_SIZE=2048
    
    # Set the default Tx Power of BLE 
    # CONFIG_BT_CTLR_TX_PWR_MINUS_20=y
    # CONFIG_BT_CTLR_TX_PWR_MINUS_16=y
    # CONFIG_BT_CTLR_TX_PWR_MINUS_12=y
    # CONFIG_BT_CTLR_TX_PWR_MINUS_8=y
    # CONFIG_BT_CTLR_TX_PWR_MINUS_4=y
    CONFIG_BT_CTLR_TX_PWR_0=y
    # CONFIG_BT_CTLR_TX_PWR_PLUS_4=y
    # CONFIG_BT_CTLR_TX_PWR_PLUS_8=y
    ---------------------------------------------------------------------------------------------------------------------------------
    

  • Hello

    I have shared the custom board files and the config files.

    Regards,

    Sri

  • Hi

    I looked over and they seems fine to me. 

    I got a few pointers from a collauge that is worth having a look at

    1. The PPK2 may give some spikes when changing level

    2. You should zoom in where the adv.evt is and look at the level where is stable

    Regards

    Runar

  • Hello,

    I have looked into the adv.evt in the PPK current consumption by zooming in and found three peaks. But all the peaks are above the value mentioned in the datasheet even excluding the peak at the start.

    So is there anything I can do to reduce or do you think the PPK is giving the spikes in current consumption?

    TIA

  • The stable current is only high. So I presume DC/DC mode is not activated. So am I missing anything in enabling the DCDC mode?

    Regards,

    Sri

Related