2014-09-25 03:26 PM
Hi,
I have a problem with a SPI data transfer with DMA. I use a STM32L051 as SPI slave and created the code with STM32CubeMX.I used the sample code as a reference and do something like this:if (HAL_SPI_TransmitReceive_DMA(&hspi1, &txb, &rxb, 5) != HAL_OK) { /* Transfer error in transmission process */ } while (HAL_SPI_GetState(&hspi1) != HAL_SPI_STATE_READY) { HAL_Delay(1); } The transfer never completes (HAL_SPI_GetState always returns busy). The bytes are transmitted to the SPI master but the last byte is wrong (duplicated from the byte before).Before that I transfer a single byte (with the blocking function not with DMA) and that works. I also tried to use the blocking HAL function instead of the DMA version for transmitting the 5 bytes above but it also will not terminate.I've spent hours on that, any ideas anyone?Danny2014-09-29 04:53 AM
[DEAD LINK /public/STe2ecommunities/mcu/Lists/STM32Java/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM32Java/STM32L051%20SPI%20Slave%20DMA%20-%20last%20byte%20duplicated%20%20doesn%27t%20terminate¤tviews=7]Duplicate thread !