一个简单crash v0.9.5的方法

xiaodong
Posts: 2
Joined: Sat May 16, 2015 1:15 am

一个简单crash v0.9.5的方法

Postby xiaodong » Sat May 16, 2015 1:27 am

以下做法可crash v0.9.5。主要原因应该在os_delay_us()。有没有人知为什么?

结果是不断重启。

Code: Select all

#define DELAY 1000 /* milliseconds */

LOCAL os_timer_t hello_timer;
extern int ets_uart_printf(const char *fmt, ...);

LOCAL void ICACHE_FLASH_ATTR hello_cb(void *arg)
{
   ets_uart_printf("Hello World!\r\n");
}

static void ICACHE_FLASH_ATTR systemInitDoneHandler() {
   os_delay_us(5*1000000);
}

void user_init(void)
{
   // Configure the UART
   uart_init(BIT_RATE_115200, BIT_RATE_115200);

   os_timer_disarm(&hello_timer);
   os_timer_setfn(&hello_timer, (os_timer_func_t *)hello_cb, (void *)0);
   os_timer_arm(&hello_timer, DELAY, 1);

   system_init_done_cb(systemInitDoneHandler);
}



Code: Select all

wdt reset
load 0x40100000, len 27256, room 16
tail 8
chksum 0x8e
load 0x3ffe8000, len 2392, room 0
tail 8
chksum 0x4e
load 0x3ffe8960, len 1228, room 0
tail 12
chksum 0x94
csum 0x94
{$
 ets Jan  8 2013,rst cause:4, boot mode:(3,7)

wdt reset
load 0x40100000, len 27256, room 16
tail 8
chksum 0x8e
load 0x3ffe8000, len 2392, room 0
tail 8
chksum 0x4e
load 0x3ffe8960, len 1228, room 0
tail 12
chksum 0x94
csum 0x94
;l
 ets Jan  8 2013,rst cause:4, boot mode:(3,7)

wdt reset
load 0x40100000, len 27256, room 16
tail 8
chksum 0x8e
load 0x3ffe8000, len 2392, room 0
tail 8
chksum 0x4e
load 0x3ffe8960, len 1228, room 0
tail 12
chksum 0x94
csum 0x94
{l
 ets Jan  8 2013,rst cause:4, boot mode:(3,7)

wdt reset
load 0x40100000, len 27256, room 16
tail 8
chksum 0x8e
load 0x3ffe8000, len 2392, room 0
tail 8
chksum 0x4e
load 0x3ffe8960, len 1228, room 0
tail 12
chksum 0x94
csum


:?:

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: 一个简单crash v0.9.5的方法

Postby ESP_Faye » Tue May 19, 2015 10:03 am

您好,

非 OS SDK 其实相当于单线程,您使用的 os_delay_us 其实是 while 住了系统,影响底层喂看门狗,因而看门狗复位了。

详细请参考 BBS http://bbs.espressif.com/viewtopic.php?f=10&t=323

Who is online

Users browsing this forum: No registered users and 141 guests