[已解决] GATT CLIENT例程导致开发板持续重启

某某ESP32友
Posts: 25
Joined: Fri May 07, 2021 4:10 pm

[已解决] GATT CLIENT例程导致开发板持续重启

Postby 某某ESP32友 » Thu May 20, 2021 3:33 pm

WIN10系统,VSCODE+idf插件开发环境,IDF版本4.2.1,python3.8.9,开发板为ESP32 WROOM,编译烧录ble中的GATT CLIENT 和SERVER例程后,整板频繁掉电加电,现象就是持续听到USB口设备移除声音,此时找不到COM口,用VSCODE无法继续烧录。最后采取摁住EN键,使用烧录工具整片擦除的办法解决。
同样使用VSCODE+插件,这两个例程在原来python3.5 IDF4.0环境下无任何问题。
PS:这个问题我不理解的地方,USB不是U转串芯片CP2101负责吗,供电电路目测就是简单的ASM1117稳压芯片,就算是固件造成ESP32死机循环,是如何影响U转串芯片和电路工作的???BUG这么诡异的吗???

某某ESP32友
Posts: 25
Joined: Fri May 07, 2021 4:10 pm

Re: GATT CLIENT例程导致开发板持续重启

Postby 某某ESP32友 » Thu May 20, 2021 3:37 pm

串口打印信息如下:
PS D:\Users\Lenovo\esp\esp-idf\examples\bluetooth\bluedroid\ble\gatt_client> d:\Users\Lenovo\.espressif\python_env\idf4.2_py3.8_env\Scripts\python.exe D:\Users\Lenovo\esp\esp-idf\tools\idf.py -p COM3 monitor
Executing action: monitor
Running idf_monitor in directory d:\users\lenovo\esp\esp-idf\examples\bluetooth\bluedroid\ble\gatt_client
Executing "D:\Users\Lenovo\.espressif\python_env\idf4.2_py3.8_env\Scripts\python.exe D:\Users\Lenovo\esp\esp-idf\tools/idf_monitor.py -p COM3 -b 115200 --toolchain-prefix xtensa-esp32-elf- d:\users\lenovo\esp\esp-idf\examples\bluetooth\bluedroid\ble\gatt_client\build\gatt_client_demo.elf -m 'D:\Users\Lenovo\.espressif\python_env\idf4.2_py3.8_env\Scripts\python.exe' 'D:\Users\Lenovo\esp\esp-idf\tools\idf.py' '-p' 'COM3'"...
--- WARNING: GDB cannot open serial ports accessed as COMx
--- Using \\.\COM3 instead...
--- idf_monitor on \\.\COM3 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
Exception in thread Thread-2:
Traceback (most recent call last):
File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python38\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python38\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "D:\Users\Lenovo\esp\esp-idf\tools/idf_monitor.py", line 166, in _run_outer
self.run()
File "D:\Users\Lenovo\esp\esp-idf\tools/idf_monitor.py", line 373, in run
self.serial.open()
File "D:\Users\Lenovo\.espressif\python_env\idf4.2_py3.8_env\lib\site-packages\serial\serialwin32.py", line 64, in open
raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
serial.serialutil.SerialException: could not open port '\\\\.\\COM3': FileNotFoundError(2, '

就这么多,戛然而止

ESP_Gargamel
Posts: 786
Joined: Wed Nov 14, 2018 8:45 am

Re: GATT CLIENT例程导致开发板持续重启

Postby ESP_Gargamel » Fri May 21, 2021 9:55 am

你插件的版本是多少?你烧录完成后,不要用 vscode 的插件里的 monitor,直接用串口调试助手呢?当出问题后,设备管理器上,COM3 还在吗?如果在的话,还能用串口调试助手连上吗?只有这两个示例有问题?还是其他简单的示例,如 blink 也会这样?

某某ESP32友
Posts: 25
Joined: Fri May 07, 2021 4:10 pm

Re: GATT CLIENT例程导致开发板持续重启

Postby 某某ESP32友 » Fri May 21, 2021 12:09 pm

插件版本是1.0.3,应该是最新版本。
现在的状况不是例程本身运行的问题了,根据情况判断,是整个开发板在频繁的掉电加电,所以造成USB串口在不停的插拔,现象就是系统持续不断的播放USB设备移除的提示音。此时串口根本无法工作,打开串口软件也找不到USB串口。
我个人怀疑是固件BUG造成整个ESP32芯片瞬间短路,导致整个开发板供电线路重启,重启后芯片加电运行又短路,进入死循环,所以只有按住EN,使芯片停止运行,消除固件运行造成的短路,才能使USB串口正常工作,进而烧录或擦除。我认为真是这种情况,这应该算是一个芯片比较严重的硬件BUG了。

某某ESP32友
Posts: 25
Joined: Fri May 07, 2021 4:10 pm

Re: GATT CLIENT例程导致开发板持续重启

Postby 某某ESP32友 » Fri May 21, 2021 12:14 pm

将固件奉上,可以试一下是否如此,发现这固件好大啊,启用BLE,需要这么大的固件吗?稍微整合点别的岂不要超1M了
gatt_client_demo.zip
(420.54 KiB) Downloaded 910 times

ESP_Gargamel
Posts: 786
Joined: Wed Nov 14, 2018 8:45 am

Re: GATT CLIENT例程导致开发板持续重启

Postby ESP_Gargamel » Fri May 21, 2021 12:26 pm

所以先排除是 vscode 插件的问题。你是否试过其他 example?你使用的是什么开发板?

ESP_Gargamel
Posts: 786
Joined: Wed Nov 14, 2018 8:45 am

Re: GATT CLIENT例程导致开发板持续重启

Postby ESP_Gargamel » Fri May 21, 2021 12:30 pm

Code: Select all

I (423) cpu_start: Project name:     gatt_client_demo
I (428) cpu_start: App version:      v4.2.1-dirty
I (433) cpu_start: Compile time:     May 21 2021 16:59:43
I (440) cpu_start: ELF file SHA256:  1894b2cb098a6df7...
I (446) cpu_start: ESP-IDF:          v4.2.1-dirty
没有任何问题,请先排查你自己的开发板。

某某ESP32友
Posts: 25
Joined: Fri May 07, 2021 4:10 pm

Re: GATT CLIENT例程导致开发板持续重启

Postby 某某ESP32友 » Fri May 21, 2021 2:23 pm

核心板是wroom32,开发板是devkitv1,是直接用烧录工具烧录到0X10000吗?

某某ESP32友
Posts: 25
Joined: Fri May 07, 2021 4:10 pm

Re: GATT CLIENT例程导致开发板持续重启

Postby 某某ESP32友 » Fri May 21, 2021 2:35 pm

ESP_Gargamel wrote:
Fri May 21, 2021 12:30 pm

Code: Select all

I (423) cpu_start: Project name:     gatt_client_demo
I (428) cpu_start: App version:      v4.2.1-dirty
I (433) cpu_start: Compile time:     May 21 2021 16:59:43
I (440) cpu_start: ELF file SHA256:  1894b2cb098a6df7...
I (446) cpu_start: ESP-IDF:          v4.2.1-dirty
没有任何问题,请先排查你自己的开发板。
重启电脑,安装一个更新之后,问题就消失了,真是太诡异了。

某某ESP32友
Posts: 25
Joined: Fri May 07, 2021 4:10 pm

Re: GATT CLIENT例程导致开发板持续重启

Postby 某某ESP32友 » Sun May 23, 2021 5:25 am

居然是Micro usb接口的问题,出现类似情况,重新插拔一下,烧录完成就不会出现所描述问题,是板载的micro usb口,电脑端的USB口再插拔也没用,号神奇诡异的问题。

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 190 guests