STM32 H563 I2C TIMINGR Add
Description
Description
The STM32H5 series (e.g., STM32H563/H573) features high-performance I2C peripherals (I2C V2 IP), which utilize the 32-bit I2C_TIMINGR register for baud rate and timing configuration (Standard-mode, Fast-mode, and Fast-mode Plus).
Currently, in ports/stm32/, the preprocessor logic for I2C_V2 and TIMINGR calculation includes families like STM32H7, STM32G0/G4, and STM32WB, but STM32H5 is notably absent. This prevents the driver from correctly initializing the I2C block on H5 hardware.
Verification & Results
I have implemented a patch to include STM32H5 in the I2C V2 logic. Local testing on a H563RI Board demonstrates that the timing calculation is accurate. I have successfully verified stable I2C communication at standard bus speeds, as well as custom configurations up to 1.5 MHz (overclocked Fast-mode Plus), which confirms the flexibility and correctness of the timing logic.
<img width="586" height="292" alt="Image" src="https://github.com/user-attachments/assets/e14a14fe-a3df-4fdb-9b7a-838631271579" />
Code Size
No response
Implementation
I hope the MicroPython maintainers or community will implement this feature
Code of Conduct
Yes, I agree
stm32lib: ST not adding new parts.
Description
It appears ST are no longer adding new MCU drivers to stm32lib. For the H5 series stm32lib only supports H503, H562, H563 and H573. It does not support H523, H533, H5E or H5F.
New parts like the H523 are only supported in stand-alone repositories cmsis-device-h5 and stm32h5xx-hal-driver. The C0 series are also only supported in stand-alone drivers. The C5 has no support yet, but I expect it to be stand-alone. ST are also imminently releasing HAL2, see: https://github.com/STMicroelectronics/STM32CubeU5-V2-Preview
I have diffed the stm32lib H5 drivers with the stand-alone versions and there are quite a few difference. NUCLEO_H563ZI produces many errors when built with the stand-alone drivers.
I want to use the H523, but I don't know how to proceed or how the developers would want to incorporate new ST drivers - either add stand-alone submodules or wait for HAL2. I don't think my git and C skills are up to the task.
I think the H5, C5 and C0 families will be very important. ST is putting a lot of effort into M33 parts and they are significantly cheaper than the older M4 parts. H5 and C5 are pin compatible high performance / low cost families and C0 is pin compatible low cost alternative to G0.
https://github.com/STMicroelectronics/cmsis-device-h5
https://github.com/STMicroelectronics/stm32h5xx-hal-driver
https://github.com/STMicroelectronics/cmsis-device-c0
https://github.com/STMicroelectronics/stm32c0xx-hal-driver
Code Size
It is reported the HAL2 drivers will be more compact.
Implementation
I hope the MicroPython maintainers or community will implement this feature
Code of Conduct
Yes, I agree