Olimex Support Forum

Microcontrollers => ESP32 => Topic started by: jorn on January 19, 2023, 04:27:43 PM

Title: olimex ESP32-EVB does not always boot correcty
Post by: jorn on January 19, 2023, 04:27:43 PM
sometimes after power on or after programming the EVB will not load the programmed code but hang on the UART boot.
Via the terminal I'll get: rst:0x1 (POWERON_RESET),boot:0xf (UART_BOOT(UART0))
read somewhere it could be because of pin 2 not being held low during boot.
I've got a REV.k here any ideas?
Title: Re: olimex ESP32-EVB does not always boot correcty
Post by: LubOlimex on January 19, 2023, 04:56:09 PM
What kind of code is loaded to the board? Can you try to insert some software delay around the start of your code?
Title: Re: olimex ESP32-EVB does not always boot correcty
Post by: jorn on January 20, 2023, 10:40:13 AM
In short the code reads in a sensor on gpio 16, when the sensor is high it will send and recieve data over serial to/from a barcode reader (RXD gpio 36 and TXD gpio 4, serial port 2). After that a UDP message will be send over ethernet and relay 1 will be triggered.
adding a delay to the start does not seem to work. I've tried 1s and 10s and in both cases I could still replicate the problem by pressing the reset button.
I'll try other code to see if I can replicate the problem.
-edit-
able to replicate problem with: https://github.com/espressif/arduino-esp32/blob/master/libraries/Ethernet/examples/ETH_LAN8720/ETH_LAN8720.ino
by pressing the reset button
-edit2-
only seems to happen when the barcode reader is (powered and) connected to the RX and TX pins
Title: Re: olimex ESP32-EVB does not always boot correcty
Post by: jorn on January 20, 2023, 01:44:50 PM
I've made a (temporary) fix/bodge in hardware to disconnect the RX and TX lines until the code is loaded.
This is done by putting a 2n2222 transistor in series with the TX and RX line. Then these transistors are connected to another 2n2222 acting as a not-gate.
The not-gate input is connected to gpio 14.
During boot the RX and TX will be 'disconnected' and when the code is ready to use the UART it wil pull GPIO 14 low.
I needed the not gate because all the pins I could use are pulled high on boot.
This seems to solve my problem for now.
p.s. I'm using these pins because I wanted to use the UEXT connector and not have to solder to the EVB
Title: Re: olimex ESP32-EVB does not always boot correcty
Post by: LubOlimex on January 20, 2023, 02:25:36 PM
Hmmmm maybe it is voltage difference between two grounds that affects the board?

Is the barcode reader powered form another source? Can you power it from the board (or power the board from the same source as the barcode reader)?
Title: Re: olimex ESP32-EVB does not always boot correcty
Post by: LubOlimex on January 20, 2023, 03:10:32 PM
Also you can try to use some of the other pins from the UART if you need just two out of 8 there. Just as test. UART can be re-defined to pins #5 and #6 for example (GPIO16 and GPIO17).
Title: Re: olimex ESP32-EVB does not always boot correcty
Post by: JohnS on January 20, 2023, 05:16:36 PM
Quote from: jorn on January 20, 2023, 10:40:13 AMonly seems to happen when the barcode reader is (powered and) connected to the RX and TX pins
Sounds like it may be feeding power (aka backfeeding) the board.

Add some schottky diodes?

John
Title: Re: olimex ESP32-EVB does not always boot correcty
Post by: jorn on January 23, 2023, 01:22:56 PM
Thanks for all the sugestions. Changing the TX pin to GPIO15 seems to fix the problem as well.