Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ISSUE Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
#1
Hello All,

I am working on a project having ESP32 as the brain.
Port: Lobo Micropython
The code has 4 different .py files being called in main.py. Module modem is frozen. I have successfully uploaded the files main.py and others. The code is given below:
Code:
    modem.poweron()                                                                                      
    modem.powercycle()                                                                              
    #time.sleep(15)
    #TTC Code, after power cycling the module starts 
    
    wait_time = 30000           #in miliseconds
    (status, TTC) = modem.connect(18,39,'y.com',wait_time)
    RSSI = modem.rssi()
    net_params = [str(TTC),str(RSSI)]

    if(status == True):
        print('Network connection established')
        flag=1
    else:
        print('Unable to establish network connection')
        flag=0
    
    if(flag==1):
        httpclient = modem.HttpClient()
        run(httpclient,count, net_params)


Everything works fine till the 'run' function (last line of above code). Which is given below:
Code:
def run(httpclient, count, net_params):
    get_attr = ['Server_Name', 'Lognum', 'LogTime_Mins']                                            #Attributes list to be acquired from server
    rtc = machine.RTC()

    url = "xxxxxxxxx"

    success, try_count = 0
    while((success==0)&(try_count<=5)):
        if(gsm.connect()):
            resp = json.loads((httpclient.get(url)).content)
            print(resp)
            success=1
        else:
            print('Unable to access network while downloading data...')        

    time_data = modem.synctime(rtc)                                                                        
    print('synced time is: ',time_data)                                                                  
    logtime = resp['LogTime_Mins']      
    compare_attr(json.dumps(resp))                                                                        
    sensordata = acq.data(acq)                                                               
    sensordata = process_data(sensordata,'PASS', resp['Lognum'])                              
    data = [str(sensordata)]+net_params
    modem.store(data, time_data)
    js_data_list = modem.AccumulateData(resp['Lognum'])
    count+=1
    modem.updatecount(count)
    print("update count: ", count)

    url_post = resp['Server_Name']+"/api/v1/"+ACCESS_TOKEN+"/telemetry"
    success, try_count=0
    while((success==0)&(try_count<=5)):
        if(gsm.connect()):
            for js_data in js_data_list:
                print('posting ', js_data)
                post_resp = httpclient.post(url_post, None, js_data).status_code
                print('post response status: ' ,post_resp)
            success=1
        else:
            print('Unable to access network while uploading data...')
        
    if(modem.shutdown()):                                                                           
        print("shutdown modem: Done")                                                               
        time.sleep(5)
        modem.poweroff()                                                                            
    
    sleepseconds = logtime*60                                                                        
    MSP.shutdownESP(sleepseconds)                                                               
    machine.deepsleep()

In the 'run' function, at modem.store function, it throws the error:

Quote:Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC      : 0x40139453  PS      : 0x00060f30  A0      : 0x800e4a9c  A1      : 0x3ffda880  
A2      : 0x00000000  A3      : 0x3ffb6b5c  A4      : 0x00000400  A5      : 0x00000000  
A6      : 0x00000000  A7      : 0x00000000  A8      : 0x80139430  A9      : 0x3ffda840  
A10     : 0x00000000  A11     : 0x00000000  A12     : 0x00000000  A13     : 0x00000000  
A14     : 0x00000000  A15     : 0x00000051  SAR     : 0x00000008  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x00000014  LBEG    : 0x4000c46c  LEND    : 0x4000c477  LCOUNT  : 0x00000000  

Backtrace: 0x40139453:0x3ffda880 0x400e4a99:0x3ffda8d0

Rebooting...


What I have tried till now?
1. Tried to reduce the size of 'modem' module, as it was around 20kb, I reduced it to 14kb. No improvement. Same error at the same location. Reduced the size of main.py also.
2. After commenting out line of code " modem.store(data, time_data)", the error popped up at next line "js_data_list = modem.AccumulateData(resp['Lognum'])"
3. When I commented out line : "js_data_list = modem.AccumulateData(resp['Lognum'])". Error popped up at "post_resp = httpclient.post(url_post, None, js_data).status_code"
4. When commented out the above, same error appeared at line "if(modem.shutdown()): ".

'store' and 'AccumulateData' methods store and retrieve data from same file, and calls gc.collect() in the end when the task completes. 'shutdown' method puts an AT command on a UART port of the ESP32. 

I know that this error comes up when the ESP program counter is trying to read the undesired memory location. What is the way around it? Are there any coding rules to be followed to avoid such errors? Your insights will be highly appreciated.

Thank you.
Reply
#2
Hello All,

I was able to resolve the issue. This might be a bug (though I'm not sure). So, I was using UART2 on ESP32 to communicate to a sensor. The Error comes when I put below line after the sensor communication is completed.

uart.deinit()
I removed this line and error didn't arise.

Previously, before Guru Meditation Error, I was receiving 'ValueError: Cannot stop UART task!' error, from the same line mentioned above. i modified the source code slightly as given here. The error was resolved, however, I got Guru Meditation Error after this. 

I hope someone can look into this method (uart.deinit()) and see if it can be resolved.

Thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)