2020-12-15 06:42 AM
Hi everyone,
I'm having problems using several SPI blocks for different data length transmission via SPI with a STM32F303 MCU.
I've realized that when I try to send multiple messages with different data length (using different SPI blocks) the data buffer TX of the SPI remains constant in function of the Buffer_Size_Send parameter of the block .
If I try to send another data with other SPI block and I change Buffer_Size_Send according to data length, only the first Buffer_Size_Send is taken in consideration during the transmission so I only send three bytes. This is the generated code where I realized the DataBufferTX remains constant for la SPI1_DataLink struct in any function call generated by the block.
/* Array of SPI data information */
struct SPI_DataLinkTypeDef* G_SPI_Data[1];/* Pointer to SPI data information*/
/* SPI1 transmit data buffers*/
uint8_t G_SPI1_DataBufferTx[3];
uint8_t G_SPI1_DataBufferRx[0];
/* SPI1 transmit data structure information*/
struct SPI_DataLinkTypeDef SPI1_DataLink;
What should I do for sending different buffer size send in the same model?
Which element of the model sets the G_SPI1_DataBufferTX dimension?
Regards,
Ruben