cancel
Showing results for 
Search instead for 
Did you mean: 

aci_hal_write_config_data() usage

xufl
Associate II

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions
xufl
Associate II

This issue is solved by:

- Use public address

- Write my MAC to 0x00 every time at boot up

 

View solution in original post

3 REPLIES 3
Imen.D
ST Employee

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.

Screenshot 2026-03-26 133138.png

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

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.

xufl
Associate II

This issue is solved by:

- Use public address

- Write my MAC to 0x00 every time at boot up