I'm about to implement a ModBus handler over RS-485 and I want to use the UART device driver on USART2.
However, the call to initialise the driver always causes the program to crash. The config is below.
If I enable the the serial driver on SD2, it works great. I've checked there are no DMA conflicts, and expanded the stack sizes beyond any reasonable limit.
Any ideas?
Craig
Code: Select all
UARTConfig config = {
&Modbus_TxEnd1, // uartcb_t txend1_cb; // End of transmission buffer callback.
&Modbus_TxEnd2, // uartcb_t txend2_cb; // Physical end of transmission callback.
&Modbus_RxEnd, // uartcb_t rxend_cb; // Receive buffer filled callback.
&Modbus_RxOOB, // uartccb_t rxchar_cb; // Character received while out if the @p UART_RECEIVE state.
&Modbus_RxTO, // uartecb_t rxerr_cb; // Receive error callback.
9600,
0,
USART_CR2_STOP1_BITS | USART_CR2_LINEN,
0
};