Im tying to setup a custom brownout detection intterupt on an ESP32.
I have added a large storage cap to the 3.3v VCC so I should have at least half a second from brownout dtection to the flash ship hitting minimum vcc.
I want to save a short piece of data to the internal flash after brownout detection, i have found out how to disable the default brownout trigger, but can't find out how to attach a custom function to the brownout etection.
Any help would be appricated.
many thanks
Edward
See if this link helps you out... Had it bookmarked, but eyes are tired and I can't re-read it... I think they do this...
Hi Jkwilborn,
Thanks for the sugestion. Unfortunatly, I've already tried the code in that thread, it doesn't compile. I'm asuming the API has been changed since that post.
I'm leaning towards it not being possible (maybe anymore). But I would love to be proven wrong.
Thanks
Edward
What kind of compilation errors do you get?
The code to set the interrupt vector was in the links code, I thought....
Maybe you should post the code you are working with...
I will not guarantee you will find an answer, but a well-constructed Google search is helpful at the beginning of research:
"Arduino" "brownout" "interrupt" site:ESP32.com - Google Search
The other helpful thing is that Espressif has their own Arduino reference:
Getting Started — Arduino-ESP32 2.0.6 documentation (espressif.com)
Finally, Espressif has their own Arduino forum:
ESP32 Arduino - ESP32 Forum
Most Sample code is in IDF, but you can typically incorporate into Arduino source calls:
Sample Code - ESP32 Forum
yeah, belive it or not. I do actually know how to use a search engine.
The ESP32 documentaiton doesn't cover a bunch of the lower level commands. The technical reference manual shows commands not documented anywhere else, so there is no information on how to implement them.
I've posted on the ESP 32 forum but that formum is basically dead, and there is no sample code for anything other than disabling the brownout built in functions.
Agreed.
The ESP32 dude that wrote much of the Arduino core routines says:
Is brownout detection usable now? - Page 2 - ESP32 Forum
When brownout is detected, it is very likely that reliable flash writes are already impossible (unless you have a 1.8V capable part). In fact, in many cases it is the flash chip that browns out first.
Now, the above being said in 2018 does not imply the same would be said at the close of 2022.
Since you are proficient with Internet searches, I'll leave that effort to you. I rather suspect you will need to look through the source-code or will need a new attack vector, maybe using external FRAM storage to be updated regularly by a timer... with 10^15 write cycles, you could update at sub-second intervals to retain a near-reatime value.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.