Why I change the lpuart priority cause lpuart send failed?S32K148

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

Why I change the lpuart priority cause lpuart send failed?S32K148

Jump to solution
311 Views
Licunhao
Contributor II
Please help to review the follow code;
 
When I open the comment for change the uart priority to 2, uart can not send data.
 
void uart_init(void) {
uint8_t uart_proi = 0;
UART_Init(&uart_pal1_instance, &uart_pal1_Config0);
 
INT_SYS_DisableIRQ(LPUART1_RxTx_IRQn);
uart_proi = INT_SYS_GetPriority(LPUART1_RxTx_IRQn);
// INT_SYS_SetPriority(LPUART1_RxTx_IRQn, 2);
uart_proi = INT_SYS_GetPriority(LPUART1_RxTx_IRQn);
INT_SYS_EnableIRQ(LPUART1_RxTx_IRQn);
 
GE_LOGI(LOG_TAG "uart_proi = %d", __func__, uart_proi);
// start uart rx
UART_ReceiveData(&uart_pal1_instance, uart_rx_buf, 1);
}
 
void uart_send_data(uint8_t *data, uint32_t size) {
uint32_t bytesRemaining;
UART_SendData(&uart_pal1_instance, data, size);
// blocking here if change priority
while (UART_GetTransmitStatus(&uart_pal1_instance, &bytesRemaining) != STATUS_SUCCESS)  {
 
}
}
 
 
Labels (1)
0 Kudos
Reply
1 Solution
234 Views
Licunhao
Contributor II

I solved this problem.

Just must change priority after vTaskStartScheduler.

I think it root case is osif_freertos.c should work after TaskStartScheduler.,

 

Close

View solution in original post

0 Kudos
Reply
4 Replies
235 Views
Licunhao
Contributor II

I solved this problem.

Just must change priority after vTaskStartScheduler.

I think it root case is osif_freertos.c should work after TaskStartScheduler.,

 

Close

0 Kudos
Reply
289 Views
danielmartynek
NXP TechSupport
NXP TechSupport
0 Kudos
Reply
304 Views
Licunhao
Contributor II

And I also use FreeRTOS.

0 Kudos
Reply
299 Views
Licunhao
Contributor II
without FreeRTOS.IT works well.
with FreeRTOS.IT works fail. Why?
0 Kudos
Reply