Skip to content

Commit 39406aa

Browse files
authored
Merge pull request stm32duino#26 from FRASTM/wb55_otp
Set a bd address from OTP for the BLE device stm32wb55
2 parents 5ceaf45 + 870c91e commit 39406aa

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Diff for: src/utility/HCISharedMemTransport.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#include "HCISharedMemTransport.h"
2222
#include "STM32Cube_FW/hw.h"
23+
#include "otp.h"
2324

2425
/* Private variables ---------------------------------------------------------*/
2526
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static TL_CmdPacket_t BleCmdBuffer;
@@ -338,8 +339,13 @@ static bool get_bd_address(uint8_t *bd_addr)
338339

339340
bd_found = true;
340341
} else {
341-
bd_addr = NULL;
342-
bd_found = false;
342+
OTP_BT_t *p_otp = (OTP_BT_t *)OTP_Read(0);
343+
if (p_otp) {
344+
memcpy(bd_addr, p_otp->bd_address, CONFIG_DATA_PUBADDR_LEN);
345+
bd_found = true;
346+
} else {
347+
bd_found = false;
348+
}
343349
}
344350

345351
return bd_found;

0 commit comments

Comments
 (0)