I encountered this error while using ESP32. Whenever the serial port prints to Start up, this error occurs, causing a restart,please help me. enter image description here
This code implements the use of ESP32 to control the DC motor to pull the belt and lift the trash can lid. An infrared sensor is used to detect whether pedestrians are in front of the trash can and wait for two seconds. Then, a timer interrupt and various flag bits are used to control the opening and closing of each trash can.
Guru Meditation Error: Core 1 panic’ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x40084a68 PS : 0x00050031 A0 : 0x800856de A1 : 0x3ffbf39c
A2 : 0x00000010 A3 : 0x00018010 A4 : 0x000637ff A5 : 0x3ffbf37c
A6 : 0x00000000 A7 : 0x3ffbdc78 A8 : 0x00000000 A9 : 0x00000000
A10 : 0x0000c350 A11 : 0x003fffff A12 : 0x80081649 A13 : 0x3ffbf35c
A14 : 0x3ffc2b68 A15 : 0xfffffbff SAR : 0x00000005 EXCCAUSE: 0x0000001c
EXCVADDR: 0x800856ea LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000
Backtrace: 0x40084a65:0x3ffbf39c |<-CORRUPTED
ELF file SHA256: abe9752fff8c14b2
void loop()
{
Get_I2C();
if(Infrared_Flag){
if(Go_Flag){
Infrared_EN_Flag=false;
if(UP_Flag){
Motor_StopFlag=false;
Motor_GoFlag=true;
if(Check_UP_Flag){
Get_I2C();
Serial.print("Start_UP:");
Serial.print(" Angle= ");
Serial.println(Angle);
}
}
if(Down_Flag){
Motor_StopFlag=false;
Motor_BackFlag=true;
if(Check_Down_Flag){
Get_I2C();
Serial.print("Start_DN:");
Serial.print(" Angle= ");
Serial.println(Angle);
}
}
}
}else{
Stay_Counter=0;
}
Serial.print("Angle= ");
Serial.println(Angle);
}// This is my loop function.
void IRAM_ATTR onTimer0()
{
if(Motor_StopFlag){
Motor_GoFlag = false;
Motor_BackFlag = false;
Motor1_OFF;
Motor2_OFF;
}
if(Motor_GoFlag){
Motor_StopFlag=false;
Motor2_ON;
Motor1_OFF;
}
if(Motor_BackFlag){
Motor_StopFlag=false;
Motor1_ON;
Motor2_OFF;
}
if (Infrared_Flag==true && (Motor_GoFlag || Motor_BackFlag)){
if(Motor_GoFlag && UP_Flag){
if(Angle<Angle_UP){
UP_Flag=false;
Throw_Flag=true;
Motor_StopFlag=true;
}
}else if(Motor_BackFlag && Down_Flag){
if(Angle>Angle_Down){
Down_Flag=false;
Go_Flag=false;
Infrared_EN_Flag=true;
Infrared_Flag=false;
Motor_StopFlag=true;
}
}
}
}
void IRAM_ATTR onTimer1()
{
if (I2C_Flag){
I2C_Counter+=1;
if(I2C_Counter>500) {
I2C_Flag=false;
I2C_Counter=0;
}
}
if(Stay_Flag==true){
Stay_Counter+=1;
if(Stay_Counter>1000) {
Go_Flag=true;
UP_Flag=true;
Check_UP_Flag=true;
Stay_Counter=0;
Stay_Flag=false;
}
}
if(Throw_Flag){
Throw_Counter+=1;
if(Throw_Counter>2500){
Throw_Flag=false;
Down_Flag=true;
Check_Down_Flag=true;
Throw_Counter=0;
}
}
if (Infrared_EN_Flag)
{
if (digitalRead(Infrared) == 1){
Infrared_Flag = true;
Stay_Flag=true;
}
else
Infrared_Flag = false;
}
}
void IRAM_ATTR onTimer2()
{
if(Check_UP_Flag){
Check_Counter+=1;
if(Check_Counter>1200){
Check_Counter=0;
Check_UP_Flag=false;
}
}
else if(Check_Down_Flag){
Check_Counter+=1;
if(Check_Counter>1000){
Check_Counter=0;
Check_Down_Flag=false;
}
}
}
>//These are my three timer interrupt functions.
Prompt me for memory access error,help me please!
user25358555 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.