AnsweredAssumed Answered

UART ISR for K70 in MQX

Question asked by Akshat Saraf on May 1, 2014
Latest reply on May 2, 2014 by Garabo

Hello,

 

I use interrupt driven UART ("ittyb:") in my project and wanted to send and receive strings over the UART.

I am able to receive the string, but only one byte is transmitting from the UART, Here is my sample uart ISR


void serial_isr(void *user_isr_ptr)

{

     UART_MemMapPtr sci_ptr = _bsp_get_serial_base_address (1);      //DES get base address for UART5

     uData = sci_ptr->S1;                                                                       //DES read status register.  Part of two step process to clear the interrupt flag.

     uData = sci_ptr->D;                                                                       //DES get the character

     //printf("%c", uData);

     switch(uData)

     {

          // Data processing...

     }

}

 

In main task:

void SerialZero_Task(uint32_t initial_data)

{

     serial_ptr = fopen (SERIAL_CHANNEL_ZERO, BSP_DEFAULT_IO_OPEN_MODE);

     if( serial_ptr == NULL )

     {

          printf("Error: Unable to open IO channel\n");

          _task_block();

      }

     param = TRUE;

     result = ioctl( serial_ptr, IO_IOCTL_SERIAL_SET_FLAGS , &param );

     if( MQX_OK != result )

     {

          _task_block();

     }

     result = ioctl(serial_ptr, IO_IOCTL_SERIAL_SET_BAUD, &baudrate);

     if (MQX_OK != result)

     {

          _task_block();

     }

     _nvic_int_init(INT_UART1_RX_TX, 2, TRUE); 

     _nvic_int_enable(INT_UART1_RX_TX); 

     _int_install_isr(INT_UART1_RX_TX, serial_isr, serial_ptr);

 

     while()

     { }

}

Outcomes