Skip to main content

tos.py idf Command Reference

Overviewโ€‹

tos.py idf forwards arguments to Espressif idf.py inside the ESP32 platform tree. Use it when you need native ESP-IDF workflows (menuconfig, fullclean, set-target, doctor, and so on) while staying in your TuyaOpen application directory.

Audience: Developers building ESP32 targets with TuyaOpen.

Requirements: Project must be configured for ESP32 (CONFIG_PLATFORM_CHOICE=ESP32 in app_default.config). Run tos.py config choice or tos.py config menu first.

Behaviorโ€‹

  1. Reads the resolved config (.build/cache/using.config) and verifies CONFIG_PLATFORM_CHOICE is ESP32.
  2. Resolves the ESP32 platform directory under TuyaOpen/platform/ESP32/.
  3. Builds the command idf.py, plus any --idf-flags, plus your subcommand and arguments.
  4. Runs the command with working directory platform/ESP32/tuya_open_sdk/, where the ESP-IDF project lives.

This is a passthrough: any valid idf.py subcommand and options that your installed ESP-IDF supports can be used.

Syntaxโ€‹

tos.py idf [OPTIONS] IDF_SUBCOMMAND [ARGS...]
OptionDescription
--idf-flags TEXTExtra tokens inserted after idf.py and before the subcommand (quoted string, shell-split). Example: -v, -D MY_MACRO=1.

Examplesโ€‹

tos.py idf menuconfig
tos.py idf fullclean
tos.py idf --idf-flags="-v" build
tos.py idf flash

Common errorsโ€‹

  • Project not configured โ€” Run tos.py config choice or tos.py config menu from the application directory.
  • Not ESP32 โ€” idf is rejected for other platforms; switch config or use the platform normal tos.py build flow.
  • Import or path errors โ€” Ensure ESP32 platform submodules and toolchain are installed (tos.py check, tos.py update).

See alsoโ€‹