LoginSignup
KenjiMaehara
@KenjiMaehara (Kenji maemae)

Are you sure you want to delete the question?

Leaving a resolved question undeleted may help others!

platformio + FT232HLでESP32のデバッグができない。

解決したいこと

platformio + FT232HLでESP32のデバッグができない現象が出ていて困っています。

この場合はどのようにしたらよいかなどご教示の程よろしくお願い致します。

例)
Ruby on RailsでQiitaのようなWebアプリをつくっています。
記事を投稿する機能の実装中にエラーが発生しました。
解決方法を教えて下さい。

自分で試したこと

こちらのサイトに出てきているエラー内容とほぼ同様の現象が起きています。

Zadigというソフトで検索した場合、(Interface 0)というのに"FT2232H MiniMoule"という表示が出てくるとのことですが、私のところではこれが出てきません。

なので、”%HOMEPATH%/.platformio/packages/tool-openocd-esp32/share/openocd/scripts/interface”以下のディレクトリ配下の「Dual RS232-HS」をgrepして置換する文字がわからない状態です。

スクリーンショット 2020-10-16 210247.png

スクリーンショット 2020-10-16 210313.png

(Interface0)という表示もありますが、Wireless Dongleなんていうのが表示されていて、FT2232H MiniMouleというのは全く出てきません。

追記1 2020年10月18日 15:59追記

https://www.m-kobayashi.org/working_log/2018/06/10_01.html
こちらのサイトなどを見ていて、そういえば、”Replace Driver”というボタンを押すのを忘れていたことに気づきました。

Inkedスクリーンショット 2020-10-16 210247_LI.jpg

ボタンを押して、インストール完了の表示が出た後、デバイスマネジャに、今まで出ていなかった”Single RS232-HS”の表示が出てくるようになりました。

Inkedスクリーンショット 2020-10-18 155609_LI.jpg

これでようやくデバッグできるようになるのかなと思い、デバッグを開始してみたところ、やはりエラーが出てきてしまいます。他にも行うべきことはありますでしょうか?

Inkedスクリーンショット 2020-10-18 160915_LI.jpg

Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (2.0.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (minimodule) External (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.10004.200129 (1.0.4) 
 - tool-esptoolpy 1.20600.0 (2.6.0) 
 - tool-openocd-esp32 1.1000.20190709 (10.0) 
 - toolchain-xtensa32 2.50200.80 (5.2.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 27 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <TFT_eSPI> 2.3.2
|   |-- <SPIFFS> 1.0
|   |   |-- <FS> 1.0
|   |-- <FS> 1.0
|   |-- <SPI> 1.0
|-- <ESP32 BLE Arduino> 1.0.1
Building in debug mode
Linking .pio\build\esp32dev\firmware.elf
Building .pio\build\esp32dev\firmware.bin
Retrieving maximum program size .pio\build\esp32dev\firmware.elf
Checking size .pio\build\esp32dev\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   4.8% (used 15860 bytes from 327680 bytes)
Flash: [==        ]  20.4% (used 267399 bytes from 1310720 bytes)
esptool.py v2.6
========================= [SUCCESS] Took 4.88 seconds =========================
Reading symbols from d:\githubFolder\lvglTest20201003\.pio\build\esp32dev\firmware.elf...
done.
PlatformIO Unified Debugger -> http://bit.ly/pio-debug
PlatformIO: debug_tool = minimodule
PlatformIO: Initializing remote target...
Open On-Chip Debugger  v0.10.0-esp32-20190708 (2019-07-08-11:04)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
adapter speed: 20000 kHz
Info : Configured 2 cores
esp32 interrupt mask on
Info : tcl server disabled
Info : telnet server disabled
Error: no device found
Error: unable to open ftdi device with vid 0403, pid 6010, description 'FT2232H MiniModule', serial '*' at bus location '*'

Warn : Flash driver of esp32.flash does not support free_driver_priv()
Warn : Flash driver of irom does not support free_driver_priv()
Warn : Flash driver of drom does not support free_driver_priv()
.pioinit:11: Error in sourced command file:
Remote communication error.  Target disconnected.: No error.
0

1Answer

デバイス・ドライバーがインストールされていないため、デバイスが認識されず、その一覧に表示されないのかも知れません。
同じ問題かどうか分かりませんが、この方はデバイス・ドライバーをインストールしたら、デバッグできたと言っています。
https://qiita.com/bishi/items/c753f2b24f46ad162936

0

Comments

  1. @KenjiMaehara

    Questioner
    回答頂きありがとうございます。
    教えて頂いたZadigのドライバのインストールで”Replace Driver”のボタンを押してなかったことに気づきました。

    デバイスドライバで”Single RS232-HS”が表示されるようになったことを確認できました。


    ただ、デバッグを開始すると依然と変わらずエラーが出てくる状態です。
    他に何かすべきことなどはありますか?
  2. Open On-Chip Debugger v0.10.0-esp32-20190708 (2019-07-08-11:04)
    Licensed under GNU GPL v2
    For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
    adapter speed: 20000 kHz
    Info : Configured 2 cores
    esp32 interrupt mask on
    Info : tcl server disabled
    Info : telnet server disabled
    Error: no device found
    Error: unable to open ftdi device with vid 0403, pid 6010, description 'FT2232H MiniModule', serial '*' at bus location '*'
    Warn : Flash driver of esp32.flash does not support free_driver_priv()
    Warn : Flash driver of irom does not support free_driver_priv()
    Warn : Flash driver of drom does not support free_driver_priv()
    .pioinit:11: Error in sourced command file:
    Remote communication error. Target disconnected.: No error.

    上記のエラーと下記のエラーは似てると思います。
    https://qiita.com/nishinohi/items/d1c1a517f26394c492c3#%E3%82%A8%E3%83%A9%E3%83%BC%E3%81%8C%E5%87%BA%E3%81%9F%E5%A0%B4%E5%90%88

    nishinohiさんはエラーに表示されたドライバ名「Dual RS232-HS」をZadigに表示されたドライバ名「FT2232H MiniModule」に置換したら上手く行ったと言っています。

    なので、あなたの場合、エラーに表示されたドライバ名「FT2232H MiniModule」をZadigに表示されたドライバ名「Single RS232-HS」に置換したら上手く行くのではないでしょうか?
  3. @KenjiMaehara

    Questioner
    回答頂きありがとうございます。助かります。
    C:\Users\kmaeh\.platformio\packages\tool-openocd-esp32\share\openocd\scripts\interface\

    こちらのフォルダ内にある”FT2232H MiniModule”という記述のあるファイルをVSCodeのReplace in Filesで検索して、”Single RS232-HS”に一括置換しました。

    そして、Debugを実行したところやはりエラーが出てきます。

    Open On-Chip Debugger v0.10.0-esp32-20190708 (2019-07-08-11:04)
    Licensed under GNU GPL v2
    For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
    adapter speed: 20000 kHz
    Info : Configured 2 cores
    esp32 interrupt mask on
    Info : tcl server disabled
    Info : telnet server disabled
    Error: no device found
    Error: unable to open ftdi device with vid 0403, pid 6010, description 'Single RS232-HS', serial '*' at bus location '*'

    Warn : Flash driver of esp32.flash does not support free_driver_priv()
    Warn : Flash driver of irom does not support free_driver_priv()
    Warn : Flash driver of drom does not support free_driver_priv()
    .pioinit:11: Error in sourced command file:
    Remote communication error. Target disconnected.: No error.


    他に方法などありますでしょうか?
  4. @KenjiMaehara

    Questioner
    回答頂きありがとうございます。助かります。
    C:\Users\kmaeh\.platformio\packages\tool-openocd-esp32\share\openocd\scripts\interface\

    こちらのフォルダ内にある”FT2232H MiniModule”という記述のあるファイルをVSCodeのReplace in Filesで検索して、”Single RS232-HS”に一括置換しました。


    Replace in Fileで検索されたファイルは
    ・minimodule-swd.cfg
    ・minimodule.cfg
    ・ftdi/minimodule-swd.cfg
    ・ftdi/minimodule.cfg

    これらのファイルにあった”FT2232H MiniModule”の記述を”Single RS232-HS”に一括置換しています。


    そして、Debugを実行したところやはりエラーが出てきます。

    Open On-Chip Debugger v0.10.0-esp32-20190708 (2019-07-08-11:04)
    Licensed under GNU GPL v2
    For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
    adapter speed: 20000 kHz
    Info : Configured 2 cores
    esp32 interrupt mask on
    Info : tcl server disabled
    Info : telnet server disabled
    Error: no device found
    Error: unable to open ftdi device with vid 0403, pid 6010, description 'Single RS232-HS', serial '*' at bus location '*'

    Warn : Flash driver of esp32.flash does not support free_driver_priv()
    Warn : Flash driver of irom does not support free_driver_priv()
    Warn : Flash driver of drom does not support free_driver_priv()
    .pioinit:11: Error in sourced command file:
    Remote communication error. Target disconnected.: No error.


    他に方法などありますでしょうか?
  5. @KenjiMaehara

    Questioner
    お世話になっております。この件に関しまして、デバッグができるようになりました。
    教えて頂いたサイト記事の”ハマリポイント3 設定ファイル”の項目の
    ~/.platformio/packages/tool-openocd-esp32/share/openocd/scripts/interface/ftdi/minimodule.cfg

    このファイル内容を

    interface ftdi
    ftdi_vid_pid 0x0403 0x6014
    ftdi_layout_init 0x0008 0x000b
    ftdi_layout_signal nSRST -data 0x0020 -oe 0x0020

    こちらの内容に修正したところ、エラーは出ず、デバッグに移行できるようになりました。

    助かります。

Your answer might help someone💌