FREERTOS Guru mediation error, esp32

I am attempting to use FREERTOS. Using 2.09. I have tried various examples, all blow up in, I think the same way. Currently using an ESP32 DEVKIT, although I am really trying to use the C3. So getting down to simplest possible program:

TaskHandle_t Task1;


void setup() {
  Serial.begin(115200); 
  Serial.print("setup() is running on core ");
  Serial.println(xPortGetCoreID());

  xTaskCreatePinnedToCore(Task1code,"Task1",20000,NULL,1,&Task1,1);   
  Serial.println("Past xTaskCreate...????");                        
  delay(500); 
  
}



void Task1code( void * parameter ){
  Serial.print("Task1 is running on core ");
  Serial.println(xPortGetCoreID());
  Serial.print( "Task1 Stack WATERMARK " );
  Serial.println( uxTaskGetStackHighWaterMark(NULL) ); 
  delay(10000);

}

void loop() {
  //Serial.print("loop() is running on core ");
  //Serial.println(xPortGetCoreID());  
  //delay(10000);
}

All compiles and loads, no problemo.
I get:

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:13220
ho 0 tail 12 room 4
load:0x40080400,len:3028
entry 0x400805e4
setup() is running on core 1
Past xTaskCreate...????Task1 is running on core 1
Task1 Stack WATERMARK
19328
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x400d12c8: 9565fb59 00f01d00 32006136
Core 1 register dump:
PC : 0x400d12cd PS : 0x00060330 A0 : 0x00000000 A1 : 0x3ffc83c0
A2 : 0x3ffc24cc A3 : 0x00000000 A4 : 0x00000000 A5 : 0x00000000
A6 : 0x00000000 A7 : 0x00000000 A8 : 0x800d12cd A9 : 0x3ffc83a0
A10 : 0x00007530 A11 : 0x00000005 A12 : 0x0000000a A13 : 0x00000004
A14 : 0x3ffb8a28 A15 : 0x80000001 SAR : 0x00000000 EXCCAUSE: 0x00000000
EXCVADDR: 0x00000000 LBEG : 0x400862c1 LEND : 0x400862d1 LCOUNT : 0xfffffffe

Backtrace: 0x400d12ca:0x3ffc83c0

Apparently it creates the task, hits it one time, then blows up. The stack size seems to use most of what I put in there--doesn't make a difference.
Obviously, I am doing something wrong, simply wrong. I am primarily a hardware guy, tend to go down rabbit holes on this kind of stuff.
HELP?
And, thanks in advance.

A task should NEVER return. It should be an infinite loop. There's an example in the Arduino IDE:

Of course.
Dumb de dumb dumb.
Thanks so much.
Made the change, things now starting to make sense.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.