toggle quoted messageShow quoted text
Setting of public address based on flash registers should be done as part of controller init in hci driver.
In function bt_ipm_ble_init in drivers/bluetooth/hci/ipm_stm32wb.c
It should be done by sending a custom command to the controller (ACI_HAL_WRITE_CONFIG_DATA), which will provide the address that you can get by the piece of code you mentionned.
This proprietary command is described in following application note:
Hope it helps
On Thu, 8 Aug 2019 at 20:29, Marcio Montenegro <mtuxpe@...
I got the error below:
undefined reference to `bt_ctlr_set_public_addr'
Yes I included <bluetooth/controller.h>
I don't know if any config is missing and how public BLE address is assigned for this board.
Anyway I can connect to nrf connect and ST BLE sensor android app.
The battery service is working.
Now I am finishing a custom service.
Thanks, I'll check it out.
On Wed, Aug 7, 2019, 13:57 Rob Weber <rob@...
On Tue, Aug 06, 2019 at 11:26:59AM -0300, Marcio Montenegro wrote:
> I am evaluating STM32WB55 board HCI driver.
> During my test I found that BLE public address is 02:80:e1:00:00:00
> But this microcontroller has an internal flash register to store BLE
> address and device id.
> I would like to know the best way to change the address BLE in this case.
> Best regards,
> BLE Stack initialization:
> [00:00:00.015,000] <dbg> bt_settings.bt_settings_init:
> Bluetooth initialized
> Configuration mode: waiting connections...
> [00:00:00.187,000] <inf> bt_hci_core: Identity: 02:80:e1:00:00:00 (public)
> [00:00:00.187,000] <inf> bt_hci_core: HCI: version 5.0 (0x09) revision
> 0x0026, manufacturer 0x0030
> [00:00:00.187,000] <inf> bt_hci_core: LMP: version 5.0 (0x09) subver 0x2126
> Get correct BLE address:
> udn = LL_FLASH_GetUDN();
> if(udn != 0xFFFFFFFF)
> company_id = LL_FLASH_GetSTCompanyID();
> device_id = LL_FLASH_GetDeviceID();
> bd_addr_udn = (uint8_t)(udn & 0x000000FF);
> bd_addr_udn = (uint8_t)( (udn & 0x0000FF00) >> 8 );
> bd_addr_udn = (uint8_t)( (udn & 0x00FF0000) >> 16 );
> bd_addr_udn = (uint8_t)device_id;
> bd_addr_udn = (uint8_t)(company_id & 0x000000FF);;
> bd_addr_udn = (uint8_t)( (company_id & 0x0000FF00) >> 8 );
> bd_addr = (const uint8_t *)bd_addr_udn;
I have not yet worked with any of the bluetooth APIs, but this thread
peaked my interest because I am also evaluating the STM32WB55 for an
I did a quick search through the bluetooth API and found the function
bt_ctlr_set_public_addr . I started digging into its implementation,
but I was not able to figure out how this function relates to the rest
of the bluetooth system, or how it relates to the STM32WB55 LL/HAL.
I would recommend trying this function to see if it meets your needs.
Please let me know if it works! I'm definitely curious to know how this
might work with the STM32WB55.