Thank you @MabezDev . As we were discussing the problem is caused by allocating too big chunk of data for Framebuffer for ESP32 on stack which causes overwrite of ROM functions which are in the middle of ESP32 memory. This issue is not present in ESP32-S2 and later version of chips since they do not have this type of ROM in the middle of address space.
The suggestion was to move framebuffer to static alloc to avoid allocation on the stack.
Thank you @MabezDev . As we were discussing the problem is caused by allocating too big chunk of data for Framebuffer for ESP32 on stack which causes overwrite of ROM functions which are in the middle of ESP32 memory. This issue is not present in ESP32-S2 and later version of chips since they do not have this type of ROM in the middle of address space.
The suggestion was to move framebuffer to static alloc to avoid allocation on the stack.
Closing PR.