November 24, 2024, 02:34:23 PM

How to get started with the ESP32-Pro

Started by Bumbum, November 19, 2021, 06:46:06 PM

Previous topic - Next topic

Bumbum

Hello,

I try to get started, but I have some problems. I want to use a ESP32-Pro Board and program the ESP32 only from the Arduino IDE. I have installed the Arduino Bootloader on the PIC32, but then I get stuck. I cannot connect to the ESP32. How do I upload my first Sketch to the ESP32?

thank you and best regards
Bumbum

Bumbum

Hello,

I have done some research to provide some more informations about my problem. I have flashed the Arduino Bootloader to the PIC32MX270F256D on my Olimex ESP32pro board from the following URL:

https://github.com/OLIMEX/Arduino_configurations/tree/master/PIC

I have used a PICkit3 and the MPLAB X IDE. The flashing went fine. After this step I can program the PIC in the Arduino IDE. I have choosen the pic32-default-firmware from the examples. This software seems to handover the USB serial to the ESP32.

I have tested this and it seems to work. I have connect to the Olimex COM-port by a terminal and controlled the DTR and RTS line manually from my PC. I can measure either 0 V or 3,3 V on R21 and 0,6 V or 3,3 V on R47 which seems to be fine according to the schematics of the Olimex ESP32Pro.

I then try to upload a simply sketch with code to send "Hello World" over the Serial. For this I have selected the ESP32 Dev Module as Board and select the COM-port of the Olimex board. But then the Arduino IDE is not able to connect to the ESP32. I see the .... ___ animation until I get a timeout.

Can somebody help what I am doing wrong?

best regards
Bumbum

LubOlimex

Technical support and documentation manager at Olimex

Bumbum

Hello LubOlimex,

thank you for your answer. I have the link for the bootloader from the official documentation for Arduino to this board:

https://www.olimex.com/Products/Duino/_resources/Arduino_instructions.pdf

If it is wrong, Olimex should add the correct link there. I cannot find your link anywhere in this document.

Nevertheless, I have flashed this bootloader to the PIC with MPLAB X IPE but still get no connection to the ESP32 in the Arduino IDE.

Then I treid to upload the pic32-default-firmware in the Arduino IDE (which source is also shown on your link), but still get no connection. As board I selected "Olimex PIC boards/ESP32-PRO"

After this, the "Connection Animation" to the ESP32 stopps at "Connection...." and nothing more is happening.

What am I doing wrong again?

best regards
Bumbum

JohnS

#4
deleted

LubOlimex

It seems to work out-of-the-box here. Probably something wrong in your drivers installation or Arduino IDE package installation. I will make you a video Monday.
Technical support and documentation manager at Olimex

LubOlimex

#6
You can find how it looks here in the 6 pictures that I uploaded here:

https://imgur.com/a/JDiY55X

Make sure it looks the same at your side.

This is ESP32-PRO without any modifications, taken directly from shop and plugged via microUSB cable to the PC.
Technical support and documentation manager at Olimex

Bumbum

Hello LubOlimex,

thank you, I can see the chipKIT device in my device-manager, selected the Olimex ESP32-EVB board in my Arduino IDE and the correct COM, but I am still not able to upload a programm. I also have tried to flash both bootloaders again, the one I tried first from the Olimex Arduino manual and the other one you have linked here. But this also does not help.

I guess my problem is here:

Quote from: LubOlimex on December 01, 2021, 04:25:38 PMThis is ESP32-PRO without any modifications, taken directly from shop and plugged via microUSB cable to the PC.

Because the Olimex manual told me to upload an other bootloader something is messed up. How can I get my Olimex Board to Factory defaults?

best regards
Bumbum

LubOlimex

Alright, I think the bootloader binary that is at the GitHub doesn't have the USB-serial program for the PIC32 on it. Basically you can program the PIC32 chip via Arduino but not the Arduino chip. So while you can see the PIC32 via the USB, the code send to the board is not transferred to the ESP32. To save some trouble I read the PIC32 of one of the working units and you can find it now here as ESP32-PRO-bootloader+serial-bridge.hex:

https://github.com/OLIMEX/ESP32-PRO/tree/master/SOFTWARE/PIC32_part_bootloader_MPLAB

Download this hex to the PIC32 board via your PIC programmer. Then try to program the ESP32 via Arduino IDE as you did previously. Follow again the pictures from my previous post. Let me know how it goes.
Technical support and documentation manager at Olimex

Bumbum

Hello Lub,

thank you for your efforts. Unfortunately it is still not working. Here some pictures of my steps, maybe you see the problem:

MPAL IPE

Device Manager

Arduino Upload Problem

best regards
Bumbum

LubOlimex

#10
One thing I immediately see is that the esptool is version v3.1 stable while it seems v3.0 developer version at your side. This means the ESP32 Arduino package that we used is different. I used 2.0, here you can see my packages and compare:

https://imgur.com/a/3tLxIhK

Edit: I will now try version 2.0.1 which seems to be the latest stable version.

I install the stable via the Board Manager, as detailed here:

https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html
Technical support and documentation manager at Olimex

Bumbum

Hello Lub,

I have updated my ESP-Board to 2.0.0 and are now able to upload code. Unfortunately it seems there is another problem, since I get no Serial output now:

Arduino Result

best regards
Bumbum

LubOlimex

Did you press "Enter" in the text box to send empty string? Try that.
Technical support and documentation manager at Olimex

Bumbum

Hello Lub,

thank you for this hint. This was the last piece of the puzzle. What a journey until here. Now everything seems to work as expected. Thank you, I have learned a lot of your board.

best regards
Bumbum

LubOlimex

#14
I thank you for your persistence, I will try to update the documentation to describe this process.

The difficulties are just the payoff for having both PIC32 and ESP32 in same design. It is much straight forward with boards that have just ESP32 or just PIC32, and we have a number of products with only each of them.

By the way, you can also program the PIC32 via Arduino. At the moment it has simple serial passthrough code (so you can program the ESP32 via USB), but for complex projects you can implement other extra code on top of the serial and utilize some of the PIC32 power. For final products, when final ESP32 software is downloaded you can even program the PIC32 with something else entirely. Programming the PIC32 via Arduino IDE requires the change of the state of PROG_EN1 jumper. When jumper is closed you can program the ESP32 via Arduino IDE, when it is open you can program the PIC32 via Arduino IDE.

The simple serial brodge for the PIC32 is this code: https://github.com/OLIMEX/ESP32-PRO/tree/master/SOFTWARE/PIC32_part_Arduino_IDE/PIC32_USB-Serial_Bridge/pic32-usb-serial

The hex we lastly made "ESP32-PRO-bootloader+serial-bridge.hex" contains both the bootloader and the bride code linked above.
Technical support and documentation manager at Olimex