Using ESP-IDF for C programming on WiPy
Some time ago I've decided to leave micropython and start development in C (University requirements..). As we all know WiPy 3.0 is based on ESP32, so I've tried to use ESP-IDF.
I got following error:
A fatal error occurred: Failed to connect to ESP32: Invalid head of packet (0x08)
I'm using WiPy 3.0 with FTDI USB converter on breadboard. I've installed all drivers for ftdi. Tried using Pycom branch of ESP-IDF. Still same problem.
Converter is connected to default pins on board.
Any ideas, why it is not working?
Maybe I should buy Expansion Board?
I did it, and it worked for me!
Thank you so much for pointing that out!
I was not able to flash my program via esp32-idf terminal as well due to the same time-out error, or sometimes (There is not serial data received).
When I connect P2 to GND, I get this error: flash read error x1000, which I think indicates an error while trying to access the flash mem.
When the P2 is not connected to GND, I do not see (Download_boot(UART...)), but instead, I see (SPI_fast_flash).
Any held in this is very appreciated.
@Mr-Admin P8 (GPIO2) has an internal Pull-Down. So if you leave it floating, it will read as 0.
I find (on LO1 module) that it requires both P2 and P8 to be at GND when RST happens to get the UART downloader to work.
And depending on the quality of your jumper connections (or rats nest...) it will work at up to 960000 (ish) baud, or only at 115200....
This post is deleted!
@EngeenerAtendee That#s good. However, if GND is connected between UART converted and WiPy, it should not matter on which side you connect P2 to GND.
You were right!
I achieved success after changing UART converter GND to WiPy GND. Now it works. Thanks!
@EngeenerAtendee If you connect P2 (which is GPIO0) to GND, open a terminal emulator (e.g. putty, .. ) with 115200 baud and push reset, you should see a message like:
rst:0x1 (POWERON_RESET),boot:0x3 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2)) waiting for download
If not, the device is not in download mode or connected wrong.
No difference. Timeout in firmware update mode and Invalid head of packets in normal mode.
@EngeenerAtendee Try to lower the baud rate with:
make ESPBAUD=230400 flash
In firmware update mode I have timeout problem.
I've connected P02 to GND and pushed reset. LED stopped blinking. I've run "make flash" and this error occurred:
/dev/cu.usbserial-AC0210YS failed to connect: Failed to connect to ESP32: Timed out waiting for packet header
@EngeenerAtendee You have to connect GPIO0 (=P2) to GND and push reset, to set the ESP32 into firmware update mode. Then firmware upload should work.