谷动谷力

 找回密码
 立即注册
查看: 1204|回复: 0
打印 上一主题 下一主题
收起左侧

ESP idf 使用 编译配置工程

[复制链接]
跳转到指定楼层
楼主
发表于 2022-11-27 16:53:05 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
ESP idf 使用 编译配置工程

用idf.py 编译ESP工程,python脚本


idf.py --help
Usage: idf.py [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...  选项... 命令1【参数】...  命令2【参数】....

  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.

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|MinGW Makefiles]  // 选择生成器
                                  CMake generator.  //默认是CMake
  -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. 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
  app-flash                Flash the app only.  //仅烧录APP
  bootloader               Build only bootloader.  //仅编译bootloader
  bootloader-flash         Flash bootloader only. //仅烧录bootloader
  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.
  delete-version           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. Deprecated alias: "efuse_common_table".
  efuse-custom-table       Generate C-source for user's eFuse fields. Deprecated alias: "efuse_custom_table".
  encrypted-app-flash      Flash the encrypted app only.
  encrypted-flash          Flash the encrypted project.
  erase-flash              Erase entire flash chip. Deprecated alias: "erase_flash"
  erase-otadata            Erase otadata partition. Deprecated alias: "erase_otadata".
  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           Create component archive and store it in the dist directory.
  partition-table          Build only partition table. Deprecated alias: "parititon_table".
  partition-table-flash    Flash partition table only. Deprecated alias: "partition_table-flash".
  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. Deprecated alias: "read_otadata".
  reconfigure              Re-run CMake.
  set-target               Set the chip target to build.
  show-efuse-table         Print eFuse table. Deprecated alias: "show_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         Upload component to the component registry. If the component doesn't exist in the registry
                           it will be created automatically.
  upload-component-status  Check the component uploading status by the job ID.


用例:
查看idf版本
idf.py --version
ESP-IDF v4.4.3-dirty
我的版本是4.4.3
查看idf支持芯片
idf.py --list-targets
esp32
esp32s2
esp32c3
esp32s3

支持以上芯片
设置芯片型号
idf.py set-target esp32c3
设置芯片:esp32c3

配置工程
idf.py menuconfig

编译工程
idf.py all
编译整个工程

烧录程序
idf.py flash



+10
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|深圳市光明谷科技有限公司|光明谷商城|Sunshine Silicon Corpporation ( 粤ICP备14060730号|Sitemap

GMT+8, 2024-6-1 20:41 , Processed in 0.100439 second(s), 44 queries .

Powered by Discuz! X3.2 Licensed

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表