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

Update STM32H5 HAL driver, fix some DMA bugs #344

Merged

Conversation

multiplemonomials
Copy link
Collaborator

Summary of changes

This MR fixes some test failures that we have been seeing with STM32H5 processors on the spi-basic DMA abort test. Unfortunately, it seems like this isn't a scenario that STMicro tests when releasing their HAL, because I found two different issues with it.

Issue number 1 was that, in one of the DMA callbacks, it was concluding that the channel didn't abort successfully because a certain register flag (DMA_CCR_EN) was still set after aborting the channel.
Debugger screenshot

I'm not entirely 100% sure why that flag was still set, but it seems like checking it was in error, because in the latest release of the HAL, they removed the code that does the check!
Check removed diff

Unfortunately, updating the HAL introduced a different issue, where aborting the transfer would fail to correctly abort the Rx DMA channel. After some time going back and forth, I was finally able to work out what was going on. I filed a bug with STMicro here.

This MR updates Mbed to use the latest release (commit 7e8c7d8e) of the STM32H5 HAL driver, plus the patch mentioned in the issue above.

Impact of changes

  • Aborting DMA SPI transfers should work now on STM32H5

Migration actions required

Documentation

None


Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[X] Tests / results supplied as part of this PR

New test results for STM32H5 pushed here: https://mbed-ce.github.io/mbed-ce-test-tools/tests/index.html


@multiplemonomials multiplemonomials force-pushed the dev/stm32h5-update-hal-driver-and-bugfix-spi-abort branch from 0df1e87 to ab05128 Compare September 21, 2024 23:01
@multiplemonomials
Copy link
Collaborator Author

OK this should be mergeable now, I added a new way in the license scanner to exempt the STM32Cube HAL directory from checking

@multiplemonomials multiplemonomials merged commit f2a128b into master Sep 22, 2024
10 checks passed
@multiplemonomials multiplemonomials deleted the dev/stm32h5-update-hal-driver-and-bugfix-spi-abort branch September 22, 2024 06:13
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.

2 participants