Bluetooth Setting Changes when mainly using app core

Hello,

I am using the nrf5340. My project is quite large but running on the app core just fine.

Now, I have the problem that I want to adjust some BLE settings, like tx Power, connection intervall ecc. As I have read here, it is said that bluetooth is generally handled using the net core.

I cannot build my project on the netcore however since it is to large and needs a lot of periphery which is not trivial to access using the net core apparently. Also, I have not found a easy example or documentation on how to send data from the app to the net core (I thought of doing so, so I have all the periphery communication and processing on the app core, send the data to the net core and have the netcore transmit the data via ble).

My question now is: would that really be the best process to do so? My basic example on which I started building my project was the peripheral uart example, which does not seem to use the net core for bluetooth at all.

Thanks in advance,

Morandell Paul

Parents
  • Hi,

    Normally, the Bluetooth stack is split with the controller on the network core and the host on the application core. Most parameters can be configured from the application core via the Zephyr Bluetooth APIs. This include things like advertising interval, Tx power etc, and you do not need to do changes on the network core.

    My basic example on which I started building my project was the peripheral uart example, which does not seem to use the net core for bluetooth at all.

    If you build for the app core, the HCI rpmsg application (which contain the Bluetooth controller) is automatically added to the project as a child image. This is normally what you want to do. Then, just do the BT configuration in your application, just as you would have on a single core device. The API is the same. For an introduction to Bluetooth development you may want to look at the Dev Academy Bluetooth Low Energy Fundamentals course.

  • Ah ok, so I do not have to flash my code onto the net core as it was suggested here

    I have implemented the set_tx_power function from this example. I simply copy pasted the function definition with its dependencies as well as the includes and called the function after I have set up my bluetooth in the peripheral uart example. It does not change the tx power however.

    Do I need any further configs, or where could the issue be? 

    These are y Bluetooth configs

    # take the ble parameters from peripheral
    CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS=y
    CONFIG_BT_PERIPHERAL_PREF_MIN_INT=6
    CONFIG_BT_PERIPHERAL_PREF_MAX_INT=6
    CONFIG_BT_PERIPHERAL_PREF_LATENCY=0
    CONFIG_BT_PERIPHERAL_PREF_TIMEOUT=30
    
    CONFIG_BT_LL_SOFTDEVICE=y
    CONFIG_BT_LL_SW_SPLIT=y
    
    CONFIG_BT=y
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_DEVICE_NAME="Nordic_UART_Service"
    CONFIG_BT_DEVICE_APPEARANCE=833
    CONFIG_BT_MAX_CONN=1
    CONFIG_BT_MAX_PAIRED=1
    
    # Enable the NUS service
    CONFIG_BT_NUS=y
    

  • I don't expect you will run into problems, no. That approach only works with the SoftDevice controller, but that is the controller you should use and which is used by default in the nRF Connect SDK. Another thing that separates this from the power control sample is that the API there can set different Tx power on different connections etc, but if that is not relevant, then CONFIG_BT_CTLR_TX_PWR_ANTENNA works well.

  • I have some further issues implementig the CONFIG_BT_CTLR_TX_PWR_ANTENNA or gernerally the 

    BT_CTLR_TX_PWR configs, it says that it needs the BT_CTLR dependency, however, if I introduce CONFIG_BT_CTLR into my prj.cong I get building errors. I now just removed the BT_CTLR depency in the Kconfig file. It now still requests the choice BT_CTLR_TX_PWR dependency. How can i select such a choice in the prj.conf?
  • Hi,

    The dependencies is that the controller must be the SoftDevice controller (i.e. not the Zephyr controller which is what you get with BT_LL_SW_SPLIT). This is the default so you don't need to think about that. If you started with a Bluetooth sample, you just need to add that specific config. If you have done other changes try reverting them.

  • After doing that, I do not get any further warning regarding the dependencies. However, the tx power does still not change. It is always the power I put into default. Meaning, if I remove the BT_CTLR dependency and call CONFIG_BT_CTLR_TX_PWR_MINUS_40=y in my prj.conf it still stays at the 3 dbm set as default.

    Further, how can I change the advertisment and connection intervals?

    Thanks very much

  • Ok manged to chenge the advertisment interval by using 

    #define BT_LE_ADV_CONN_SLOW BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONNECTABLE, \
    				       BT_GAP_ADV_SLOW_INT_MIN, \
    				       BT_GAP_ADV_SLOW_INT_MAX, NULL)

    for my bt_le_adv_start function.

    Still struggleing to change the connection interval dynamically

Reply Children
Related