cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB55 interrupt blocking BLE

RKalm
Associate

Hi everyone,

I am actually working on a project based on a custom STM32WB55 platform with a LIS2DTW12 (accelerometer) embedded.

I am having an issue with a code based on the BLE_p2pserver example code. I am using the LIS2DTW12 dataready interruption as a "virtual button" in order to update the alarm which is readable through the ST BLE Sensor smartphone application.

The example code is running "as is" without any issue, the device is discoverable and i am able to read the services and characteristics.

Adding the LIS2DTW12 (12,5 Hz ODR) interruption (through EXT1) seems to be blocking the connection between my custom board and the ST BLE Sensor application (but still discoverable).

/*Configure GPIO pin Output Level */
  HAL_GPIO_WritePin(LIS2DTW12_CS_GPIO_Port, LIS2DTW12_CS_Pin, GPIO_PIN_SET);
 
  /*Configure GPIO pin : LIS2DTW12_CS_Pin */
  GPIO_InitStruct.Pin = LIS2DTW12_CS_Pin;
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
  GPIO_InitStruct.Pull = GPIO_NOPULL;
  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
  HAL_GPIO_Init(LIS2DTW12_CS_GPIO_Port, &GPIO_InitStruct);
 
  /*Configure GPIO pin : IIS2MDC_INT_Pin */
  GPIO_InitStruct.Pin = IIS2MDC_INT_Pin;
  GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
  GPIO_InitStruct.Pull = GPIO_PULLUP;
  HAL_GPIO_Init(IIS2MDC_INT_GPIO_Port, &GPIO_InitStruct);
 
  /*Configure GPIO pin : LIS2DTW12_INT_Pin */
  GPIO_InitStruct.Pin = LIS2DTW12_INT_Pin;
  GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
  GPIO_InitStruct.Pull = GPIO_PULLUP;
  HAL_GPIO_Init(LIS2DTW12_INT_GPIO_Port, &GPIO_InitStruct);
 
  /* EXTI interrupt init*/
  HAL_NVIC_SetPriority(EXTI1_IRQn, 2, 2);
  HAL_NVIC_EnableIRQ(EXTI1_IRQn);
 
  HAL_NVIC_SetPriority(EXTI4_IRQn, 2, 2);
  HAL_NVIC_EnableIRQ(EXTI4_IRQn);
 
}
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_PIN)
{
	switch (GPIO_PIN)
	{
	case IIS2MDC_INT_Pin:
//		IIS2MDC_read();
		break;
	case LIS2DTW12_INT_Pin:
		//Virtual button pressed
	    UTIL_SEQ_SetTask(1<<CFG_TASK_SW1_BUTTON_PUSHED_ID, CFG_SCH_PRIO_0);
		break;
	default:
		break;
	}
	return;
}

Debbuging through SWD interface show that the interrupt is working accordingly and the UTIL_SEQ_SetTask is running.

I tried the following modifications without succes :

  • I first though it was an interrupt priority issue, however setting EXTI1 priority superior to 0 doesn't change anything.
  • Commented the UTIL_SEQ_SetTask, the interrupt alone seems to be the problem

Any input is appreciated

2 REPLIES 2
Mecanix
Senior

Wasted little over 1 day with this bug... Kudos to @BSANT.17​ 

https://community.st.com/s/question/0D53W000010sROBSA2/stm32wb-fw-update-1121-issue

Lep
Senior

Have you solved this problem? This problem has puzzled me for a long time. I used stm32wb5mmg to make a PCBboard, and collected data and BLE notification through external interrupt (EXT0) (I used the latest library 1.17.2...)