Page 1 of 1

FreeRTOS SDK - changing the uart

Posted: Sun Feb 22, 2015 1:49 pm
by tve
How can I change the UART used by the closed source parts in the esp_iot_rtos_sdk for error messages? I am connecting the UART to some other device and can't see the output, I only see what's printed via uart1 (to gpio2). For example, on uart1 I see a problem:

Code: Select all

Fatal exception (20):

but then the next thing happens on uart0:

Code: Select all

 ets Jan  8 2013,rst cause:4, boot mode:(1,7)

wdt reset

I am using

Code: Select all

but it doesn't seem to affect everything?

Re: FreeRTOS SDK - changing the uart

Posted: Sun Mar 01, 2015 4:05 pm
by fdivitto
I've disabled debug messages from the SDK using:

Code: Select all

void dummy_write_char(char c)

// now you can execute

Above code hides all stdout outputs (like printf).
You can send messages to UART using your own routine:

Code: Select all

   void writebyte(uint8_t b)
      while (true)
         uint32_t fifo_cnt = READ_PERI_REG(UART_STATUS(0)) & (UART_TXFIFO_CNT << UART_TXFIFO_CNT_S);
         if ((fifo_cnt >> UART_TXFIFO_CNT_S & UART_TXFIFO_CNT) < 126)

...or the functions provided by the SDK like "user_uart_tx_one_char" or "user_uart_write_char" located in libmain.a (I haven't tested it!).