KL16Z UART peripheral menu does not enable UART2 clock DMA

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

KL16Z UART peripheral menu does not enable UART2 clock DMA

745 Views
turtius
Contributor I

Hello, I'm having a bit of trouble with the GUI interface when selecting the UART2 peripheral with DMA where a HardFault is triggered upon using any UART related API such as UART_WriteBlocking.

Here is the UART configuration: 

Screenshot from 2021-07-03 02-10-16.png

 tested it with: 

 

sendXfer.data = sendData;
sendXfer.dataSize = sizeof(sendData)/sizeof(sendData[0]);
UART_TransferSendDMA(UART2,&UART2_UART_DMA_Handle, &sendXfer);

 

triggers Hard-fault when attempting to read UART2_PERIPHERAL. So it turned out that clock for UART 2 is not enabled and had to be enabled manually be enabled like this (even though the gui config should handle this): 

    /* Init board hardware. */
    BOARD_InitBootPins();
    BOARD_InitBootClocks();
    SIM->SCGC4 |= SIM_SCGC4_UART2(1);
    BOARD_InitBootPeripherals();

this no longer triggers an hard-fault when calling the API functions but no output is given from UART2 so any help would really be appreciated. 

Here is the pin mux for UART2:

Screenshot from 2021-07-03 04-07-04.png

 

 

0 Kudos
Reply
1 Reply

734 Views
turtius
Contributor I

The problem has been fixed where no data is sent through UART2 by increasing the baud rate from 115200 to 128000 and the tx line sends the right pulses at 128000 but not 115200 which is strange. 

If anyone knows the reason why please let me know.

 

0 Kudos
Reply