[MPC5748G][S32DS] SDK LinFlexD and FreeRTOS

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

[MPC5748G][S32DS] SDK LinFlexD and FreeRTOS

Jump to solution
1,626 Views
travis_kuo
Contributor III

Hi,

We tried to use LinFlexD to output UART charecters with API LINFLEXD_UART_DRV_SendDataBlocking(). It looks we can only use it after OS starts. If we send right after driver inits, it will hang. See the example below. The code will hang at LINFLEXD_UART_DRV_SendDataBlocking() and never get return.

Would you please comment if there's any limitation or rule in this case?

int main(void)
{

CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT,
g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);
CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT);

PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);
LINFLEXD_UART_DRV_Init(INST_LINFLEXD_UART1, &linflexd_uart1_State, &linflexd_uart1_InitConfig0);

LINFLEXD_UART_DRV_SendDataBlocking(INST_LINFLEXD_UART1, "test", 5, 1000U);

xTaskCreate(xxxx);

vTaskStartScheduler();

0 Kudos
1 Solution
1,353 Views
raresvasile
NXP Employee
NXP Employee

Hi,

LINFLEXD_UART_DRV_SendDataBlocking uses FreeRTOS API via OSIF_SemaWait(called to wait until the transfer is complete or timeout is reached). This is the reason why the program hangs when LINFlexD API is called.

SDK drivers that use OSIF must be run after the scheduler is started.

Best regards,

Rares

View solution in original post

0 Kudos
1 Reply
1,354 Views
raresvasile
NXP Employee
NXP Employee

Hi,

LINFLEXD_UART_DRV_SendDataBlocking uses FreeRTOS API via OSIF_SemaWait(called to wait until the transfer is complete or timeout is reached). This is the reason why the program hangs when LINFlexD API is called.

SDK drivers that use OSIF must be run after the scheduler is started.

Best regards,

Rares

0 Kudos