cancel
Showing results for 
Search instead for 
Did you mean: 

NUCLEO-NFC06A1

zovkorall
Associate II

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

  1. I changed resistorto select i2c
  2. add pull up resistor R116 and R117
  3. Add define RFAL_USE_I2C

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 ?

1 ACCEPTED SOLUTION

Accepted Solutions
Brian TIDAL
ST Employee

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

4 REPLIES 4
Brian TIDAL
ST Employee

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
zovkorall
Associate II

Hi, Brian TIDAL.

I am trying to add what you recommended - the error is the same.

zovkorall
Associate II

Brian TIDAL, sorry for previos letter.

I just reboot all sysytem and rebuild project.

All works!

Thanks!

Brian TIDAL
ST Employee

​Hi,

thanks for the update. This issue will be taken into account for the next release.

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.