cancel
Showing results for 
Search instead for 
Did you mean: 

Has Anyone Successfully Implemented Micro-ROS UDP on STM32F7?

sahan_s
Associate

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!

4 REPLIES 4
pp3reira
Associate

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.

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.

Thank you for your prompt response and assistance.

I wanted to provide an update regarding my firmware situation: I recently switched back to the F7 firmware version to 1.16.2 from version 1.17.2 after experiencing some challenges with the newer release. So far, the older firmware (1.16.2) has been functioning flawlessly. Notably, it does not require manual memory address configurations.

Additionally, I’ve successfully implemented micro-ROS over UDP using this firmware version (1.16.2) without encountering any issues thus far. I’ll continue monitoring performance as I proceed with further testing.

Once again, thank you for your support.