LPUART_DRV_SendDataBlocking hang in OSIF_SemaWait?

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

LPUART_DRV_SendDataBlocking hang in OSIF_SemaWait?

Jump to solution
1,165 Views
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 Kudos
1 Solution
1,143 Views
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

View solution in original post

0 Kudos
2 Replies
1,144 Views
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 Kudos
1,132 Views
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 Kudos