Hard Fault in BLE_OTA demo application
When I compile the BLE_OTA demo application and run it, it hard faults in APPE_Init when it configures the BLE processor to control flash activity using hardware semaphore SEM7:
SHCI_C2_SetFlashActivityControl(FLASH_ACTIVITY_CONTROL_SEM7);Stepping through the code, I found that in "shci_send", it accesses "pCmdBuffer" and stores several variables. I found that the pCmdBuffer gets initialized in "appe_Tl_Init" that gets called from APPE_Init right at the end. By moving the SHCI_C2_SetFlashActivityControl call after this, the hard fault was eliminated. My final APPE_Init function is:
void APPE_Init( void )
{
/* Select which mechanism is used by CPU2 to protect its timing versus flash operation */
// SHCI_C2_SetFlashActivityControl(FLASH_ACTIVITY_CONTROL_SEM7);
SystemPower_Config(); /**< Configure the system Power Mode */
HW_TS_Init(hw_ts_InitMode_Full, &hrtc); /**< Initialize the TimerServer */
APPD_Init( );
/**
* The Standby mode should not be entered before the initialization is over
* The default state of the Low Power Manager is to allow the Standby Mode so an request is needed here
*/
UTIL_LPM_SetOffMode(1 << CFG_LPM_APP, UTIL_LPM_DISABLE);
Led_Init();
Button_Init();
appe_Tl_Init(); /**< Initialize all transport layers */
/* Select which mechanism is used by CPU2 to protect its timing versus flash operation */
SHCI_C2_SetFlashActivityControl(FLASH_ACTIVITY_CONTROL_SEM7);
/**
* From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
* received on the system channel before starting the Stack
* This system event is received with APPE_SysUserEvtRx()
*/
return;
}Is this a bug or is there something else going on?
