esp32 - idf命令
1.idf指令说明
D:\esp-ide-workspace\hello_world>idf.py Usage: idf.py [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]... ESP-IDF CLI build management tool. For commands that are not known to idf.py an attempt to execute it as a build system target will be made. Selected target: esp32 Options: --version Show IDF version and exit. --list-targets Print list of supported targets and exit. -C, --project-dir PATH Project directory. -B, --build-dir PATH Build directory. -w, --cmake-warn-uninitialized / -n, --no-warnings Enable CMake uninitialized variable warnings for CMake files inside the project directory. (--no- warnings is now the default, and doesn't need to be specified.) The default value can be set with the IDF_CMAKE_WARN_UNINITIALIZED environment variable. -v, --verbose Verbose build output. --preview Enable IDF features that are still in preview. --ccache / --no-ccache Use ccache in build. Disabled by default. The default value can be set with the IDF_CCACHE_ENABLE environment variable. -G, --generator [Ninja] CMake generator. --no-hints Disable hints on how to resolve errors and logging. -D, --define-cache-entry TEXT Create a cmake cache entry. This option can be used at most once either globally, or for one subcommand. -b, --baud INTEGER Baud rate for flashing. It can imply monitor baud rate as well if it hasn't been defined locally. The default value can be set with the ESPBAUD environment variable. This option can be used at most once either globally, or for one subcommand. -p, --port TEXT Serial port. The default value can be set with the ESPPORT environment variable. This option can be used at most once either globally, or for one subcommand. --help Show this message and exit. Commands: add-dependency Add dependency to the manifest file. For now we only support adding dependencies from the component registry. all Aliases: build. Build the project. app Build only the app. app-flash Flash the app only. bootloader Build only bootloader. bootloader-flash Flash bootloader only. build-system-targets Print list of build system targets. clean Delete build output files from the build directory. confserver Run JSON configuration server. create-component Create a new component. create-manifest Create manifest for specified component. create-project Create a new project. create-project-from-example Create a project from an example. delete-version (Deprecated) Deprecated! New CLI command: "compote component delete". Delete specified version of the component from the component registry. docs Open web browser with documentation for ESP-IDF efuse-common-table Generate C-source for IDF's eFuse fields. efuse-custom-table Generate C-source for user's eFuse fields. encrypted-app-flash Flash the encrypted app only. encrypted-flash Flash the encrypted project. erase-flash Erase entire flash chip. erase-otadata Erase otadata partition. flash Flash the project. fullclean Delete the entire build directory contents. gdb Run the GDB. gdbgui GDB UI in default browser. gdbtui GDB TUI mode. menuconfig Run "menuconfig" project configuration tool. monitor Display serial output. openocd Run openocd from current path pack-component (Deprecated) Deprecated! New CLI command: "compote component pack". Create component archive and store it in the dist directory. partition-table Build only partition table. partition-table-flash Flash partition table only. post-debug Utility target to read the output of async debug action and stop them. python-clean Delete generated Python byte code from the IDF directory read-otadata Read otadata partition. reconfigure Re-run CMake. save-defconfig Generate a sdkconfig.defaults with options different from the default ones set-target Set the chip target to build. show-efuse-table Print eFuse table. size Print basic size information about the app. size-components Print per-component size information. size-files Print per-source-file size information. uf2 Generate the UF2 binary with all the binaries included uf2-app Generate an UF2 binary for the application only upload-component (Deprecated) Deprecated! New CLI command: "compote component upload". Upload component to the component registry. If the component doesn't exist in the registry it will be created automatically. upload-component-status (Deprecated) Deprecated! New CLI command: "compote component upload-status". Check the component uploading status by the job ID.
2. 编译工程
idf.py build
3.下载固件
idf.py -p com3 falsh //通过串口COM3下载固件
4.擦除flash
idf.py -p com3 erase-flash
5.串口监视程序运行
idf.py -p com3 monitor //按Ctrl + ] 组合键推出monitor
6.工程配置
idf.py menuconfig