Skip to content

Overflow when transmitting SPI data #6

@rgqsch

Description

@rgqsch

HAL_SPI_TransmitReceive gives a timeout in polling mode.

When transmitting over SPI5 we get a timeout on transmitting upon sending a large dataset (4096 bytes).
SPI5 is configured as a Master, 2 Line device, transmit and receive data in 8 Bit mode.

Not in every loop the SPI_FLAG_RXP is set, so no data is read. This will cause a discrepancy in the TxXferCount and RxXferCount and therefor a Timeout after the /* Timeout management */

When setting a breakpoint on the corresponding SPI_CloseTransfer we also see SPI_FLAG_OVR is set.
However when checking for the SPI_FLAG_OVR in the loop, this is never set and will transmit all bytes successfully. A tiny delay might seem to be the solution. Since the function is polling, a wait for SPI_FLAG_TXP might be a solution

Clock settings:

Image

Image

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghalHAL-LL driver-related issue or pull-request.spiSerial Peripheral Interface

Type

Projects

Status

Analyzed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions