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

Porting Peer manager or How to do bonding

Firstly my current usecase:

We are using a STM32 as a main processor. the STM uses UART to communicate with the nRF52 using the serialization stuff. I currently have most of it working and ported. I can use the hrs example, connect to the Nordic_HRM and get heartrate measurements. This does not include bonding and pairing though.

What i want:
I want to be able to start a pairing and bonding procedure from the STM using the serialization. 

The problem:

The bonding and pairing is handeled by the peer manager and corresponding files on the nRF52 library. These files use A LOT of internal nRF parts. including atommic functions, queues flash stoage, crypto etc. And consist of a lot and a lot of files. I am trying to get this to work under the STM but can't even get it to compile. It also uses the nRF flash storage to save bonding information. I dont mind writing my own stuff for this ofcourse and eventually we will need to safe this bonding information on the SD card connected to the STM.

I would like a pointer where to start with porting this managing of peers or how to do pairing and bonding without these libraries, what information needs to be send, the events etc. 

Ideally i would have all the parts that are needed for bonding so that i have the most control over the flow on the STM and saving information etc.

Parents
  • Hi Sveenman, 

    Porting the peer manager can be a challenging job, it's one of the biggest module we have in the SDK. 

    But I don't see any hard blocker that would stop you from porting the module to STM32. 

    Regarding your question, I would suggest having a look at these message sequence charts here. It should cover most of the situations regarding BLE bonding/pairing. 

Reply
  • Hi Sveenman, 

    Porting the peer manager can be a challenging job, it's one of the biggest module we have in the SDK. 

    But I don't see any hard blocker that would stop you from porting the module to STM32. 

    Regarding your question, I would suggest having a look at these message sequence charts here. It should cover most of the situations regarding BLE bonding/pairing. 

Children
  • I will look into it a bit more, is there an easy example of basic bonding without peer manager or an older basic version?

  • Hi Sveenman, 

    You can trace back to the ble_app_template example in SDK v8.1, we handle the bonding and handling manually in main.c without using a library (and without storing in flash). But the API maybe changed a little bit.

    You can also have a look at SDK v11 when we don't have peer manager and used device manager instead. It's more simpler than peer manager.

    In SDK v17.0 we have the ble_app_uart example which we don't use the peer manager and handle the pairing manually. But it simply send the "Pairing not supported" back. 

  • hi Sveenman have you got it already, i'm getting involved with this issue currently, hope you can share your thought for reference.

  • Trying to port this library got me into a whole lot of issues, with my limited understanding of the internals of the library (what part was nrf52 BLE code, and what part was application code etc). So we have decided to take a different approach. We got the secure bootloader on so now we have developed our own communication between the nrf52 and the STM32 with our own communication library. This offloads all BLE specific implementations to the nrf52 and allows our STM32 to only do application code. (adding filters, whitelistst, deleting bonds etc) 

    from our STM we can now flash new firmware through this bootloader so we always have the option to add more communication on the NRF52 when needed.

  • Thanks Sveenman. I didn't expect you to reply so quickly, what a surprise.

    as far as I can see there's only two parts need to be reimplement, one is flash operation, provide read/write basic functions, the other is select available crypto as backend, I'm considering software crypto can be used. are you saying those things would bought a lot of issues?

Related