2024-04-09 01:15 AM
- Use MCU : STM32G473VET
- Use connectivity : SPI 3
-> Mode : Full-Duplex Slave
1. It it possible to clear Tx FIFO??
"FTLVL" It's not '0' value. how to make '0'?
The code used is :
1)
if(spi3_cs_low == true){
HAL_SPI_Transmit_DMA(&hspi3, aTxBuffer, 11);
HAL_DMA_STATE_CHANGE(&hspi3);
HAL_SPI_Receive_DMA(&hspi3, aRxBuffer, 11);
HAL_DMA_STATE_CHANGE(&hspi3);
}
or
2)
if(spi3_cs_low == true){
HAL_SPI_TransmitReceive_DMA(&hspi3, (uint8_t *)aTxBuffer, (uint8_t *)aRxBuffer, 11);
}
-- Send data when CS is low and receive the same data many times.
-- Is there a code to add?
2. Do I have no choice but to receive Data to update DMA Tx data ?
I want to send.
SLAVE FIFO buffer update continues. and
I would like to send last SLAVE FIFO buffer when I request MASTER writing.
Is that possible??
Thank you. I need your help!!
2024-04-18 07:03 AM
Hello @MartinK
1. It it possible to clear Tx FIFO??
There is no possibility to clear these bits by software. these bits are fully managed by hardware. Please take a look at the description provided in the reference manual below.
2. Do I have no choice but to receive Data to update DMA Tx data?
To answer your question, we need to know what the slave device is you are communicating with. If I understand correctly, your application is designed to send and receive data in a loopback configuration.