Skip to main content
Associate
Feb 10, 2025 12:19 PM UTC
Question

Has Anyone Successfully Implemented Micro-ROS UDP on STM32F7?

Hi everyone,

I am trying to implement Micro-ROS over UDP on an STM32F7 (Nucleo-F767ZI), but I keep running into hard fault errors. I am using LWIP with FreeRTOS in STM32CubeIDE.

So far, I have:

  • Successfully built and integrated Micro-ROS into my project using serial transport.
  • Configured LWIP for UDP and able to ping the board.
  • Initialized Micro-ROS with a UDP transport, but the system crashes with a hard fault.

Has anyone successfully gotten Micro-ROS over UDP working on an STM32F7? If so, could you share:

  1. Any specific LWIP settings that need to be changed?
  2. The correct way to handle memory allocation (heap/stack sizes) for Micro-ROS?
  3. Debugging tips for tracing the cause of the hard fault error?

Any insights or working examples would be greatly appreciated!

Thanks in advance!

This topic has been closed for replies.

9 replies

Andrew Neil
Super User
Feb 10, 2025 12:46 PM UTC
A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Associate
Feb 14, 2025 2:32 PM UTC

First, I recommend that you take a look at this micro-ROS link: https://github.com/micro-ROS/micro_ros_stm32cubemx_utils

Next, you need to change some configurations for both LWIP, Ethernet, and FreeRTOS. Since you have the STM32F767ZI, you need to change the "First Tx Descriptor Address" and the one for Rx as well. The default value generated by CubeMX causes Hard Faults. For this, I recommend using 0x2000e1e0 for Tx and 0x2000e140 for Rx. In LWIP, I recommend setting a static IP, and you also need to modify the "LWIP_RAM_HEAP_POINTER" and "MEM_SIZE" values. For this, I recommend 0x20020000 for the first one and 10*1024 for the second one.

Finally, you need to add:

.lwip_sec (NOLOAD) : {
 *(.RxDecripSection)
 *(.TxDecripSection)

} >RAM AT> FLASH

to the FLASH.ld file, because this configuration is not defined in it.

I recommend that you check the STM32F767ZI manual and see where SRAM1 is located. As for micro-ROS, I am still trying to find an implementation because, for now, I haven't been able to get it working with UDP either.

Associate
Feb 14, 2025 2:33 PM UTC

I forgot to mention this as well, but this link: https://community.st.com/t5/stm32-mcus-embedded-software/lwip-is-not-working-in-cmsis-v2/td-p/67495/page/2 might also help you get Ethernet working with the V2 of CMSIS.

Andrew Neil
Super User
Jul 21, 2025 8:42 AM UTC

More of a question for https://micro.ros.org/ than ST:

AndrewNeil_0-1753087343625.png

 

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.