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

core: STM32 H5 support #348

Draft
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

PhilippMolitor
Copy link
Member

@PhilippMolitor PhilippMolitor commented Aug 16, 2024

The STM32 H503 chip is one of the newest releases by ST.
There already is a (almost) pin-compatible BlackPill board for this MCU: https://github.com/WeActStudio/WeActStudio.STM32H503CoreBoard

I think this chip might come up in the future for 3d printer electronics boards, as it is a good value for medium to high performance. Also this lays the foundation for STM32H562, which is basically the same with more IO and larger ram/flash (not relevant for klipper).

I already added the CMSIS files and some define guards to correct for some renamed register names. I could use some help for the functions in src/stm32/stm32h5.c, as I do not know much about the initialization and important registers of the STM32 platform.
Additional work will be needed for some of the common peripheral files in the src/stm32 folder.

PR Checklist

  • pr title makes sense
  • squashed to 1 commit
  • added a test case if possible
  • if new feature, added to the readme
  • ci is happy and green

H5(03) Checklist

  • Import all needed CMSIS files
  • Add Cortex M33 support
  • Add MPU ARM v8
  • Add to Kconfig
  • Add to STM32 Makefile
  • Validate Makefile includes
  • Implement entrypoint and helpers src/stm32/stm32h5.c
    • lookup_clock_line()
    • get_pclock_frequency()
    • gpio_clock_enable()
    • bootloader_request()
    • clock_setup()
    • armcm_main()
  • Check USB code src/stm32/usbfs.c
  • Check ADC peripheral code src/stm32/adc.c
  • Check CAN peripheral code src/stm32/can.c
  • Check FDCAN peripheral code src/stm32/fdcan.c
  • Check SPI peripheral code src/stm32/spi.c
  • Check Hardware PWM peripheral code src/stm32/hard_pwm.c
  • Check DFU reboot code src/stm32/dfu_reboot.c
  • Bootloader offsets?
  • Compile test file

H562 Checklist

  • Add H562 CMSIS files
  • Kconfig, Makefile
  • Bootloader offsets?
  • Additional IOs and their definitions for the peripherals
  • Compile test file

@PhilippMolitor PhilippMolitor requested a review from a team as a code owner August 16, 2024 14:29
@PhilippMolitor PhilippMolitor force-pushed the feature/mcu_support_stm32h503 branch from c36c460 to 3a6e304 Compare August 16, 2024 14:29
@PhilippMolitor PhilippMolitor marked this pull request as draft August 16, 2024 14:30
@PhilippMolitor PhilippMolitor changed the title [WIP] STM32 H503 support core: STM32 H5 support Aug 16, 2024
@PhilippMolitor PhilippMolitor force-pushed the feature/mcu_support_stm32h503 branch from 6ae47ad to 53cca54 Compare August 17, 2024 14:38
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