LIN on K66 not working

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

LIN on K66 not working

666 Views
madhusandeept
Contributor I

I am trying to port FSL_LIN_2.x_STACK_4.5.9 on K66 processor and I took KEA128 project as reference from the stack. After porting I dont see any messages sent over the Tx line of UART. At this point my UART registers looks like this

pastedImage_1.png

UART is initialized as LIN using the code below.

UART_Type* const BASE[] = UART_BASE_PTRS;
UART_Type* base = BASE[4];

// Un-gate UART module clock
CLOCK_SYS_EnableUartClock(4);

// UART clock source is either system or bus clock depending on instance
l_u32 uartSourceClock = CLOCK_SYS_GetUartFreq(4);

// Initialize UART baud rate, bit count, parity and stop bit.
UART_HAL_SetBaudRate(base, uartSourceClock, lconf_p->baud_rate);

_pUART->uartcr1.byte = 0x00; /* one start bit, eight data bits, one stop bit */
_pUART->uartcr2.byte = (UARTCR2_TE_MASK | UARTCR2_RE_MASK);

_pUART->uartsr2.byte |= (UARTSR2_LBKDIF_MASK | UARTSR2_BRK13_MASK | UARTSR2_LBKDE_MASK); /* clear LIN Break Detection flag */
NVIC_EnableIRQ(UART4_RX_TX_IRQn);
_pUART->uartcr2.byte |= UARTCR2_RIE_MASK | UARTCR2_RWU_MASK; /* enable RX complete interrupt */
_pUART->uartcr3.byte |= UARTCR3_FEIE_MASK; /* Enable Frame Error interrupt */
_pUART->uartbdh.byte |= UARTBDH_LBKDIE_MASK; /* enable LIN Break Detection interrupt */

Why am I not seeing any messages sent over UART's Tx line, am I missing any configuration? Any help is greatly appreciated.

0 Kudos
1 Reply

442 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi Sandeep,

Have you config the corresponding pin to uart mode?

Regards

0 Kudos