AnsweredAssumed Answered

UART interrupt not working

Question asked by raghu kumar on Apr 3, 2012
Latest reply on Apr 3, 2012 by Martin Kojtal

Hi,

 

I am trying to use interrupt on UART3. I have configured user_config.h as below :

#define BSPCFG_ENABLE_TTYD 0

#define BSPCFG_ENABLE_ITTYD 1

#define BSP_DEFAULT_IO_CHANNEL "ittyd:"

#define BSP_DEFAULT_IO_CHANNEL_DEFINED

and also update twrk40x256.h with following:

#ifndef BSP_DEFAULT_IO_CHANNEL
#if BSPCFG_ENABLE_TTYD
#define BSP_DEFAULT_IO_CHANNEL "ittyd:"
#define BSP_DEFAULT_IO_CHANNEL_DEFINED

The problem i am facing is that the when some data is sent from host on UART the interrupt is not triggered.

Part of application which installs ISR and some code in ISR:

#define RS485_CHANNEL "ittyd:"

func()
{

rs485_dev = fopen( RS485_CHANNEL, (char const *)IO_SERIAL_HW_485_FLOW_CONTROL );
#else
/* HW 485 flow not available on chip */
rs485_dev = fopen( RS485_CHANNEL, NULL );
#endif
if( rs485_dev == NULL )
{
/* device could not be opened */
_task_block();
}
if( result == IO_ERROR_INVALID_IOCTL_CMD )
{
_task_block();
}
_int_install_isr(INT_UART3_RX_TX, uart3_rx_tx_isr, NULL);
err = _io_ioctl(rs485_dev, IO_IOCTL_SERIAL_SET_BAUD, &ulBaudRate);
err = _io_ioctl(rs485_dev, IO_IOCTL_SERIAL_SET_DATA_BITS, &ucDataBits);
err = _io_ioctl(rs485_dev, IO_IOCTL_SERIAL_SET_STOP_BITS, &ucStopBits);
}


void
uart3_rx_tx_isr( pointer user_isr_ptr )
{
UBYTE ubUDR; /* TODO: Get byte from UART. */;

/* optional to open device again*/
rs485_dev = fopen( RS485_CHANNEL, NULL );
if( rs485_dev == NULL )
{
/* device could not be opened */
_task_block();
}

if (fstatus( rs485_dev ))
{
    ubUDR = fgetc( rs485_dev );
}
}

 

Can some one help getting ISR triggered when there is some data on UART3?

 

/Raghu

Outcomes