2026-03-25 4:41 PM - last edited on 2026-03-26 5:04 AM by Imen.D
Hello,
I use STM32WB05KZ. Could you give me an example about how to store configuration data to NVM by aci_hal_write_config_data() function?
- When I tried to store to 0x00 (I used static randow MAC address), it returns 0 but the data is lost when the chip is rebooted;
- When I save to any other address (such as, 0x40), it always returns to 0x12.
Thanks a lot.
Solved! Go to Solution.
2026-03-30 10:57 PM
This issue is solved by:
- Use public address
- Write my MAC to 0x00 every time at boot up
2026-03-26 5:36 AM - edited 2026-03-26 5:39 AM
Hello @xufl
Use offset 0x2E and a 6-byte address for storing a static random MAC address with aci_hal_write_config_data().
Ensure you handle the NVM cache as required by the BLE stack for data retention.
Refer to the PM0271 and AN6142 in section "2.3.11 aci_hal_write_config_data" for valid offsets and command usage.
2026-03-26 9:40 PM
Hi Imen.D,
Thanks for the reply. When I write to 0x2E, it returns 0x12.
I notice "This command shall not be called if a command different than Stack Init, HCI_RESET, ACI_HAL_WRITE_CONFIG_DATA, ro ACI_HAL_READ_CONFIG_DATA has already been called", so what is the formal solution to import our own MAC address (I am sure I used legal MAC address)?
For example, we run p2pService example but with our own MAC address. How to implement it?
Best Regards.
2026-03-30 10:57 PM
This issue is solved by:
- Use public address
- Write my MAC to 0x00 every time at boot up