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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

ソリューションへジャンプ
1,555件の閲覧回数
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,478件の閲覧回数
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,479件の閲覧回数
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,533件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport
0 件の賞賛
返信
1,548件の閲覧回数
Licunhao
Contributor II

And I also use FreeRTOS.

0 件の賞賛
返信
1,543件の閲覧回数
Licunhao
Contributor II
without FreeRTOS.IT works well.
with FreeRTOS.IT works fail. Why?
0 件の賞賛
返信