manuelbl / ttn-esp32

The Things Network device library for ESP32 (ESP-IDF) and SX127x based devices
MIT License
303 stars 64 forks source link

segfault after make flash monitor #19

Closed almoondsllc closed 4 years ago

almoondsllc commented 4 years ago

I'm using stable esp-idf, esp32-wroom-32, I got segfault after make flash monitor, here the output:

Hard resetting via RTS pin... MONITOR --- idf_monitor on /dev/ttyUSB0 115200 --- --- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H --- ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0018,len:4 load:0x3fff001c,len:6320 ho 0 tail 12 room 4 load:0x40078000,len:11624 ho 0 tail 12 room 4 load:0x40080400,len:6648 entry 0x40080764 I (32) boot: ESP-IDF v3.3 2nd stage bootloader I (33) boot: compile time 21:32:29 I (33) boot: Enabling RNG early entropy source... I (37) boot: SPI Speed : 40MHz I (41) boot: SPI Mode : DIO I (45) boot: SPI Flash Size : 4MB I (49) boot: Partition Table: I (53) boot: ## Label Usage Type ST Offset Length I (60) boot: 0 nvs WiFi data 01 02 00009000 00006000 I (67) boot: 1 phy_init RF data 01 01 0000f000 00001000 I (75) boot: 2 factory factory app 00 00 00010000 00100000 I (82) boot: End of partition table I (87) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x0ef34 ( 61236) map I (117) esp_image: segment 1: paddr=0x0001ef5c vaddr=0x3ffb0000 size=0x010b4 ( 4276) load I (119) esp_image: segment 2: paddr=0x00020018 vaddr=0x400d0018 size=0x1d764 (120676) map 0x400d0018: _flash_cache_start at ??:?

I (166) esp_image: segment 3: paddr=0x0003d784 vaddr=0x3ffb10b4 size=0x00e50 ( 3664) load I (168) esp_image: segment 4: paddr=0x0003e5dc vaddr=0x40080000 size=0x00400 ( 1024) load 0x40080000: _WindowOverflow4 at /home/almoonds/esp/esp-idf/components/freertos/xtensa_vectors.S:1779

I (173) esp_image: segment 5: paddr=0x0003e9e4 vaddr=0x40080400 size=0x09e48 ( 40520) load I (205) boot: Loaded app from partition at offset 0x10000 I (205) boot: Disabling RNG early entropy source... I (205) cpu_start: Pro cpu up. I (209) cpu_start: Application information: I (214) cpu_start: Project name: hello_world I (219) cpu_start: App version: 1 I (223) cpu_start: Compile time: Dec 2 2019 21:32:32 I (230) cpu_start: ELF file SHA256: d457863be7c51ee3... I (236) cpu_start: ESP-IDF: v3.3 I (240) cpu_start: Starting app cpu, entry point is 0x400811b8 0x400811b8: call_start_cpu1 at /home/almoonds/esp/esp-idf/components/esp32/cpu_start.c:270

I (0) cpu_start: App cpu up. I (251) heap_init: Initializing. RAM available for dynamic allocation: I (258) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM I (264) heap_init: At 3FFB3288 len 0002CD78 (179 KiB): DRAM I (270) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM I (276) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM I (283) heap_init: At 4008A248 len 00015DB8 (87 KiB): IRAM I (289) cpu_start: Pro cpu start user code I (307) cpu_start: Chip Revision: 1 W (308) cpu_start: Chip revision is higher than the one configured in menuconfig. Suggest to upgrade it. I (311) cpu_start: Starting scheduler on PRO CPU. I (0) cpu_start: Starting scheduler on APP CPU. I (384) ttn_hal: IO initialized I (384) ttn_hal: SPI initialized I (384) ttn_hal: Timer initialized E (394) ttn_hal: /home/almoonds/esp/hello_world/components/ttn-esp32/src/lmic/oslmic.c:53 E (394) ttn_hal: /home/almoonds/esp/hello_world/components/ttn-esp32/src/hal/hal_esp32.cpp:449 E (404) ttn_hal: /home/almoonds/esp/hello_world/components/ttn-esp32/src/hal/hal_esp32.cpp:449 E (414) ttn_hal: /home/almoonds/esp/hello_world/components/ttn-esp32/src/hal/hal_esp32.cpp:449

manuelbl commented 4 years ago

On line 53 of oslmic.c, there's an assertion. It's triggered if the SPI communication with the SX127x chip fails.

Most likely, the SPI wiring does not match the pin definitions in main.cpp or the wiring does not make good connections.