Skip to content

stm32: Add support for H5 MCUs #11138

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

Merged
merged 12 commits into from
Jun 15, 2023
Merged

Conversation

dpgeorge
Copy link
Member

@dpgeorge dpgeorge commented Mar 28, 2023

This PR adds support for STM32H5xx MCUs. A board definition for the STM32H573I-DK is provided.

Current status:

  • updated stm32lib
  • REPL
  • filesystem on internal flash
  • filesystem on external SPI flash (using OCTOSPI peripheral but in SPI mode)
  • USB CDC, MSC
  • mboot support
  • RTC
  • sleep modes
  • DMA
  • hardware SPI (using DMA)

Note that stm32lib is not yet updated with H5 support. So to build this PR you need to clone https://github.com/STMicroelectronics/STM32CubeH5 and then point to it using:

CUBEH5=<path to STM32CubeH5 repo>
export STM32LIB_CMSIS_DIR=$CUBEH5/Drivers/CMSIS/Device/ST/STM32H5xx
export STM32LIB_HAL_DIR=$CUBEH5/Drivers/STM32H5xx_HAL_Driver

Then build with make BOARD=STM32H573I_DK as usual.

Edit: stm32lib now supports H5, so the build can proceed as usual.

@github-actions
Copy link

github-actions bot commented Mar 28, 2023

Code size report:

   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:   +32 +0.008% PYBV10
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% PICO
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS

@codecov-commenter
Copy link

codecov-commenter commented Mar 28, 2023

Codecov Report

Merging #11138 (0908d00) into master (33b403d) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master   #11138   +/-   ##
=======================================
  Coverage   98.40%   98.40%           
=======================================
  Files         155      155           
  Lines       20543    20543           
=======================================
  Hits        20215    20215           
  Misses        328      328           

@dpgeorge dpgeorge force-pushed the stm32-h5-v2 branch 2 times, most recently from 0d1582e to b517b9f Compare May 17, 2023 05:57
@pschindler pschindler mentioned this pull request Jun 1, 2023
@dpgeorge dpgeorge force-pushed the stm32-h5-v2 branch 3 times, most recently from bddb4e8 to 8e6b2d8 Compare June 14, 2023 05:16
@dpgeorge dpgeorge changed the title stm32: Add support for H5 MCUs (WIP) stm32: Add support for H5 MCUs Jun 14, 2023
dpgeorge added 12 commits June 15, 2023 11:02
Signed-off-by: Damien George <damien@micropython.org>
Needed for compiling gchelper_thumb2 on cortex-m33.

Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
For debugging purposes, to see output from other peripherals.

Also reset the pyb_stdio_uart state at the end of soft reset, in case it
points to a heap-allocated object.

Signed-off-by: Damien George <damien@micropython.org>
The G0 USB peripheral behaves more like MICROPY_HW_USB_IS_MULTI_OTG=0 than
that config =1.  This fixes the configuration of the PMA FIFO buffers.

Signed-off-by: Damien George <damien@micropython.org>
All MCUs can have 6-bit resolution; see adc_cr_to_bits_table.

Signed-off-by: Damien George <damien@micropython.org>
Changes in this new library version are:
- Add H5 HAL at v1.0.0.

Signed-off-by: Damien George <damien@micropython.org>
This commit adds initial support for STM32H5xx MCUs.  The following
features have been confirmed to be working on an STM32H573:
- UART over REPL and USB CDC
- USB CDC and MSC
- internal flash filesystem
- machine.Pin
- machine.SPI transfers with DMA
- machine.ADC
- machine.RTC
- pyb.LED
- pyb.Switch
- pyb.rng
- mboot

Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
It currently operates in 1-line (SPI) mode only.

Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
@dpgeorge dpgeorge merged commit 0908d00 into micropython:master Jun 15, 2023
@dpgeorge dpgeorge deleted the stm32-h5-v2 branch June 15, 2023 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants