ESP8266 Developer Zone The Official ESP8266 Forum 2016-11-25T13:23:35+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=3114 2016-11-25T13:23:35+08:00 2016-11-25T13:23:35+08:00 https://bbs.espressif.com:443/viewtopic.php?t=3114&p=10654#p10654 <![CDATA[Re: ESP8266 RTOS SDK version 1.4.0 "how to get data from UART0?"]]>

Statistics: Posted by Guest — Fri Nov 25, 2016 1:23 pm


]]>
2016-11-22T05:21:53+08:00 2016-11-22T05:21:53+08:00 https://bbs.espressif.com:443/viewtopic.php?t=3114&p=10606#p10606 <![CDATA[Re: ESP8266 RTOS SDK version 1.4.0 "how to get data from UART0?"]]>
Thanks you for your directions.

I solved my problem, without using interrupt:

if( (READ_PERI_REG(UART_STATUS(0))>>UART_RXFIFO_CNT_S) & UART_RXFIFO_CNT )
{
data = READ_PERI_REG(UART_FIFO(0) );
}

As my console is a thread and the data flux is low ( few console commands ), polling method works very well.

Problem solved.

Anyway, thank you for your kind support.

Sergio

Statistics: Posted by serkam — Tue Nov 22, 2016 5:21 am


]]>
2016-11-19T13:51:43+08:00 2016-11-19T13:51:43+08:00 https://bbs.espressif.com:443/viewtopic.php?t=3114&p=10587#p10587 <![CDATA[Re: ESP8266 RTOS SDK version 1.4.0 "how to get data from UART0?"]]> You can simply register an interrupt handler and process the keystrokes in there. That would be the best way to work with UART. Meanwhile I can try to come up with some examples for the same.

Also, see the function definitions in uart.h header file... they are described in the header file itself and you can use the character receive function from there!

Statistics: Posted by Guest — Sat Nov 19, 2016 1:51 pm


]]>
2016-11-18T20:47:27+08:00 2016-11-18T20:47:27+08:00 https://bbs.espressif.com:443/viewtopic.php?t=3114&p=10582#p10582 <![CDATA[ESP8266 RTOS SDK version 1.4.0 "how to get data from UART0?"]]>
I need to build a UART console routine ( as a thread ) for my ESP8266 project under RTOS SDK ( 1.4.0 ), for debugging purposes, but, I couldn't use scanf or getchar to get data from UART0. The program is compiled and linked without problem, but, at execution, the FreeRTOS enter in a crazy loop. The console routine is built as a thread. If I comment the block code with scanf or getchar, the thread works perfectly, indicating that the problem is over scanf or getchar.

Which function can I use instead scanf or getchar?

Any example available, please?

Thanks

Sergio

Statistics: Posted by serkam — Fri Nov 18, 2016 8:47 pm


]]>