Skip to content

Set a bd address from OTP for the BLE device stm32wb55 #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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