MPC5606B LINFlex5 raising 'Stuck at Zero Flag' interrupt

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

MPC5606B LINFlex5 raising 'Stuck at Zero Flag' interrupt

3,656 Views
snafu
Contributor III

Hi

I have problem with LINFlex5 calling 'Stuck at Zero Flag' interrupt continuously. Voltage on the pin 29 (GPIO4/E0UC4/CS0_1/LIN5RX/WKUP9) is 3.2V nevertheless. It's 100-pin LQFP version so there no other choise for LIN5RX input (using PADSEL60). I configured pin in PCR4 both as input or input with pull-up but to no avail.

 

I'll be grateful for any help

Regrads

Pavel

0 Kudos
Reply
15 Replies

3,648 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Hi, could you clarify details about used configuration? LIN or UART mode? Can you read correct level with using of GPDI register?

0 Kudos
Reply

3,637 Views
snafu
Contributor III

Hi

yes I use LINFlex in UART mode.

I checked value of GPDI4 in debugger and it shows 1. I use the same LINFlex code in 176 processor version and it works fine. The exact marking of the processor with this strange behaviour is SPC5606BVLL6.

Thank you

0 Kudos
Reply

3,628 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Are you checking UARTSR register, correct?

0 Kudos
Reply

3,634 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Could you provide complete part number (all lines printed on the chip)?

0 Kudos
Reply

3,621 Views
snafu
Contributor III

All numbers are:

SPC5606BVLL6
1M03Y
QYE2043H
 
Yes I use UARTSR at offset 0x14 which shows 0x00008000
0 Kudos
Reply

3,608 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Is it possible to clear these status registers (by w1c)?

0 Kudos
Reply

3,592 Views
snafu
Contributor III

Hello David,

I do it upon each interrupt occurence. But it's reraised again and again. I have following register settings:

UARTCR:0x23

LINCR1:0x90 (despite the fact, that I use INIT bit only and set the register either to 1 or 0)

LINIER:0x8184

 

Thank you for hints

0 Kudos
Reply

3,550 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Are these values taken from debugger?

0 Kudos
Reply

3,505 Views
snafu
Contributor III

No, I printed them over LIN2, which I use for communication with PC. I use the same cod ethere and RX/Tx works fine.

0 Kudos
Reply

3,461 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Would you please check it with debugger?

I would like to test it, unfortunately I don't have this specific device with 100-pin package. I got a board for MPC560B 100LQFP, but I currently I don't have sample device with this mask and package.

Also I browsed over ticket history and errata, no evidence or complains of such behavior.

0 Kudos
Reply

3,408 Views
snafu
Contributor III

Hi David

 

I finally got to the board and checked register values in debugger. They are the same as the ones printed over LIN2.

 

Regards

Pavel

0 Kudos
Reply

3,577 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Is LINESR register cleared? Just asking as there is some weird erratum, I am completely sure why is there.

davidtosenovjan_0-1644333033491.png

Do you have other MCU piece? Have your tried the same LinFlex init code with different LinFlex module? Could I see your LinFlex init code?

Also I would point out following bulletin as it is often source of weird issues:
https://www.nxp.com/docs/en/engineering-bulletin/EB758.pdf

 

 

0 Kudos
Reply

3,192 Views
snafu
Contributor III

Hello

 

I discovered one more thing. When I set LIN5 into loop-back mode, Stuck-at-zero interrupt stops comming and RPS bit in UARTSR register is in 1. On the other hand when it's not in loopback mode RPS bit is 0, but GPDI4 shows 1. It seems to me as if LIN5RX was not routed to GPIO4. Or Am I missing some register that needs to be set? PSMI (PADSEL60) register doesn't seem to be implemented for 100pin version.

 

Thank you

0 Kudos
Reply

3,185 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Have you bought these devices over official distribution channels?

If it was an issue with silicon routing if would affect all package variants (if device mask is the same).

On the other hand if it was an issue with pin bonding, it would correlate with GPDI reading.

When you said "more boards", does it mean all boards with 100-pin SPC5606 or some? Are all affected devices of the same lot?

0 Kudos
Reply

3,563 Views
snafu
Contributor III

Hi

 

thank you for the links.

 

I check LINSR and it is 0.

The init code is this:

linflexp->LINCR1.R = 0x01; /* INIT bit. */
while (0x1000 != (linflexp->LINSR.R & 0xF000)) {}
linflexp->UARTCR.R = SPC5_UARTCR_UART;
linflexp->UARTCR.R = SPC5_UARTCR_UART | SPC5_UARTCR_RXEN | SPC5_UARTCR_WL;
setSpeed((Serial_Driver *)lin, config->rxSpeed);
linflexp->UARTSR.R = 0xFFFF;
linflexp->LINIER.R = SPC5_LINIER_BOIE| SPC5_LINIER_FEIE | SPC5_LINIER_SZIE; /* Interrupts enabled. */
linflexp->LINSR.R = 0;
linflexp->LINIER.R |= SPC5_LINIER_DRIE;
linflexp->LINCR1.R = 0x00;

 

static void setSpeed(Serial_Driver *sdp, int speed)
{
volatile struct spc5_linflex *linflexp = ((LINFlexDriver *)sdp)->linflexp;
uint32_t div;

div = (SPC5_LINFLEX0_CLK + speed/2)/ speed;
linflexp->LINFBRR.R = (uint16_t)(div & 15); /* Fractional divider. */
linflexp->LINIBRR.R = (uint16_t)(div >> 4); /* Integer divider. */
}

 

bit definitions:

#define SPC5_LINIER_HRIE (1U << 0)
#define SPC5_LINIER_DTIE (1U << 1)
#define SPC5_LINIER_DRIE (1U << 2)
#define SPC5_LINIER_DBEIE (1U << 3)
#define SPC5_LINIER_DBFIE (1U << 4)
#define SPC5_LINIER_WUIE (1U << 5)
#define SPC5_LINIER_LSIE (1U << 6)
#define SPC5_LINIER_BOIE (1U << 7)
#define SPC5_LINIER_FEIE (1U <<
#define SPC5_LINIER_HEIE (1U << 11)
#define SPC5_LINIER_CEIE (1U << 12)
#define SPC5_LINIER_BEIE (1U << 13)
#define SPC5_LINIER_OCIE (1U << 14)
#define SPC5_LINIER_SZIE (1U << 15)


#define SPC5_UARTSR_NF (1U << 0)
#define SPC5_UARTSR_DTF (1U << 1)
#define SPC5_UARTSR_DRF (1U << 2)
#define SPC5_UARTSR_TO (1U << 3)
#define SPC5_UARTSR_WUF (1U << 5)
#define SPC5_UARTSR_RPS (1U << 6)
#define SPC5_UARTSR_BOF (1U << 7)
#define SPC5_UARTSR_FEF (1U <<
#define SPC5_UARTSR_RMB (1U << 9)
#define SPC5_UARTSR_PE0 (1U << 10)
#define SPC5_UARTSR_PE1 (1U << 11)
#define SPC5_UARTSR_PE2 (1U << 12)
#define SPC5_UARTSR_PE3 (1U << 13)
#define SPC5_UARTSR_OCF (1U << 14)
#define SPC5_UARTSR_SZF (1U << 15)


#define SPC5_UARTCR_UART (1U << 0)
#define SPC5_UARTCR_WL (1U << 1)
#define SPC5_UARTCR_PCE (1U << 2)
#define SPC5_UARTCR_OP (1U << 3)
#define SPC5_UARTCR_TXEN (1U << 4)
#define SPC5_UARTCR_RXEN (1U << 5)
#define SPC5_UARTCR_TFBM (1U <<
#define SPC5_UARTCR_RFBM (1U << 9)

 

I use LINFlexD with DMA and it works fine. I also use the same code at other boards with 176 pin processor and it's also ok.  The UART doesn't work on more boards.

 

Thank you for the help.

pa

0 Kudos
Reply