Skip to content

Enable ICACHE, LPTICKER, TRNG and WATCHDOG for STM32H5 #465

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wdx04
Copy link

@wdx04 wdx04 commented May 25, 2025

Summary of changes

Enables ICACHE, LPTICKER, TRNG and WATCHDOG features for the STM32H5 family.
MPU Region 5 is used to avoid hardfaults when ICACHE is enabled:
https://community.st.com/t5/stm32-mcus/how-to-avoid-a-hardfault-when-icache-is-enabled-on-the-stm32h5/ta-p/630085

Impact of changes

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

I run GreenTea tests on a NUCLEO-H563ZI board and passed the LPTICKER, TRNG and WATCHDOG tests.
The hal-sleep test failed when LPTICKER is used as wakup source from deepsleep mode, but it seems unrelated to LPTICKER itself: even if I comment out the code that setup the LPTICKER interrupt, the system will still wake up from deepsleep mode after 309 ticks. The netsocket related tests failed with Hard Faults. I'm not sure how to setup the test environments for netsocket tests or skip them.

greentea-log-nucleo-h563zi.txt


@@ -45,6 +45,43 @@ uint8_t SetSysClock_PLL_HSE(uint8_t bypass);
uint8_t SetSysClock_PLL_HSI(void);
#endif /* ((CLOCK_SOURCE) & USE_PLL_HSI) */

/**
Copy link
Collaborator

@multiplemonomials multiplemonomials May 25, 2025

Choose a reason for hiding this comment

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

system_clock.c feels like the wrong location to put this. Could we create a new .c file for this under TARGET_STM32H5, and then call the function from SystemInit() in TARGET_STM32H5/STM32Cube_FW/system_stm32h5xx.c?

@multiplemonomials
Copy link
Collaborator

I can test this on my end to see what's up with the Ethernet tests.

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