ESP8266 Developer Zone The Official ESP8266 Forum 2016-05-31T09:34:41+08:00 https://bbs.espressif.com:443/feed.php?f=66&t=1675 2016-05-31T09:34:41+08:00 2016-05-31T09:34:41+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1675&p=7144#p7144 <![CDATA[Re: WDT reset on pwm_init]]>
Sorry that we can not reproduce your problem.

Here is our test code, please have a try and feel free to let us know, if your problem is still unsolved.

Thanks for your interest in ESP8266 !
app_dbg_wdt_For_ESP8266_NONOS_SDK_V1.4.0_201605.zip

Statistics: Posted by ESP_Faye — Tue May 31, 2016 9:34 am


]]>
2016-04-23T16:30:55+08:00 2016-04-23T16:30:55+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1675&p=6582#p6582 <![CDATA[Re: WDT reset on pwm_init]]> http://www.esp8266.com/viewtopic.php?f= ... =48#p46002

Statistics: Posted by anszom — Sat Apr 23, 2016 4:30 pm


]]>
2016-02-15T02:12:34+08:00 2016-02-15T02:12:34+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1675&p=5741#p5741 <![CDATA[Re: WDT reset on pwm_init]]> Statistics: Posted by snapdan — Mon Feb 15, 2016 2:12 am


]]>
2016-02-02T11:51:49+08:00 2016-02-02T11:51:49+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1675&p=5619#p5619 <![CDATA[Re: WDT reset on pwm_init]]>
Here is our entire test project, sorry that we could not duplicate your problem.
user_main.c is the source code you provided.
\esp_iot_sdk_test\bin are our bin files after compiling the test code, please download and have a try.
esp_iot_sdk_test.zip

Statistics: Posted by ESP_Faye — Tue Feb 02, 2016 11:51 am


]]>
2016-01-31T03:23:26+08:00 2016-01-31T03:23:26+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1675&p=5579#p5579 <![CDATA[Re: WDT reset on pwm_init]]>
Espressif_Faye wrote:
Hi,

I tested your code, it works fine, no WDT reset.

Did you download a wrong bin file ? It seems that your log is not corresponding to your test code.
In your log, the ESP8266 connects to a router, but there is no this part in your test code.


Thanks for checking. It was connecting to a router because it was stored in flash. I cleared that with system_restore() and changed the code but it still resets when it gets to the pwm_init.

This code:

Code:

#include "ets_sys.h"
#include "osapi.h"
#include "user_interface.h"
 
void user_init() {

    // wifi_set_opmode_current(STATION_MODE);
    wifi_set_opmode_current(SOFTAP_MODE);
    uart_div_modify(0, UART_CLK_FREQ / 115200);
    gpio_init();

    uint32_t io_info[1][3] = {   
                          {PERIPHS_IO_MUX_MTCK_U,FUNC_GPIO13,13},
                          };

    uint32_t duty[1] = {500};
    pwm_init(1000, duty,1,io_info);
    pwm_start();

}


Gets this output:


�lrl�mode : softAP(1a:fe:34:9f:da:75)
add if1
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)

ets Jan 8 2013,rst cause:4, boot mode:(3,0)

wdt reset
load 0x40100000, len 27336, room 16
tail 8
chksum 0x9f
load 0x3ffe8000, len 904, room 0
tail 8
chksum 0x5f
load 0x3ffe8388, len 244, room 0
tail 4
chksum 0x7d
csum 0x7d
rl�mode : softAP(1a:fe:34:9f:da:75)
add if1
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)

ets Jan 8 2013,rst cause:4, boot mode:(3,0)

wdt reset
load 0x40100000, len 27336, room 16
tail 8
chksum 0x9f
load 0x3ffe8000, len 904, room 0
tail 8
chksum 0x5f
load 0x3ffe8388, len 244, room 0
tail 4
chksum 0x7d
csum 0x7d
rl�mode : softAP(1a:fe:34:9f:da:75)
add if1
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)


This code:

Code:

#include "ets_sys.h"
#include "osapi.h"
#include "user_interface.h"
 
void user_init() {

    wifi_set_opmode_current(STATION_MODE);
    // wifi_set_opmode_current(SOFTAP_MODE);
    uart_div_modify(0, UART_CLK_FREQ / 115200);
    gpio_init();

    uint32_t io_info[1][3] = {   
                          {PERIPHS_IO_MUX_MTCK_U,FUNC_GPIO13,13},
                          };

    uint32_t duty[1] = {500};
    pwm_init(1000, duty,1,io_info);
    pwm_start();

}


Gets this output:


�l�lrl�mode : sta(18:fe:34:9f:da:75)
add if0

ets Jan 8 2013,rst cause:4, boot mode:(3,0)

wdt reset
load 0x40100000, len 27336, room 16
tail 8
chksum 0x9c
load 0x3ffe8000, len 904, room 0
tail 8
chksum 0x5c
load 0x3ffe8388, len 244, room 0
tail 4
chksum 0x7e
csum 0x7e
rl�mode : sta(18:fe:34:9f:da:75)
add if0

ets Jan 8 2013,rst cause:4, boot mode:(3,0)

wdt reset
load 0x40100000, len 27336, room 16
tail 8
chksum 0x9c
load 0x3ffe8000, len 904, room 0
tail 8
chksum 0x5c
load 0x3ffe8388, len 244, room 0
tail 4
chksum 0x7e
csum 0x7e
rl�mode : sta(18:fe:34:9f:da:75)
add if0


This code works and I get the expected tone from the piezo:

Code:

#include "ets_sys.h"
#include "osapi.h"
#include "user_interface.h"
 
void user_init() {

    // wifi_set_opmode_current(STATION_MODE);
    // wifi_set_opmode_current(SOFTAP_MODE);
    uart_div_modify(0, UART_CLK_FREQ / 115200);
    gpio_init();

    uint32_t io_info[1][3] = {   
                          {PERIPHS_IO_MUX_MTCK_U,FUNC_GPIO13,13},
                          };

    uint32_t duty[1] = {500};
    pwm_init(1000, duty,1,io_info);
    pwm_start();

}


Output:


r��`rlmode : softAP(1a:fe:34:9f:da:75)
add if1
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100

Statistics: Posted by snapdan — Sun Jan 31, 2016 3:23 am


]]>
2016-01-28T12:10:13+08:00 2016-01-28T12:10:13+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1675&p=5550#p5550 <![CDATA[Re: WDT reset on pwm_init]]>
I tested your code, it works fine, no WDT reset.

Did you download a wrong bin file ? It seems that your log is not corresponding to your test code.
In your log, the ESP8266 connects to a router, but there is no this part in your test code.

Statistics: Posted by ESP_Faye — Thu Jan 28, 2016 12:10 pm


]]>
2016-01-26T09:38:15+08:00 2016-01-26T09:38:15+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1675&p=5530#p5530 <![CDATA[Re: WDT reset on pwm_init]]>
Espressif_Faye wrote:
Hi,

If you want to download firmware into Flash, it is : MTDO:0,GPIO0:0,GPIO2:1.
If you want to run the firmware, it is : MTDO:0,GPIO0:1,GPIO2:1.

It seems your GPIO0 is still in low-level, so the ESP8266 could not run the firmware.

If your problem is still unsolved, please feel free to let us know.


Ah, thank you but that's not the problem. Sorry - I should have been clearer with the debug output. With this code

Code:

#include "ets_sys.h"
#include "osapi.h"
#include "user_interface.h"

void show_mac (void) {
    unsigned char mac[6];
    // wifi_get_macaddr ( STATION_IF, mac );
    // os_printf ( "MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
    // mac[0], mac[1], mac[2], mac[3], mac[4], mac[5] );
}
 
void user_init() {

    uart_div_modify(0, UART_CLK_FREQ / 115200);
    gpio_init();

    uint32_t io_info[1][3] = {   
                          {PERIPHS_IO_MUX_MTCK_U,FUNC_GPIO13,13},
                          };

    uint32_t duty[1] = {500};
    pwm_init(1000, duty,1,io_info);
    pwm_start();

    // show_mac ();

}


the pwm works (I have it connected to a piezo and it's making a tone) and I get the expected output


r��`rlmode : sta(18:fe:34:9f:da:75) + softAP(1a:fe:34:9f:da:75)
add if0
add if1
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100
f r0, scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 1
cnt

connected with MuseumWorst, channel 5
dhcp client start...
ip:192.168.1.81,mask:255.255.255.0,gw:192.168.1.254


When I un-comment line 7 - which is never even used:

Code:

#include "ets_sys.h"
#include "osapi.h"
#include "user_interface.h"

void show_mac (void) {
    unsigned char mac[6];
    wifi_get_macaddr ( STATION_IF, mac );
    // os_printf ( "MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
    // mac[0], mac[1], mac[2], mac[3], mac[4], mac[5] );
}
 
void user_init() {

    uart_div_modify(0, UART_CLK_FREQ / 115200);
    gpio_init();

    uint32_t io_info[1][3] = {   
                          {PERIPHS_IO_MUX_MTCK_U,FUNC_GPIO13,13},
                          };

    uint32_t duty[1] = {500};
    pwm_init(1000, duty,1,io_info);
    pwm_start();

    // show_mac ();

}


I get constant wdt resets and it never seems to make it through pwm_init (the piezo is silent) :


b��`rlmode : sta(18:fe:34:9f:da:75) + softAP(1a:fe:34:9f:da:75)
add if0
add if1
dhcp server start:(ip:192.
ets Jan 8 2013,rst cause:4, boot mode:(3,0)

wdt reset
load 0x40100000, len 27360, room 16
tail 0
chksum 0x5d
load 0x3ffe8000, len 904, room 8
tail 0
chksum 0x9d
load 0x3ffe8388, len 244, room 8
tail 12
chksum 0xbf
csum 0xbf
rlmode : sta(18:fe:34:9f:da:75) + softAP(1a:fe:34:9f:da:75)
add if0
add if1
dhcp server start:(ip:192.
ets Jan 8 2013,rst cause:4, boot mode:(3,0)

wdt reset
load 0x40100000, len 27360, room 16
tail 0
chksum 0x5d
load 0x3ffe8000, len 904, room 8
tail 0
chksum 0x9d
load 0x3ffe8388, len 244, room 8
tail 12
chksum 0xbf
csum 0xbf
rlmode : sta(18:fe:34:9f:da:75) + softAP(1a:fe:34:9f:da:75)
add if0
add if1
dhcp server start:(ip:192.


Even just trying to add any more debug messages with os_printf causes the resets as well.

Statistics: Posted by snapdan — Tue Jan 26, 2016 9:38 am


]]>
2016-01-25T17:00:42+08:00 2016-01-25T17:00:42+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1675&p=5515#p5515 <![CDATA[Re: WDT reset on pwm_init]]>
If you want to download firmware into Flash, it is : MTDO:0,GPIO0:0,GPIO2:1.
If you want to run the firmware, it is : MTDO:0,GPIO0:1,GPIO2:1.

It seems your GPIO0 is still in low-level, so the ESP8266 could not run the firmware.

If your problem is still unsolved, please feel free to let us know.

Statistics: Posted by ESP_Faye — Mon Jan 25, 2016 5:00 pm


]]>
2016-01-24T09:36:19+08:00 2016-01-24T09:36:19+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1675&p=5497#p5497 <![CDATA[WDT reset on pwm_init]]>

Code:

#include "ets_sys.h"
#include "osapi.h"
#include "user_interface.h"

void show_mac (void) {
    unsigned char mac[6];
    // wifi_get_macaddr ( STATION_IF, mac );
    // os_printf ( "MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
    // mac[0], mac[1], mac[2], mac[3], mac[4], mac[5] );
}
 
void user_init() {

    uart_div_modify(0, UART_CLK_FREQ / 115200);
    gpio_init();

    uint32_t io_info[1][3] = {   
                          {PERIPHS_IO_MUX_MTCK_U,FUNC_GPIO13,13},
                          };

    uint32_t duty[1] = {500};
    pwm_init(1000, duty,1,io_info);
    pwm_start();

    // show_mac ();

}


However, if I un-comment just line 7 so it's like so:

Code:

#include "ets_sys.h"
#include "osapi.h"
#include "user_interface.h"

void show_mac (void) {
    unsigned char mac[6];
    wifi_get_macaddr ( STATION_IF, mac );
    // os_printf ( "MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
    // mac[0], mac[1], mac[2], mac[3], mac[4], mac[5] );
}
 
void user_init() {

    uart_div_modify(0, UART_CLK_FREQ / 115200);
    gpio_init();

    uint32_t io_info[1][3] = {   
                          {PERIPHS_IO_MUX_MTCK_U,FUNC_GPIO13,13},
                          };

    uint32_t duty[1] = {500};
    pwm_init(1000, duty,1,io_info);
    pwm_start();

    // show_mac ();

}


It crashes:


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

wdt reset


Which is especially strange since I'm still not even calling the show_mac() function!

I'm using the pfalcon/open-sdk and toolchain, which uses the v1.4.0 sdk. Here's the makefile I'm using:

Code:

# Makefile for older versions (<1.0) of Espressif "AT" firmware
CC = xtensa-lx106-elf-gcc
CFLAGS = -I. -mlongcalls
LDLIBS = -nostdlib -Wl,--start-group -lmain -lupgrade -lnet80211 -lwpa -llwip -lpp -lphy -Wl,--end-group -lcirom -lgcc -lpwm
LDFLAGS = -Teagle.app.v6.ld

malarm-0x00000.bin: malarm
   esptool.py elf2image $^

malarm: malarm.o
   $(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS)

malarm.o: malarm.c

flash: malarm-0x00000.bin
   esptool.py write_flash 0 malarm-0x00000.bin 0x40000 malarm-0x40000.bin

connect:
   picocom -b 115200 --omap crcrlf /dev/ttyUSB0


Any thoughts or ideas? Thanks.

Statistics: Posted by snapdan — Sun Jan 24, 2016 9:36 am


]]>