Skip to content

Conversation

bschwind
Copy link
Contributor

@bschwind bschwind commented Oct 4, 2025

This PR fixes a few issues:

  • Using a literal 0 instead of a more informative enum variant for describing the "indirect write" mode
  • Transfers over OSPI, HSPI, and XSPI didn't take into account the word size when setting the register for the number of bytes to transfer
  • One of our previous PRs (embasy-stm32: Allow large OSPI DMA writes with chunking #4671), also didn't take into account the word size when chunking DMA transfers. Sorry about that! Thankfully we caught this before the next embassy release, as before embasy-stm32: Allow large OSPI DMA writes with chunking #4671, it would have panicked on a transfer size larger than 0xFFFF anyway

I would normally pull 0xFFFF out into something like const MAX_DMA_TRANSFER_BYTES: usize = 0xFFFF and place that in the GPDMA module for embassy-stm32, but I'm not sure if that value holds true for all STM32 variants. If that is true, then I think the code clarity would benefit from having it defined in a const.

@bschwind bschwind force-pushed the xspi-transfer-fixes branch from 32f4c2a to 4616810 Compare October 4, 2025 11:14
@bschwind bschwind changed the title OSPI/HSPI/XSPI transfer fixes [embassy-stm32] OSPI/HSPI/XSPI transfer fixes Oct 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant