Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable SPI DMA receive before transmit on AT32 #12368

Merged
merged 2 commits into from Feb 15, 2023

Conversation

SteveCEvans
Copy link
Member

If a USB interrupt occurred between enabling the transmitter and receiver, then the first bit would be lost of reception and the SPI transfer would hang.

@github-actions

This comment has been minimized.

@haslinghuis haslinghuis added this to the 4.5 milestone Feb 15, 2023
@@ -230,8 +230,11 @@ void spiInternalStartDMA(const extDevice_t *dev)
xDMA_Cmd(streamRegsTx, TRUE);
xDMA_Cmd(streamRegsRx, TRUE);

spi_i2s_dma_transmitter_enable(dev->bus->busType_u.spi.instance, TRUE);
/* Enable the receiver before the transmitter to ensure that not bits are missed on reception. An interrupt between
* the tramitter and receiver being enabled can otherwise cause a hang.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tramitter 🙂

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arrrggghhh

@haslinghuis haslinghuis merged commit 3faf844 into betaflight:master Feb 15, 2023
davidbitton pushed a commit to davidbitton/betaflight that referenced this pull request Feb 5, 2024
* Enable DMA rx before tx

* Update bus_spi_at32bsp.c

Typo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: COMPLETED
Development

Successfully merging this pull request may close these issues.

None yet

4 participants