<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[[Solved]Guru Meditation Error:]]></title><description><![CDATA[<p dir="auto">Hi, when I upload on M5Stack base,  the following sketch..</p>
<pre><code>/* Ultrasonic distance sensor example - Better Version

   Paul Carpenter, PC Services
   26-Jan-2017

   Update 4-Feb-2017 PC make variables more obvious
   Update 13-May-2017 PC add half bit rounding to distance calculation

   Uses HC-SR04 four pin ultrasonic sensor to continuously output distances
   found when in range (every second).

   Results WHEN valid output onto serial port at 115,200 baud

   Both LEDs ON when program starts and any other time for no start of echo
   received (probably bad wiring or faulty unit) on start up also serial port
   error string
    
   Lights RED Led when No Reading received or out of range
   Lights Yellow LED when too close (less than 5 cm)
   LEDs are connected via 330R or similar resistor other end of LED to GND

   Works on principle sound travels at 343.2 m/s in dry STILL air at 20 deg C

   So time per cm is 29.137529 micro seconds /cm

   For round trip (there and back)  58.275058 micro seconds /cm

   In order to reduce code size and execution time values are kept as integers
   and factor of 58 to calculate distances
*/

/* Pin definitions */
#define echopin     4
#define trigpin     5
#define redled      6
#define yellowled   7

/* time between readings in ms
   On Arduino Mega readings belown 20ms interval could 
   have residual echo issues */
#define INTERVAL    30

/* Scale factor round trip micro seconds per cm */
#define SCALE_CM    58
#define SCALE_CM_ROUND  (SCALE_CM/2)

/* Timeout for distance sensing rather than 1 second in us */
#define MAX_ECHO    300000
#define MIN_ECHO    (3 * SCALE_CM)

/* Timeout for start of ECHO pulse being received in us */
#define MAX_START_ECHO  1000

/* Limits for application ranges in cm */
#define MIN_RANGE   4
#define MAX_RANGE   500

#define MAX_ERROR 10

/* calculated distance in centimetres */
unsigned long distance;
unsigned int echotime;
unsigned long next_time, new_time;


/* Distance sensor function to get echo time
   Note most ultrasonic distance sensors are only usable beyond 3 cm
   So usable range is 3 * SCALE_CM to MAX_ECHO, therefore anything below
   3 * SCALE_CM should be treated as error

   Returns echo time in microseconds
        Maximum MAX_ECHO
        Minimum 3 * SCALE_CM    (minimum usable)
   error codes
        Error   2   Echo HIGH before start
        Error   1   Echo did not start
        Error   0   NO ECHO (Timeout)

   Timeout for measurements set by MAX_ECHO
*/
unsigned long GetEchoTime( )
{
unsigned long start_time;
unsigned long end_time;

/* check Echo if high return error */
if( digitalRead( echopin ) )
  return( 2 );
  
/* note start time */
start_time = micros( );

/* send the trigger pulse */
digitalWrite( trigpin, HIGH );
delayMicroseconds( 10 );
digitalWrite( trigpin, LOW );

/* Set timeout for start of echo pulse */
end_time = start_time + MAX_START_ECHO;

/* check ECHO pin goes high within MAX_START_ECHO
   if not return error of 1  */
while( !digitalRead( echopin ) )
   if( micros( ) &gt; end_time )
     return( 1 );

/* Check for Length of echo occurred or timeout */
start_time = micros( );
end_time = start_time + MAX_ECHO;
while( digitalRead( echopin ) )
   if( micros( ) &gt; end_time )
     break;
end_time = micros( );
     
/* Return time or timeout   */
return( ( start_time &lt; end_time ) ? end_time - start_time: 0 );
}


void setup( )
{
/* set time from reset */
next_time = INTERVAL;

Serial.begin( 115200 );

/* Configure pins and ensure trigger is OFF */
pinMode( trigpin, OUTPUT );
digitalWrite( trigpin, LOW );
pinMode( echopin, INPUT );

/* Configure LED drive and both LEDs On at start up */
pinMode( redled, OUTPUT );
pinMode( yellowled, OUTPUT );
digitalWrite( redled, HIGH );
digitalWrite( yellowled, HIGH );

/* Send signon message */
Serial.println( F( "PC Services - Better Range test" ) );

/* Do test reading to check if unit connected */
distance = GetEchoTime( );
if( distance &gt; 0 &amp;&amp; distance &lt;= 10 )
  {
  Serial.println( F( "No unit found - Error = " ) );
  Serial.println( distance );
  }
}


void loop( )
{
new_time = millis( );           /* check if to run this time */
if( new_time &gt;= next_time )
  {
  /* Turn LEDs Off */
  digitalWrite( redled, LOW );
  digitalWrite( yellowled, LOW );

  /* Calculate distance */
  echotime = GetEchoTime( );
  /* only scale valid readings 0 is timeout or 1 is no echo
     realistically minimum accurate or physical range is 3cm */
  if( echotime &gt; MAX_ERROR )
    {
    // Valid number covert to cm
    distance = echotime;
    distance += SCALE_CM_ROUND;  // add in half bit rounding  
    distance /= SCALE_CM;
    }

  /* catch errors first */
  if( echotime &lt;= MAX_ERROR || distance &gt; MAX_RANGE )
    {
    digitalWrite( redled, HIGH );               // Range error too large
    if( echotime &gt; 0 &amp;&amp; echotime &lt;= MAX_ERROR )
      digitalWrite( yellowled, HIGH );          // Light 2nd LED error
    }
  else
    if( distance &lt; MIN_RANGE )
      digitalWrite( yellowled, HIGH );          // Range too close
    else
      Serial.println( int( distance ) );        // In range output distance

  next_time = new_time + INTERVAL;       // save next time to run
  }
}
</code></pre>
<p dir="auto">I got this error... why?</p>
<pre><code>rst:0x1 (POWERON_RESET),boot:0x17 (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:0x3fff0018,len:4
load:0x3fff001c,len:1100
load:0x40078000,len:9220
load:0x40080400,len:6300
entry 0x400806a4
Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (Unhandled debug exception)
Debug exception reason: Stack canary watchpoint triggered (loopTask) 
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstructionGuru Meditation Error: Core  1 panic'ed (Interrupt wdt timeout on CPU1)
Guru Meditation Error: Core  1 panic'ed (Interrupt wdt timeout on CPU1)
Guru Meditation Error: Core  1 panic'ed (Interrupt wdt timeout on CPU1)
Guru Meditation Error: Core  1 panic'ed (Interrupt wdt timeout on CPU1)
Guru Meditation Error: Core  1 panic'ed (Interrupt wdt timeout on CPU1)
Guru Meditation Error: Core  1 panic'ed (Interrupt wdt timeout on CPU1)
Guru Meditation Error: Core  1 panic'ed (Interrupt wdt timeout on CPU1)
Guru Meditation Error: Core  1 panic'ed (Interrupt wdt timeout on CPU1)
Guru Meditation Error: Core  1 panic'ed (Double exception)

</code></pre>
]]></description><link>https://community.m5stack.com/topic/957/solved-guru-meditation-error</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 16:17:49 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/957.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 28 Apr 2019 08:15:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [Solved]Guru Meditation Error: on Tue, 30 Apr 2019 09:39:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ajb2k3" aria-label="Profile: ajb2k3">@<bdi>ajb2k3</bdi></a> Thanks a lot !</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cepics" aria-label="Profile: cepics">@<bdi>cepics</bdi></a>  "A custom ESP-WROOM-32 build without any flash chip added, so the existing GPIO6, GPIO7, GPIO8, GPIO9, GPIO10 and GPIO11 pins can be used to allow us to add a GD25Q127C (or similar) on our external circuit."</p>
]]></description><link>https://community.m5stack.com/post/4069</link><guid isPermaLink="true">https://community.m5stack.com/post/4069</guid><dc:creator><![CDATA[m5-docs]]></dc:creator><pubDate>Tue, 30 Apr 2019 09:39:16 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved]Guru Meditation Error: on Sun, 28 Apr 2019 18:10:33 GMT]]></title><description><![CDATA[<p dir="auto">tnks a lot!!!</p>
<p dir="auto">this one compile &amp; no error in serial monitor</p>
<pre><code>/* Ultrasonic distance sensor example - Better Version

   Paul Carpenter, PC Services
   26-Jan-2017

   Update 4-Feb-2017 PC make variables more obvious
   Update 13-May-2017 PC add half bit rounding to distance calculation

   Uses HC-SR04 four pin ultrasonic sensor to continuously output distances
   found when in range (every second).

   Results WHEN valid output onto serial port at 115,200 baud

   Both LEDs ON when program starts and any other time for no start of echo
   received (probably bad wiring or faulty unit) on start up also serial port
   error string
    
   Lights RED Led when No Reading received or out of range
   Lights Yellow LED when too close (less than 5 cm)
   LEDs are connected via 330R or similar resistor other end of LED to GND

   Works on principle sound travels at 343.2 m/s in dry STILL air at 20 deg C

   So time per cm is 29.137529 micro seconds /cm

   For round trip (there and back)  58.275058 micro seconds /cm

   In order to reduce code size and execution time values are kept as integers
   and factor of 58 to calculate distances
*/

/* Pin definitions */
#define echopin     21
#define trigpin     22
//#define redled      6
//#define yellowled   7

/* time between readings in ms
   On Arduino Mega readings belown 20ms interval could 
   have residual echo issues */
#define INTERVAL    30

/* Scale factor round trip micro seconds per cm */
#define SCALE_CM    58
#define SCALE_CM_ROUND  (SCALE_CM/2)

/* Timeout for distance sensing rather than 1 second in us */
#define MAX_ECHO    300000
#define MIN_ECHO    (3 * SCALE_CM)

/* Timeout for start of ECHO pulse being received in us */
#define MAX_START_ECHO  1000

/* Limits for application ranges in cm */
#define MIN_RANGE   4
#define MAX_RANGE   500

#define MAX_ERROR 10

/* calculated distance in centimetres */
unsigned long distance;
unsigned int echotime;
unsigned long next_time, new_time;


/* Distance sensor function to get echo time
   Note most ultrasonic distance sensors are only usable beyond 3 cm
   So usable range is 3 * SCALE_CM to MAX_ECHO, therefore anything below
   3 * SCALE_CM should be treated as error

   Returns echo time in microseconds
        Maximum MAX_ECHO
        Minimum 3 * SCALE_CM    (minimum usable)
   error codes
        Error   2   Echo HIGH before start
        Error   1   Echo did not start
        Error   0   NO ECHO (Timeout)

   Timeout for measurements set by MAX_ECHO
*/
unsigned long GetEchoTime( )
{
unsigned long start_time;
unsigned long end_time;

/* check Echo if high return error */
if( digitalRead( echopin ) )
  return( 2 );
  
/* note start time */
start_time = micros( );

/* send the trigger pulse */
digitalWrite( trigpin, HIGH );
delayMicroseconds( 10 );
digitalWrite( trigpin, LOW );

/* Set timeout for start of echo pulse */
end_time = start_time + MAX_START_ECHO;

/* check ECHO pin goes high within MAX_START_ECHO
   if not return error of 1  */
while( !digitalRead( echopin ) )
   if( micros( ) &gt; end_time )
     return( 1 );

/* Check for Length of echo occurred or timeout */
start_time = micros( );
end_time = start_time + MAX_ECHO;
while( digitalRead( echopin ) )
   if( micros( ) &gt; end_time )
     break;
end_time = micros( );
     
/* Return time or timeout   */
return( ( start_time &lt; end_time ) ? end_time - start_time: 0 );
}


void setup( )
{
/* set time from reset */
next_time = INTERVAL;

Serial.begin( 115200 );

/* Configure pins and ensure trigger is OFF */
pinMode( trigpin, OUTPUT );
digitalWrite( trigpin, LOW );
pinMode( echopin, INPUT );

/* Configure LED drive and both LEDs On at start up */
//pinMode( redled, OUTPUT );
//pinMode( yellowled, OUTPUT );
//digitalWrite( redled, HIGH );
//digitalWrite( yellowled, HIGH );

/* Send signon message */
Serial.println( F( "PC Services - Better Range test" ) );

/* Do test reading to check if unit connected */
distance = GetEchoTime( );
if( distance &gt; 0 &amp;&amp; distance &lt;= 10 )
  {
  Serial.println( F( "No unit found - Error = " ) );
  Serial.println( distance );
  }
}


void loop( )
{
new_time = millis( );           /* check if to run this time */
if( new_time &gt;= next_time )
  {
  /* Turn LEDs Off */
//  digitalWrite( redled, LOW );
 // digitalWrite( yellowled, LOW );

  /* Calculate distance */
  echotime = GetEchoTime( );
  /* only scale valid readings 0 is timeout or 1 is no echo
     realistically minimum accurate or physical range is 3cm */
  if( echotime &gt; MAX_ERROR )
    {
    // Valid number covert to cm
    distance = echotime;
    distance += SCALE_CM_ROUND;  // add in half bit rounding  
    distance /= SCALE_CM;
    }

  /* catch errors first */
  if( echotime &lt;= MAX_ERROR || distance &gt; MAX_RANGE )
    {
  //  digitalWrite( redled, HIGH );               // Range error too large
    if( echotime &gt; 0 &amp;&amp; echotime &lt;= MAX_ERROR )
   //   digitalWrite( yellowled, HIGH ); // Light 2nd LED error
   Serial.println("MAX");
    }
  else
    if( distance &lt; MIN_RANGE )
  //    digitalWrite( yellowled, HIGH ); // Range too close
     Serial.println("MIN");
    else
      Serial.println( int( distance ) );        // In range output distance

  next_time = new_time + INTERVAL;       // save next time to run
  }
}
</code></pre>
]]></description><link>https://community.m5stack.com/post/4045</link><guid isPermaLink="true">https://community.m5stack.com/post/4045</guid><dc:creator><![CDATA[cepics]]></dc:creator><pubDate>Sun, 28 Apr 2019 18:10:33 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved]Guru Meditation Error: on Sun, 28 Apr 2019 15:06:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cepics" aria-label="Profile: cepics">@<bdi>cepics</bdi></a> said in <a href="/post/4041">Guru Meditation Error:</a>:</p>
<blockquote>
<p dir="auto">#define redled      6<br />
#define yellowled   7</p>
</blockquote>
<p dir="auto">you cant use 5 to 11 as they are reserved for flash.</p>
<p dir="auto">change the lines to</p>
<pre><code>//#define redled 6
//#define yellowled 7
</code></pre>
<p dir="auto">This is the only difference between you working program an non working program.<br />
Github has a few errors of this type all connected to pins 5-11 and because the</p>
<p dir="auto">Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.<br />
has been triggered, it keeps crashing the Watchdog timer.<br />
Guru Meditation Error: Core  1 panic'ed (Interrupt wdt timeout on CPU1)</p>
]]></description><link>https://community.m5stack.com/post/4042</link><guid isPermaLink="true">https://community.m5stack.com/post/4042</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Sun, 28 Apr 2019 15:06:28 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved]Guru Meditation Error: on Sun, 28 Apr 2019 14:41:50 GMT]]></title><description><![CDATA[<p dir="auto">this code:</p>
<pre><code>/* Ultrasonic distance sensor example - Better Version

   Paul Carpenter, PC Services
   26-Jan-2017

   Update 4-Feb-2017 PC make variables more obvious
   Update 13-May-2017 PC add half bit rounding to distance calculation

   Uses HC-SR04 four pin ultrasonic sensor to continuously output distances
   found when in range (every second).

   Results WHEN valid output onto serial port at 115,200 baud

   Both LEDs ON when program starts and any other time for no start of echo
   received (probably bad wiring or faulty unit) on start up also serial port
   error string
    
   Lights RED Led when No Reading received or out of range
   Lights Yellow LED when too close (less than 5 cm)
   LEDs are connected via 330R or similar resistor other end of LED to GND

   Works on principle sound travels at 343.2 m/s in dry STILL air at 20 deg C

   So time per cm is 29.137529 micro seconds /cm

   For round trip (there and back)  58.275058 micro seconds /cm

   In order to reduce code size and execution time values are kept as integers
   and factor of 58 to calculate distances
*/

/* Pin definitions */
#define echopin     21
#define trigpin     22
#define redled      6
#define yellowled   7

/* time between readings in ms
   On Arduino Mega readings belown 20ms interval could 
   have residual echo issues */
#define INTERVAL    30

/* Scale factor round trip micro seconds per cm */
#define SCALE_CM    58
#define SCALE_CM_ROUND  (SCALE_CM/2)

/* Timeout for distance sensing rather than 1 second in us */
#define MAX_ECHO    300000
#define MIN_ECHO    (3 * SCALE_CM)

/* Timeout for start of ECHO pulse being received in us */
#define MAX_START_ECHO  1000

/* Limits for application ranges in cm */
#define MIN_RANGE   4
#define MAX_RANGE   500

#define MAX_ERROR 10

/* calculated distance in centimetres */
unsigned long distance;
unsigned int echotime;
unsigned long next_time, new_time;


/* Distance sensor function to get echo time
   Note most ultrasonic distance sensors are only usable beyond 3 cm
   So usable range is 3 * SCALE_CM to MAX_ECHO, therefore anything below
   3 * SCALE_CM should be treated as error

   Returns echo time in microseconds
        Maximum MAX_ECHO
        Minimum 3 * SCALE_CM    (minimum usable)
   error codes
        Error   2   Echo HIGH before start
        Error   1   Echo did not start
        Error   0   NO ECHO (Timeout)

   Timeout for measurements set by MAX_ECHO
*/
unsigned long GetEchoTime( )
{
unsigned long start_time;
unsigned long end_time;

/* check Echo if high return error */
if( digitalRead( echopin ) )
  return( 2 );
  
/* note start time */
start_time = micros( );

/* send the trigger pulse */
digitalWrite( trigpin, HIGH );
delayMicroseconds( 10 );
digitalWrite( trigpin, LOW );

/* Set timeout for start of echo pulse */
end_time = start_time + MAX_START_ECHO;

/* check ECHO pin goes high within MAX_START_ECHO
   if not return error of 1  */
while( !digitalRead( echopin ) )
   if( micros( ) &gt; end_time )
     return( 1 );

/* Check for Length of echo occurred or timeout */
start_time = micros( );
end_time = start_time + MAX_ECHO;
while( digitalRead( echopin ) )
   if( micros( ) &gt; end_time )
     break;
end_time = micros( );
     
/* Return time or timeout   */
return( ( start_time &lt; end_time ) ? end_time - start_time: 0 );
}


void setup( )
{
/* set time from reset */
next_time = INTERVAL;

Serial.begin( 115200 );

/* Configure pins and ensure trigger is OFF */
pinMode( trigpin, OUTPUT );
digitalWrite( trigpin, LOW );
pinMode( echopin, INPUT );

/* Configure LED drive and both LEDs On at start up */
pinMode( redled, OUTPUT );
pinMode( yellowled, OUTPUT );
digitalWrite( redled, HIGH );
digitalWrite( yellowled, HIGH );

/* Send signon message */
Serial.println( F( "PC Services - Better Range test" ) );

/* Do test reading to check if unit connected */
distance = GetEchoTime( );
if( distance &gt; 0 &amp;&amp; distance &lt;= 10 )
  {
  Serial.println( F( "No unit found - Error = " ) );
  Serial.println( distance );
  }
}


void loop( )
{
new_time = millis( );           /* check if to run this time */
if( new_time &gt;= next_time )
  {
  /* Turn LEDs Off */
  digitalWrite( redled, LOW );
  digitalWrite( yellowled, LOW );

  /* Calculate distance */
  echotime = GetEchoTime( );
  /* only scale valid readings 0 is timeout or 1 is no echo
     realistically minimum accurate or physical range is 3cm */
  if( echotime &gt; MAX_ERROR )
    {
    // Valid number covert to cm
    distance = echotime;
    distance += SCALE_CM_ROUND;  // add in half bit rounding  
    distance /= SCALE_CM;
    }

  /* catch errors first */
  if( echotime &lt;= MAX_ERROR || distance &gt; MAX_RANGE )
    {
    digitalWrite( redled, HIGH );               // Range error too large
    if( echotime &gt; 0 &amp;&amp; echotime &lt;= MAX_ERROR )
      digitalWrite( yellowled, HIGH );          // Light 2nd LED error
    }
  else
    if( distance &lt; MIN_RANGE )
      digitalWrite( yellowled, HIGH );          // Range too close
    else
      Serial.println( int( distance ) );        // In range output distance

  next_time = new_time + INTERVAL;       // save next time to run
  }
}
</code></pre>
<p dir="auto">give this error:</p>
<pre><code>rst:0x1 (POWERON_RESET),boot:0x17 (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:0x3fff0018,len:4
load:0x3fff001c,len:1100
load:0x40078000,len:9220
load:0x40080400,len:6300
entry 0x400806a4
Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.
Guru Meditation Error: Core  1 panic'ed (IllegalInstruGuru Meditation Error: Core  1 panic'ed (Interrupt wdt timeout on CPU1)
Guru Meditation Error: Core  1 panic'ed (Interrupt wdt timeout on CPU1)
Guru Meditation Error: Core  1 panic'ed (Interrupt wdt timeout on CPU1)
Guru Meditation Error: Core  1 panic'ed (Interrupt wdt timeout on CPU1)
Guru Meditation Error: Core  1 panic'ed (Interrupt wdt timeout on CPU1)
Guru Meditation Error: Core  1 panic'ed (Interrupt wdt timeout on CPU1)
Guru Meditation Error: Core  1 panic'ed (Interrupt wdt timeout on CPU1)
Guru Meditation Error: Core  1 panic'ed (Interrupt wdt timeout on CPU1)
Guru Meditation Error: Core  1 panic'ed (Double exception)

</code></pre>
<p dir="auto">tnks</p>
]]></description><link>https://community.m5stack.com/post/4041</link><guid isPermaLink="true">https://community.m5stack.com/post/4041</guid><dc:creator><![CDATA[cepics]]></dc:creator><pubDate>Sun, 28 Apr 2019 14:41:50 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved]Guru Meditation Error: on Sun, 28 Apr 2019 14:38:07 GMT]]></title><description><![CDATA[<p dir="auto">I already use the hc-sr04 on M5stack with this code:</p>
<pre><code>// defines pins numbers
const int trigPin = 22;
const int echoPin = 21;
// defines variables
long duration;
int distance;
void setup() {
pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
pinMode(echoPin, INPUT); // Sets the echoPin as an Input
Serial.begin(9600); // Starts the serial communication
}
void loop() {
// Clears the trigPin
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Reads the echoPin, returns the sound wave travel time in microseconds
duration = pulseIn(echoPin, HIGH);
// Calculating the distance
distance= duration*0.034/2;
// Prints the distance on the Serial Monitor
Serial.print("Distance: ");
Serial.println(distance);
}
</code></pre>
<p dir="auto">but I would like to test the "better version" one</p>
]]></description><link>https://community.m5stack.com/post/4040</link><guid isPermaLink="true">https://community.m5stack.com/post/4040</guid><dc:creator><![CDATA[cepics]]></dc:creator><pubDate>Sun, 28 Apr 2019 14:38:07 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved]Guru Meditation Error: on Sun, 28 Apr 2019 13:06:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cepics" aria-label="Profile: cepics">@<bdi>cepics</bdi></a> Shouldn't it then be 21 and 22 defined in the code?<br />
GPIO 6 and 7 are not broken out.<br />
I thought that in arduino that pin was also defined as the gpio number.<br />
21 and 22 are digital pins isn't the echopin analogue?</p>
]]></description><link>https://community.m5stack.com/post/4039</link><guid isPermaLink="true">https://community.m5stack.com/post/4039</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Sun, 28 Apr 2019 13:06:17 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved]Guru Meditation Error: on Sun, 28 Apr 2019 12:37:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ajb2k3" aria-label="Profile: ajb2k3">@<bdi>ajb2k3</bdi></a> said in <a href="/post/4036">Guru Meditation Error:</a>:</p>
<blockquote>
<p dir="auto">Where are you getting pins 4, 6, 7 from as they are not broken out anywhere?</p>
</blockquote>
<p dir="auto">I'm testing with pins 21 and 22 for the hc-sr04 and no ledconnected....</p>
]]></description><link>https://community.m5stack.com/post/4038</link><guid isPermaLink="true">https://community.m5stack.com/post/4038</guid><dc:creator><![CDATA[cepics]]></dc:creator><pubDate>Sun, 28 Apr 2019 12:37:33 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved]Guru Meditation Error: on Sun, 28 Apr 2019 08:59:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cepics" aria-label="Profile: cepics">@<bdi>cepics</bdi></a> said in <a href="/post/4035">Guru Meditation Error:</a>:</p>
<blockquote>
<p dir="auto">Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled</p>
</blockquote>
<p dir="auto">Unkown but seeing this pop up a few times on github with those pins.<br />
Try installing this arduino plugin and see what it says.<br />
<a href="https://github.com/me-no-dev/EspExceptionDecoder" target="_blank" rel="noopener noreferrer nofollow ugc">link text</a></p>
<p dir="auto">Where are you getting pins 4, 6, 7 from as they are not broken out anywhere?</p>
]]></description><link>https://community.m5stack.com/post/4036</link><guid isPermaLink="true">https://community.m5stack.com/post/4036</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Sun, 28 Apr 2019 08:59:31 GMT</pubDate></item></channel></rss>