AnsweredAssumed Answered

UART ISR not exiting

Question asked by kiran kunnath on Nov 5, 2013
Latest reply on Nov 6, 2013 by kiran kunnath

Hi,

     I am using MQX UART driver for a project. Iam using TWR-K60 board for testing.

I have used UART0 and for that i have enabled "BSPCFG_ENABLE_ITTYA = 1" ( I want interrupt mode).

 

I have opened the device successfully and installed the ISR for the "INT_UART0_RX_TX".

when i am doing a write, the control is going to the ISR. But it is not coming out from there.

Code is given below. Any more settings need to be done?

Please help in this issue.

 

#define RS232_CHANNEL "ittya:"

 

// Main task

 

void rs232_write_task

   (

      uint_32 initial_data

   )

{

   

    MY_ISR_STRUCT_PTR  isr_ptr;

    char  data_buffer[] = "ISR EXAMPLE";

    uint_32 flag=IO_SERIAL_RAW_IO|IO_SERIAL_NON_BLOCKING;

    uint_32 baud=9600;

    uint_32 count = 0;

  

   rs232_dev = fopen( RS232_CHANNEL, (char const *)IO_SERIAL_HW_232_FLOW_CONTROL );

   if( rs232_dev == NULL )

   {

      _task_block();

   }

   ioctl(rs232_dev,IO_IOCTL_SERIAL_SET_FLAGS, &flag);

   ioctl(rs232_dev,IO_IOCTL_SERIAL_SET_BAUD, &baud);

 

    isr_ptr = _mem_alloc_zero((_mem_size)sizeof(MY_ISR_STRUCT));

    isr_ptr->OLD_ISR_DATA =

    _int_get_isr_data(INT_UART0_RX_TX);

    isr_ptr->OLD_ISR      =

    _int_get_isr(INT_UART0_RX_TX);

 

    _int_install_isr(INT_UART0_RX_TX, my_uart0_isr, isr_ptr);

    write( rs232_dev, data_buffer, strlen(data_buffer) );

     while(1)

     {

         count++;

    }

}

 

// ISR

 

void my_uart0_isr

(

   pointer user_isr_ptr

)

{

 

   MY_ISR_STRUCT_PTR  isr_ptr;

   

   isr_ptr = (MY_ISR_STRUCT_PTR)user_isr_ptr;

   (*isr_ptr->OLD_ISR)(isr_ptr->OLD_ISR_DATA);

  

}

 

 

Thanks,

Kiran

Outcomes