Something wrong with BLENRG-MS and STM32CubeExpansion_BLE1_4.2.0 sdk, program will trap in infinite loop at SPI_IRQ.
I use BLENRG-MS and stm32l07 mcu. Mcu call the APIs to control the BLENRG-MS module.
MCU initialize the ble module and start observer process by calling API,and the process will be terminated in three seconds.
The problem is that program may trap in infinite loop many times. The hci_tl driver is from STM32CubeExpansion_BLE1_4.2.0 packet. so whats the problem?
I found "while()" statement at hci_tl_lowlevel_isr() in STM32CubeExpansion_BLE1_4.2.0 sdk.
thanks.
/**
* @brief HCI Transport Layer Low Level Interrupt Service Routine
*
* @param None
* @retval None
*/
void hci_tl_lowlevel_isr(void)
{
/* Call hci_notify_asynch_evt() */
#ifdef HCI_TL
while(IsDataAvailable())
{
hci_notify_asynch_evt(NULL);
}
#endif /* HCI_TL */
/* USER CODE BEGIN hci_tl_lowlevel_isr */
/* USER CODE END hci_tl_lowlevel_isr */
}
static int32_t IsDataAvailable(void)
{
return (HAL_GPIO_ReadPin(HCI_TL_SPI_EXTI_PORT, HCI_TL_SPI_EXTI_PIN) == GPIO_PIN_SET);
} 