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
  • Thanks for the quick response haakonsh!

    The link to scan.rst helped.  After looking through the examples more, I'm wondering if the peripheral_uart is the right starting point.  Looking at peripheral_lbs, this would get me the end functionality I need on one side  - sending a button state and receiving an LED control command.  I just need the matching central side to go with it, along with the ability to detect whether the device is connected as the central or the peripheral.  I'd like to run the same code on both dev boards and have them connect when a button on one of the boards is pressed - the button press would initiate scanning on that board.  How difficult would it be to implement the central side of the peripheral_lbs on the dev board?

    Any inputs on future support for FreeRTOS?

    Thanks...

    Brian

  • Hmm, The central uart sample could serve as a template for the lbs central. 


    I believe the uart central filters advertisers based on the Nordic Uart Service UUID. You'll have to change that to filter for the LBS Service UUID instead. You will also have to change how the application reacts to the Service Discovery data received as it will not contain the Nordic Uart Service and its Characteristics but the LBS instead. 

    I'm writing a tutorial that covers the creation of a custom Service as we speak, though I've only implemented the peripheral side and have just started on the central side myself. 

    For FreeRTOS support I'm guessing we'll have to look for support for the nRF5340 in a future nRF5 SDK. I'll ask around for what the plans are there.

Reply
  • Hmm, The central uart sample could serve as a template for the lbs central. 


    I believe the uart central filters advertisers based on the Nordic Uart Service UUID. You'll have to change that to filter for the LBS Service UUID instead. You will also have to change how the application reacts to the Service Discovery data received as it will not contain the Nordic Uart Service and its Characteristics but the LBS instead. 

    I'm writing a tutorial that covers the creation of a custom Service as we speak, though I've only implemented the peripheral side and have just started on the central side myself. 

    For FreeRTOS support I'm guessing we'll have to look for support for the nRF5340 in a future nRF5 SDK. I'll ask around for what the plans are there.

Children
No Data
Related