I edited the "task" function so that initialization depends on the arguments passed.
Code: Select all
wiegand_data_t data = *(wiegand_data_t *)arg;
printf("D0 = %d, D1 = %d\n", data.d0, data.d1);
// Initialize reader
ESP_ERROR_CHECK(wiegand_reader_init(&reader, data.d0, data.d1, true, CONFIG_EXAMPLE_BUF_SIZE, reader_callback,
WIEGAND_MSB_FIRST, WIEGAND_LSB_FIRST));
Code: Select all
typedef struct wiegand_t
{
gpio_num_t d0, d1;
} wiegand_data_t;
Code: Select all
void app_main()
{
xTaskCreate(task, TAG, configMINIMAL_STACK_SIZE * 4, &data1, 5, NULL);
xTaskCreate(task, TAG_2, configMINIMAL_STACK_SIZE * 4, &data2, 5, NULL);
Code: Select all
D (654) intr_alloc: Connected src 24 to int 9 (cpu 0)
I (659) cpu_start: Starting scheduler on PRO CPU.
D (0) intr_alloc: Connected src 25 to int 2 (cpu 1)
I (0) cpu_start: Starting scheduler on APP CPU.
D (684) heap_init: New heap initialised at 0x3ffe0440
D (684) heap_init: New heap initialised at 0x3ffe4350
D (694) intr_alloc: Connected src 16 to int 12 (cpu 0)
D0 = 16, D1 = 17
D0 = 5, D1 = 18
E (694) gpio: gpio_install_isr_service(465): GPIO isr service already installed
Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x400e658b PS : 0x00060c33 A0 : 0x800d647a A1 : 0x3ffb7630
0x400e658b: esp_intr_get_cpu at C:/Work/Programs/Espressif/frameworks/esp-idf-v5.0/components/esp_hw_support/intr_alloc.c:771
A2 : 0x00000000 A3 : 0x3ffb293c A4 : 0x00060c20 A5 : 0x00060c23
A6 : 0x3f403b0c A7 : 0x0000abab A8 : 0x800d618c A9 : 0x3ffb75f0
A10 : 0x00010000 A11 : 0x00000010 A12 : 0x00000000 A13 : 0x00060c23
A14 : 0x3ffb7610 A15 : 0x0000abab SAR : 0x00000010 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000 LBEG : 0x4000c46c LEND : 0x4000c477 LCOUNT : 0x00000000
But I can't figure out at what point this is happening. It seemed to me that the "GPIOisr service already installed" error shouldn't affect, but now I'm not sure...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