Part Number: AM6442
Other Parts Discussed in Thread: AM263P4
Hi all,
I’m looking for advice on how to make SPI peripheral reception more reliable on AM6442 when running on Cortex-R5F (core 0) with FreeRTOS.
Platforms affected
-
AM6442, firmware running on R5FSS0 Core 0
-
Similar behavior previously observed on AM263P4, but the issue was significantly harder to trigger there
Problem description
SPI reception works correctly when the system is mostly idle. However, once the system experiences even light additional load, SPI reception becomes unreliable and frequently fails with FIFO errors (RX overrun / TX underrun – I need to double-check which exact one is dominant).
By “load” I don’t mean heavy CPU usage — often it is enough to:
-
run a few additional FreeRTOS tasks (even if total non-idle time is low),
-
enable debug logging (CCS IDE print / logging),
-
or generally increase task scheduling activity.
On AM6442, the issue can appear even at ~5% non-idle time.
On AM263P4, the same firmware required noticeably higher activity before showing similar symptoms.
SPI configuration / traffic characteristics
-
SPI clock: 17 MHz
-
Transfer period: every 100 ms (≈10 FPS)
-
Payload size: fixed 2012 bytes
-
Interface: 3-wire SPI (no dedicated CS pin)
Reception is interrupt-driven. I would like to keep it that way (i.e. no polling / foreground blocking).
Observed behavior
-
SPI data is known to be present on the bus.
-
Under load, the SPI RX interrupt appears to be serviced too late or not serviced at all, resulting in FIFO errors.
-
Once this happens, communication breaks down.
What I have tried (without success)
1) Increasing interrupt priority
-
Tried multiple SPI interrupt priority levels.
-
Ensured the priority still allows FreeRTOS
FromISRAPI usage. -
Did not improve reliability.
2) FreeRTOS interrupt priority masking
-
Rebuilt FreeRTOS with priority masking enabled using:
EN_MAX_SYSCALL_INTR_PRI_CRIT_SECTION -
Tested different interrupt priority configurations.
-
Did not observe any improvement.
3) FIQ Interrupts
-
Made the SPI peripheral interrupt a FIQ interrupt instead of IRQ.
-
SPI reception is totally broken, with this interrupt. It appears that the driver doesn't receive any data at all.
What I’m asking
I’d appreciate guidance on how to make SPI peripheral reception robust and reliable on AM6442 R5F, specifically:
-
Is this a known limitation or common issue on AM64x R5F when using SPI RX interrupts under FreeRTOS?
-
Are there recommended SPI FIFO thresholds, interrupt trigger levels, or driver settings that improve tolerance to interrupt latency?
-
Is DMA strongly recommended for SPI RX on this platform for reliable operation, even at moderate data rates like this?
-
Are CCS debug prints / logging known to introduce enough latency or critical sections to break time-sensitive SPI RX?
-
Are there R5F-specific or VIM-specific interrupt configuration pitfalls that could explain why the SPI ISR is not serviced in time?
My goal is to achieve near-100% reliable SPI reception without occupying the foreground (interrupt-driven or DMA-based solutions are fine).
If needed, I can provide:
-
SPI driver configuration details (FIFO, thresholds, driver API),
-
interrupt numbers and priorities,
-
whether this uses TI MCU+ SDK SPI drivers or a custom implementation.
Thanks in advance for any insights or best-practice recommendations.
