Author Topic: Wierd crashing issue with ESP32  (Read 3413 times)

0 Members and 1 Guest are viewing this topic.

Offline MatCatTopic starter

  • Frequent Contributor
  • **
  • Posts: 377
  • Country: us
Wierd crashing issue with ESP32
« on: May 20, 2018, 11:20:24 pm »
I just got back a board for a deisgn I am  using ESP32 Wrover module,  I have an FTDI header for programming, DTR and RTS go to transistor pair as shown in espressif layouts, VCC from FTDI is not used.  Now here is the wierd part, Everything runs fine and stable IF I am not using WiFi, BUT as soon as I use WiFi, board becomes unstable and freezes or resets (with no FTDI plugged in), NOW IF I plug in the FTDI, all of a sudden WHAM everything works PERFECT, No crashing, no resetting, WiFi works like a champ.  Unplug the FTDI, and freeze or reset loops.  Turn off WiFi function and works just fine with or without FTDI.  Now even more wierd is the FTDI doesn't even need power!  I can plug it in with no USB going to it, and the board runs perfectly stable,  unplug it, crash.  Without the FTDI plugged in I measure infinite resistence from GND to DTR / RTS, with it plugged in and not powered I measure 35M from DTR and RTS to both VCC AND GND, which results in 2.5V potential on DTR / RTS with no power to FTDI.  I tried pull ups AND pull downs on DTR / RTS lines, makes no difference for stability.  So I am really stumped on this one.
« Last Edit: May 20, 2018, 11:25:08 pm by MatCat »
 

Offline lucazader

  • Regular Contributor
  • *
  • Posts: 221
  • Country: au
Re: Wierd crashing issue with ESP32
« Reply #1 on: May 21, 2018, 03:56:55 am »
You should check that the 3v3 line can sustain peak currents of 500mA at a minimum without dropping too low.
The esp32 has rather large current peaks.

The chip could be drawing just enough power from the DTR, CTS, TX and RX lines from the FTDI to sustain it'self when the wifi is on, compared to when the FTDI is disconnected.
I have had many issues over the years with debug UART lines supplying power to a device causing it to not reset, or have different behaviour during debugging.
 

Offline MatCatTopic starter

  • Frequent Contributor
  • **
  • Posts: 377
  • Country: us
Re: Wierd crashing issue with ESP32
« Reply #2 on: May 21, 2018, 06:13:27 am »
I could understand this if the FTDI was plugged in, but I don't understand how this could happen with in unpowered? (Granted it does suck in power from the other lines), The voltage isn't sagging, though it does get quite noisy
 

Offline MatCatTopic starter

  • Frequent Contributor
  • **
  • Posts: 377
  • Country: us
Re: Wierd crashing issue with ESP32
« Reply #3 on: May 21, 2018, 06:24:11 am »
So I gave it a try just to see, I hooked up the 3.3V rail to lab supply with 5A limit, it never drew more tehn 160mA (1117 onboard was also getting powered from 5V rail), so plenty enough current available but still same issues.
 

Online Psi

  • Super Contributor
  • ***
  • Posts: 9925
  • Country: nz
Re: Wierd crashing issue with ESP32
« Reply #4 on: May 21, 2018, 06:46:37 am »
Need full schematic.

Something about your DTS/RTS circuit doesn't sit right with me.
I know you said you tried pullup/down on DTR/RTS but need to scope the reset line to be sure that's not the issue.

Also check the ESP32 IO for any that are special purpose or used by the bootloader.
Maybe one IO is for an LED to show when WIFI is connected and you're trying to use it for something else :)



« Last Edit: May 21, 2018, 06:53:27 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline georges80

  • Frequent Contributor
  • **
  • Posts: 912
  • Country: us
Re: Wierd crashing issue with ESP32
« Reply #5 on: May 21, 2018, 03:48:12 pm »
Disconnect Collector of Q3 from your ESP reset input and see what happens - that will isolate all your FTDI 'stuff'.

Note, that WIFI can/does draw high peak currents, so looking at a power supply and saying it never draws more than xyz mA is not a valid measure. The PS will only display average current. You want to use a regulator that has fast transient response and also ensure you have enough bulk capacitance on the regulator output.

cheers,
george.
 

Offline lucazader

  • Regular Contributor
  • *
  • Posts: 221
  • Country: au
Re: Wierd crashing issue with ESP32
« Reply #6 on: May 21, 2018, 07:14:22 pm »
georges80 is right about the transient nature of wifi power draw.
If you put a current shunt in the circuit and looked at the current through it you would see very short spikes, in the order of 10s of uS, up to around the 500mA region.

In saying this, unless the wires you are using to hook up to your supply are terrible quality and have high resistance, with the 5A limit you mentioned i no longer think it is a power issue.
 
The following users thanked this post: julianhigginson

Offline MatCatTopic starter

  • Frequent Contributor
  • **
  • Posts: 377
  • Country: us
Re: Wierd crashing issue with ESP32
« Reply #7 on: May 21, 2018, 08:16:04 pm »
georges80 is right about the transient nature of wifi power draw.
If you put a current shunt in the circuit and looked at the current through it you would see very short spikes, in the order of 10s of uS, up to around the 500mA region.

In saying this, unless the wires you are using to hook up to your supply are terrible quality and have high resistance, with the 5A limit you mentioned i no longer think it is a power issue.
I really do not think it's a power issue either, I am using 1117 which is rated for 800mA, and only dropping down from 5V I have used them before on ESP32's with a TFT and haven't had a problem.  Even then it's stable with the FTDI plugged in BUT NOT POWERED, which means when it's plugged in it's not providing any more power then the 3.3V rail can push anyway.  I am starting to wonder if the PCB antenna itself is creating currents on the circuitry, since this design really isn't going to be using Wifi in production, and I didn't really do proper clearance on  the PCB GND plane like recommended.  As far as capacitance goes that was one of my very first thoughts and I soldered a 470uF directly to the ESP32 3.3V pin, made no difference.
 

Offline julianhigginson

  • Frequent Contributor
  • **
  • Posts: 783
  • Country: au
Re: Wierd crashing issue with ESP32
« Reply #8 on: May 22, 2018, 05:46:30 am »
how are you dealing with the serial port in firmware? interrupt driven?
And what does the cmos level serial line look like going from the ftdi chip to the ESP32? vs how it looks when disconnected?

if you are sending that line permanently low (or allowing it to flap around in the breeze)  is that being seen by the serial port peripheral as "data" which then causes interrupts to fire in order to process it, and then chokes out your WIFI related interrupts?
 

Offline MatCatTopic starter

  • Frequent Contributor
  • **
  • Posts: 377
  • Country: us
Re: Wierd crashing issue with ESP32
« Reply #9 on: May 22, 2018, 09:48:25 am »
how are you dealing with the serial port in firmware? interrupt driven?
And what does the cmos level serial line look like going from the ftdi chip to the ESP32? vs how it looks when disconnected?

if you are sending that line permanently low (or allowing it to flap around in the breeze)  is that being seen by the serial port peripheral as "data" which then causes interrupts to fire in order to process it, and then chokes out your WIFI related interrupts?
There is no code running to handle receive of serial, I think I did try pulldowns at one point on serial lines, but I may try that again, I am not checking for serial data or clearing it, I am not sure how Arduino ESP32 implementation handles that, though I have done a lot of code in the past where I use serial only for debugging info as is the case here, and never had that be an issue.   

Note that the FTDI being plugged in makes it stable EVEN IF the FTDI is NOT plugged into USB, I.E. just floating and left to whatever internal pullups and pull downs exist.
 

Offline MatCatTopic starter

  • Frequent Contributor
  • **
  • Posts: 377
  • Country: us
Re: Wierd crashing issue with ESP32
« Reply #10 on: May 22, 2018, 10:09:03 am »
I tried some pull downs on serial lines just for the heck of it, made no difference.
 

Offline julianhigginson

  • Frequent Contributor
  • **
  • Posts: 783
  • Country: au
Re: Wierd crashing issue with ESP32
« Reply #11 on: May 22, 2018, 10:19:40 am »
I'd try pull ups. CMOS serial is active low. But yeah, it was a guess.
Try connecting one line (plus ground) at a time between the processor and the ftdi module, and see if just one connection makes the pain go away.
 

Offline MatCatTopic starter

  • Frequent Contributor
  • **
  • Posts: 377
  • Country: us
Re: Wierd crashing issue with ESP32
« Reply #12 on: May 23, 2018, 02:47:37 am »
I'd try pull ups. CMOS serial is active low. But yeah, it was a guess.
Try connecting one line (plus ground) at a time between the processor and the ftdi module, and see if just one connection makes the pain go away.
OMG Why didn't I think of this!!!! I did this, and found RTS when connected alone made the system stable, all it's got going for it is 10M to 5V rail, that wasn't it, but then I got a thought, WHAT if I stick a cap on it?  Put 100nF, nothing ok kind of expected it, as there is nothing to feed the cap, so I put as 100k pull up with the cap (happened to have one on desk), and BAM, stable!
 

Offline julianhigginson

  • Frequent Contributor
  • **
  • Posts: 783
  • Country: au
Re: Wierd crashing issue with ESP32
« Reply #13 on: May 24, 2018, 06:18:48 am »
you're welcome!

knowing that's a thing to try comes from years of dealing with similar experiences.
 8)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf