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