Where to start STM32H7 support

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: barthess, RoccoMarco

tridge
Posts: 47
Joined: Mon Sep 25, 2017 8:27 am
Has thanked: 6 times
Been thanked: 9 times
Contact:

Re: Where to start STM32H7 support

Postby tridge » Wed Feb 13, 2019 9:25 am

Giovanni wrote:One of those "feel stupid" moments...

I feel pretty silly too - I was staring at that line hard for a while before I finally noticed.

The good news is this has fixed a lot of stuff for the ArduPilot port on the H743

- OTG1 USB
- SPI works (3 buses in parallel, 3 IMUs, 2 baros, compass and FRAM)
- I2C works, with DMA (2 buses)
- 5 UARTs (but without DMA, using the ArduPIlot driver that makes DMA optional)
- PWM out works (6 outputs on main MCU)
- DCache and bouncebuffers all working (only on AXI SRAM for now)
- clock tree seems good, though I've only managed 384MHz with 8, 16 and 24 MHz crystals. Maybe we'd need 25MHz crystal to get 400?
- PWM buzzer
- LEDs (both I2C and GPIO)

things that don't work:
- ADC inputs (I haven't yet looked into that)
- UART DMA
- CAN
- SDMMC
- DShot PWM (needs a DMAR trick that will need some work)

The one I'll probably look at first is UART DMA, as that is the only one standing in the way of a first flight test. We have to use DMA on the UART going to the IOMCU (a STM32F103) as it runs as 1.5MBit and is timing critical.
It's getting close!

tridge
Posts: 47
Joined: Mon Sep 25, 2017 8:27 am
Has thanked: 6 times
Been thanked: 9 times
Contact:

Re: Where to start STM32H7 support

Postby tridge » Thu Feb 14, 2019 9:55 pm

I've got ADCs and DMA on UARTs working now, so we're ready for an initial flight test.

I've started looking at SDMMC. At first glance it looks fairly similar to the F7 device, with some extra FIFO DMA registers and new features like polarity control. Some of the control bits in registers have moved around (eg. CLKDIV is wider). Do you think I should create a SDMMCv2, or try to work within SDMMCv1?

User avatar
Giovanni
Site Admin
Posts: 11555
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 472 times
Been thanked: 391 times
Contact:

Re: Where to start STM32H7 support

Postby Giovanni » Thu Feb 14, 2019 10:09 pm

Hi,

It depends, if it is going to clutter the code with conditionals all over the place then better make a v2. If it is limited to a little different configuration then it could stay in v1. Usually the STM32 designers try hard to stay backward compatible.

You could add a key in the registry to differentiate, better to not put direct checks on the platform in the code.

Giovanni

tridge
Posts: 47
Joined: Mon Sep 25, 2017 8:27 am
Has thanked: 6 times
Been thanked: 9 times
Contact:

Re: Where to start STM32H7 support

Postby tridge » Fri Feb 15, 2019 11:36 am

Giovanni wrote:It depends, if it is going to clutter the code with conditionals all over the place then better make a v2. If it is limited to a little different configuration then it could stay in v1.

It looks like the biggest difference is going to be the DMA. For the SPI conversion you made a nice new abstraction for handling the DMAMUX, but the SDMMC on the H7 doesn't use the DMAMUX, instead it has its own dedicated "Internal DMA" (IDMA) controller on the AHB.
So we'd have a bunch of compilation conditionals around the DMA code, plus some helper functions for setting up and handling the IDMA.
The non-DMA parts of the driver will be pretty close to the F7 version I think.
Still reading the reference manual ...

User avatar
Giovanni
Site Admin
Posts: 11555
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 472 times
Been thanked: 391 times
Contact:

Re: Where to start STM32H7 support

Postby Giovanni » Fri Feb 15, 2019 11:55 am

Let me give it a try then, I will add mux support to the existing driver. You could help with tests, I don't have HW for that right now.

Giovanni


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 6 guests