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:
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:
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.