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

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

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

跳至解决方案
1,472 次查看
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)  {
 
}
}
 
 
标签 (1)
0 项奖励
回复
1 解答
1,395 次查看
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 项奖励
回复
4 回复数
1,396 次查看
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 项奖励
回复
1,450 次查看
danielmartynek
NXP TechSupport
NXP TechSupport
0 项奖励
回复
1,465 次查看
Licunhao
Contributor II

And I also use FreeRTOS.

0 项奖励
回复
1,460 次查看
Licunhao
Contributor II
without FreeRTOS.IT works well.
with FreeRTOS.IT works fail. Why?
0 项奖励
回复