ESP8266 Developer Zone The Official ESP8266 Forum 2015-12-08T12:19:36+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=1491 2015-12-08T12:19:36+08:00 2015-12-08T12:19:36+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1491&p=4950#p4950 <![CDATA[Re: UART cause esp8266 reboot]]>
void uart0_disable_interrupt(void)
{
//disable rx interrupt
CLEAR_PERI_REG_MASK(UART_INT_ENA(UART0), UART_RXFIFO_FULL_INT_ENA|UART_RXFIFO_TOUT_INT_ENA | UART_RXFIFO_OVF_INT_ENA | UART_FRM_ERR_INT_ENA | UART_PARITY_ERR_INT_ENA);
}
void uart0_enable_interrupt(void)
{
//enable rx interrupt
SET_PERI_REG_MASK(UART_INT_ENA(UART0), UART_RXFIFO_FULL_INT_ENA|UART_RXFIFO_TOUT_INT_ENA | UART_RXFIFO_OVF_INT_ENA | UART_FRM_ERR_INT_ENA | UART_PARITY_ERR_INT_ENA);
}
when read all FIFO datas, call WRITE_PERI_REG() clear interrupt, disable uart0 interrupt when Receive buffer is full, and in task re-enable uart0 interrupt when Receive buffer is empty, it never reboot.

Statistics: Posted by wjzhang — Tue Dec 08, 2015 12:19 pm


]]>
2015-12-08T09:52:10+08:00 2015-12-08T09:52:10+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1491&p=4947#p4947 <![CDATA[Re: UART cause esp8266 reboot]]> for example, our UART task has max 64 events, but UART ISR may has more 64 interrupts when UART task process first event.

Statistics: Posted by wjzhang — Tue Dec 08, 2015 9:52 am


]]>
2015-12-08T08:27:31+08:00 2015-12-08T08:27:31+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1491&p=4946#p4946 <![CDATA[Re: UART cause esp8266 reboot]]> if the FIFO still has data, could WRITE_PERI_REG(UART_INT_CLR(UART0), UART_RXFIFO_FULL_INT_CLR) and WRITE_PERI_REG(UART_INT_CLR(UART0), UART_RXFIFO_TOUT_INT_CLR) clear the interrupt? also include the Overrun interrupt?

Statistics: Posted by wjzhang — Tue Dec 08, 2015 8:27 am


]]>
2015-12-07T19:49:47+08:00 2015-12-07T19:49:47+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1491&p=4941#p4941 <![CDATA[Re: UART cause esp8266 reboot]]>
wjzhang wrote:
Hi, when i try send esp8266 uart as much as possible datas, it caused the reboot. :(
it show " ets Jan 8 2013,rst cause:2, boot mode:(6,6) \r\n waiting for host" (foget the boot mode first 6)

the UART is set enable RTS/CTS. and the RTS also rise and fall. the test client stop send data when esp8266 rise the RTS signal. it restart send when esp8266 RTS fall.

//set Rx hardware flow control
if((pconfig->hwflowctrl == USART_HardwareFlowControl_CTS_RTS) || (pconfig->hwflowctrl == USART_HardwareFlowControl_RTS))
{
SET_PERI_REG_MASK(UART_CONF1(uart_no), ((0x78 & UART_RX_FLOW_THRHD) << UART_RX_FLOW_THRHD_S) | UART_RX_FLOW_EN );
}

in the UART ISR, read data from FIFO, stored to buffer(512 bytes size), then system_os_post() to active the UART task to handle these datas. the UART task queue size is 64. (512/(128*3/4)= 5.333)


Hello,
would you please send your test code to feedback@espressif.com? We will try to figure out what the problem is ASAP.

Statistics: Posted by costaud — Mon Dec 07, 2015 7:49 pm


]]>
2015-12-07T15:49:43+08:00 2015-12-07T15:49:43+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1491&p=4927#p4927 <![CDATA[UART cause esp8266 reboot]]>
it show " ets Jan 8 2013,rst cause:2, boot mode:(6,6) \r\n waiting for host" (foget the boot mode first 6)

the UART is set enable RTS/CTS. and the RTS also rise and fall. the test client stop send data when esp8266 rise the RTS signal. it restart send when esp8266 RTS fall.

//set Rx hardware flow control
if((pconfig->hwflowctrl == USART_HardwareFlowControl_CTS_RTS) || (pconfig->hwflowctrl == USART_HardwareFlowControl_RTS))
{
SET_PERI_REG_MASK(UART_CONF1(uart_no), ((0x78 & UART_RX_FLOW_THRHD) << UART_RX_FLOW_THRHD_S) | UART_RX_FLOW_EN );
}

in the UART ISR, read data from FIFO, stored to buffer(512 bytes size), then system_os_post() to active the UART task to handle these datas. the UART task queue size is 64. (512/(128*3/4)= 5.333)

Statistics: Posted by wjzhang — Mon Dec 07, 2015 3:49 pm


]]>