Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 7 months ago.
K64F Rx Serial Interrupt working?
Hello,
I have a tried-and-true serial interrupt routine for mbed. It seems to get stuck with getc() command for the K64F. In this example, no RTOS is used. However, the RTOS equivalent code also fails at getc().
Serial pc(USBTX, USBRX); void PcRxIRQ(void){ NVIC_DisableIRQ(UART0_RX_TX_IRQn); // n=0, 1 or 2 Disable Rx interrupt on k64f while (pc.readable()) { inchar = pc.getc(); //<<<<< broken here!!!! //read data from USB PcRxChar(inchar); //go process char } NVIC_EnableIRQ(UART0_RX_TX_IRQn); // n=0, 1 or 2 Re-enable Rx interrupt on k64f } int main() { //init code here pc.baud(115200); pc.attach(&PcRxIRQ, pc.RxIrq); //more init code while(1); }
...kevin
1 Answer
10 years, 6 months ago.
I'm not sure if this is related, but in working through start-up issues with the K64F board I ran across an oddity related to serial communication. After opening a serial connection out the usb port with
Serial pc(USBTX, USBRX);
I tried increasing the baud rate, first to 230400 and then to 460800. Sending out 30-40K characters at a time worked fine at 230400, but at 460800 about every 4th character was dropped. For reference, there is no handshaking set up with my rig.
Also for reference, I have had no problem running at 460800 with several other mbed platforms, including LPC1768 LPC4088 Nucleo F401RE
Got any ideas?
Jim
Hello Kevin, have you found out the issue here? I will look at this this week
posted by Martin Kojtal 28 Apr 2014Hold off on looking into this Martin,
I have removed a couple unused drivers (.h files). I am getting some results, but still having a problem processing characters as they arrive. Give me a couple more days.
...kevin
posted by Kevin Braun 28 Apr 2014Martin,
I think I've narrowed down the issue. The receive character hardware does not seem to have a receive FIFO. Then receiving multiple characters quickly, (e.g. return "\r\n" or up-arrow "ESC[ A") characters get missed.
...kevin
posted by Kevin Braun 28 Apr 2014Yes, k64f does not have fifo enabled. I assume FIFO is available for K64F. Are you familiar with github? You can change the current implementation in mbe dsources and ask for a pull request.
posted by Martin Kojtal 04 May 2014Sorry Martin,
I am out of my league with that request.
...kevin
posted by Kevin Braun 05 May 2014