-->
Page 1 of 1

FreeRTOS first experiences

PostPosted: Tue Mar 24, 2015 12:11 pm
by kate
I have been trying to get FreeRTOS sdk running by using https://github.com/espressif/esp_iot_rtos_sdk .

I got everything compiled and downloaded to bard but the baudrate the strange default one 74880 and I have not found any Linux app supportin that.

After browsing the source usr app is in user_init(), not FreeRTOS standars not_main() . Uart seems to be initialized in app_main() that is part of libmain.a that's closed source so there is no way to check how uart is initialized or how to change baudrate.

There is uart.o in libmain.a but that's different than examples/drivers/uart.c so that does not help either.


Kate

Re: FreeRTOS first experiences

PostPosted: Tue Mar 24, 2015 1:21 pm
by kate
I solved Baudrate problem. The issue is just that it is difficult to find documentsation about API's.

Baudrate was solved by adding function
void ICACHE_FLASH_ATTR
UART_SetBaudrate(uint8 uart_no, uint32 baud_rate)
{
uart_div_modify(uart_no, UART_CLK_FREQ / baud_rate);
}

and then in user_init

void ICACHE_FLASH_ATTR
user_init(void)
{
UART_SetBaudrate(0,115200);

After searching I found APi document ESP8266_IoT_SDK_Programming Guide_v0.9.1.

Kate

Re: FreeRTOS first experiences

PostPosted: Wed Mar 25, 2015 8:46 am
by oscaracena
Hi,

I've found a way to read the serial device at the uncommon speed of 74880 (in Linux). Just use Python! :) The following script will do:

Code: Select allimport sys
from serial import Serial

dev = Serial("/dev/ttyUSB0", 74880)
while True:
    c = dev.read(1)
    sys.stdout.write(c)


Save it to a file (for example "catty.py"), and run it (with "python -u catty.py")

I hope it helps.
Cheers.

Re: FreeRTOS first experiences

PostPosted: Tue Nov 10, 2015 6:37 pm
by kolban
Looking in the latest RTOS SDK, I can no longer find a definition for uart_div_modify. Can anyone confirm if this recipe still works?