AnsweredAssumed Answered

Synchronization string losed using SPI with DMA

Question asked by de Haro Carbonell on Aug 11, 2017
Latest reply on Nov 17, 2017 by de Haro Carbonell

Hello Community,

 

I have configured a STM32F429ZIT to communicate through SPI (SPI6) as slave and using DMA, see attached file.

 

The transmission works very well during 1 - 5 min but suddenly some transmission errors ocurs and HAL_SPI_ErrorCallback is called.

 

/***********************************************************************/

void HAL_SPI_ErrorCallback(SPI_HandleTypeDef *hspi)
{
    if(hspi -> Instance == SPI6)
    {
        HAL_GPIO_WritePin(GPIOF, GPIO_PIN_1, GPIO_PIN_SET);
        memcpy((uint8_t*)HMI_slave_TX_data, (uint8_t*)HMI_slave_TX_working_buffer, 8);
        HAL_SPI_TransmitReceive_DMA(&hspi6, (uint8_t*)HMI_slave_TX_data, (uint8_t*)HMI_slave_RX_data, 8); //--- initiate HMI communication
    }
}

/********************************************************************/

 

Then the communications is still there but the string "HMI_slave_TX_data" sent by the STM32 is shifted or delayed 8bits, I have seen this on the oscilloscope. But the content of this string is correct, i can see the transmission delayed on the oscilloscope and HMI_slave_TX_data values using debut (and also using STMStudio) and their values are OK!!!!

 

So, at the beginning the transmission is perfect but suddenly the GPIOG PIN 1 is set and the transimion is shifted...

 

So i don’t understand what is happening with DMA, memory address or something related to the transmission...

 

Some similar it happens using DMA in circular mode instead normal mode...

 

Could anyone help me on this issue???

 

Thanks in advance and best regards.
Alejandro

Outcomes