Page 1 of 1

git errors in downloading esp-idf for thread border router

Posted: Thu Jan 22, 2026 3:43 am
by JamesL
I have an ESP Thread Border Router board with ethernet module as described here: https://docs.espressif.com/projects/esp ... forms.html. I am attempting to build and flash the thread border router code following instructions here: https://docs.espressif.com/projects/esp ... d_run.html. I have not used esp-idf before however I have some familiarity with ESP32 having successfully deployed multiple projects on a few different ESP32 platforms, writing nearly 20k lines of ESP32 C++ code in Arduino.
I have had multiple attempts, starting from a clean slate, to follow the instructions.

2.1.1 Set up the repositories

Code: Select all

git clone --recursive https://github.com/espressif/esp-idf.git
cd esp-idf
git checkout v5.5.2
This completes without error. However:

Code: Select all

git submodule update --init --depth 1
This goes most of the way then gives the following error:

Code: Select all

From https://github.com/espressif/esp-thread-lib
 * branch            e9980c56558876ae1102be8ae9dc70821aded72c -> FETCH_HEAD
Submodule path 'components/openthread/lib': checked out 'e9980c56558876ae1102be8ae9dc70821aded72c'
error: The following untracked working tree files would be overwritten by checkout:
	third_party/mbedtls/repo/.gitattributes
	third_party/mbedtls/repo/.github/ISSUE_TEMPLATE/bug_report.md
	third_party/mbedtls/repo/.github/ISSUE_TEMPLATE/config.yml
	third_party/mbedtls/repo/.github/ISSUE_TEMPLATE/feature_request.md
	third_party/mbedtls/repo/.github/pull_request_template.md
	third_party/mbedtls/repo/.gitignore
	third_party/mbedtls/repo/.gitmodules
	third_party/mbedtls/repo/.globalrc
	third_party/mbedtls/repo/.mypy.ini
	third_party/mbedtls/repo/.pylintrc
	third_party/mbedtls/repo/.readthedocs.yaml
	third_party/mbedtls/repo/.travis.yml
	third_party/mbedtls/repo/.uncrustify.cfg
	third_party/mbedtls/repo/3rdparty/.gitignore
	third_party/mbedtls/repo/3rdparty/CMakeLists.txt
	third_party/mbedtls/repo/3rdparty/Makefile.inc
	third_party/mbedtls/repo/3rdparty/everest/.gitignore
	third_party/mbedtls/repo/3rdparty/everest/CMakeLists.txt
	third_party/mbedtls/repo/3rdparty/everest/Makefile.inc
	third_party/mbedtls/repo/3rdparty/everest/README.md
	third_party/mbedtls/repo/3rdparty/everest/include/everest/Hacl_Curve25519.h
	third_party/mbedtls/repo/3rdparty/everest/include/everest/everest.h
	third_party/mbedtls/repo/3rdparty/everest/include/everest/kremlib.h
	third_party/mbedtls/repo/3rdparty/everest/include/everest/kremlib/FStar_UInt128.h
	third_party/mbedtls/repo/3rdparty/everest/include/everest/kremlib/FStar_UInt64_FStar_UInt32_FStar_UInt16_FStar_UInt8.h
	third_party/mbedtls/repo/3rdparty/everest/include/everest/kremlin/c_endianness.h
	third_party/mbedtls/repo/3rdparty/everest/include/everest/kremlin/internal/builtin.h
	third_party/mbedtls/repo/3rdparty/everest/include/everest/kremlin/internal/callconv.h
	third_party/mbedtls/repo/3rdparty/everest/include/everest/kremlin/internal/compat.h
	third_party/mbedtls/repo/3rdparty/everest/include/everest/kremlin/internal/debug.h
	third_party/mbedtls/repo/3rdparty/everest/include/everest/kremlin/internal/target.h
	third_party/mbedtls/repo/3rdparty/everest/include/everest/kremlin/internal/types.h
	third_party/mbedtls/repo/3rdparty/everest/include/everest/kremlin/internal/wasmsupport.h
	third_party/mbedtls/repo/3rdparty/everest/include/everest/vs2013/Hacl_Curve25519.h
	third_party/mbedtls/repo/3rdparty/everest/include/everest/x25519.h
	third_party/mbedtls/repo/3rdparty/everest/library/Hacl_Curve25519.c
	third_party/mbedtls/repo/3rdparty/everest/library/Hacl_Curve25519_joined.c
	third_party/mbedtls/repo/3rdparty/everest/library/everest.c
	third_party/mbedtls/repo/3rdparty/everest/library/kremlib/FStar_UInt128_extracted.c
	third_party/mbedtls/repo/3rdparty/everest/library/kremlib/FStar_UInt64_FStar_UInt32_FStar_UInt16_FStar_UInt8.c
	third_party/mbedtls/repo/3rdparty/everest/library/legacy/Hacl_Curve25519.c
	third_party/mbedtls/repo/3rdparty/everest/library/x25519.c
	third_party/mbedtls/repo/3rdparty/p256-m/CMakeLists.txt
	third_party/mbedtls/repo/3rdparty/p256-m/Makefile.inc
	third_party/mbedtls/repo/3rdparty/p256-m/README.md
	third_party/mbedtls/repo/3rdparty/p256-m/p256-m/README.md
	third_party/mbedtls/repo/3rdparty/p256-m/p256-m/p256-m.c
	third_party/mbedtls/repo/3rdparty/p256-m/p256-m/p256-m.h
	third_party/mbedtls/repo/3rdparty/p256-m/p256-m_driver_entrypoints.c
	third_party/mbedtls/repo/3rdparty/p256-m/p256-m_driver_entrypoints.h
	third_party/mbedtls/repo/BRANCHES.md
	third_party/mbedtls/repo/BUGS.md
	third_party/mbedtls/repo/CMakeLists.txt
	third_party/mbedtls/repo/CONTRIBUTING.md
	third_party/mbedtls/repo/ChangeLog
	third_party/mbedtls/repo/ChangeLog.d/00README.md
	third_party/mbedtls/repo/LICENSE
	third_party/mbedtls/repo/Makefile
	third_party/mbedtls/repo/README.md
	third_party/mbedtls/repo/SECURITY.md
	third_party/mbedtls/repo/SUPPORT.md
	third_party/mbedtls/repo/cmake/MbedTLSConfig.cmake.in
	third_party/mbedtls/repo/configs/README.txt
	third_party/mbedtls/repo/configs/config-ccm-psk-dtls1_2.h
	third_party/mbedtls/repo/configs/config-ccm-psk-tls1_2.h
	third_party/mbedtls/repo/configs/config-no-entropy.h
	third_party/mbedtls/repo/configs/config-suite-b.h
	third_party/mbedtls/repo/configs/
Aborting
fatal: Unable to checkout '36b14d3ef74f5e37e5be8902e1c1955a642fdfbf' in submodule path 'components/openthread/openthread'
How do I resolve this?

The files to be replaced are in the directory repo within components/openthread/openthread/third_party/mbedtls/. I tried renaming this to repo_old and re-running

Code: Select all

git submodule update --init --depth 1
This completed successfully as follows:

Code: Select all

Submodule path 'components/openthread/openthread': checked out '36b14d3ef74f5e37e5be8902e1c1955a642fdfbf'
Comparing what is in repo with what is in repo_old:
* repo_old has about 2.5 MB more (47 MB) in about 200 more files and directories
* the file Changelog shows that repo_old is a newer version (Mbed TLS 3.6.5 branch released 2025-10-15) than repo ((Mbed TLS 3.6.0 branch released 2024-03-20)
* there are huge numbers of differences in the contents of the files of the two versions of the repo

Which is the correct version to use here?

I have tried keeping 3.6.0 (the version put there by the git submodule update) and proceeding from there.

Code: Select all

./install.sh
. ./export.sh
cd ..
git clone --recursive https://github.com/espressif/esp-thread-br.git
This all completes without error.

2.1.2 Build the RCP image

Code: Select all

cd $IDF_PATH/examples/openthread/ot_rcp
idf.py set-target esp32h2
idf.py build
This completes without error. It generates a number of binaries including bootloader.bin and esp_ot_rcp.bin.

2.1.3. Configure ESP Thread Border Router
Starting from the original directory where we started:

Code: Select all

cd esp-thread-br/examples/basic_thread_border_router
idf.py set-target esp32-s3
This completes without error.

Code: Select all

idf.py menuconfig
... and change settings as shown here: https://docs.espressif.com/projects/esp ... der-router

Code: Select all

idf.py -p /dev/cu.usbmodem-1202 flash monitor
This builds successfully reporting progress up to 97% then generates the following errors:

Code: Select all

{97%} Built target __idf_espressif__esp_ot_cli_extension
{97%} Building C object esp-idf/thread_border_router/CMakeFiles/__idf_thread_border_router.dir/src/border_router_launch.c.obj
/Users/james/Documents/ESP_IDF/esp-thread-br/examples/common/thread_border_router/src/border_router_launch.c: In function 'launch_openthread_border_router':
/Users/james/Documents/ESP_IDF/esp-thread-br/examples/common/thread_border_router/src/border_router_launch.c:206:5: error: implicit declaration of function 'ot_register_external_commands' {-Wimplicit-function-declaration}
  206 |     ot_register_external_commands();
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make{3}: *** {esp-idf/thread_border_router/CMakeFiles/__idf_thread_border_router.dir/src/border_router_launch.c.obj} Error 1
make{2}: *** {esp-idf/thread_border_router/CMakeFiles/__idf_thread_border_router.dir/all} Error 2
make{1}: *** {CMakeFiles/flash.dir/rule} Error 2
make: *** {flash} Error 2
make failed with exit code 2, output of the command is in the /Users/james/Documents/ESP_IDF/esp-thread-br/examples/basic_thread_border_router/build/log/idf_py_stderr_output_85636 and /Users/james/Documents/ESP_IDF/esp-thread-br/examples/basic_thread_border_router/build/log/idf_py_stdout_output_85636
{Note that I replaced square braces in the error quote above with curly braces to stop confusing the bbcode interpreter.}
This appears to be a compile time error within a source file where the compiler does not like the implicit declaration of ot_register_external_commands() within the function launch_openthread_border_router in the file border_router_launch.c. Searching through the entire directory tree I see that this is the only mention of ot_register_external_commands anywhere.


How do I resolve this?

Re: git errors in downloading esp-idf for thread border router

Posted: Thu Jan 29, 2026 11:30 pm
by DulionTech
I was able to get it to compile by switching to the v1.3 tag.

git checkout "v1.3"