spi problem with interrupt
Hi every one I have problem in spi communication , I want to Send and
Receive
data with loopback(mosi connects to miso) in stm32f103c8t6 by interrupt . I set this settings in stm32cube : clock 8m, prescaler 128 ,,,.......in IDE I use this code:
.
.
.
uint8_t tx[13]={'aliyazdanifar'};
uint8_t rx[13];HAL_StatusTypeDef a,b;.
.
void HAL_SPI_RxCpltCallback(SPI_HandleTypeDef *hspi)
{
while(1);
}
void HAL_SPI_TxCpltCallback(SPI_HandleTypeDef *hspi)
{
}
.
.
.
a=HAL_SPI_Receive_IT(&spi1,rx,13);
b=HAL_SPI_Transmit_IT((&spi1,tx,13);
.
.
while(1)
{}
when I debug this code ,I have (a=hal_ok,b=hal_busy,) and spi is not work.
What should I doØŸ