UART conflicts with SPI

technomage
Posts: 7
Joined: Fri Dec 03, 2021 12:28 pm

UART conflicts with SPI

Postby technomage » Tue Mar 22, 2022 2:58 pm

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

technomage
Posts: 7
Joined: Fri Dec 03, 2021 12:28 pm

Re: UART conflicts with SPI

Postby technomage » Thu Mar 24, 2022 4:17 pm

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?

Who is online

Users browsing this forum: Bing [Bot] and 87 guests