LPUART_DRV_SendDataBlocking hang in OSIF_SemaWait?

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

LPUART_DRV_SendDataBlocking hang in OSIF_SemaWait?

跳至解决方案
3,179 次查看
APU
Contributor II

Dear NXP,

I am using a customized board with a S32K118 chip on it, running FreeRTOS.

I've referred to the "lpuart_echo_s32k118" example and tried to verify the UART communication on my board.

 

// Initialization starts here

CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT, g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);

CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT);

POWER_SYS_Init(&powerConfigsArr, POWER_MANAGER_CONFIG_CNT, &powerStaticCallbacksConfigsArr, POWER_MANAGER_CALLBACK_CNT);

PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);

 

LPUART_DRV_Init(INST_LPUART0, &lpuart0_State, &lpuart0_InitConfig0);

/*

Other Initialization such as PWM, I2C and several GPIO pins

/*

LPUART_DRV_SendDataBlocking(INST_LPUART0, (uint8_t *)welcomeMsg, strlen(welcomeMsg), 100);   // In the example, this function is called after "LPUART_DRV_Init" returns STATE_SUCCESS, so I supposed I can do so as well.

// Initialization ends here

 

I haven't implemented a RX handler yet since I want to test the TX behavior first.

After I enter debug mode and run the program, all the functions are able to executed until LPUART_DRV_SendDataBlocking. I traced down to OSIF_SemaWait and seemed like it didn't respond judging from the system didn't run to the debug point I set at `if (syncStatus == STATUS_TIMEOUT)`

 

I've already compare other settings in Processor Experts like `clock_manager`, `lpuart` and 'pin_mux' between my code and the example. Nothing seems to be particularly different.

 

Please kindly offer some suggestions which I can look into, thank you.

 

Best regards.

0 项奖励
回复
1 解答
3,157 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

if have FreeRTOS running, try to call LPUART_DRV_SendDataBlocking after scheduler is started, i.e. in some task.

BR, Petr

在原帖中查看解决方案

0 项奖励
回复
2 回复数
3,158 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

if have FreeRTOS running, try to call LPUART_DRV_SendDataBlocking after scheduler is started, i.e. in some task.

BR, Petr

0 项奖励
回复
3,146 次查看
APU
Contributor II

Dear Petrs,

Your suggestion works.

I am curious about the theory behind this. Would you explain what other things should I be aware of when implementing a non-rtos example to my rtos project?

Thank you.

Best regards.

0 项奖励
回复