Closed brainstorm closed 2 years ago
Hi @brainstorm, modbus component is being moved out of esp-idf to https://github.com/espressif/esp-modbus in the upcoming v5.0 release.
If you don't use modbus in the application, you can trim the build to not contain freemodbus component.
For example, you can do this by adding set(EXCLUDE_COMPONENTS freemodbus)
to you project CMakeLists.txt, before the line where you include project.cmake
.
You can also use set(COMPONENTS main)
to trim the build even further, and then explicitly set component requirements (REQUIRES
or PRIV_REQUIRES
arguments of idf_component_register
) in every component of your application (including main
).
(Example: https://github.com/espressif/esp-idf/blob/4350e6fef859b94f3efae6ceced751911c9d2cbc/components/newlib/test_apps/CMakeLists.txt#L5, https://github.com/espressif/esp-idf/blob/4350e6fef859b94f3efae6ceced751911c9d2cbc/components/newlib/test_apps/main/CMakeLists.txt#L5)
Thanks Ivan, TIL ;)
On any arbitrary esp-idf example, if one disables all Modbus-related components (TCP, RTU, ASCII), the result is the error below. Ideally the FreeModbus (esp-modbus) component should be completely independent of the rest and not occupy space nor compile time when building ModBus-unrelated IDF applications: