micro-ROS / micro-ROS/micro_ros_setup

Not able to build the firmware for transport type UDP (although it is working for serial).

Open
#809 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
509
Forks
183
Avg merge
22h 26m
Merged PRs (30d)
7

Description

- Hardware description: esp32s3
- RTOS: freertos
- Installation type: micro_ros_setup
- Version or commit hash: jazzy

### Steps to reproduce the issue

#### Create a fresh workspace and build micro-ROS setup for Jazzy
`mkdir uros_ws && cd uros_ws`
`git clone -b jazzy https://github.com/micro-ROS/micro_ros_setup.git src/micro_ros_setup`

> after cloning I changed the version to v5.2 from v4.1

`apt update`
`rosdep update && rosdep install --from-paths src --ignore-src -y`
`apt install python3-pip`
`colcon build`
`source install/local_setup.bash`

#### Create firmware for ESP32
ros2 run micro_ros_setup create_firmware_ws.sh freertos esp32

`./firmware/toolchain/esp-idf/install.sh esp32s3`
`. ./firmware/toolchain/esp-idf/export.sh`

#### Configure firmware for ESP32 using UDP transport
`ros2 run micro_ros_setup configure_firmware.sh int32_publisher --transport udp`

#### Attempt to build the firmware
`ros2 run micro_ros_setup build_firmware.sh menuconfig`

> I set the ssid and password and save the sdkconfig

`idf.py build`
> I ran the above command from inside the `/uros_ws/firmware/freertos_apps/microros_esp32_extentions/` folder

#### Expected behavior
It should successfully build the firmware.

#### Actual behavior
It is throwing error with this error,
```bash

...

[100%] Generating binary image from built executable
esptool.py v4.11.0
Creating esp32s3 image...
Merged 2 ELF sections
Successfully created esp32s3 image.
Generated /uros_ws/firmware/freertos_apps/microros_esp32_extensions/build/bootloader/bootloader.bin
make[5]: Leaving directory '/uros_ws/firmware/freertos_apps/microros_esp32_extensions/build/bootloader'
[100%] Built target gen_project_binary
make[5]: Entering directory '/uros_ws/firmware/freertos_apps/microros_esp32_extensions/build/bootloader'
make[5]: Leaving directory '/uros_ws/firmware/freertos_apps/microros_esp32_extensions/build/bootloader'
make[5]: Entering directory '/uros_ws/firmware/freertos_apps/microros_esp32_extensions/build/bootloader'
Bootloader binary size 0x5240 bytes. 0x2dc0 bytes (36%) free.
make[5]: Leaving directory '/uros_ws/firmware/freertos_apps/microros_esp32_extensions/build/bootloader'
[100%] Built target bootloader_check_size
make[5]: Entering directory '/uros_ws/firmware/freertos_apps/microros_esp32_extensions/build/bootloader'
make[5]: Leaving directory '/uros_ws/firmware/freertos_apps/microros_esp32_extensions/build/bootloader'
[100%] Built target app
make[4]: Leaving directory '/uros_ws/firmware/freertos_apps/microros_esp32_extensions/build/bootloader'
make[3]: Leaving directory '/uros_ws/firmware/freertos_apps/microros_esp32_extensions/build/bootloader'
[ 3%] No install step for 'bootloader'
cd /uros_ws/firmware/freertos_apps/microros_esp32_extensions/build/bootloader && /usr/bin/cmake -E echo_append
[ 3%] Completed 'bootloader'
/usr/bin/cmake -E make_directory /uros_ws/firmware/freertos_apps/microros_esp32_extensions/build/CMakeFiles
/usr/bin/cmake -E touch /uros_ws/firmware/freertos_apps/microros_esp32_extensions/build/CMakeFiles/bootloader-complete
/usr/bin/cmake -E touch /uros_ws/firmware/freertos_apps/microros_esp32_extensions/build/bootloader-prefix/src/bootloader-stamp/bootloader-done
make[2]: Leaving directory '/uros_ws/firmware/freertos_apps/microros_esp32_extensions/build'
[ 3%] Built target bootloader
make[1]: Leaving directory '/uros_ws/firmware/freertos_apps/microros_esp32_extensions/build'
make: *** [Makefile:139: all] Error 2
Missing "lwipopts.h" file name found in the following component(s): lwip(/uros_ws/firmware/toolchain/esp-idf/components/lwip/port/include/lwipopts.h), lwip(/uros_ws/firmware/toolchain/esp-idf/components/lwip/lwip/test/unit/lwipopts.h), lwip(/uros_ws/firmware/toolchain/esp-idf/components/lwip/lwip/test/fuzz/lwipopts.h), lwip(/uros_ws/firmware/toolchain/esp-idf/components/lwip/lwip/test/apps/lwipopts.h). Maybe one of the components needs to add the missing header directory to INCLUDE_DIRS of idf_component_register call in CMakeLists.txt.
make failed with exit code 2
```

#### Additional information

> I am using docker ros:jazzy image.

Running the command, `ros2 run micro_ros_setup build_firmware.sh` is also giving the same error in different format,
```bash
--- stderr: microxrcedds_client
In file included from /uros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/util/time.c:3:
/uros_ws/firmware/toolchain/esp-idf/components/newlib/platform_include/time.h:11:2: warning: #include_next is a GCC extension
11 | #include_next
| ^~~~~~~~~~~~
In file included from /uros_ws/firmware/toolchain/esp-idf/components/lwip/lwip/src/include/lwip/sockets.h:42,
from /uros_ws/firmware/toolchain/esp-idf/components/lwip/lwip/src/include/compat/posix/sys/socket.h:33,
from /uros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/profile/transport/ip/udp/udp_transport_posix_nopoll.c:5:
/uros_ws/firmware/toolchain/esp-idf/components/lwip/lwip/src/include/lwip/opt.h:51:10: fatal error: lwipopts.h: No such file or directory
51 | #include "lwipopts.h"
| ^~~~~~~~~~~~
compilation terminated.
gmake[6]: *** [CMakeFiles/microxrcedds_client.dir/build.make:415: CMakeFiles/microxrcedds_client.dir/src/c/profile/transport/ip/udp/udp_transport_posix_nopoll.c.obj] Error 1
gmake[6]: *** Waiting for unfinished jobs....
In file included from /uros_ws/firmware/toolchain/esp-idf/components/lwip/lwip/src/include/lwip/sockets.h:42,
from /uros_ws/firmware/toolchain/esp-idf/components/lwip/lwip/src/include/compat/posix/arpa/inet.h:33,
from /uros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/profile/transport/ip/ip_posix.c:18:
/uros_ws/firmware/toolchain/esp-idf/components/lwip/lwip/src/include/lwip/opt.h:51:10: fatal error: lwipopts.h: No such file or directory
51 | #include "lwipopts.h"
| ^~~~~~~~~~~~
compilation terminated.
gmake[6]: *** [CMakeFiles/microxrcedds_client.dir/build.make:429: CMakeFiles/microxrcedds_client.dir/src/c/profile/transport/ip/ip_posix.c.obj] Error 1
gmake[5]: *** [CMakeFiles/Makefile2:86: CMakeFiles/microxrcedds_client.dir/all] Error 2
gmake[4]: *** [Makefile:139: all] Error 2
---
Failed <<< microxrcedds_client [4.55s, exited with code 2]
Aborted <<< rcutils [8.32s]
Aborted <<< rmw_implementation_cmake [2.62s]
Aborted <<< rosidl_adapter [1.83s]

Summary: 4 packages finished [9.75s]
1 package failed: microxrcedds_client
3 packages aborted: rcutils rmw_implementation_cmake rosidl_adapter
2 packages had stderr output: microxrcedds_client rcutils
68 packages not processed
make[3]: *** [libmicroros.mk:33: colcon_compile] Error 2
make[3]: Leaving directory '/uros_ws/firmware/freertos_apps/microros_esp32_extensions'
make[2]: *** [esp-idf/main/CMakeFiles/libmicroros.dir/build.make:89: libmicroros-prefix/src/libmicroros-stamp/libmicroros-build] Error 2
make[2]: Leaving directory '/uros_ws/firmware/freertos_apps/microros_esp32_extensions/build'
make[1]: *** [CMakeFiles/Makefile2:4756: esp-idf/main/CMakeFiles/libmicroros.dir/all] Error 2
make[1]: Leaving directory '/uros_ws/firmware/freertos_apps/microros_esp32_extensions/build'
make: *** [Makefile:139: all] Error 2
[ros2run]: Process exited with failure 2
```

Please help, thanks in advance!!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the UDP firmware build in firmware/freertos_apps/microros_esp32_extensions using the ESP-IDF setup under firmware/toolchain/esp-idf. Start with the lwip include paths and the CMakeLists.txt context reported by the build, then inspect the Micro-XRCE-DDS-Client UDP sources that include lwip/opt.h. Done means the UDP firmware build completes without the missing lwipopts.h error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, docker, shell
Domain
build-system, embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.