Asking here since I'm not getting any response on the ESP32 forum on the Micropython site:
ESP-IDF version: v5.1.2-dirty
I have a custom board design that uses an ESP32-PICO-D4. On this board is a SC16IS752 dual SPI UART, accessed from MP via a custom C module. I have found that characters are dropped, particularly at higher baud rates, due to the time that MP GPIO interrupts require. So, I would like to have the UART received character interrupt served via a FreeRTOS task, Adding a test function that creates a task that blinks an LED while running in parallel with the MP task was not a problem, however when trying to add support for a GPIO interrupt to service the UART IRQ I found that portYIELD_FROM_ISR() was preventing the module from successfully linking, generating the following error message:
Here is the relevant part of the task that sets up the interrupt handler:spisvc.c:(.iram1.0+0x21): undefined reference to traceISR_EXIT_TO_SCHEDULER
- gpio_isr_handler_add(GPIO_NUM_34, spi_uart_isr_handler, NULL);
- for (;;) {
- xSemaphoreTake(spi_svc_sem, portMAX_DELAY);
- gpio_set_level(GPIO_NUM_12, 1);
- spisvc_uart_rx_fifos();
- gpio_set_level(GPIO_NUM_12, 0);
- }
- void spi_uart_isr_handler(void *param)
- {
- static BaseType_t xHigherPriorityTaskWoken = pdFALSE;
- xSemaphoreGiveFromISR(spi_svc_sem, &xHigherPriorityTaskWoken);
- if( xHigherPriorityTaskWoken) {
- portYIELD_FROM_ISR();
- }
- }
If I add a call to vTaskDelay() there are no problems, so it doesn't seem to be a FreeRTOS library issue.
Any help greatly appreciated!