Where is documentation on the brownout trigger?
Perhaps all the devices on-board with an ESP32 require a larger power supply. There seems to be a hardware and software discussion/solution for the ESP32 power (not verified) on this page...
Hardware (from above link):
For all my designs now I always provide both a 100nF and an 10uF capacitor right at the power pins of the module.
Software (from above link):
#include "soc/soc.h"
#include "soc/rtc_cntl_reg.h"
void setup(){
WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); //disable brownout detector
Which Arduino Board (UNOR3) are you using?
Official Hardware >> Kits >> Nesso N1
Hi @allenfr ,
Welcome to the forum..
It’s listed under other fatal errors..
try a different cable/port??
good luck.. ~q
Just in case you haven't got around it yet, I found the esp32 was detecting a brownout, but the cause was the Battery charge controller's watchdog timer (max 160seconds), which gets disabled automatically when using the M5Unified library.
I've seen this print in serial only a couple of times, but mostly it fails to say anything as it reboots (happens often):
E BOD: Brownout detector was triggered.
Turned out I needed to set the Watchdog timer for the battery charge chip to be disabled, otherwise the board reboots after 160s.
See
and the datasheet (search for 05h):
I used something like this: (DONT USE THIS - SEE END POST)
Wire.begin(SDA, SCL, 100000);
// verify chip id 0x49 at 0x0Ah
Wire.beginTransmission(0x49);
Wire.write(0x0A);
Wire.endTransmission();
Wire.requestFrom(0x49, 1);
uint8_t chipId = Wire.read();
if (chipId != 0x49) {
//WS_DEBUG_PRINTLN("ERROR: AW32001E not found on I2C bus!");
Wire.endTransmission();
Wire.end();
} else {
//WS_DEBUG_PRINTLN("AW32001E detected on I2C bus.");
// Disable AW32001E watchdog timer, read 05h, & 0x1F, write back
Wire.beginTransmission(0x49);
Wire.write(0x05);
Wire.endTransmission();
Wire.requestFrom(0x49, 1);
uint8_t regVal = Wire.read();
Wire.endTransmission();
// WS_DEBUG_PRINTLN("AW32001E WDT reg before disable: " + String(regVal, BIN));
delay(10);
regVal &=
0b00011111; // Clear bits 5:6 to disable Watchdog timer, 7 for discharge
Wire.beginTransmission(0x49);
Wire.write(0x05);
Wire.write(regVal);
Wire.endTransmission();
Wire.end();
delay(10);
battery.enableCharge();
}
Thanks (again) for sharing this. To share with this community as well, I've also now successfully utilised similar code to disable the WatchDog Timer (WDT) and prevent the unceremonious shutdowns.
Nice one for getting through it!
@ptillisch it would be great if the ExpanderPins.cpp or NessoBattery class could include some helper methods to disableWDT(bool whenCharging, bool whenDischarging), and possibly set the watchdog timer values for charging and discharging (probably less utilised).
It might also make sense to have a poke/prod/tickle/feedWDT so the user can easily utilise the watchdog timer by keeping it fed.
Similarly to @arduinash's definition + use of NessoBattery.begin, but I think it would make more sense to include a boolean flag (defaulted true) to begin. Begin would check the chipID and then calls disableWDT(true,true) if the argument dictated as such.
Doh, I should have checked, the code has been updated since last week, and there is now a comprehensive battery management API that was added in https://github.com/espressif/arduino-esp32/pull/12052 :
See here:
The talk is that it will be released as part of the next arduino-esp32 core, within the next fortnight.
It also contains details in the pull request link for unbricking your nesso if the battery got too low.
@tyeth it will be part of the next release, yes
we also bumped into a conflict between the Wire implementation vs M5GFX (the display backlight is controlled over lgfx::gpio and it seems to want to retain the i2c bus.
We’re already talking to M5, just giving you the heads up since you seem to be comfortable hacking your way through it.
New device, lots of users, new bugs for us ![]()