Skip to content

Commit 49ceb3c

Browse files
committed
STM32WB: FLASH compilation issue with baremetal
1 parent fdab61d commit 49ceb3c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

targets/TARGET_STM/TARGET_STM32WB/flash_api.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727
/* Family specific include for WB with HW semaphores */
2828
#include "hw.h"
2929
#include "hw_conf.h"
30+
#if MBED_CONF_BLE_PRESENT
3031
#include "shci.h"
32+
#endif
3133

3234
/* Used in HCIDriver.cpp/stm32wb_start_ble() */
3335
int BLE_inited = 0;
@@ -90,6 +92,7 @@ int32_t flash_erase_sector(flash_t *obj, uint32_t address)
9092
return -1;
9193
}
9294

95+
#if MBED_CONF_BLE_PRESENT
9396
if (BLE_inited) {
9497
/*
9598
* Notify the CPU2 that some flash erase activity may be executed
@@ -99,6 +102,7 @@ int32_t flash_erase_sector(flash_t *obj, uint32_t address)
99102
*/
100103
SHCI_C2_FLASH_EraseActivity(ERASE_ACTIVITY_ON);
101104
}
105+
#endif
102106

103107
do {
104108
/* PESD bit mechanism used by M0+ to protect its timing */
@@ -137,13 +141,15 @@ int32_t flash_erase_sector(flash_t *obj, uint32_t address)
137141

138142
while (__HAL_FLASH_GET_FLAG(FLASH_FLAG_CFGBSY));
139143

144+
#if MBED_CONF_BLE_PRESENT
140145
if (BLE_inited) {
141146
/**
142147
* Notify the CPU2 there will be no request anymore to erase the flash
143148
* On reception of this command, the CPU2 disables the BLE timing protection versus flash erase processing
144149
*/
145150
SHCI_C2_FLASH_EraseActivity(ERASE_ACTIVITY_OFF);
146151
}
152+
#endif
147153

148154
/* Lock the Flash to disable the flash control register access (recommended
149155
to protect the FLASH memory against possible unwanted operation) */

0 commit comments

Comments
 (0)