鱼香ROS社区
    • 版块
    • 最新
    • 未解决
    • 已解决
    • 群组
    • 注册
    • 登录
    紧急通知:禁止一切关于政治&VPN翻墙等话题,发现相关帖子会立马删除封号
    提问前必看的发帖注意事项: 社区问答规则(小鱼个人)更新 | 高质量帖子发布指南

    在烧录时出现了一些问题

    已定时 已固定 已锁定 已移动 未解决
    综合问题
    编译出错 烧录失败
    2
    2
    356
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • 1
      zxy
      最后由 编辑

      我在编译和烧录时遇到了一些问题在编写hello world程序时
      背景

      我编译后写着这样一句话“======================================== [SUCCESS] Took 4.23 seconds =========================================

      • 终端将被任务重用,按任意键关闭。 ”我不知道这里运行是否正常(这里我已经禁用占用项了)
        然后我就插上板子进行了烧录,烧录完写着这样一句话“正在执行任务: platformio run --target upload

      Processing featheresp32 (platform: espressif32; board: featheresp32; framework: arduino)

      Verbose mode can be enabled via -v, --verbose option
      CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/featheresp32.html
      PLATFORM: Espressif 32 (6.6.0) > Adafruit ESP32 Feather
      HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
      DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
      PACKAGES:

      • framework-arduinoespressif32 @ 3.20014.231204 (2.0.14)
      • tool-esptoolpy @ 1.40501.0 (4.5.1)
      • tool-mkfatfs @ 2.0.1
      • tool-mklittlefs @ 1.203.210628 (2.3)
      • tool-mkspiffs @ 2.230.0 (2.30)
      • toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
        LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
        LDF Modes: Finder ~ chain, Compatibility ~ soft
        Found 33 compatible libraries
        Scanning dependencies...
        No dependencies
        Building in release mode
        Retrieving maximum program size .pio/build/featheresp32/firmware.elf
        Checking size .pio/build/featheresp32/firmware.elf
        Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
        RAM: [= ] 6.5% (used 21408 bytes from 327680 bytes)
        Flash: [== ] 20.1% (used 263705 bytes from 1310720 bytes)
        Configuring upload protocol...
        AVAILABLE: cmsis-dap, esp-bridge, esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
        CURRENT: upload_protocol = esptool
        Looking for upload port...

      Warning! Please install 99-platformio-udev.rules.
      More details: https://docs.platformio.org/en/latest/core/installation/udev-rules.html

      Auto-detected: /dev/ttyS0
      Uploading .pio/build/featheresp32/firmware.bin
      esptool.py v4.5.1
      Serial port /dev/ttyS0

      A fatal error occurred: Could not open /dev/ttyS0, the port doesn't exist
      *** [upload] Error 2
      ========================================= [FAILED] Took 6.86 seconds =========================================

      • 终端进程“platformio 'run', '--target', 'upload'”已终止,退出代码: 1。
      • 终端将被任务重用,按任意键关闭。 ”
        我察觉到了不对劲,然后我以为还是占用项那里的问题,于是进行了卸载占用项处理,重新编译烧录,问题还是没有解决
        问题:
        我现在不知道如何解决
      小鱼小 1 条回复 最后回复 回复 引用 0
      • 小鱼小
        小鱼 技术大佬 @1209070035
        最后由 编辑

        @1209070035

        您遇到的问题主要集中在两个部分:编译过程和烧录过程。

        1. 编译过程:
          您的编译过程显示为“[SUCCESS]”,这意味着您的代码已经成功编译成可执行文件(.elf和.bin文件)。编译阶段没有问题,您的代码已正确转换成设备可执行格式。

        2. 烧录过程:
          烧录过程中出现了错误,错误信息为:“A fatal error occurred: Could not open /dev/ttyS0, the port doesn't exist”。这表明您尝试连接的串行端口/dev/ttyS0不存在。这可能是由几个原因造成的:

          • 设备未正确连接:请确认您的ESP32设备已经通过USB连接到计算机,并且连接稳定。
          • 端口选择错误:在某些情况下,PlatformIO可能错误地选择了一个不存在的端口。您可以尝试查看系统中实际存在的串行端口列表,确认哪个是ESP32设备连接的端口。您可以在命令行中使用ls /dev/tty*查看可用的串行端口。

        解决步骤:

        • 确认ESP32设备已经正确连接到计算机。
        • 确认设备使用的端口。在PlatformIO的项目配置文件(platformio.ini)中,您可以手动设置使用的端口,例如:
        [env:featheresp32]
        platform = espressif32
        board = featheresp32
        framework = arduino
        upload_port = /dev/ttyUSB0  ; 根据您的实际端口修改这里
        
        • 重新尝试烧录。

        如果您完成以上步骤后仍然遇到问题,请提供更多信息,例如操作系统环境和具体的硬件连接细节,以便进一步诊断。

        新书配套视频:https://www.bilibili.com/video/BV1GW42197Ck/

        1 条回复 最后回复 回复 引用 0
        • 第一个帖子
          最后一个帖子
        皖ICP备16016415号-7
        Powered by NodeBB | 鱼香ROS