Can not enter the callback function when I use UART0

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

Can not enter the callback function when I use UART0

802 Views
2433841893
Contributor I

I am working on the JN-AN-1189.

PRIVATE void vUart_Init(void)
{
vAHI_UartEnable(E_AHI_UART_0);
vAHI_UartReset(E_AHI_UART_0, TRUE, TRUE);
vAHI_UartReset(E_AHI_UART_0, FALSE, FALSE);
vAHI_UartSetBaudRate(E_AHI_UART_0, E_AHI_UART_RATE_115200);
vAHI_UartSetRTSCTS(E_AHI_UART_0, FALSE);
vAHI_UartSetControl(E_AHI_UART_0, FALSE, FALSE, E_AHI_UART_WORD_LEN_8, TRUE, FALSE); /* [I SP001222_P1 279] */
vAHI_Uart0RegisterCallback ( APP_myisrUart );
vAHI_UartSetInterrupt(E_AHI_UART_0, FALSE, TRUE, TRUE, TRUE, E_AHI_UART_FIFO_LEVEL_1);
}

PUBLIC void APP_myisrUart(uint32 u32Device, uint32 u32ItemBitmap)
{
unsigned int irq = ((*((volatile uint32 *)(UART_START_ADR + 0x08))) >> 1) & 0x0007;
uint8 u8Byte;
vAHI_UartWriteData(E_AHI_UART_0, 0x33);
vAHI_UartWriteData(E_AHI_UART_0, 0x33);
if (irq & E_AHI_UART_INT_RXDATA)
{
u8Byte = u8AHI_UartReadData(E_AHI_UART_0);
vAHI_UartWriteData(E_AHI_UART_0, u8Byte);
//if(ZQ_bQueueSend(&APP_msgSerialRx, &u8Byte) == FALSE)
//{
// /* Failed to send the message to queue */
//}
}

if (irq & E_AHI_UART_INT_TX)
{
/*if(ZQ_bQueueReceive(&APP_msgSerialTx, &u8Byte) == TRUE)
{
vAHI_UartWriteData(E_AHI_UART_0, u8Byte);
decrement activity counter for dequeued data
}
else
{
disable tx interrupt as nothing to send
UART_vSetTxInterrupt(FALSE);
}*/
}
}

Note: I have seen suggestions inJN5168 UART vAHI_Uart0RegisterCallback() Using ,but it has no effect.

The send function can be used normally, but the callback function of APP_myisrUart() has no effect。

can you help me to solve it?

Thank you !

Labels (1)
0 Kudos
2 Replies

558 Views
2433841893
Contributor I

Hello Is there anyone, this problem has been bothering me for a few days, can you help me analyze it?

0 Kudos

558 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Gao Lei,

Could you please try to call OS_ISR(APP_myisrUart)?

Also, you have to add the interrupt source,Uart in this case in the .oscfgdiag file

Regards,

Mario

0 Kudos