Portenta H7: Want to use STM32H747XI's SPI3

Cool, thank you.

BTW:
have you checked SPI signals with a scope?
I saw, that Arduino uses SW mode: all comes in byte bursts. Not a seamless clock.
I use my own SPI driver (for bare-metal, HAL drivers) using DMA: looks much better in terms of SCLK.

And how do you select the PCLK for SPI? Are you using PLL2 or PLL3 for it?
If you like - I can post my SPI driver (native HAL) which has a much more fine granular SPI clock configuration (I think the Arduino driver uses just the SPI divider - very huge steps in speed).

Here my SPI source code files - as bare-metal (not Arduino sketch, direct HAL drivers, with CMSIS 2 as RTOS)
system_clock_override.c (11.1 KB)
SPI.c (16.4 KB)
SPI.h (2.0 KB)
stm32h7xx_it.c (5.2 KB)

The "beauty": I use SPI in DMA mode (not SW mode) - much faster and seamless SPI SCLK.
I have added support for SPI packets >64KB (a HW limitation inside STM MCU, max. DMA length is 64KB - 1 !).
Much more fine granular SPI clock speed config, using PLL2 config to trim: range: 73 KHz ... 90 MHz (faster possible but I see strange NSS behavior on scope).

It might be possible to use on an Arduino sketch: if you define the "C" functions when used from CPP code and if it works to define and get the INT Handlers needed to your project.
Not sure which CMSIS RTOS version is used by Arduino LIB. This code uses CMSIS 2 semaphores.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.