Qwiic Button (BOB-15931) with ESP32 and FreeeRTOS

I just purchased 4 of the Qwiic Buttons (BOB-15931) boards. My project is using a ESP32 Feather from Adafruit.

This processor has FreeRTOS built in. This is my first project with ESP32 and FreeRTOS. After wiring one board up

I wrote a conventional sketch with a Setup() and loop(). In the loop I put the following code:

if (button0.isPressed() == true)

{

Serial.println (“Button0_Press”);

button0.LEDon(brightness0);

while (button0.isPressed() == true)

delay (10); //wait for user to get off the button

Serial.println (“Button0_Released”);

button0.LEDoff();

}

It compiled fine and worked great!

Next I took an example from the IDE 2.0.0 rc3 from the FreeRTOS section that contained 2 tasks

1st - to blink the builtin LED

2nd - to read an analog pin and write the value to the serial monitor

It compiled fine and worked as expected.

I then replaced the code in the analog pin read task with the code (above) to read the button.

The processor goes nuts (reboot loop)

I then replaced the code with just:

if (button0.isPressed() == true)

{

}

This empty If ststement still makes the procesor go into a reboot loop.

It appears that the SparkFun_Qwiic_Button.h library is not compatible with FreeRTOS.

Is their a fix or a compatible library for this device?

Thanks

Tom

The error I am getting is :Guru Meditation Error: Core 1 panic’ed (LoadProhibited). Exception was unhandled.

and a register Dump. A Google search on this error produces the following from https://docs.espressif.com/

LoadProhibited, StoreProhibited

These CPU exceptions happen when an application attempts to read from or write to an invalid memory location. The address which has been written/read is found in the EXCVADDR register in the register dump. If this address is zero, it usually means that the application has attempted to dereference a NULL pointer. If this address is close to zero, it usually means that the application has attempted to access a member of a structure, but the pointer to the structure is NULL. If this address is something else (garbage value, not in 0x3fxxxxxx - 0x6xxxxxxx range), it likely means that the pointer used to access the data is either not initialized or has been corrupted.

The register EXCVADDR always contains 134

If I put some different code in Taskbutton0 it works fine but when I call a method in the SparkFun_Qwiic_Button.h library

the error occurs. For example. If (button0.isPressed() == true) {…}

Maybe an expert with ESP32 and FreeRTOS can help me sort this out. As a Newbie to both ESP32 and freeRTOS I am a bit over my head. Any help would be greatly appreciated.

Tom