Direction finding connectionless sample doesn't work on my nrf5340dk

Hello!

I will start by saying that I am new to embedded software development, and new to nrf boards in general.

After successfully running the direction finding connectionless (rx and tx) samples on my nrf52833dk, I want to run it on my nrf5340dk. I ran into a difficult issue when trying to flash the bluetooth controller on the network core. I think I followed the exact steps that are specified in the README of https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/bluetooth/direction_finding_connectionless_rx#id5

I copied the .overlay file with the pin configuration into the hci-rpmsg sample and modified it accordingly, and then I copied the .conf file from the direction_finding_connectionless boards folder and changed its name such that it configures the cpunet (like the README says). When I try to flash the code for the cpunet, it seems that there is not enough RAM on the network core. (It says that I overflowed by around 20 kilobytes)

I then tried flashing the hci-rpmsg sample unmodified, and saw that by itself it was allocating ~60% of the 64kB of RAM. (Which was already a bit surprising to me)

It seems that when pasting and modifying the .conf file from the direction_finding_connectionless_rx (same happens with tx, except it overflows with about 12kB) the RAM overflows by quite a lot (So I can't just cut some of the 8kB of heap memory because it wouldn t be enough), which is weird and it leads me to believe I am doing something very wrong. Perhaps I don't need all the settings that are in there? I did try to play around with the settings in the hope it would work but I am now completely stuck.

Any help or tips would be greatly appreciated!

  • Hello,

    Should the child_image/hci_rpmsg.conf file appear by itself? Because for me it does not when I build. (And there is no child_image folder either)

    I removed the two files I added manually (so now the hci_rpmsg sample is unmodified), and building the direction_finding_locator sample works (This happened before so nothing new here, I assumed that I needed those configurations to get it to work, which I added because it is what the readme says), but when I flash it on the nrf5340dk I get the following error:

    Waiting for periodic advertising...*** Booting Zephyr OS build v3.1.99-ncs1-1  ***
    Starting Connectionless Locator Demo
    Bluetooth initialization...success
    Scan callbacks register...success.
    Periodic Advertising callbacks register...success.
    Start scanning...failed (err -5)
    Waiting for periodic advertising...
    
    


    Whereas when I run it on my nrf52833dk (Exact same setup and sample except I use the command for the nrf52) everything works exactly as expected.

    Is the following section from the sample README not up to date? Because these are the exact steps I followed and it does not work for me due to that memory overflow issue.

    To run the application on nRF5340DK, a Bluetooth controller application must     
    also run on the network core. The :ref:`bluetooth-hci-rpmsg-sample` sample       
    application may be used. To build this sample with direction finding support     
    enabled:                                                                         
                                                                                     
    * Copy                                                                           
      :zephyr_file:`samples/bluetooth/direction_finding_connectionless_rx/boards/nrf52833dk_nrf52833.overlay`
      to a new file,                                                                 
      :file:`samples/bluetooth/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay`.   
    * Make sure the same GPIO pins are assigned to Direction Finding Extension in file
      :zephyr_file:`samples/bluetooth/direction_finding_connectionless_rx/boards/nrf5340dk_nrf5340_cpuapp.overlay`.
      as those in the created file :file:`samples/bluetooth/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay`.
    * Copy                                                                           
      :zephyr_file:`samples/bluetooth/direction_finding_connectionless_rx/boards/nrf52833dk_nrf52833.conf`
      to a new file,                                                                 
      :file:`samples/bluetooth/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.conf`. Add  
      the line ``CONFIG_BT_EXT_ADV=y`` to enable extended size of                    
      :kconfig:option:`CONFIG_BT_BUF_CMD_TX_SIZE` to support the LE Set Extended Advertising
      Data command.                                                        


    Perhaps you could explain what exactly is wrong with the steps I took, because I don't seem to be making any progress with this problem by myself. From what I understood before you said I don't need the .conf file, which I worm but it still doesn't work. like it does on the nrf52833dk. Maybe it has something to do with the child_image folder that I don't have.

    Best regards,

    Filip.

  • Hi Filip,

    It might be that you are using Zephyr sample instead of nrf sample. When creating freestanding application in VS Code choose application template to be nrf\samples\direction_finding_connectionless_rx. I have tested using nrf sample. Folder child_image is automatically created in your application directory and includes hci_rpmsg.conf file.

    Best regards,
    Dejan

  • Hello,

    Thank you so much for all your responses, it seems that was indeed the issue, should have been using nrf sample instead of zephyr!

    Best regards,

    Filip.

Related