Course: Learning LVGL, Module 1, Upload of Wifi Scan sketch failed, message –
Sketch uses 890333 bytes (67%) of program storage space. Maximum is 1310720 bytes.
Global variables use 43508 bytes (13%) of dynamic memory, leaving 284172 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.6
Serial port /dev/cu.usbserial-1120
Connecting….
Chip is ESP32-D0WD-V3 (revision v3.1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: d8:13:2a:7d:d9:d0
Uploading stub…
Running stub…
Stub running…
Changing baud rate to 921600
Changed.
A fatal error occurred: Unable to verify flash chip connection (Invalid head of packet (0x86): Possible serial noise or corruption.).
Failed uploading: uploading error: exit status 2
Hi.
That issue is related with the connection of the board with your computer.
Make sure you have the right board and COM port selected and that you’re using a proper USB cable.
In some boards, you may need to press the BOOT button right after clicking on the upload button.
Regards,
Sara
Hi.
The problem seems similar to an issue reported using an Apple Silicon Mac a while ago. I too sourced my ESP32 CYD from Amazon UK and the board indeed has an extra USB C connector between the TX/RX connector and the Micro USB port. The board is supplied with a USB C cable. In my case reverting to a micro USB connection has not solved my issue.
I verified the micro USB cable by connecting another ESP32 I used for your Smart Home course and successfully compiled and flashed the Wifi Scan sketch. During the test, I noticed that the connection was via Serial port /dev/cu.usbserial-0001 whereas the CYD board, was trying to use Serial port /dev/cu.usbserial-1120. I guess this value is set in the CYD firmware because the port selection is set during board selection and I can’t see how to. change it.
The BOOT button doesn’t solve the issue either.
Is it worth trying the VSCODE/Platform IO IDE?
Regards – John
Hi.
Maybe you need to install the CH340 drivers on your MAC computer?
Have you tried that?
You can try VS Code, and see if it has a different outcome: https://randomnerdtutorials.com/programming-esp32-cyd-cheap-yellow-display-vs-code/
Regards,
Sara
I asked Google Gemini how to load the driver and this is the reply:
How do you load CH340 drivers on an iMac with Apple Silicon?
Unfortunately, there’s no direct way to load CH340 drivers on an Apple Silicon Mac.
The CH340 is a USB-to-serial bridge chip commonly found in low-cost USB-to-serial adapters. Apple Silicon Macs use a different USB controller architecture that doesn’t natively support the CH340 driver.
However, there are a few workarounds you can try:
- Use a Different Adapter: If possible, use a different USB-to-serial adapter that Apple Silicon Macs natively supports. Some popular options include adapters based on the FT232X or CP210x chips.
- Virtual Machine: You could run a virtual machine with a Windows or Linux operating system on your Apple Silicon Mac. These operating systems typically have built-in support for CH340 drivers.
- External Device: Consider using an external device with built-in CH340 support. This could be a USB-to-serial adapter or a microcontroller board that includes a CH340.
Please note: Using a virtual machine or an external device might introduce additional complexity and potential performance overhead.
I’ll try using a Raspberry Pi.
Regards
John
Hello John, unfortunately that answer is completely incorrect. So, I recommend to ignore it.
The CH340 works under Mac with Apple Silicon (M chips), I have one myself and it works just fine.
- Does that USB cable work with other ESP32 boards? When you plug the board to your computer does it show a Port in the Arduino IDE (under TOOLS > PORT)?
- I recommend using this guide: https://sparks.gogo.co.nz/ch340.html