Skip to main content
Explorer II
February 10, 2025
Question

Has Anyone Successfully Implemented Micro-ROS UDP on STM32F7?

  • February 10, 2025
  • 3 replies
  • 1759 views

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.

    3 replies

    Super User
    February 10, 2025
    Visitor II
    February 14, 2025

    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.

    Visitor II
    February 14, 2025

    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.

    Super User
    July 21, 2025

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

    AndrewNeil_0-1753087343625.png