cancel
Showing results for 
Search instead for 
Did you mean: 

X-CUBE-BLE1 GAP Initialization for BlueNRG-M0 module with STM32L4

cvanbeek
Associate III

Hello ST Support,

I have an STM32L4 MCU connected to a BlueNRG-M0 module on a custom PCB. I am not sure how to initialize the BLE gap for this BLE module. I'm using X-CUBE-BLE1 version 6.2.4 in a STM32CubeMx project with FreeRTOS. The getting started document says to use the aci_gap_init() function, but that does not exist in the library. Instead, there are the aci_gap_init_IDB04A1() and aci_gap_init_IDB051A() functions. However, both of those eval boards are NFRD and do not have the BlueNRG-M0 module. I've read a post about corrupting the memory on BLE modules, so I'm afraid to try that code before knowing if it will work with the BlueNRG-M0 module.

As far as I can tell, the X-CUBE-BLE1 library is the correct library to use for the BlueNRG-M0, but please let me know if that isn't the case. If it is, how can I safely initialize the BLE gap interface?

Best regards,

Cory

1 ACCEPTED SOLUTION

Accepted Solutions
cvanbeek
Associate III

Yeah, there are definitely some holes in the app note. After not getting a response on this for a couple of weeks, I gave aci_gap_init_IDB05A1 a try and it worked. So that solved my issue.

View solution in original post

3 REPLIES 3
EGi
Associate III

I have the same problem. I use a STM32L476 Nucleo board with Nucleo IDB05A2 BLE interface and have called the GAP init function from my own code (all I need is establish pairing with few phones since that is expected to be more secure than beacon (and I expect it deals with changing BLE MAC from the phones).

The BLE1 code in my project was installed as described in the ST Application Note and appear in my project in the Middleware directory. But the ST AN forgets to go further from there (ex. how to use GAP functions).

At present my project doesn't compile at all. I already modified some ST sources by including headers etc. But the compiler error list is huge and it gives me low confidence what I do to fix is OK. A good practice for this would be ST lets an AE with limit BLE knowledge struggle to get it functional based on their own AN. That identifies all the gaps in the AN.

cvanbeek
Associate III

Yeah, there are definitely some holes in the app note. After not getting a response on this for a couple of weeks, I gave aci_gap_init_IDB05A1 a try and it worked. So that solved my issue.

EGi
Associate III

FYI so far I'm able to compile my project. But I still consider the documentation is a bunch of junk. Sometimes I wonder if people writing this kind of code realize others cannot look in somebody else' head. For example the return value of most GAP functions:

0693W00000bk0t6QAA_image.png

One has to look in the code to determine what value indicates success or what errors may be returned.

 

Another example is for instance when a timing parameter is passed to a function. For instance called "Timeout". Explained as "Timeout". Software guys: please consider if the comment has any value. If not, don't put any or change it. In this case, the missing info are unit, limits (ex. what happens if 0 is passed? Will it wait very long or not at all?) etc.