Dear Team,
We are using DA14531 soc for our application. I have used "default_app_generate_unique_static_random_addr()" to generate the unique address for each device.
In this I want to flash this unique address into the OTP memory at this address 0x07F87FD4.
I am using smart snippets cli for programming. After flashing i want to verify the BD address in the OTP and the address my device advertise are same.
How to read the particular address from the OTP using cli? and how to flash the BD address in OTP.
Kindly help me to solve this issue.
Hi TDC,
Thank you for posting your questions online.
Please refer to this tutorial for OTP and CLI:
3.2. OTP — UM-B-083 (renesas.com)
8. CLI implementation — UM-B-083 (renesas.com)
BR,
JH_Renesas
How can I able to get the BD address of the device ( which is been generated using the "default_app_generate_unique_static_random_addr()" ) after flashing the program using command line. Where this MAC ID will be stored? How can I retrieve that using command prompt?
It was generated in the progress of initialing:
CLI does not support get BD addr for this.
Thank you for your support.
Is there any other alternative way to get the BD address of the device, without scanning using mobiles.
Dear TDC,Thank you for the reply.
TDC said: Is there any other alternative way to get the BD address of the device, without scanning using mobiles.
On the following callback function declare a custom callback function that will call the default_app_generate_static_random_addr callback and then just print out the BDA via the bd_addr struct.
//on user_callback_config.h file .app_on_generate_static_random_addr = default_app_generate_static_random_addr, //implementation of the default callback functions can be found on app_default_handlers.c file void default_app_generate_static_random_addr(struct bd_addr *addr) { // Check if the static random address is already generated. // If it is already generated the two MSB are equal to '1' if (!(addr->addr[BD_ADDR_LEN - 1] & GAP_STATIC_ADDR)) { // Generate static random address, 48-bits co_write32p(&addr->addr[0], co_rand_word()); co_write16p(&addr->addr[4], co_rand_hword()); // The two MSB shall be equal to '1' addr->addr[BD_ADDR_LEN - 1] |= GAP_STATIC_ADDR; } }
Best Regards,OV_Renesas
I'm working on a production implementation where I need to retrieve the MAC ID of the device after flashing it and then store that MAC ID in the OTP memory. I can program the DA14531 using the CLI, but I'm unsure how to obtain the MAC ID post-flashing. Can you provide guidance on this?
Dear TDC,Thank you for the reply.First Alternative:Use the default_app_generate_unique_static_random_addr callback function to generate the Unique BD Address, then store this BD Address on the SPI Flash. Via CLI you can read the specific address on SPI Flash to retrieve the BD Address and then burn it into the OTP.Second Alternative:Work with PLT,During Production, you can provide a csv file with all the BDA you want to be burned on the OTP header.Since you will provide the CSV you can guarantee that each device will have a unique BDA.Best Regards,OV_Renesas