Question
SPI Dasi Chain: Is it possible to capture a 10-byte DMA array transmission with 10 1-byte transmission?
Hi there,
I'm trying to create a Dasi Chain setup with STM32 Nucleo boards using the HAL library.
My master should send a command to 10 slaves. It would be best to use DMA for the master to avoid blocking the mpu.
HAL_SPI_Transmit_DMA(&hspi1, command_array, 10);The slaves must capture the byte one by one and send it to the next slave for the fastest transmission. Is this possible?
I tried to use
HAL_SPI_TransmitReceive_IT(&hspi1, &dataTx, &dataRx, 1);and catch the interrupt with
void HAL_SPI_TxRxHalfCpltCallback(SPI_HandleTypeDef *hspi) {
if(hspi->Instance == hspi1.Instance){
temp = dataTx;
dataTx = dataRx;
dataRx = temp;
HAL_SPI_TransmitReceive_IT(&hspi1, &dataTx, &dataRx, 1);
}
}This approach does not seem to be fast enough because the transferred data is not correct.
Thanks for help :)
