Page 1 of 1

UART conflicts with SPI

Posted: Tue Mar 22, 2022 2:58 pm
by technomage
Hello,
I have an application in an esp32 using the IDF framework. In one core runs a task reading an ADC via SPI non stop. On the other core there is a task that wakes up every 10ms that sends via RS485 the data read from the ADC on the other core.

The problem is that when UART is transmitting the data in one core, the SPI doesn't reads much less data than the time the UART is not transmiting. I supose the UART is blocking in some way the SPI transactions.

SPI config:
- Host: SPI3
- MISO: GPIO23
- MOSI: GPIO18
- SCLK: GPIO5
- DMA disabled

UART config:
- UART2
- RX: GPIO12
- TX: GPIO14
- RTS: GPIO15
- Mode: UART_MODE_RS485_HALF_DUPLEX

I use the IDF framework for SPI transactions and UART transmissions. Where can be the problem and how to solve it?

Thanks

Re: UART conflicts with SPI

Posted: Thu Mar 24, 2022 4:17 pm
by technomage
Solved.

I had the UART task in the APP CPU and the SPI task in the PRO CPU. Changed the affinity and now the SPI keeps reading all time while UART is transmitting.

Maybe UART driver interrupts PRO CPU?