0

我在 Arduino(1.8.9)上收到此错误。

usage: esptool write_flash [-h] [--erase-all]
                       [--flash_freq {keep,40m,26m,20m,80m}]
                       [--flash_mode {keep,qio,qout,dio,dout}]
                       [--flash_size FLASH_SIZE]
                       [--spi-connection SPI_CONNECTION] [--no-progress]
                       [--verify] [--compress | --no-compress]
                       <address> <filename> [<address> <filename> ...]
esptool write_flash: error: argument <address> 
<filename>: [Errno 2] No such file or directory:'/home/USER/.arduino15/packages/esp32/hardware/esp32/1.0.2/tools/partitions/boot_app0.bin'
esptool write_flash: error: argument <address> <filename>: [Errno 2] No such file or directory: '/home/USER/.arduino15/packages/esp32/hardware/esp32/1.0.2/tools/partitions/boot_app0.bin'

虽然 boot_app0.bin 文件存在: 图片链接

4

2 回答 2

1

要解决此问题,您可以尝试编辑您可以在 esp 包目录中找到的 platform.txt 文件。

因此,您需要用下面编写的代码替换内部部分:

## 结合 gc 部分、档案和对象 recipe.c.combine.pattern={recipe.hooks.linking.prelink.1.pattern} & "{compiler.path}{compiler.c.elf.cmd}" { build.exception_flags} -Wl,-Map "-Wl,{build.path}/{build.project_name}.map" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -o "{build .path}/{build.project_name}.elf" -Wl,--start-group {object_files} "{archive_file_path}" {compiler.c.elf.libs} -Wl,--end-group "-L{build .path}" & {recipe.objcopy.hex.1.pattern}

这里的关键是开头的“{recipe.hooks.linking.prelink.1.pattern} &”和结尾的“& {recipe.objcopy.hex.1.pattern}”。之间的文本是 platform.txt 文件的一部分,您不需要更改。

以上适用于操作系统 Windows。在 OS Linux 中设置 {recipe.hooks.linking.prelink.1.pattern} ;" 和 "; {recipe.objcopy.hex.1.pattern}”。

它解决了我对 ESP8266 的问题,我希望它对你也有帮助。

参考链接https://www.eclipse.org/forums/index.php/t/1095090/

于 2020-04-26T18:13:49.433 回答
0

如果您使用的是 esptool。当您右键单击文件名时,请确保您使用下载按钮实际从 github 下载文件,而不是使用另存为选项。

于 2021-06-06T11:36:10.460 回答