AnsweredAssumed Answered

MPC5748G-Problem of LinFlexUART with DMA

Question asked by YANG LI on Jun 27, 2019
Latest reply on Jun 28, 2019 by YANG LI

hi,

I need UART to transmit data with DMA,but there is a problem of UART initialization.When MCU run into the code of write register "LINFlexD_1.DMATXE", the MCU stop work and throw an exception of " No source available for "IVOR1_Vector() at 0x1001010" ".
The initialization code is below:

void initLINFlexD_1 ( unsigned int MegaHertz, unsigned int BaudRate )
{

unsigned int Fraction = 0;
unsigned int Integer = 0;
unsigned int i = 0;

SIUL2.MSCR[PC6].B.SSS = 1; /* Pad PC6: Source signal is LIN1_TX */
SIUL2.MSCR[PC6].B.OBE = 1; /* Pad PC6: OBE=1. */
SIUL2.MSCR[PC6].B.SRC = 3; /* Pad PC6: Full strength slew rate */
SIUL2.MSCR[PC7].B.IBE = 1; /* Pad PC7: Enable pad for input */
SIUL2.IMCR[201].B.SSS = 1; /* LIN1_RX : connected to pad PC9 */

LINFlexD_1.LINCR1.B.INIT = 1; /* Enter Initialization Mode */
LINFlexD_1.LINCR1.B.SLEEP = 0; /* Exit Sleep Mode */

while (0x1000 != (LINFlexD_1.LINSR.R & 0xF000)) {}

LINFlexD_1.UARTCR.B.UART = 1; /* UART Enable, Req'd before UART configuration */

LINFlexD_1.UARTCR.B.RxEn = 1;
LINFlexD_1.UARTCR.B.TxEn = 1;
LINFlexD_1.UARTCR.B.WL1 = 0;
LINFlexD_1.UARTCR.B.WL0 = 1;


LINFlexD_1.UARTCR.B.TFBM = 1;
LINFlexD_1.UARTCR.B.RFBM = 1;

LINFlexD_1.DMATXE.R = 0x0000ffff;//something is wrong here
LINFlexD_1.DMARXE.R = 0x0000ffff;

LINFlexD_1.LINIER.B.DTIE = 0;
LINFlexD_1.LINIER.B.DRIE = 1;

LINFlexD_1.UARTSR.B.SZF = 1; /* CHANGE THIS LINE Clear the Zero status bit */
LINFlexD_1.UARTSR.B.DRFRFE = 1; /* CHANGE THIS LINE Clear DRFRFE flag - W1C */

BaudRate = (MegaHertz * 1000000) / BaudRate;
Integer = BaudRate / 16;
Fraction = BaudRate - (Integer * 16);

LINFlexD_1.LINIBRR.R = Integer;
LINFlexD_1.LINFBRR.R = Fraction;

LINFlexD_1.LINCR1.B.INIT = 0; /* Exit Initialization Mode */

INTC.PSR[379].B.PRC_SELN = 0x8; /* IRQ sent to Core 0 */
INTC.PSR[379].B.PRIN = 8; /* IRQ priority = 10 (15 = highest) */

Lin_1_UARTFirstTransmitFlag = 1; /* Indicate no Tx has taken place yet */
for(i = 0; i < 1000; i++)
{}
}

 

The project is in accessory.Can any one help me how to solve this problem, or share some example code with me, thank you.
Best wishes!

Outcomes