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

nRF5340 development

  I have just ordered several nRF5340-PDK dev boards which should arrive tomorrow.  I've gone through the process of installing the nRF Connect SDK and other tools using the Getting Started Assistant.  I've imported the peripheral_uart sample code from the nrf/samples/bluetooth folder and built the code successfully using Segger Embedded Studio.  A couple of questions - 

- There is BLE sample code available in both nrf/samples/bluetooth as well as zephyr/samples/bluetooth.  Should sample code from both of these directories work on the dev board?

- I ultimately need to get dual-role (multi-role) mode working on a pair of dev boards - each board advertising and scanning simultaneously.  I'd like the boards to power-up advertising only, and then switch to both advertising and scanning on a button push.  Once the boards are connected, I'd like to send data to the other board on a button press.  Can you give me some guidance on which sample code to start with?  Is it as simple as starting with the peripheral_uart example and adding a call to bt_scan_start when the button is pushed?  Or is there more infrastructure to add to enable the central role?

- Is there documentation that describes the steps I need to go through to implement this functionality?

- Is there documentation that describes setting up the various BLE parameters (connection interval, advertising interval, etc), as well as other behaviors such as scan filters?

- I need to eventually integrate this work into a larger code base which is running FreeRTOS (on the app processor).  Is Nordic planning to support FreeRTOS on the 5340 in the future, or alternatively, is FreeRTOS planning to support the 5340?  If not, is there a technical reason why FreeRTOS would not work on this MCU?  Is it a matter of doing the porting work, or something else?

Thanks!

Brian

Parents
  • Should sample code from both of these directories work on the dev board?

     Yes.

    Can you give me some guidance on which sample code to start with?  Is it as simple as starting with the peripheral_uart example and adding a call to bt_scan_start when the button is pushed?  Or is there more infrastructure to add to enable the central role?

     We've made a library/module called scan.c in NCS that we use to decode the advertising data that is returned in the scan callback. The uart and LBS Central samples use this library. I suggest you set the scan parameters with a call to bt_scan_params_set prior to calling bt_scan_start.

    Is there documentation that describes the steps I need to go through to implement this functionality?

     Documentation: https://github.com/NordicPlayground/fw-nrfconnect-nrf/blob/master/include/bluetooth/scan.rst use the Central samples in NCS as a reference.

    Is there documentation that describes setting up the various BLE parameters (connection interval, advertising interval, etc), as well as other behaviors such as scan filters?

     Zephyr API docs for the GAP layer: https://docs.zephyrproject.org/latest/reference/bluetooth/gap.html. The GAP layer handles advertisements, scanning, and connection management. 

    Setting the scan filter and parsing scan data with just the Zephyr API is a bit difficult so I recommend to use our Scan library.

Reply
  • Should sample code from both of these directories work on the dev board?

     Yes.

    Can you give me some guidance on which sample code to start with?  Is it as simple as starting with the peripheral_uart example and adding a call to bt_scan_start when the button is pushed?  Or is there more infrastructure to add to enable the central role?

     We've made a library/module called scan.c in NCS that we use to decode the advertising data that is returned in the scan callback. The uart and LBS Central samples use this library. I suggest you set the scan parameters with a call to bt_scan_params_set prior to calling bt_scan_start.

    Is there documentation that describes the steps I need to go through to implement this functionality?

     Documentation: https://github.com/NordicPlayground/fw-nrfconnect-nrf/blob/master/include/bluetooth/scan.rst use the Central samples in NCS as a reference.

    Is there documentation that describes setting up the various BLE parameters (connection interval, advertising interval, etc), as well as other behaviors such as scan filters?

     Zephyr API docs for the GAP layer: https://docs.zephyrproject.org/latest/reference/bluetooth/gap.html. The GAP layer handles advertisements, scanning, and connection management. 

    Setting the scan filter and parsing scan data with just the Zephyr API is a bit difficult so I recommend to use our Scan library.

Children
No Data
Related