FreeRTOS SDK - changing the uart

tve
Posts: 123
Joined: Sun Feb 15, 2015 4:33 pm

FreeRTOS SDK - changing the uart

Postby tve » Sun Feb 22, 2015 1:49 pm

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):
epc1=0x00000000
epc2=0x00000000
epc3=0x40242f90
epcvaddr=0x00000000
depc=0x00000000
"@▒rjrA(!▒S▒u▒К▒X%(▒▒y▒eh)"8▒t▒ͪN

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

os_install_putc1(uart1_write_char);
but it doesn't seem to affect everything?

fdivitto
Posts: 4
Joined: Fri Feb 20, 2015 6:50 am
Location: Italy
Contact:

Re: FreeRTOS SDK - changing the uart

Postby fdivitto » Sun Mar 01, 2015 4:05 pm

Hello,
I've disabled debug messages from the SDK using:

Code: Select all

void dummy_write_char(char c)
{
}


// now you can execute
os_install_putc1(dummy_write_char);


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)
            break;
      }
      WRITE_PERI_REG(UART_FIFO(0) , b);
   }


...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!).

Who is online

Users browsing this forum: No registered users and 14 guests