[riot-notifications] [RIOT-OS/RIOT] cpu/esp32: WDT reset in threaded applications (#11443)

Yegor Yefremov notifications at github.com
Thu Apr 25 10:39:35 CEST 2019


I'm porting TTGO T-Beam board to RIOT (#11418). Executing `examples/lorawan` produces following output:

```
2019-04-25 10:26:56,695 - INFO # I (37) boot: ESP-IDF v3.1-dev-961-ga255622 2nd stage bootloader
2019-04-25 10:26:56,699 - INFO # I (43) boot: compile time 12:38:02
2019-04-25 10:26:56,705 - INFO # I (56) boot: Enabling RNG early entropy source...
2019-04-25 10:26:56,710 - INFO # I (56) boot: SPI Speed      : 40MHz
2019-04-25 10:26:56,715 - INFO # I (57) boot: SPI Mode       : DOUT
2019-04-25 10:26:56,719 - INFO # I (61) boot: SPI Flash Size : 4MB
2019-04-25 10:26:56,724 - INFO # I (65) boot: Partition Table:
2019-04-25 10:26:56,731 - INFO # I (69) boot: ## Label            Usage          Type ST Offset   Length
2019-04-25 10:26:56,739 - INFO # I (76) boot:  0 nvs              WiFi data        01 02 00009000 00006000
2019-04-25 10:26:56,747 - INFO # I (83) boot:  1 phy_init         RF data          01 01 0000f000 00001000
2019-04-25 10:26:56,755 - INFO # I (91) boot:  2 factory          factory app      00 00 00010000 00020a90
2019-04-25 10:26:56,760 - INFO # I (98) boot: End of partition table
2019-04-25 10:26:56,769 - INFO # I (103) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x03f78 ( 16248) map
2019-04-25 10:26:56,779 - INFO # I (118) esp_image: segment 1: paddr=0x00013fa0 vaddr=0x3ffb0000 size=0x0129c (  4764) load
2019-04-25 10:26:56,788 - INFO # I (122) esp_image: segment 2: paddr=0x00015244 vaddr=0x40080000 size=0x00400 (  1024) load
2019-04-25 10:26:56,797 - INFO # I (130) esp_image: segment 3: paddr=0x0001564c vaddr=0x40080400 size=0x07928 ( 31016) load
2019-04-25 10:26:56,806 - INFO # I (152) esp_image: segment 4: paddr=0x0001cf7c vaddr=0x00000000 size=0x03094 ( 12436)
2019-04-25 10:26:56,816 - INFO # I (156) esp_image: segment 5: paddr=0x00020018 vaddr=0x400d0018 size=0x10a54 ( 68180) map
2019-04-25 10:26:56,825 - INFO # I (187) boot: Loaded app from partition at offset 0x10000
2019-04-25 10:26:56,831 - INFO # I (187) boot: Disabling RNG early entropy source...
2019-04-25 10:26:56,832 - INFO #
2019-04-25 10:26:56,836 - INFO # Starting ESP32 with ID: c23c71bf9db6cc
2019-04-25 10:26:56,837 - INFO #
2019-04-25 10:26:56,844 - INFO # Current clocks in Hz: CPU=80000000 APB=80000000 XTAL=40000000 SLOW=150000
2019-04-25 10:26:56,850 - INFO # PRO cpu is up (single core mode, only PRO cpu is used)
2019-04-25 10:26:56,853 - INFO # PRO cpu starts user code
2019-04-25 10:26:56,861 - INFO # _lock_acquire_recursive parameter condition (sched_active_thread != 0) not fulfilled
2019-04-25 10:26:56,869 - INFO # _lock_release_recursive parameter condition (sched_active_thread != 0) not fulfilled
2019-04-25 10:26:56,877 - INFO # system_wdt_init TIMERG0 wdt_config0=b83f8000 wdt_config1=00500000 wdt_config2=001e8480
2019-04-25 10:26:56,888 - INFO # _lock_acquire_recursive parameter condition Used clocks in Hz: CPU=80000000 APB=80000000 XTAL=40000000 FAST=8000000 SLOW=150000
2019-04-25 10:26:56,892 - INFO # XTAL calibration value: 3544115
2019-04-25 10:26:56,897 - INFO # Heap free: 176128 bytes
2019-04-25 10:26:56,905 - INFO # _lock_acquire_recursive parameter condition (sched_active_thread != 0) not fulfilled
2019-04-25 10:26:56,913 - INFO # _lock_release_recursive parameter condition (sched_active_thread != 0) not fulfilled
2019-04-25 10:26:56,920 - INFO # _lock_acquire parameter condition (sched_active_thread != 0) not fulfilled
2019-04-25 10:26:56,927 - INFO # _lock_release parameter condition (sched_active_thread != 0) not fulfilled
2019-04-25 10:26:56,930 - INFO # System time: 1970-01-01 00:00:06
2019-04-25 10:26:56,931 - INFO #
2019-04-25 10:26:56,934 - INFO # Board configuration:
2019-04-25 10:26:56,939 - INFO #        ADC             pins=[ 36 39 32 33 34 35 4 0 2 13 25 ]
2019-04-25 10:26:56,941 - INFO #        DAC             pins=[ 25 ]
2019-04-25 10:26:56,945 - INFO #        PWM_DEV(0)      channels=[ 25 0 2 ]
2019-04-25 10:26:56,948 - INFO #        I2C_DEV(0)      scl=22 sda=21
2019-04-25 10:26:56,952 - INFO #        SPI_DEV(0)      VSPI sck=5 miso=19 mosi=27 cs=18
2019-04-25 10:26:56,955 - INFO #        UART_DEV(0)     txd=1 rxd=3
2019-04-25 10:26:56,958 - INFO #        UART_DEV(1)     txd=15 rxd=12
2019-04-25 10:26:56,961 - INFO #        LED             pins=[ 14 ]
2019-04-25 10:26:56,963 - INFO #        BUTTONS         pins=[ 39 ]
2019-04-25 10:26:56,964 - INFO #
2019-04-25 10:26:56,968 - INFO # Starting RIOT kernel on PRO cpu
2019-04-25 10:26:56,977 - INFO # I (6563) [main_trampoline]: main(): This is RIOT! (Version: 2019.07-devel-89-g9fed1-pr/esp32/esptool)
2019-04-25 10:26:56,981 - INFO # LoRaWAN Class A low-power application
2019-04-25 10:26:56,985 - INFO # =====================================
2019-04-25 10:26:56,988 - INFO # system_wdt_feed
2019-04-25 10:26:56,990 - INFO # system_wdt_feed
2019-04-25 10:26:56,994 - INFO # [semtech-loramac] initializing loramac
2019-04-25 10:27:02,959 - INFO # ets Jun  8 2016 00:22:57
2019-04-25 10:27:02,960 - INFO #
2019-04-25 10:27:02,966 - INFO # rst:0x7 (TG0WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
2019-04-25 10:27:02,969 - INFO # configsip: 0, SPIWP:0xee
2019-04-25 10:27:02,976 - INFO # clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
2019-04-25 10:27:02,979 - INFO # mode:DOUT, clock div:2
2019-04-25 10:27:02,981 - INFO # load:0x3fff0018,len:4
2019-04-25 10:27:02,984 - INFO # load:0x3fff001c,len:5632
2019-04-25 10:27:02,987 - INFO # ho 0 tail 12 room 4
2019-04-25 10:27:02,989 - INFO # load:0x40078000,len:0
2019-04-25 10:27:02,992 - INFO # load:0x40078000,len:14868
2019-04-25 10:27:02,995 - INFO # entry 0x40078628
2019-04-25 10:27:03,000 - INFO # W (30) boot: PRO CPU has been reset by WDT.
2019-04-25 10:27:03,006 - INFO # W (31) boot: WDT reset info: PRO CPU PC=0x40081ecb
2019-04-25 10:27:03,012 - INFO # W (31) boot: WDT reset info: APP CPU PC=0x7ee2cab7
```

`tests/pkg_semtech-loramac` is working without an issue and I can join a LoRaWAN network and send/receive packets.

@gschorcht suggested to enable syscall debug messages to see when `system_wdt_feed` is called the last time. The console output shows that it will be called before loramac init and 6 seconds later WDT resets the system.

```
2019-04-25 10:26:56,988 - INFO # system_wdt_feed
2019-04-25 10:26:56,990 - INFO # system_wdt_feed
2019-04-25 10:26:56,994 - INFO # [semtech-loramac] initializing loramac
2019-04-25 10:27:02,959 - INFO # ets Jun  8 2016 00:22:57
```

#### Steps to reproduce the issue

Flash examples/lorawan on a TTGO T-Beam board.

#### Expected results

LoRaWAN example starts and tries to join the network and sends packets.

#### Actual results

The system will be reset via WDT.

#### Versions

Riotdocker was used to build the application.



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/issues/11443
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190425/32fbe6b7/attachment-0001.html>


More information about the notifications mailing list