Recommended starting point for nRF5340, passive scanner with output to UART?

Hi all,

I am working with the nRF5340 and prototyping on the 5340-DK board. I'd like to get the board to be able to passively scan Bluetooth beacons, perform some filtering and parsing on those beacons, and write output to UART. Ideally the UART would be a virtual one on one of the USB ports on the DK board, but GPIO could work too. I think if I were to use a USB port for UART out it would need to be the one closer to the nRF5340 IC, as the other is dedicated to the debugger, right?

I am trying to determine:

a) Is there a sample project that would be a good starting point for this kind of project? The ones I've looked at don't appear to include just a passive scanner.

b) How can I determine which core I want to run my code on? What criteria should be considered when making this decision? Or should I just use the app core by default unless there is a good reason to run code on the net core?

c) Based on some of what I've seen and read, I think maybe if I write code for the app core, I should use hci_rpmsg on the net core. Is that correct and applicable for this situation?

d) Are there any particular resources or topics I should be reading to get a better handle on these kinds of questions? Does the fact that I'm asking these things imply I've missed some important documentation?

Thanks!

Scott

Parents
  • Hi Scott,

    a) Is there a sample project that would be a good starting point for this kind of project? The ones I've looked at don't appear to include just a passive scanner.

    This observer sample here seems like a good fit based on what you describe:

    https://github.com/nrfconnect/sdk-zephyr/tree/main/samples/bluetooth/observer

    b) How can I determine which core I want to run my code on? What criteria should be considered when making this decision? Or should I just use the app core by default unless there is a good reason to run code on the net core?

    Typically you run your application on the app core. The network core is commonly only used for the Bluetooth Controller.

    c) Based on some of what I've seen and read, I think maybe if I write code for the app core, I should use hci_rpmsg on the net core. Is that correct and applicable for this situation?

    Correct. (hci_rpmsg contains the Bluetooth Controller code)

    d) Are there any particular resources or topics I should be reading to get a better handle on these kinds of questions? Does the fact that I'm asking these things imply I've missed some important documentation?

    If you are starting with the nRF5340 series, I recommend reading this Working with nRF5340 DK user guide:

    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.2.0/nrf/ug_nrf5340.html

    BR,

    Sigurd

  • Thanks very much, Sigurd. This information is very helpful.  I was able to build and flash the observer project to my board.

    I'm having a little trouble figuring out where to see the output from it. I see it has printk statements, but where are those being directed to? I have three serial ports showing up that say JLink CDC UART Port, but if I connect to these at 115200 baud, N/8/1, I am not seeing any traffic.  I also checked the config files for this project and readme, and I don't see any mention of where the output goes to.

    However, I realize this question, while related, is distinct from my original question, which you answered very well, so this case can be closed if that would make more sense from your side, and I'll work some more on trying to get the output myself.

    Thanks!

    Scott

Reply
  • Thanks very much, Sigurd. This information is very helpful.  I was able to build and flash the observer project to my board.

    I'm having a little trouble figuring out where to see the output from it. I see it has printk statements, but where are those being directed to? I have three serial ports showing up that say JLink CDC UART Port, but if I connect to these at 115200 baud, N/8/1, I am not seeing any traffic.  I also checked the config files for this project and readme, and I don't see any mention of where the output goes to.

    However, I realize this question, while related, is distinct from my original question, which you answered very well, so this case can be closed if that would make more sense from your side, and I'll work some more on trying to get the output myself.

    Thanks!

    Scott

Children
No Data
Related