2019-12-13 01:59 AM
Good day.
I use devboard NFC06A1 with Nucleo-L053R8. Project from STM32CubeExpansion_NFC6_V1.0.0.
All works fine - via SPI. But when i choose i2C - i have a problem
4. change //HAL_NVIC_SetPriority(I2C1_EV_IRQn, 5, 5);
//HAL_NVIC_EnableIRQ(I2C1_EV_IRQn);
HAL_NVIC_SetPriority(I2C1_IRQn, 0, 1);
HAL_NVIC_EnableIRQ(I2C1_IRQn);
Device was crash when call I2C_Enable_IRQ(hi2c, I2C_XFER_TX_IT); in stm32l0xx_hal_i2c.c
MCU freez in startup_stm32l053xx.s
I2C1_IRQHandler
I2C2_IRQHandler
SPI1_IRQHandler
SPI2_IRQHandler
USART1_IRQHandler
USART2_IRQHandler
RNG_LPUART1_IRQHandler
LCD_IRQHandler
USB_IRQHandler
B . ;crash in current line
ENDP
ALIGN
What a mistake here ?
Solved! Go to Solution.
2019-12-13 04:55 AM
Hi,
on my side, I've used I2C communication between X-NUCLEO_NFC06A1 and NUCLEO-L476RG. For your case with NUCELO-L053R8, it seems that the I2C1_IRQHandler is missing so the default one is used (basically infinitely looping).
I will check internally but something like the following lines should be added in the stm32l0xx_it.c interrupt handler file:
/**
* @brief This function handles I2C1 event global interrupt / I2C1 wake-up interrupt through EXTI line 23.
*/
void I2C1_IRQHandler(void)
{
/* USER CODE BEGIN I2C1_IRQn 0 */
/* USER CODE END I2C1_IRQn 0 */
if (hi2c1.Instance->ISR & (I2C_FLAG_BERR | I2C_FLAG_ARLO | I2C_FLAG_OVR)) {
BSP_I2C1_ER_IRQHandler();
} else {
BSP_I2C1_EV_IRQHandler();
}
/* USER CODE BEGIN I2C1_IRQn 1 */
/* USER CODE END I2C1_IRQn 1 */
}
Rgds
BT
2019-12-13 04:55 AM
Hi,
on my side, I've used I2C communication between X-NUCLEO_NFC06A1 and NUCLEO-L476RG. For your case with NUCELO-L053R8, it seems that the I2C1_IRQHandler is missing so the default one is used (basically infinitely looping).
I will check internally but something like the following lines should be added in the stm32l0xx_it.c interrupt handler file:
/**
* @brief This function handles I2C1 event global interrupt / I2C1 wake-up interrupt through EXTI line 23.
*/
void I2C1_IRQHandler(void)
{
/* USER CODE BEGIN I2C1_IRQn 0 */
/* USER CODE END I2C1_IRQn 0 */
if (hi2c1.Instance->ISR & (I2C_FLAG_BERR | I2C_FLAG_ARLO | I2C_FLAG_OVR)) {
BSP_I2C1_ER_IRQHandler();
} else {
BSP_I2C1_EV_IRQHandler();
}
/* USER CODE BEGIN I2C1_IRQn 1 */
/* USER CODE END I2C1_IRQn 1 */
}
Rgds
BT
2019-12-16 02:13 AM
Hi, Brian TIDAL.
I am trying to add what you recommended - the error is the same.
2019-12-16 03:57 AM
Brian TIDAL, sorry for previos letter.
I just reboot all sysytem and rebuild project.
All works!
Thanks!
2019-12-16 05:30 AM
Hi,
thanks for the update. This issue will be taken into account for the next release.
Rgds
BT