FreeRTOS-Plus-TCP porting to STM32H5

I have a STM32H743 based application that is using FreeRTOS AWS Core IOT including FreeRTOS-Plus-TCP.
We need to upgrade the project HW to H563 (Without TZ).
I tried to use the same FreeRTOS-Plus-TCP porting as the H7 as the name of the directory - portable\NetworkInterface\STM32Hxx refers to all H MCUs but I realized it doesn’t.
Is there any porting of the FreeRTOS-Plus-TCPto STM32H5? Or U5?
If not then can you suggest how to handle this porting? Are there any porting guidelines?

@EyalG

I tried to use the same FreeRTOS-Plus-TCP porting as the H7 as the name of the directory - portable\NetworkInterface\STM32Hxx refers to all H MCUs but I realized it doesn’t.

What exact issue are you facing? Are you able to build the project?

If not then can you suggest how to handle this porting? Are there any porting guidelines?

You can find the porting guide here: Porting FreeRTOS-Plus-TCP to a Different Microcontroller

Are you using a reference design board from ST or a custom board? If its a reference design board from ST, like NUCLEO or DISCOVERY, please provide the part number to help you better.

Also, did you port the FreeRTOS kernel from Cortex M7 to Cortex M33?

Thank you @tony-josi-aws for your quick reply.

What exact issue are you facing? Are you able to build the project?

I have compilation issues when I try to use the STM32Hxx even after I changed the h7 include files reference to h5.
For example:

  • In the file stm32hxx_hal_eth.h under NetworkInterface\STM32Hxx there are reference to EXTI_D1 where in H5 there is no EXTI_D1 but EXTI and different fields.
  • In stm32hxx_hal_eth.c there is reference to a macro __HAL_RCC_SYSCFG_CLK_ENABLE that does not exist in H5 (In the H7 version it is supplied from stm32h7xx_hal_rcc.h)

Are you using a reference design board from ST or a custom board? If its a reference design board from ST, like NUCLEO or DISCOVERY, please provide the part number to help you better.

In order to reduce complexity I started with the Nucleo-H563ZI insted of my target

Also, did you port the FreeRTOS kernel from Cortex M7 to Cortex M33?

For the FreeRTOS kernel I used the STM32CubeMx to generate the base project for the board with FreeRTOS so I have the “STM Out of the box” FreeRTOS version for the H5, that is, V10.5.1 and of course it comes with the right porting for ARM_CM33_NTZ non_secure

It seems like the STM32H5 ethernet drivers have a considerable difference with STM32H7.

You might have to modify the network interface file with respect to the STM32H5 drivers while using the STM32H7 as a reference.

Please feel free to post here if you have questions.

@tony-josi-aws, I tried to find matches between some of the functions that are mention in the guide you refer me to and the H7 driver but I was no able to find any.
For example:

What interface I need to supply? Where do I start?

@htibosch Have you by any chance used the STM32H5 device with FreeRTOS-Plus-TCP?

Can you provide a link to your project or a more descriptive error that you are seeing?

I used the STM32CubeMx to generate the base project for the board with FreeRTOS so I have the “STM Out of the box” FreeRTOS version for the H5

If you’re using the default generated BSP from CubeIDE does it provide any networking capabilities by default?

Per what @tony-josi-aws said you would reference the existing pxSTM32H_FillInterfaceDescriptor and other such functions and modify them as needed by the stm32hxx_hal_eth.c that was generated by your IDE.

I would suggest to start with building the network interface file provided in the STM32Hxx port of FreeRTOS+TCP with the ethernet drivers provided with the STM32H5 HAL and fix the build failures and related issues. The drivers provided in STM32Hxx folder is suitable for STM32H7xx so you might have to disable those from the build and include the ethernet drivers for STM32H5xx.

As the ETH_IRQHandler is defined in the NetworkInterface.c file, you might have to disable the code generation of ethernet IRQ handlers in the CubeIDE.

Also, if you are using the CubeIDE to generate ethernet initialization code, it might generate code to initialize the ethernet in the [MX_ETH_Init] in the main(). Whereas FreeRTOS+TCP network interface expect it to be done in the xSTM32H_NetworkInterfaceInitialise.

Hey there,

I’m facing the exact same issues and am struggling with the porting of the eth drivers (started with FreeRTOS-Plus today). Any chance you have managed to get the project working?

Hi,
No, I did not managed to use the TCP lib with the H5.
I switched to ST package for the H5 from here

Appreciate the response. Ill get stuck into trying to port the drivers and trying to get it working. Would you like me to let you know if I get it working?

Please share here so that others can benefit from it too.

Yeah will do. Just a small update that maybe someone can help with. I’ve got the program running and FreeRTOS_IPInit completes successfully, however I am not able to see the board on the network at all (this is the same for static IP and dhcp).

To expand when DHCP is enabled it fails when trying to create the DHCP socket and reverts to static. I see no transmissions on wireshark and nothing on the network however the vApplicationIPNetworkEventHook function gets called and the network event is eNetworkUP.

I am worried the registers I used for the ethernet drivers are incorrect. The registers changed were from the EXTI_D1 struct to the EXIT_S.

Any chance someone that knows a bit more than me could assist?