Merge pull request #13633 from jeromecoutant/PR_WB_FLASH_BARE

STM32WB: FLASH compilation issue with baremetal
pull/13663/head
Martin Kojtal 2020-09-23 15:58:38 +01:00 committed by GitHub
commit f3d91fdba1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -27,7 +27,9 @@
/* Family specific include for WB with HW semaphores */ /* Family specific include for WB with HW semaphores */
#include "hw.h" #include "hw.h"
#include "hw_conf.h" #include "hw_conf.h"
#if MBED_CONF_BLE_PRESENT
#include "shci.h" #include "shci.h"
#endif
/* Used in HCIDriver.cpp/stm32wb_start_ble() */ /* Used in HCIDriver.cpp/stm32wb_start_ble() */
int BLE_inited = 0; int BLE_inited = 0;
@ -90,6 +92,7 @@ int32_t flash_erase_sector(flash_t *obj, uint32_t address)
return -1; return -1;
} }
#if MBED_CONF_BLE_PRESENT
if (BLE_inited) { if (BLE_inited) {
/* /*
* Notify the CPU2 that some flash erase activity may be executed * 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)
*/ */
SHCI_C2_FLASH_EraseActivity(ERASE_ACTIVITY_ON); SHCI_C2_FLASH_EraseActivity(ERASE_ACTIVITY_ON);
} }
#endif
do { do {
/* PESD bit mechanism used by M0+ to protect its timing */ /* PESD bit mechanism used by M0+ to protect its timing */
@ -137,6 +141,7 @@ int32_t flash_erase_sector(flash_t *obj, uint32_t address)
while (__HAL_FLASH_GET_FLAG(FLASH_FLAG_CFGBSY)); while (__HAL_FLASH_GET_FLAG(FLASH_FLAG_CFGBSY));
#if MBED_CONF_BLE_PRESENT
if (BLE_inited) { if (BLE_inited) {
/** /**
* Notify the CPU2 there will be no request anymore to erase the flash * Notify the CPU2 there will be no request anymore to erase the flash
@ -144,6 +149,7 @@ int32_t flash_erase_sector(flash_t *obj, uint32_t address)
*/ */
SHCI_C2_FLASH_EraseActivity(ERASE_ACTIVITY_OFF); SHCI_C2_FLASH_EraseActivity(ERASE_ACTIVITY_OFF);
} }
#endif
/* Lock the Flash to disable the flash control register access (recommended /* Lock the Flash to disable the flash control register access (recommended
to protect the FLASH memory against possible unwanted operation) */ to protect the FLASH memory against possible unwanted operation) */