Skip to content

Commit

Permalink
Merge pull request arduino-libraries#26 from FRASTM/wb55_otp
Browse files Browse the repository at this point in the history
Set a bd address from OTP for the BLE device stm32wb55
  • Loading branch information
cparata authored Feb 8, 2021
2 parents 5ceaf45 + 870c91e commit 39406aa
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/utility/HCISharedMemTransport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "HCISharedMemTransport.h"
#include "STM32Cube_FW/hw.h"
#include "otp.h"

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

bd_found = true;
} else {
bd_addr = NULL;
bd_found = false;
OTP_BT_t *p_otp = (OTP_BT_t *)OTP_Read(0);
if (p_otp) {
memcpy(bd_addr, p_otp->bd_address, CONFIG_DATA_PUBADDR_LEN);
bd_found = true;
} else {
bd_found = false;
}
}

return bd_found;
Expand Down

0 comments on commit 39406aa

Please sign in to comment.