[MPC5748G][S32DS] SDK LinFlexD and FreeRTOS

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

[MPC5748G][S32DS] SDK LinFlexD and FreeRTOS

跳至解决方案
2,427 次查看
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 项奖励
回复
1 解答
2,154 次查看
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 项奖励
回复
1 回复
2,155 次查看
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 项奖励
回复