marciot / esp32-dali-clock

An NTSC/PAL version of the 80s Dali Clock for the ESP32
GNU General Public License v3.0
117 stars 10 forks source link

Boot loop/crash with Espressif ESP32 Arduino core version 2.0.2 #5

Closed ncmreynolds closed 2 years ago

ncmreynolds commented 2 years ago

No video output with Espressif ESP32 Arduino core version 2.0.2. Enters a boot loop with an ledc error. Identical hardware/code works with ESP32 Arduino core v1.0.6, v2.0.0 and v2.0.1.

I'm aware this may actually be an issue with the ESP32 Arduino core that you cannot fix, but thought I'd raise it here as I don't have the background on the internals of the composite video code to be sure.

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:1 load:0x3fff0030,len:1184 load:0x40078000,len:12804 ho 0 tail 12 room 4 load:0x40080400,len:3032 entry 0x400805e4 E (37) ledc: requested frequency and duty resolution can not be achieved, try reducing freq_hz or duty_resolution. div_param=80 Guru Meditation Error: Core 1 panic'ed (IntegerDivideByZero). Exception was unhandled.

Core 1 register dump: PC : 0x4000d099 PS : 0x00060730 A0 : 0x800def62 A1 : 0x3ffb26e0
A2 : 0x0f424000 A3 : 0x00000000 A4 : 0x00000000 A5 : 0x00000000
A6 : 0x00060520 A7 : 0x00000001 A8 : 0x00000001 A9 : 0x00000000
A10 : 0x00000000 A11 : 0x0f424000 A12 : 0x00060520 A13 : 0x3ffb2680
A14 : 0x007bea90 A15 : 0x003fffff SAR : 0x00000001 EXCCAUSE: 0x00000006
EXCVADDR: 0x00000000 LBEG : 0x4008ab0d LEND : 0x4008ab1d LCOUNT : 0xffffffff

Backtrace:0x4000d096:0x3ffb26e00x400def5f:0x3ffb2700 0x400dc1ed:0x3ffb2740 0x400d315b:0x3ffb2780 0x400d33e1:0x3ffb27b0 0x400d3bf1:0x3ffb27d0 0x400dd9ce:0x3ffb2820

marciot commented 2 years ago

I agree this may be something with the Arduino code, but I can help you come up with a test case that demonstrates the problem. Can you try the following code and see if it reproduces the problem:

void setup() {
  Serial.begin(115200);

  Serial.printf("Initializing peripherals");
  // put your setup code here, to run once:
  periph_module_enable(PERIPH_I2S0_MODULE);
  rtc_clk_apll_enable(1,0x46,0x97,0x4,1);
}

void loop() {
  // put your main code here, to run repeatedly:
 Serial.printf("Looping");
 delay(1000);
}