cancel
Showing results for 
Search instead for 
Did you mean: 

If i want to enable the received inerrupt in the STM32L053C8 then what i have to do?

Huzaifah Limbada
Associate II
Posted on April 02, 2018 at 08:08

I want to start the only received interrupt for the SPI in STM32L053, but when i enable it it will call the ISR before transmitting aything.

can anyone have suggestion for that??

#stm32l053 #stm32l053spi
6 REPLIES 6
T J
Lead
Posted on April 02, 2018 at 09:53

is your SPI set to slave ?

did you try to clear the receive buffer ?

did you check the reference manual ? find how to clear the interrupt flag.

Posted on April 02, 2018 at 14:09

each n every things i have checked, but when i call the

HAL_SPI_Receive_IT(&hspi2,&buf,1);

dirctly it is call the

HAL_SPI_RxCpltCallback(SPI_HandleTypeDef *hspi);

it's like calling an interrupt without transmit a data.

Posted on April 02, 2018 at 14:25

in SPI terms, when you transmit, you receive as well.

you must clear the receive buffer

and there may be some error flags that need clearing too.

what page are you reading in the reference manual ?

Its your job to check the flags that need clearing.

Posted on April 03, 2018 at 10:57

sorry to inform you that as per our last conversation i already told you that...each thnig i've done.

N about the flags yes i'vr did it!!!

Posted on April 03, 2018 at 11:39

how did you clear the receive buffer ?

what page in the reference manual are you on ?

Posted on April 04, 2018 at 06:08

i refer the reference manual, registers of the SPI.