Skip to main content
Associate II
March 25, 2026
Solved

aci_hal_write_config_data() usage

  • March 25, 2026
  • 1 reply
  • 176 views

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.

 

Best answer by xufl

This issue is solved by:

- Use public address

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

 

1 reply

Technical Moderator
March 26, 2026

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"".ThanksImen"
xuflAuthor
Associate II
March 27, 2026

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.

xuflAuthorBest answer
Associate II
March 31, 2026

This issue is solved by:

- Use public address

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