LIFsCode / ELOC-3.0

Firmware for ELOC 3.0 Hardware
MIT License
2 stars 3 forks source link

Rework Logging to sd card to a RAM buffered mode #73

Open LIFsCode opened 5 months ago

LIFsCode commented 5 months ago

Direct writing to SD card has 2 major drawbacks:

  1. it adds a log of stack & performance penalty to all functions due to integration in ESP_LOG()
  2. it has a significant perfformance impact due to a lot of small size file writing

This can be reworked:

OOHehir commented 5 months ago

@LIFsCode I'm sure you've considered this..

Is the driving factor behind logging to the SD tracing bugs? If the output is buffered it won't be written to the SD card when a reset occurs so this output will be lost.. It seems RTC memory is persistent during resets but I don't know if thats a viable option.

As I say, I'm sure you've considered this, but just in case!

LIFsCode commented 5 months ago

@OOHehir I know that is a problem, either getting reliable and full log or getting good performance. That's why currently after every log message the buffer is flushed.

Regarding the RTC memory, thanks that's a really good hint but so far I don't have a proper idea how to use it since it is only accessible from core 0 (PRO CPU) which makes it kind of blind for core 1.

This is something to balance out.

OOHehir commented 2 months ago

@LIFsCode Might be of some use, 'noinit' DRAM should retain its value from resets.