Chat freely about anything...

User avatar
By kate
#12548 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
User avatar
By kate
#12556 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
User avatar
By oscaracena
#12605 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.
User avatar
By kolban
#33650 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?