Hi, I'm trying to use second UART (first is working like a charm) and found out strange behavior:
UART is opened:
tInterfaceParameters.Channel = 1;
tInterfaceParameters.ucSpeed = SERIAL_BAUD_9600; // 9600 baud rate
tInterfaceParameters.Rx_tx_sizes.RxQueueSize = RX_BUFFER_SIZE; // input buffer size
tInterfaceParameters.Rx_tx_sizes.TxQueueSize = TX_BUFFER_SIZE; // output buffer size
tInterfaceParameters.Task_to_wake = OWN_TASK;
tInterfaceParameters.usConfig = (CHAR_8 | NO_PARITY | ONE_STOP | NO_HANDSHAKE | CHAR_MODE);
if (InternalUARTPortID = fnOpen( TYPE_TTY, FOR_I_O, &tInterfaceParameters )) {
fnDriver( InternalUARTPortID, ( TX_ON | RX_ON ), 0 ); // enable rx and tx
}
send some data:
if (fnWrite(InternalUARTPortID, &req, sizeof(req)) != sizeof(req)) {
//fail
}
which works fine and I can confirm data sending with osciloscope. Then as soon as data comes to this serial port execution flow jumps to
// default interrupt handler - and undefined interrupts will arrive here
//
static __interrupt__ void undef_int(void)
{
while (1) {} // wait here and analyse with debugger....
}
and application is reseted by watchdog.
Any ideas what I'm doing wrong?
Thanks in advance,
Andriy Korud