2354638_en-US

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

2354638_en-US

2354638_en-US

OsIf FreeRTOS mode causes vPortEnterCritical called from ISR context when UART DMA int

Environment:
- MCU: S32K324 (dual-core Cortex-M7)
- RTD version: [S32K3_RTD_4_0_0_HF02_D2407_ASR_REL_4_7_REV_0000_20240725/ S32DS 3.5]
- FreeRTOS version: [FreeRTOS Kernel V10.5.1]
- OsIf mode: changed from OsIf_BareMetal → OsIf_FreeRTOS
(required by IPCF component)

Problem:
After switching OsIf to FreeRTOS mode, the system crashes when
UART Lpuart DMA interrupt fires.

Crash call stack:
Lpuart_Uart_Ip_IrqHandler
→ Dma_Ip_SetLogicChannelCommand
→ SchM_Enter_Mcl_MCL_EXCLUSIVE_AREA_05
→ OsIf_SuspendAllInterrupts()
→ vPortEnterCritical() ← called from ISR → CRASH

Root cause I identified:
In FreeRTOS OsIf mode, OsIf_SuspendAllInterrupts() maps to vPortEnterCritical(), which is not ISR-safe.
The Mcl/DMA SchM exclusive areas are entered inside ISR context,  which is incompatible with FreeRTOS critical section implementation.

Workaround I found (but not acceptable for production):
Manually patching OsIf_Internal.h to map SuspendAllInterrupts back to "cpsid i" — this is a generated file and will be overwritten on RTD regeneration.

My questions:
Is this a known issue in RTD [RTD_4_0_0_HF02]? Is it fixed in a newer RTD release?


Reference: Similar issue reported at NXP community:
https://community.nxp.com/t5/S32K/RTD-4-0-0p01-FlexCAN-with-FreeRTOS-asserts-in/m-p/1778228

Re: OsIf FreeRTOS mode causes vPortEnterCritical called from ISR context when UART DMA int

Hi,

as far as I know incorrect SuspendInterrupts abstraction over FreeRTOS was fixed in RTD500.
See ARTD-111453 item in RTD release note.

BR, Petr

Tags (1)
No ratings
Version history
Last update:
‎04-28-2026 03:03 AM
Updated by: