This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF Connect SDK v.1.5.0 : How/Where to change PHY and TX power for long range application

Hello 

I'm using nRF5340 DK with nRF Connect SDK 1.5.0 and SES IDE and I want to change the PHYs and TX power of the peripheral_uart sample (v1.5.0\nrf\samples\bluetooth\peripheral_uart) to switch to the long range configuration. The problem is, with this version of nRF Connect SDK, I do not know where to write to change these parameters.

I flashed peripheral_uart in the core application and hci_rpmsg in the network core

I tried to look for answers in the forum but, unless I'm mistaken, I couldn't find any answer because all the cases in the forum are based on the old versions of the SDK and none on the new one (nRF Connect SDK 1.5.0).

Can someone please enlighten me on this :)

Any help is welcome

Thanks

Mickael 

  • Hi Mickael,

    There is a similar question here: (+) How to config nrf5340 tx power? - Nordic Q&A - Nordic DevZone - Nordic DevZone (nordicsemi.com)

    As far as i am aware implementing the hci_pwr_ctrl example should work, but i have not tested this myself.

    Regards,
    Jonathan

  • Hi Jonathan

    thank you for responding ! 

    But I have further questions : 

    Should I modify prj.conf for peripheral_uart sample AND hci_rpmsg sample to increase TX power?

    And to change PHY I have to do the same? I.e. modify the prj.conf for both samples?  but for peripheral_uart, I have prj.conf and prj_minimal.conf, which one should I modify? 

    Sorry if sometimes my questions seem far-fetched, I'm a bit confused about this net core and app core stuff and with this new nRF Connect SDK :)

    Thanks

  • Mickael_Marport said:
    Should I modify prj.conf for peripheral_uart sample AND hci_rpmsg sample to increase TX power?

     You only have to modify the one you are going to use, so in your case if a understand correctly only the prj.conf in peripheral_uart sample. 


    So, a solution that seems to be working atm is setting this in the prj.conf:

    CONFIG_BT_LL_SOFTDEVICE=n
    CONFIG_BT_LL_SW_SPLIT=y
    CONFIG_BT_CTLR_ADVANCED_FEATURES=y
    CONFIG_BT_CTLR_CONN_RSSI=y
    CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y


    The SoftDevice does not have full support for set_tx, but read_tx is supported. So then LL_SPLIT is then needed to get the desired operation.
    There is more documentation in the Kconfig docs

    Dont worry, if you have more questions then feel free to ask, thats why we have Devzone.

    Regards,
    Jonathan

  • Thank you very much Jonathan, now I can change TX power by adding this to the prj.conf files of peripheral_uart sample and hci_rpmsg sample:

    CONFIG_BT_LL_SOFTDEVICE=n
    CONFIG_BT_LL_SW_SPLIT=y
    CONFIG_BT_CTLR_ADVANCED_FEATURES=y
    CONFIG_BT_CTLR_CONN_RSSI=y
    CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y

    I also modified the main.c of peripheral_uart sample like this, as you suggested to me.

    Concerning the modification of the PHY layer on Coded, I followed this post. I added this to the prj.conf files of both samples:

    CONFIG_BT_EXT_ADV=y
    CONFIG_BT_CTLR_PHY_CODED=y

    This is my peripheral_uart prj.conf: 

    # Enable the UART driver
    CONFIG_UART_ASYNC_API=y
    CONFIG_NRFX_UARTE0=y
    CONFIG_SERIAL=y
    
    CONFIG_GPIO=y
    
    # Make sure printk is not printing to the UART console
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=y
    
    CONFIG_HEAP_MEM_POOL_SIZE=2048
    
    CONFIG_BT=y
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_DEVICE_NAME="BLE_NUS_LR"
    CONFIG_BT_DEVICE_APPEARANCE=833
    CONFIG_BT_MAX_CONN=1
    CONFIG_BT_MAX_PAIRED=1
    
    # Enable the NUS service
    CONFIG_BT_NUS=y
    
    # Enable bonding
    CONFIG_BT_SETTINGS=y
    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_FLASH_MAP=y
    CONFIG_NVS=y
    CONFIG_SETTINGS=y
    
    # Enable DK LED and Buttons library
    CONFIG_DK_LIBRARY=y
    
    # This example requires more workqueue stack
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    
    # TODO : FOR LONG RANGE
    CONFIG_BT_EXT_ADV=y
    CONFIG_BT_CTLR_PHY_CODED=y
    
    # TODO : FOR TX POWER
    CONFIG_BT_LL_SOFTDEVICE=n
    CONFIG_BT_LL_SW_SPLIT=y
    CONFIG_BT_CTLR_ADVANCED_FEATURES=y
    CONFIG_BT_CTLR_CONN_RSSI=y
    CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y
    
    # Config logger
    CONFIG_LOG=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_LOG_BACKEND_RTT=y
    CONFIG_LOG_BACKEND_UART=n
    
    CONFIG_ASSERT=y

    and this is my hci_rpmsg prj.conf:

    CONFIG_LOG=y
    
    CONFIG_RPMSG_SERVICE=y
    CONFIG_RPMSG_SERVICE_MODE_REMOTE=y
    
    CONFIG_HEAP_MEM_POOL_SIZE=8192
    
    CONFIG_MAIN_STACK_SIZE=512
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512
    CONFIG_BT=y
    CONFIG_BT_HCI_RAW=y
    CONFIG_BT_MAX_CONN=16
    CONFIG_BT_CTLR_ASSERT_HANDLER=y
    CONFIG_BT_HCI_RAW_RESERVE=1
    
    CONFIG_ASSERT=y
    CONFIG_DEBUG_INFO=y
    CONFIG_EXCEPTION_STACK_TRACE=y
    
    # TODO : MODIF FOR LONG RANGE
    CONFIG_BT_EXT_ADV=y
    CONFIG_BT_CTLR_PHY_CODED=y
    
    # TODO : MODIF FOR TX POWER
    CONFIG_BT_LL_SOFTDEVICE=n
    CONFIG_BT_LL_SW_SPLIT=y
    CONFIG_BT_CTLR_ADVANCED_FEATURES=y
    CONFIG_BT_CTLR_CONN_RSSI=y
    CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y

    I modified the main.c of peripheral_uart by adding this: 

    struct bt_le_adv_param *adv_param =
              BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONNECTABLE | BT_LE_ADV_OPT_ONE_TIME | BT_LE_ADV_OPT_CODED | BT_LE_ADV_OPT_EXT_ADV,
              BT_GAP_ADV_FAST_INT_MIN_2,
              BT_GAP_ADV_FAST_INT_MAX_2,
              NULL);
        ...
        ...
    err = bt_le_adv_start(adv_param, ad, ARRAY_SIZE(ad), sd,
    			      ARRAY_SIZE(sd));

    with no luck because I can't see my module advertising anymore although my phone is compatible with all features: 

    So, my question is: is it currently possible to do long rang with nRF5340 DK and the current version of nRF Connect SDK? Because all topics i found in Devzone about Coded PHY are on the nRF52840. And reading the README of the v1.5.0\nrf\samples\bluetooth\throughput sample I saw that it says :  

    Physical layer (PHY) data rate
       Starting with Bluetooth 5, the over-the-air data rate in Bluetooth Low Energy can exceed 1 Ms/s (mega symbol per second), which allows for faster transmission.
       In addition, it is possible to use coded PHY (available on the nRF52840 SoC only) for long-range transmission.

    I haven't tried the throughput sample yet using coded PHY but I'll jump in and see what happens.

    Any insight is appreciated!

    Mickael

  • Hi,

    Mickael_Marport said:
    is it currently possible to do long rang with nRF5340 DK

     Yes, it should be fine. 


    I believe the documentation is not quite up to date. nRF52820, nRF52833 and nRF52811 also support Coded PHY .

    Regards,
    Jonathan

Related