Core 0 panic'ed (Interrupt wdt timeout on CPU0) Error

chandan
Posts: 1
Joined: Wed Dec 08, 2021 8:45 am

Core 0 panic'ed (Interrupt wdt timeout on CPU0) Error

Postby chandan » Wed Dec 08, 2021 9:01 am

I am just using deep sleep function so that my board goes into fixed amount of sleep time and wake up to execute the main program again. When i run my code, the program runs completely fine, and at last board goes into deep sleep mode for 1 minute. and after 1 minutes, board gets in its Core 0 Panic'ed state and unable to run the program.
I am using esp32 pico based (M5atom matrix board). The micropython firmware version is v1.14 and i have tried v1.17 also.

Code: Select all

from machine import Pin, I2C, SoftI2C, SDCard
from time import sleep
import DS3231
import uos
from mpu6886 import MPU6886
import machine

i2c1 = SoftI2C(scl=Pin(21), sda= Pin(25))
sd = SDCard(slot =2, sck = Pin(23), mosi = Pin(19), miso = Pin(33), freq = 10000000)    # initialised SPI communication with sd card 
uos.mount(sd, "/sd")        # mount sd card to view, read and write in files, directories
# Values you can use to initialize the accelerometer. AFS_16G, means +-8G sensitivity, and so on
# Larger scale means less precision
AFS_2G = const(0x00)
AFS_4G = const(0x01)
AFS_8G = const(0x02)
AFS_16G = const(0x03)

# Values you can use to initialize the gyroscope. GFS_2000DPS means 2000 degrees per second sensitivity, and so on
# Larger scale means less precision
GFS_250DPS = const(0x00)
GFS_500DPS = const(0x01)
GFS_1000DPS = const(0x02)
GFS_2000DPS = const(0x03)

imu = MPU6886(i2c1, GFS_500DPS, AFS_4G)

i2c = I2C(0, scl = Pin(26), sda = Pin(32), freq= 400000)        # Initialised I2C communication to RTC module 

ds = DS3231.DS3231(i2c)                         # attached rtc module as ds object


p = imu.getAccelData()                  # get accelerator datas of x, y, & z axis 
dt = ds.DateTime()                      # get RTC date and time
sleep(1)
fdate = str(dt[2])+ "/"+str(dt[1])+"/"+str(dt[0])
ftime = str(dt[4])+ ":"+str(dt[5]) + ":"+str(dt[6])
steps = 0
sleep_time = 60
force_sleep =0
fname = str(dt[2])+str(dt[1])+str(dt[0])        # format date in dd/mm/yyyy

try:
    pa = open("/sd/countfile{}.txt".format(fname))       #TRY TO OPEN STEPS COUNT FILE TO GET PREVIOUS READINGS OF CURRENT DAY IS DATE NOT CHANGED. 
    step_count = pa.read()
    #print(step_count)
    t = int(step_count)
    #print(t)
except Exception as e:
    #print(e)
    pa = open("/sd/countfile{}.txt".format(fname),'w')       # if file doesn't exists, it create and insert zero as steps to start new count series for new day.
    step_count = 0
    pa.write(str(step_count))
    t = int(step_count)
finally:
    pa.close()                                           # finally closes the open document
steps = t

f = open("/sd/datafile{}.csv".format(fname), "a")       # open csv file store steps with x, y, z axis.
while True:
    a = imu.getAccelData()
    dt = ds.DateTime()
    fdate = str(dt[2])+ "/"+str(dt[1])+"/"+str(dt[0])
    ftime = str(dt[4])+ ":"+str(dt[5]) + ":"+str(dt[6])
    if abs(a[0]-p[0]>0.21):
        p =a
        steps +=1
        data = fdate + "," + ftime +"," + str(a[0]) + "," +str(a[1])+","+str(a[2]) +","+str(steps)
        print(data)
        f.write(data)
        f.write("\n")
        print("On")
        sleep(0.2)
        force_sleep = 0
    else:
        p = a
        print("no activity")
        force_sleep +=1
    if force_sleep ==20:
        force_sleep = 0
        print("stops recording & going into deepsleep")
        break
    sleep(0.5)
f.close()
t = steps
pa = open("/sd/countfile{}.txt".format(fname),'w')
pa.write(str(t))             #store updated total steps count of the day
pa.close()
uos.umount("/sd")
print("turn off")
machine.deepsleep(sleep_time*1000)
Here is the console error message which i am receiving :
rst:0x5 (DEEPSLEEP_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 188777542, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:5656
load:0x40078000,len:12696
load:0x40080400,len:4292
entry 0x400806b0
Guru Meditation Error: Core 0 panic'ed (Interrupt wdt timeout on CPU0).

Core 0 register dump:
PC : 0x4008240c PS : 0x00050034 A0 : 0x401d5096 A1 : 0x3ffbe470
A2 : 0x00020040 A3 : 0x3ffccd10 A4 : 0x40082d36 A5 : 0x3ffbe450
A6 : 0x00000000 A7 : 0x3ffbf680 A8 : 0x00050021 A9 : 0x40092474
A10 : 0x00000000 A11 : 0x00000000 A12 : 0x00000000 A13 : 0x3ffbe430
A14 : 0x00000000 A15 : 0x00000000 SAR : 0x00000020 EXCCAUSE: 0x00000005
EXCVADDR: 0x00000000 LBEG : 0x4000c46c LEND : 0x4000c477 LCOUNT : 0x00000000
Core 0 was running in ISR context:
EPC1 : 0x401d6663 EPC2 : 0x00000000 EPC3 : 0x00000000 EPC4 : 0x4008240c

Backtrace:0x40082409:0x3ffbe470 0x401d5093:0x3ffccd10 0x401d5404:0x3ffccd40 0x4016153f:0x3ffccd60 0x40161ccc:0x3ffccda0 0x400d7c6b:0x3ffcce00 0x400dfc09:0x3ffcce90 0x400e1cd1:0x3ffcceb0 0x400e443d:0x3ffcced0 0x400dbbc4:0x3ffccf70 0x400e1cd1:0x3ffccfa0 0x400e1cfa:0x3ffccfc0 0x400e1d6f:0x3ffccfe0 0x400fc111:0x3ffcd070 0x400fc403:0x3ffcd0a0 0x400e1e7e:0x3ffcd180 0x400e4759:0x3ffcd1c0 0x400dbbc4:0x3ffcd260 0x400e1cd1:0x3ffcd2b0 0x400e1cfa:0x3ffcd2d0 0x400ef093:0x3ffcd2f0 0x400ef411:0x3ffcd380 0x400ef475:0x3ffcd3a0 0x400d5499:0x3ffcd3c0
Core 1 register dump:
PC : 0x401d02c2 PS : 0x00060034 A0 : 0x800d4cca A1 : 0x3ffbc490
A2 : 0x3ffc3bf9 A3 : 0x00060020 A4 : 0x00060020 A5 : 0x00060023
A6 : 0x00000001 A7 : 0x00060723 A8 : 0x800d46c1 A9 : 0x3ffbc480
A10 : 0x00000003 A11 : 0x00060023 A12 : 0x00060020 A13 : 0x00000000
A14 : 0x00060020 A15 : 0x00000000 SAR : 0x0000001d EXCCAUSE: 0x00000005
EXCVADDR: 0x00000000 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000

Backtrace:0x401d02bf:0x3ffbc490 0x400d4cc7:0x3ffbc4b0 0x400929bc:0x3ffbc4d0


ELF file SHA256: 4e42143eec03262f

Rebooting...
ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 188777542, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:5656
load:0x40078000,len:12696
load:0x40080400,len:4292
entry 0x400806b0
Guru Meditation Error: Core 0 panic'ed (Interrupt wdt timeout on CPU0).

Core 0 register dump:
PC : 0x4008243b PS : 0x00050034 A0 : 0x40082d36 A1 : 0x3ffbe450
A2 : 0x3ffc3bf8 A3 : 0x00000000 A4 : 0x00050021 A5 : 0x40092474
A6 : 0x3ffbd514 A7 : 0x00000738 A8 : 0x4000bfdc A9 : 0x00000000
A10 : 0x00050021 A11 : 0x00000000 A12 : 0x00000001 A13 : 0x3ffb7ca0
A14 : 0x3ffb9a20 A15 : 0x3ffbd510 SAR : 0x00000020 EXCCAUSE: 0x00000005
EXCVADDR: 0x00000000 LBEG : 0x4000c46c LEND : 0x4000c477 LCOUNT : 0xffffffff
Core 0 was running in ISR context:
EPC1 : 0x401d6663 EPC2 : 0x00000000 EPC3 : 0x00000000 EPC4 : 0x4008243b

Backtrace:0x40082438:0x3ffbe450 0x40082d33:0x3ffbe470 0x4000bfed:0x3ffb7d10 0x40092409:0x3ffb7d20 0x400d443b:0x3ffb7d40 0x400d44bd:0x3ffb7da0 0x401d49f1:0x3ffb7dd0 0x4008a5dc:0x3ffb7df0
Core 1 register dump:
PC : 0x401d02c2 PS : 0x00060034 A0 : 0x800d4cca A1 : 0x3ffbc490
A2 : 0x3ffc3bf9 A3 : 0x00060020 A4 : 0x00060020 A5 : 0x00060023
A6 : 0x00000001 A7 : 0x00060723 A8 : 0x800d46c1 A9 : 0x3ffbc480
A10 : 0x00000003 A11 : 0x00060023 A12 : 0x00060020 A13 : 0x00000000
A14 : 0x00060020 A15 : 0x00000000 SAR : 0x0000001d EXCCAUSE: 0x00000005
EXCVADDR: 0x00000000 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000

Backtrace:0x401d02bf:0x3ffbc490 0x400d4cc7:0x3ffbc4b0 0x400929bc:0x3ffbc4d0


ELF file SHA256: 4e42143eec03262f

Who is online

Users browsing this forum: No registered users and 44 guests