LIN Break Detect Interrupt not getting detected in S32K144

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

LIN Break Detect Interrupt not getting detected in S32K144

522 Views
chilambarasanm
Contributor I

Hi,

We are trying to configure S32K144 as a slave configuration.

1. LPUART2 is configured for a Baud rate of 19200 Kb/s.

2. In LPUART2 Tx and Rx is tested via transmitting a dummy data for configuration test and its working fine.

3.  LPUART2->BAUD = 0x0F000062;
LPUART2->CTRL = 0x000C0000;
LPUART2->STAT = 0x02000000;

this is value we set for the registers

4. Interrupt enable 

/* Set the priority level */
NVIC_SetPriority ((IRQn_Type)35u, 0x1U);
/* Enable interrupt for UART1/LIN to set Flags*/
NVIC_EnableIRQ((IRQn_Type)35u);

 

5. Using Muxtrace we are sending a header to S32K144 and we are testing for STAT[LBKDIF] and eventhough header is received in the Rx pin not able to detect the LIN BREAK. Due to this STAT[LBKDIF] flag is not setting when header is available.

kindly help in this one

0 Kudos
5 Replies

464 Views
chilambarasanm
Contributor I

Hi, Petrs

Thank you for the example code. The same code we are trying to use for S32k144 board and we are facing some issues. 

1. It never enters to the interrupt handling function.

int main(void)
{
    counter = 0;
 
    SystemOSC_init();
    PORT_init();
    LPUART2_init();
 
    Enable_Interrupt(LPUART2_RxTx_IRQn);
 
    for (;;) {
 
        counter++;
 
        if (counter >= limit_value)
        {
            //__asm volatile ("svc 0");
            counter = 0;
        }
    }
    /* to avoid the warning message for GHS and IAR: statement is unreachable*/
    __NO_RETURN
    return 0;
}
 
In the above code we are enabling interrupt for LPUART2. I am transferring LIN data via Muxtrace. while in debugging mode it never enter into the LPUART2_RxTx_IRQHandler(void) function. Can you clarify this.
 
if i call this LPUART1_RxTx_IRQHandler(void) function in main loop we can see the LIN break detect happening but cant able to read the data in debug mode. But this function should not be called like that.

 

0 Kudos

418 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

do you have LBKDIE set as well in your code?

BR, Petr

0 Kudos

489 Views
chilambarasanm
Contributor I

Hi PetrS,

Thank you for the example code. we need some clarification

1. In debug mode after reading the Sync byte i cant able to read the other data since its lost

2. During debug session the sync byte was read correctly occasionaly most of the time it reads the wrong data

3. During debug session for me overrun flag is setting always kindly clarify these points

0 Kudos

479 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

debugging could be little bit hard if you stop the code and frame is going to be received or already receiving. As there is RXFIFO disabled usually some bytes can be easily lost and overflow can be detected. But even with RXFIFO enabled, above can happen too.

BR, Petr

0 Kudos

498 Views
PetrS
NXP TechSupport
NXP TechSupport
0 Kudos