2018R1 SDK0.8.6 LPUART IRQ Problem

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

2018R1 SDK0.8.6 LPUART IRQ Problem

1,186 Views
建宽高
Contributor III

hi,when i config lpuart2

```

LPUART_Type *base = g_lpuartBase[INST_LPUART2];

LPUART_DRV_Init(INST_LPUART2, &lpuart2_State, &lpuart2_InitConfig0);
INT_SYS_InstallHandler(g_lpuartRxTxIrqId[INST_LPUART2], DEBUG_DRV_IRQHandler, (isr_t *) 0);
INT_SYS_SetPriority(LPUART2_RxTx_IRQn, 2);

/* Enable the receive data overrun interrupt */
LPUART_SetIntMode(base, LPUART_INT_RX_OVERRUN, true);

/* Enable the receive data overrun interrupt */
LPUART_SetIntMode(base, LPUART_INT_FRAME_ERR_FLAG, false);

/* Enable receive data full interrupt */
LPUART_SetIntMode(base, LPUART_INT_RX_DATA_REG_FULL, true);

```

in this code 

```

LPUART_SetIntMode(base, LPUART_INT_RX_DATA_REG_FULL, true);

```

it willl go to this breakpoint,frame error, why ,and   use  api   get receive byte is zero, why ?  

```

uint8_t rb;

LPUART_Getchar(base, &rb)

```

rb result is zero

pastedImage_3.png

Labels (1)
0 Kudos
2 Replies

844 Views
razva_tilimpea
NXP Employee
NXP Employee

Hi,

Please start from our LPUARt example and update your SDK because you use a version released 2 years ago.

To get latest version please follow the steps from the attachment.

Please don't change the IRQ handlers and disable interrupts, because LPUART driver needs them to read/write data on UART.

If you want to receive data please just initialize the driver and call  LPUART_DRV_ReceiveData.

Best regards,

Razvan

0 Kudos

844 Views
建宽高
Contributor III

3Q,very much

0 Kudos