The library vendors pinned, lightly-patched copies of OpenThread and mbedtls so
that a plain Arduino library build (recursive src/ compile, single -Isrc
include root, no per-library compiler flags) produces a working FTD stack.
| Component | Source | Version |
|---|---|---|
| OpenThread core + public headers | https://github.com/openthread/openthread | fa3213ec |
| mbedtls | https://github.com/Mbed-TLS/mbedtls | e185d7fd (3.6.5, OT's pinned submodule) |
Arduino resolves quoted includes against -I<lib>/src, so the OpenThread
src/core/ tree is flattened to the src/ root (its sources include each
other as "common/... 'mac/..." etc.):
| Upstream | Here |
|---|---|
openthread/src/core/<dir>/ (api, common, config, crypto, instance, mac, meshcop, net, radio, thread, utils, coap, ...) |
src/<dir>/ |
openthread/src/core/openthread-core-config.h |
src/openthread-core-config.h (patched, see below) |
openthread/src/include/common/*.hpp |
merged into src/common/ |
openthread/include/openthread/** |
src/openthread/ |
mbedtls/include/mbedtls/, include/psa/ |
src/mbedtls/, src/psa/ |
| `mbedtls/library/*.c | *.h` |
Excluded: build files, src/cli, src/ncp, src/posix, src/lib
(spinel/hdlc), tcplp (TCP is disabled), and
src/core/instance/extension_example.cpp (a template upstream excludes too —
Arduino would otherwise compile it).
src/openthread-core-config.h— defaultsOPENTHREAD_PROJECT_CORE_CONFIG_FILEto"arduino-ot-config.h". This is the official project-config hook; it is normally set with-D, which Arduino cannot do. Every core source includes this header first, so the whole configuration flows fromsrc/arduino-ot-config.h.src/mbedtls/mbedtls_config.h— replaced with OpenThread'sthird_party/mbedtls/mbedtls-config.h(same reason:MBEDTLS_CONFIG_FILEcannot be injected). The config self-adapts to the OT feature set.src/arduino-ot-config.h— not a patch but the platform's build configuration: FTD device type, software MAC (CSMA/retransmit/ack-timeout/TX-security in the sub-MAC, matching the radio'sOT_RADIO_CAPS_NONE), microsecond timer enabled, CSL/TCP off, logging to the platform sink. Also definesPACKAGE_NAME/PACKAGE_VERSIONthat OT's build system would normally inject.
- Clone the new OpenThread, note the mbedtls submodule SHA
(
git ls-tree HEAD third_party/mbedtls/repo), and fetch mbedtls at it. - Re-run the copy mapping above into a scratch tree; delete
instance/extension_example.cpp. - Re-apply the two header patches (diff them first — both files are small and
change rarely) and keep
arduino-ot-config.has is. - Rebuild the examples; fix any new platform API (
otPlat*) the core grew — that surface lives insrc/platform_impl.cppandsrc/ot_radio_nrf52840.cpponly.