Part Number: AM62L
AM62L, RT Linux SDK11.02.08.02, Kernel 6.12.57. SPI 5.5MHz, dma on, 1KB per 2.5ms.
spi application thread priority: 55.
Disabling DMA for SPI communication results in very high CPU usage, so I enabled DMA to use SPI. However, when sending and receiving data via ioctl(), the execution time varies greatly and the jitter is also significant. Referring to AM62L-EVSE-DEV-EVM: dmaengine: ti: k3-udma: 1 second polling delay, I modified the SPI driver and spi: spi-omap2-mcspi: Use EOW interrupt for completion when DMA enabled - ti-linux-kernel/ti-linux-kernel - This repo contains a Linux kernel that has been integrated with outstanding. The changes are shown in the attached diff file.
Before modification: execution time 3602 ~ 1612 µs, jitter 1930 ~ -764 µs.
After modification: execution time 2093 ~ 1641 µs, jitter 200 ~ -248 µs.
The performance after modification basically meets our requirements. However, the modified SPI communication has a high probability of completely freezing the system, leaving it totally unresponsive, so that only a power cycle can restart it, regardless of which core.
The SPI test program I used is attached. The execution time is measured by `time_exec*`, and the jitter is measured by `time_jitter*`.
Test code: spi_mcu_test.tar.gz
Driver diff: spi-omap2-mcspi_6.12.57.diff
