Bluetooth on nRF5340

Hi Support team,

I'm using an LTE modem and enabled the net-stack and mqtt on the net-core of nRF5340, now 53% FLASH and 77% RAM are used.

I need to use Bluetooth for the system configuration when the system on config mode.

My questions are:
1 There is not much resource on my net-core, could you tell me how big is the Bluetooth stack? Is it possible for me to put the Bluetooth application on the application-core?
2. There are a lot of samples for Bluetooth in Zephyr and NCS, could you help suggest a sample of the minimal application of Bluetooth to match my requirement?

Thank you very much.

Best regards,
Yanpeng Wu

Parents
  • Hello,

    As described in the Protocols and use cases section of the SDK documentation, the typical configuration is to have the Bluetooth controller (hci_rpmsg) reside on the network core, and the Bluetooth host and application on the application core. The memory footprint of the controller depends on the configuration. E.g. how many connections it needs to support, GAP roles, etc. You also need to include a bootloader if you need support for FW updates. 

    I'm using an LTE modem and enabled the net-stack and mqtt on the net-core of nRF5340, now 53% FLASH and 77% RAM are used.

    Have you considered implementing this on the application core instead? 

    Best regards,

    Vidar

Reply
  • Hello,

    As described in the Protocols and use cases section of the SDK documentation, the typical configuration is to have the Bluetooth controller (hci_rpmsg) reside on the network core, and the Bluetooth host and application on the application core. The memory footprint of the controller depends on the configuration. E.g. how many connections it needs to support, GAP roles, etc. You also need to include a bootloader if you need support for FW updates. 

    I'm using an LTE modem and enabled the net-stack and mqtt on the net-core of nRF5340, now 53% FLASH and 77% RAM are used.

    Have you considered implementing this on the application core instead? 

    Best regards,

    Vidar

Children
  • Hi Vidar,

    Thank you for your reply. I tried to compile the sample Bluetooth: HCI RPMsg and can see that 69% Flash and 74% RAM are used.

    Just as you suggested, maybe the better solution is to move the LTE modem and net stack from the net-core to the app-core. Could you help give some guidance for the below questions?

    1. Now I use UART connecting to the LTE modem on net-core. I don't know if is there any obstacle to moving this from net-core to app-core? I mean the feasibility of this solution. Maybe your experiences can help me understand this point better:).
    2. I see the nRF5340 net-core diagram, there is a 'RADIO' on it. Is it connected to the bluetooth controller hardware? Or can I understand that the bluetooth controller hardware is fixed on net-core?

    Thank you very much.


    Best regards,
    Yanpeng Wu

  • Hi Yanpeng,

    1. I don't foresee any problems with moving this to the appcore.

    2. the RADIO peripheral cannot be accessed from the application core. Therefore, any SW requiring access to the radio must run on the network core. 

    Note that Bluetooth: HCI RPMsg is automatically included as a child-image if you build SDK BLE samples such has peripheral heart rate, etc. To apply configuration changes to a child image to reduce memory footprint, etc, you can create a child image folder as explained here: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/config_and_build/multi_image.html#permanent-configuration-changes-to-child-images 

    Best regards,

    Vidar

  • Hi Vidar,

    Thank you so much for your guidance, which helped me a lot and I know the right direction now:).
    Thank you very much.

    Best regards,
    Yanpeng Wu

  • Hi Vidar,

    Following the above inputs, I'd like to append some questions in this line:).

    Thank your suggestion, I moved the LTE modem and net stack to app-core now, it works well. In my current design, I want to use Bluetooth for system configuration only. So I'd like to put the full Bluetooth LE stack on the net-core, thus I can force-power-off the net-core when the system is not in configuration mode to save power. Could you help give some comments for this design, is it feasible, or somewhere can be optimized?

    To run the full Bluetooth LE stack on the net-core, I built the samples/bluetooth/rpc_host for the netCore image and built the samples/bluetooth/peripheral_uart for the appCore image.

    1. The sample can be built and I can exchange data between 'nRF Connect for Mobile' and appCore terminal successfully. But it is strange that the net-core image is not the rpc_host, it is hci_rpmsg as below.

    Did I make a mistake somewhere? How can I use the rpc_host and put the full Bluetooth LE stack on the netCore?

    2. To put the full Bluetooth LE stack on the net-core, I think the sample rpc_host is the right sample for netCore. Which sample is the most suitable one for my appCore? I just want to get the configuration data in my application from Bluetooth, so I think no need for UART.

    I need to read the document and study the samples more, if you can give me some guidance I can have a clearer understanding. Thank you in advance:).

    Best regards,
    Yanpeng Wu

  • Update: I followed the sample's guide, try to run 'west build -b nrf5340dk_nrf5340_cpuapp -- -DCONFIG_BT_RPC_STACK=y' in the peripheral_uart directory to replace the default hci_rpmsg with the rpc_host on the netCore, but some CMake error appears:

    CMake Error at ../../../cmake/multi_image.cmake:221 (message):
      A domain may only have a single child image.Current domain image is:
      hci_rpmsg, `hci_rpmsg` is a domain parent image, so you may add `rpc_host`
      as a child inside `hci_rpmsg`
    Call Stack (most recent call first):
      ../../../cmake/multi_image.cmake:178 (add_child_image_from_source)
      ../../CMakeLists.txt:148 (add_child_image)

    Should I change some configuration else in the sample peripheral_uart?

Related