ESP8266 Developer Zone The Official ESP8266 Forum 2015-02-13T18:28:31+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=198 2015-02-13T18:28:31+08:00 2015-02-13T18:28:31+08:00 https://bbs.espressif.com:443/viewtopic.php?t=198&p=716#p716 <![CDATA[Re: wdt reset in espconn_regist_recvcb callback]]> Statistics: Posted by muris — Fri Feb 13, 2015 6:28 pm


]]>
2015-02-13T17:34:22+08:00 2015-02-13T17:34:22+08:00 https://bbs.espressif.com:443/viewtopic.php?t=198&p=714#p714 <![CDATA[Re: wdt reset in espconn_regist_recvcb callback]]>
muris wrote:
Can I fix this using new API function: espconn_recv_hold() and espconn_recv_unhold() like this? (I am at work, can't test this until tonight) :(


No, you can't: the watchdog will reset the IC if you spend too much time in a routine, regardless of what you do inside the routine.
As I've mentioned on the other forum: a way to handle this is to push the data into a ring buffer (and you can use espconn_recv_hold there if the buffer gets too full) and use either the interrupt from the uart or a seperate thread to get the data from the ring buffer and send it out.

Statistics: Posted by ESP_Sprite — Fri Feb 13, 2015 5:34 pm


]]>
2015-02-13T16:52:20+08:00 2015-02-13T16:52:20+08:00 https://bbs.espressif.com:443/viewtopic.php?t=198&p=713#p713 <![CDATA[Re: wdt reset in espconn_regist_recvcb callback]]>

Code:

// this is the function that uses received data
static void ICACHE_FLASH_ATTR ctrl_platform_recv_cb(void *arg, char *pdata, unsigned short len)
{
   struct espconn *pespconn = arg;

   espconn_recv_hold(pespconn); // HOLD RECEIVING TCP DATA

   // Here I do stuff with data I received...
   // The WDT RESET happens when chip receives more data before exiting this function :(

   espconn_recv_unhold(pespconn); // RESUME RECEIVING TCP DATA
}

:?:

Statistics: Posted by muris — Fri Feb 13, 2015 4:52 pm


]]>
2015-02-13T03:51:41+08:00 2015-02-13T03:51:41+08:00 https://bbs.espressif.com:443/viewtopic.php?t=198&p=708#p708 <![CDATA[wdt reset in espconn_regist_recvcb callback]]> My chip resets if it receives more data and if it didn't exit the espconn_regist_recvcb callback function just yet.

For example:

Code:

// somewhere I declare callback for receiving TCP data...
espconn_regist_recvcb(pespconn, ctrl_platform_recv_cb);


Code:

// this is the function that uses received data
static void ICACHE_FLASH_ATTR ctrl_platform_recv_cb(void *arg, char *pdata, unsigned short len)
{
   struct espconn *pespconn = arg;

   // Here I do stuff with data I received...
   // The WDT RESET happens when chip receives more data before exiting this function :(
}

Is that normal? If not, how can I fix it?

If that is normal, how can I do some long-lasting work with the chip (such as forwarding data to GSM modem and waiting for a GSM modem reply) while ESP is receiving next data? Perhaps you have an example for me :D

Thanks!

Statistics: Posted by muris — Fri Feb 13, 2015 3:51 am


]]>