Hi,
I use STM32F103 as a receiver.
I read FIFO STATUS and STATUS register then execute FLUSH_RX command through SPI.
I continuously read FIFO_STATUS and STATUS registers. Before I turn transmitter on, everything is okay. Registers tell me that there is no data in RX FIFO. Once I turn the transmitter device on RX_DR bit in STATUS register is set high and FIFO_STATUS register says that there is data in RX FIFO. Although I execute Flush command, nothing happens.
FIFO_STATUS register still says that there is data in FIFO.
void Flush_RX() { csn_low(); HAL_SPI_Transmit(&hspi1, (uint8_t *)COMD_FLUSH_RX,1, 150); while( (HAL_SPI_GetState(&hspi1) != HAL_SPI_STATE_READY) ){} csn_high(); HAL_Delay(1); }
I have got a similar problem with READ_RX_PAYLOAD command. When IRQ pin goes low and RX_DR bit is set high, I execute the command but what I read is the content of STATUS register. I cannot read data that is sent from TX.
Any guidance,help,comment will be appreciated. Thanks in advance.