Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic connection to AI Thinker module reporting serial noise or corruption despite consistent responses (ESPTOOL-436) #731

Closed
1 task done
lonerzzz opened this issue Mar 31, 2022 · 9 comments

Comments

@lonerzzz
Copy link

lonerzzz commented Mar 31, 2022

Operating System

Windows 10

Version

latest master

Python Version

Using binary of esptool 3.3, python not showing on command line

Chip Description

ESP32-C3-12F module

Device Description

Custom but very simple board with TX and RX exposed

Hardware Configuration

No, the board is a custom board but only the module is currently attached to it.

How is Esptool Run

Command line

Full Esptool Command Line that Was Run

"E:\Program Files\Programming\Arduino_IDE\Arduino15\packages\esp32\tools\esptool-v3.3-win64\esptool" --chip esp32c3 --port "COM5" --trace --baud 115200 --connect-attempts 1 chip_id

Esptool Output

C:\WINDOWS\system32>"E:\Program Files\Programming\Arduino_IDE\Arduino15\packages\esp32\tools\esptool-v3.3-win64\esptool" --chip esp32c3 --port "COM5" --trace --baud 115200 --connect-attempts 1 chip_id
esptool.py v3.3
Serial port COM5
Connecting...TRACE +0.000 command op=0x08 data len=36 wait_response=1 timeout=0.100 data=
    0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    55555555                          | UUUU
TRACE +0.001 Write 46 bytes:
    c000082400000000 0007071220555555 | ...$........ UUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    5555555555555555 5555555555c0     | UUUUUUUUUUUUU.
TRACE +0.010 Read 1 bytes: c0
TRACE +0.006 Read 39 bytes:
    0824070712205555 5555555555555555 | .$... UUUUUUUUUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    555555555555c0                    | UUUUUU.
TRACE +0.000 Received full packet:
    0824070712205555 5555555555555555 | .$... UUUUUUUUUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    555555555555                      | UUUUUU
TRACE +0.111 Serial data stream stopped: Possible serial noise or corruption.
.TRACE +0.108 command op=0x08 data len=36 wait_response=1 timeout=0.100 data=
    0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    55555555                          | UUUU
TRACE +0.000 Write 46 bytes:
    c000082400000000 0007071220555555 | ...$........ UUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    5555555555555555 5555555555c0     | UUUUUUUUUUUUU.
TRACE +0.011 Read 1 bytes: c0
TRACE +0.005 Read 39 bytes:
    0824070712205555 5555555555555555 | .$... UUUUUUUUUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    555555555555c0                    | UUUUUU.
TRACE +0.003 Received full packet:
    0824070712205555 5555555555555555 | .$... UUUUUUUUUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    555555555555                      | UUUUUU
TRACE +0.122 Serial data stream stopped: Possible serial noise or corruption.
.TRACE +0.107 command op=0x08 data len=36 wait_response=1 timeout=0.100 data=
    0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    55555555                          | UUUU
TRACE +0.003 Write 46 bytes:
    c000082400000000 0007071220555555 | ...$........ UUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    5555555555555555 5555555555c0     | UUUUUUUUUUUUU.
TRACE +0.012 Read 1 bytes: c0
TRACE +0.009 Read 39 bytes:
    0824070712205555 5555555555555555 | .$... UUUUUUUUUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    555555555555c0                    | UUUUUU.
TRACE +0.001 Received full packet:
    0824070712205555 5555555555555555 | .$... UUUUUUUUUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    555555555555                      | UUUUUU
TRACE +0.114 Serial data stream stopped: Possible serial noise or corruption.
.TRACE +0.110 command op=0x08 data len=36 wait_response=1 timeout=0.100 data=
    0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    55555555                          | UUUU
TRACE +0.002 Write 46 bytes:
    c000082400000000 0007071220555555 | ...$........ UUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    5555555555555555 5555555555c0     | UUUUUUUUUUUUU.
TRACE +0.011 Read 1 bytes: c0
TRACE +0.005 Read 39 bytes:
    0824070712205555 5555555555555555 | .$... UUUUUUUUUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    555555555555c0                    | UUUUUU.
TRACE +0.002 Received full packet:
    0824070712205555 5555555555555555 | .$... UUUUUUUUUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    555555555555                      | UUUUUU
TRACE +0.122 Serial data stream stopped: Possible serial noise or corruption.
.TRACE +0.122 command op=0x08 data len=36 wait_response=1 timeout=0.100 data=
    0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    55555555                          | UUUU
TRACE +0.003 Write 46 bytes:
    c000082400000000 0007071220555555 | ...$........ UUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    5555555555555555 5555555555c0     | UUUUUUUUUUUUU.
TRACE +0.012 Read 1 bytes: c0
TRACE +0.008 Read 39 bytes:
    0824070712205555 5555555555555555 | .$... UUUUUUUUUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    555555555555c0                    | UUUUUU.
TRACE +0.001 Received full packet:
    0824070712205555 5555555555555555 | .$... UUUUUUUUUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    555555555555                      | UUUUUU
TRACE +0.117 Serial data stream stopped: Possible serial noise or corruption.
.

A fatal error occurred: Failed to connect to ESP32-C3: Serial data stream stopped: Possible serial noise or corruption.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html

More Information

When the module on the board is started, I can see the following coming from the serial port:

ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0xf (BROWNOUT_RST),boot:0xd (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:2
load:0x3fcd6100,len:0x147c
load:0x403ce000,len:0x91c
load:0x403d0000,len:0x2838
entry 0x403ce000
################################################
arch:ESP32C3, 3
compile_time:Ai-Thinker|B&T
ble_mac:34B4724fBDB6
wifi_mac:34B4724fBDB4
sdk_version:v4.3-beta3-195-g6be10fab0
firmware_version:2.2.0
compile_time:Jul 5 2021 13:46:35

ready

################################################

If I reset the unit into flash mode. I get the following so between the consistent byte output from the command supplied and the correct output, I believe the hardware connectivity is correct:

ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021rst:0xf (BROWNOUT_RST),boot:0x1 (SPI_DOWNLOAD_BOOT)
wait spi download

I have tried executing the esptool ... chip_id command in both modes just in case with no luck.

Is there a specific mode or setting to be able to talk to the AI thinker modules? Do they use the same protocol? I could not find any documentation indicating the same or different bootloader and or flashing methodologies.

Also regardless of the other details, the error about the serial noise should not be output until after a few attempts are made and the response comes back with different bit errors. In the case that the responses are exactly the same, I would highly doubt an issue with serial noise so that makes the error misleading.

Other Steps to Reproduce

No response

I Have Read the Troubleshooting Guide

  • I confirm I have read the troubleshooting guide.
@github-actions github-actions bot changed the title Basic connection to AI Thinker module reporting serial noise or corruption despite consistent responses Basic connection to AI Thinker module reporting serial noise or corruption despite consistent responses (ESPTOOL-436) Mar 31, 2022
@dobairoland
Copy link
Collaborator

Hi @lonerzzz. SPI_DOWNLOAD_BOOT doesn't seem right to me. Please check your pin connections in order to enter serial bootloader mode.

@radimkarnis
Copy link
Collaborator

I am concerned about the reset reason (BROWNOUT_RST). This means an insufficient power supply is used and the chip is browning out when being interrogated by esptool. Are these logs taken directly after disconnecting the board from power and connecting again?

@lonerzzz
Copy link
Author

@dobairoland Thanks for the reponse. The other boot mode that I can get into is the following:
Build:Feb 7 2021
rst:0xf (BROWNOUT_RST),boot:0x0 (USB_BOOT)
wait usb download

In both cases, the communications is only partial.

@lonerzzz
Copy link
Author

@radimkarnis Thanks for the help. The power is being cycled in order to get these logs out because no interactions seem to complete properly.

@lonerzzz
Copy link
Author

Also, what state is the module expected to be in to have the esptool talk to it for commands such as getting the chip_id, etc? Is it supposed to be in a particular boot mode?

@radimkarnis
Copy link
Collaborator

you should see this boot log:

rst:0x1 (POWERON),boot:0x4 (DOWNLOAD(USB/UART0/1))
waiting for download

probably some of the strapping pins described in the TRM are pulled.

@dobairoland
Copy link
Collaborator

Also, what state is the module expected to be in to have the esptool talk to it for commands such as getting the chip_id, etc?

https://docs.espressif.com/projects/esptool/en/latest/esp32c3/esptool/entering-bootloader.html

@lonerzzz
Copy link
Author

lonerzzz commented Mar 31, 2022

Thanks @radimkarnis, I was not seeing that mode as one that came up when I tried to enter flashing mode. Examining the board, I saw a small bit of solder flux between the castellated pins on the module. Once I removed that, this mode was printed out. For the reference of others, it would be helpful to add that snippet to the documentation that @dobairoland helpfully provided. I had read that "entering-bootloader" page but didn't know which text to expect when I was in the right mode and having that would be handy.

Lastly, I would again suggest that the comment about "Possible serial noise or corruption." only be printed after getting the different bit outputs as mentioned before so that it is not misleading. Alternatively, having the esptool detect the incorrect mode from the received bytes would also be helpful. Not knowing the header message output for the different modes, I do not know if this is possible.

This ticket can be closed from my standpoint.

Let me know if you want me to open enhancement tickets for these suggestions if you think that they might be implemented.

@radimkarnis
Copy link
Collaborator

Examining the board, I saw a small bit of solder flux between the castellated pins on the module

This actually happens quite often, even on professionally manufactured devkits. Glad you've noticed the issue!

For the reference of others, it would be helpful to add that snippet to the documentation

There is a boot log page in the documentation, that serves this exact purpose. Unfortunately, it currently exists only for ESP8266 and ESP32 targets. The ESP32 version could be more or less used in your case, but I agree we need to update it for ESP32-C3 and newer chips.

Alternatively, having the esptool detect the incorrect mode from the received bytes would also be helpful.

This is implemented, see here. I am not sure why this check didn't trigger in your case. You were supposed to see a Wrong boot mode detected (0x0)! The chip needs to be in download mode. message.

I would be grateful if you could open a feature request for the boot log docs page to be updated for newer chips! This is definitely something we should do. Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants