AnsweredAssumed Answered

MQX UART lost characters with ESP8266

Question asked by Norbert Gal on Apr 8, 2015

Hello!

 

I learning the basics of MQX system on KWIKSTIK K40. Now I trying to communicate with ESP8266 wifi module over UART5 in interrupt mode.

My program send AT commands to the module, then I waiting for response in form of interrupt, finally I print it to the console.

 

This is going well on BAUD RATE 9600.

 

Here is the response:

AT+CIOBAUD=9600

OK

AT+GMR

0018000902-AI03

OK

 

But when I change BAUD RATE to 115200 I lost some of characters:

AAUD=115200

OK

                              <a whole of line is missing

0018000902-AI03

OK

 

Or at BAUD RATE 921600:

AT

OK

A

0018000902-AI03

OK

 

This function is called by the interrupt:

void uart5_isr(pointer user_isr_ptr) {     MY_ISR_STRUCT_PTR  isr_ptr = (MY_ISR_STRUCT_PTR)user_isr_ptr;     isr_ptr->TICK_COUNT++;     UART_MemMapPtr sci_ptr = _bsp_get_serial_base_address (5);         if((sci_ptr->S1 & UART_S1_RDRF_MASK) == UART_S1_RDRF_MASK)     {         received_char = sci_ptr->D;         strcat(received_string,&received_char);     }     (*isr_ptr->OLD_ISR)(isr_ptr->OLD_ISR_DATA); } 

 

My first question is: why the characters are missing and how to prevent it?

The second: Is this a correct form of handling an interrupt or can It do better?

 

Iam just learning of MQX... I attach the source code.

Thank You!

Original Attachment has been moved to: main.c.txt.zip

Outcomes