FreeRTOS+TCP for STM32H7?

In @Heinrich-vanNieuwenh’s repo you will find a main.c in CM7/Core/Src.

It was written for a NUCLEO-H745ZI. I don’t know the exact differences with your H743 Nucleo board.

Here is my main()
// Initialize GPIOs for Ethernet here
FreeRTOS_IPInit( ucIPAddress,
ucNetMask,
ucGatewayAddress,
ucDNSServerAddress,
ucMACAddress );
vTaskStartScheduler();
for(;;) {}

Beside calling FreeRTOS_IPInit(), it is very important to set the clocks of the CPU:

    /* Configure the system clock */
    SystemClock_Config();

Also, as described in the readme.md, you will have to define a RAM section that can be used for DMA.

Here is the latest version of the STM32H7 driver.

It looks like many developers were waiting for a FreeRTOS+TCP driver for the STM32Hx, and several people had questions about the application code, the CPU-setup, and the memories.

Therefore I have decided to publish my testing project on Github here.

This is not an official release from AWS/FreeRTOS, it is just a help to get your project running.

It is a complete project, and it includes the latest releases of the FreeRTOS kernel, +TCP, and ST’s HAL.

It also has a small demonstration of the RNG peripheral, which is important for Internet security.

Thank you,

I forgot to include the clock configuration in the original post. However, after connecting to the debugger, I was able to determine that I was getting DMA errors (Fatal bus error + Receive Process stopped). After adding the following to the linker script:

.eth_desc (NOLOAD) : {
    . = ABSOLUTE(0x30040000);
    *(.RxDecripSection) 
    . = ABSOLUTE(0x30040060);
    *(.TxDecripSection)
    . = ABSOLUTE(0x30040200);
    *(.RxArraySection) 
} >RAM_D2 AT> FLASH

and configuring the MPU as described here, everything worked correctly! Now to move on to MQTT…

Thank you again!

The STM32H7 FreeRTOS+TCP drivers for STM32H7 are now part of the FreeRTOS 202012.00 and FreeRTOS-LTS releases.

I got the driver working on a few versions of a custom STM32H753 board, but have not validated the speed.

It is also worth nothing that when enabling Ethernet in the STM32CubeIDE GUI, the ETH_DMADescTypeDef DMARxDscrTab / DMATxDscrTab, RxBuff, ETH_TxPacketConfig and ETH_HandleTypeDef variables are generated inside main.c. To make this driver work with these variables instead, simply make NetworkInterface.c reference them instead of the ones included in the file. Also make sure to enable I cache, disable D cache, delete the stm32h7xx_hal_eth files generated by the UI, and to enable the ethernet interrupt.

I’m having issues with low clock speeds not working (DHCP request not detected by my router). I have to use VOS0 and CPU speed of 400 MHz to get the thing to work. I suspect a hardware problem on my side. I’ll update if I find an official document related to clock speed issues with ETH driver.
EDIT: Confirming this is a hardware issue on my side as Ethernet works with VOS2 and 200 MHz SYSCLK and MCU CLK on a previous version. I suspect it’s due to either the rough rework I did after a bad reflow, or to the underpowered 25 MHz clock trying to supply both the MAC and the MCU without a buffer :smiley: .

Thanks to @htibosch and everyone who contributed to this driver.