marcelkottmann / esp32-javascript

"Lightweight" JS interpreter for ESP32. Provides JS-based eventloop implementation and native asynchronous network and timer functions.
MIT License
81 stars 7 forks source link

Support for esp32s2, esp32s3 #5

Closed laldana73 closed 3 years ago

laldana73 commented 3 years ago

Congratulations, it is a wonderfull job, Do you plan support for esp32s2 and esp32s3?

marcelkottmann commented 3 years ago

Hi @laldana73 , thanks for your support! From the specifications of S2 and S3 ( https://products.espressif.com/#/product-selector?language=en ) I see there is no SPIRAM included. For esp32-javascript to run properly you would at least have to add 4MB of PSRAM by yourself externally to get it up and running. From the software side I would expect it to run properly. But I have to admit, that I do not have a S2 or S3 test device.

laldana73 commented 3 years ago

I have an esp32-s2-soala board, this board have an esp32s2wrover module, this module have 2Mb of PSRAM, do you think esp32-javascript would be able to run on this module? I am trying to build for esp32S2, but throw some errors related with arduino-esp32. i will try to download the new version of arduino-esp32

marcelkottmann commented 3 years ago

Hi @laldana73 , oh I see. After setting target esp32s2 with idf.py set-target esp32s2 I first got some spiffs partion error. After ignoring this error I also get an error inside arduino-esp32:

../components/arduino-esp32/Esp.cpp:22:10: fatal error: rom/spi_flash.h: No such file or directory
 #include "rom/spi_flash.h"
          ^~~~~~~~~~~~~~~~~
compilation terminated.

Is that the same error that occurs for you? Don't hesitate to create a PR if you upgraded arduino-esp32 inside esp32-javascript. I had only wrover modules with at least 4MB available. But 2MB may also work.

laldana73 commented 3 years ago

yes, after setting target esp32s2, we have to run idf.py menuconfig set the partition table, flash size, SPIFFS maximun length name, enable support for SPIRAM then idf.py build and then i have the same error you posted above. i am trying to upgrade arduino-esp32 inside esp32-javascript but is not working. maybe i don't know how to do it correctly

marcelkottmann commented 3 years ago

Hi @laldana73 , I upgraded arduino-esp32 to a recent version. Had to add some esp32s2 specific include pathes which ovveride default esp-idf pathes - seems like this is the way arduino-esp32 supports these different series... I pushed this to branch esp32s2-support : https://github.com/marcelkottmann/esp32-javascript/tree/esp32s2-support Lacking a ESP-S2 test device I could not test these changes...

laldana73 commented 3 years ago

Good day Marcel. idf.py set-target esp32s2 throw CMake Error at /home/leonardo/esp/esp-idf/tools/cmake/component.cmake:302 (message): Include directory '/home/marric/work/projects/arduino-esp32/tools/sdk/esp32s2/include/soc/esp32s2/include' is not a directory. Seems in your CMakeLists.txt files you are using directories outside the project

marcelkottmann commented 3 years ago

Sorry, yes found that too. Fix is now present in the branch and is building now: https://github.com/marcelkottmann/esp32-javascript/actions/runs/804785951

laldana73 commented 3 years ago

Hi. Build without error and without warnings, but esp32s2 reset itself once and again

`I (48) boot: ESP-IDF v4.2-dirty 2nd stage bootloader I (48) boot: compile time 21:21:15 I (48) boot: chip revision: 0 I (50) boot.esp32s2: SPI Speed : 80MHz I (55) boot.esp32s2: SPI Mode : DIO I (60) boot.esp32s2: SPI Flash Size : 4MB I (65) boot: Enabling RNG early entropy source... I (70) boot: Partition Table: I (74) boot: ## Label Usage Type ST Offset Length I (81) boot: 0 nvs WiFi data 01 02 00009000 00006000 I (88) boot: 1 phy_init RF data 01 01 0000f000 00001000 I (96) boot: 2 factory factory app 00 00 00010000 001b0000 I (103) boot: 3 modules Unknown data 01 82 001c0000 00020000 I (111) boot: 4 data Unknown data 01 82 001e0000 00020000 I (118) boot: End of partition table I (123) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f000020 size=0x23d20 (146720) map I (162) esp_image: segment 1: paddr=0x00033d48 vaddr=0x3ffc85d0 size=0x0333c ( 13116) load I (166) esp_image: segment 2: paddr=0x0003708c vaddr=0x40024000 size=0x00404 ( 1028) load 0x40024000: _WindowOverflow4 at /home/leonardo/esp/esp-idf/components/freertos/xtensa/xtensa_vectors.S:1730

I (169) esp_image: segment 3: paddr=0x00037498 vaddr=0x40024404 size=0x08b80 ( 35712) load I (188) esp_image: segment 4: paddr=0x00040020 vaddr=0x40080020 size=0xbb408 (766984) map 0x40080020: _stext at ??:?

I (348) esp_image: segment 5: paddr=0x000fb430 vaddr=0x4002cf84 size=0x0b648 ( 46664) load 0x4002cf84: vListInsert at /home/leonardo/esp/esp-idf/components/freertos/list.c:197

E (361) esp_image: Checksum failed. Calculated 0x55 read 0xc6 E (361) boot: Factory app partition is not bootable E (361) boot: No bootable app partitions in the partition table ESP-ROM:esp32s2-rc4-20191025 Build:Oct 25 2019 rst:0x3 (RTC_SW_SYS_RST),boot:0x1f (SPI_FAST_FLASH_BOOT) Saved PC:0x40050f10 SPIWP:0xee mode:DIO, clock div:1 load:0x3ffe6100,len:0x4 load:0x3ffe6104,len:0x187c load:0x4004c000,len:0x1688 load:0x40050000,len:0x20fc entry 0x4004c324 I (48) boot: ESP-IDF`

laldana73 commented 3 years ago

Good morning @marcelkottmann

sdkconfig.zip with this sdkconfig is runing now, but it's not loading /data/config.js

ESP-ROM:esp32s2-rc4-20191025 Build:Oct 25 2019 rst:0x1 (POWERON),boot:0x1f (SPI_FAST_FLASH_BOOT) SPIWP:0xee mode:DIO, clock div:2 load:0x3ffe6100,len:0x4 load:0x3ffe6104,len:0x4b0 load:0x4004c000,len:0x1400 load:0x40050000,len:0x1528 entry 0x4004c28c I (348) cache: Instruction cache : size 8KB, 4Ways, cache line size 32Byte I (348) cache: Data cache : size 8KB, 4Ways, cache line size 32Byte I (351) spiram: Found 16MBit SPI RAM device I (356) spiram: SPI RAM mode: sram 40m I (360) spiram: PSRAM initialized, cache is in normal (1-core) mode. I (368) cpu_start: Pro cpu up. I (371) cpu_start: Application information: I (376) cpu_start: Project name: esp32-javascript I (382) cpu_start: App version: 1 I (386) cpu_start: Compile time: May 3 2021 09:00:12 I (392) cpu_start: ELF file SHA256: 44014a1c400fc637... I (398) cpu_start: ESP-IDF: v4.2-dirty I (404) cpu_start: Single core mode I (818) spiram: SPI SRAM memory test OK I (818) heap_init: Initializing. RAM available for dynamic allocation: I (819) heap_init: At 3FFD0008 len 0002BFF8 (175 KiB): DRAM I (825) heap_init: At 3FFFC000 len 00003A10 (14 KiB): DRAM I (831) cpu_start: Pro cpu start user code I (836) spiram: Adding pool of 2048K of external SPI memory to heap allocator I (844) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations I (911) spi_flash: detected chip: generic I (911) spi_flash: flash io: dio I (911) cpu_start: Starting scheduler on PRO CPU. I (938) esp32-javascript: No ctx present: Free memory: 2241936 bytes I (1168) esp32-javascript: Free memory: 2145860 bytes I (1188) esp32-javascript: Initializing SPIFFS I (1208) esp32-javascript: Partition size: total: 1ba31, used: cfdc I (1218) esp32-javascript: Initializing SPIFFS I (1228) esp32-javascript: Partition size: total: 1ba31, used: 0 I (1248) esp32-javascript: Loading loader.js ...

I (1458) esp32-javascript: Loading urlparse.js ...

I (1478) esp32-javascript: No ctx present: Self-Socket Test successful!

I (2458) esp32-javascript: Reading file /modules/esp32-javascript/index.js I (2978) esp32-javascript: Reading file /modules/esp32-javascript/global.js I (3678) esp32-javascript: Reading file /modules/esp32-javascript/http.js I (7808) esp32-javascript: Reading file /modules/socket-events/index.js I (12408) esp32-javascript: Reading file /modules/esp32-js-eventloop/index.js I (15538) esp32-javascript: Reading file /modules/esp32-javascript/stringbuffer.js I (18738) esp32-javascript: Reading file /modules/esp32-javascript/boot.js I (23578) esp32-javascript: Reading file /modules/wifi-events/index.js I (28008) esp32-javascript: Reading file /modules/esp32-javascript/configserver.js I (35358) esp32-javascript: Reading file /modules/esp32-javascript/config.js I (38498) esp32-javascript: Reading file /modules/esp32-javascript/firmware-config.js I (50898) esp32-javascript: Reading file /modules/esp32-javascript/promise.js I (56168) esp32-javascript: Reading file /data/config.js E (56288) esp32-javascript: Failed to open file for reading I (59598) esp32-javascript: Reading file /modules/esp32-javascript/fetch.js I (76028) phy: phy_version: 603, 72dfd77, Jul 7 2020, 19:57:05, 0, 2 E (85268) esp32-javascript: No ctx present: Error getting data available from self-socket: 88. E (85758) esp32-javascript: No ctx present: Error getting data available from self-socket: 88. E (86148) esp32-javascript: No ctx present: Error getting data available from self-socket: 88. E (86638) esp32-javascript: No ctx present: Error getting data available from self-socket: 88. E (87128) esp32-javascript: No ctx present: Error getting data available from self-socket: 88. E (87498) esp32-javascript: No ctx present: Error getting data available from self-socket: 88. E (87988) esp32-javascript: No ctx present: Error getting data available from self-socket: 88. E (88478) esp32-javascript: No ctx present: Error getting data available from self-socket: 88. E (88868) esp32-javascript: No ctx present: Error getting data available from self-socket: 88. E (89378) esp32-javascript: No ctx present: Error getting data available from self-socket: 88. E (89868) esp32-javascript: No ctx present: Error getting data available from self-socket: 88. E (90238) esp32-javascript: No ctx present: Error getting data available from self-socket: 88. E (90728) esp32-javascript: No ctx present: Error getting data available from self-socket: 88. E (91218) esp32-javascript: No ctx present: Error getting data available from self-socket: 88. E (91618) esp32-javascript: No ctx present: Error getting data available from self-socket: 88.

marcelkottmann commented 3 years ago

Hi @laldana73 , good evening :-) I think the main problem here is not the "Failed to open file for reading", but the "Error getting data available from self-socket: 88." message. I remember that there were special settings in sdkconfig for LWIP necessary for that. I think the main reason for all these hickups (SPIFFS, SPIRAM, LWIP(?)) is that setting the target esp32s2 resets some of the other sdkconfig entries also, removing or changing some to the default values. I think we have to compare each setting of master branch to the esp32s2-support branch... Yesterday I have ordered a esp32-s2-soala board (with ESP32-S2-WROVER) chip. So at latest when it arrives (this week) I can support hands on.

marcelkottmann commented 3 years ago

I think it was CONFIG_LWIP_NETIF_LOOPBACK=y But the other LWIP options seem also to be removed or set to default values.

marcelkottmann commented 3 years ago

Hi @laldana73 , I fixed the issues for ESP32-S2 and tested it with a real device. Please check out the updates on the esp32s2-support branch and proceed with these steps:

  1. rm sdkconfig
  2. idf.py fullclean
  3. idf.py -DIDF_TARGET=esp32s2 build

Please let me know if this works for you.

laldana73 commented 3 years ago

Good Evening @marcelkottmann , it's not working. after idf.py flash monitor esp32s2 resets itself once and again

marcelkottmann commented 3 years ago

Hi @laldana73 , can you please provide the monitor output of the reboot loop output?

laldana73 commented 3 years ago

Hello Marcel. The procedure that i am doing is the following: from github page in the esp32s2 support branch, i download the zip file with the code button. then i extract the zip file in my ~/esp, rename the folder to esp32-javascript. open a terminal in ~/esp/esp32-javascript get_idf "I can see that there is not a sdkconfig file, only sdkconfig.defaults" then idf.py -DIDF_TARGET=esp32s2 build idf.py flash monitor

I (48) boot: ESP-IDF v4.2-dirty 2nd stage bootloader I (48) boot: compile time 09:49:41 I (48) boot: chip revision: 0 I (51) boot.esp32s2: SPI Speed : 80MHz I (55) boot.esp32s2: SPI Mode : DIO I (60) boot.esp32s2: SPI Flash Size : 4MB I (65) boot: Enabling RNG early entropy source... I (70) boot: Partition Table: I (74) boot: ## Label Usage Type ST Offset Length I (81) boot: 0 nvs WiFi data 01 02 00009000 00006000 I (88) boot: 1 phy_init RF data 01 01 0000f000 00001000 I (96) boot: 2 factory factory app 00 00 00010000 001b0000 I (103) boot: 3 modules Unknown data 01 82 001c0000 00020000 I (111) boot: 4 data Unknown data 01 82 001e0000 00020000 I (118) boot: End of partition table I (123) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f000020 size=0x24688 (149128) map I (163) esp_image: segment 1: paddr=0x000346b0 vaddr=0x3ffcb940 size=0x0333c ( 13116) load I (166) esp_image: segment 2: paddr=0x000379f4 vaddr=0x40024000 size=0x00404 ( 1028) load 0x40024000: _WindowOverflow4 at /home/leonardo/esp/esp-idf/components/freertos/xtensa/xtensa_vectors.S:1730

I (170) esp_image: segment 3: paddr=0x00037e00 vaddr=0x40024404 size=0x08218 ( 33304) load I (187) esp_image: segment 4: paddr=0x00040020 vaddr=0x40080020 size=0xbd7b8 (776120) map 0x40080020: _stext at ??:?

I (350) esp_image: segment 5: paddr=0x000fd7e0 vaddr=0x4002c61c size=0x0f324 ( 62244) load 0x4002c61c: vTaskDelete at /home/leonardo/esp/esp-idf/components/freertos/tasks.c:1227 (discriminator 4)

E (367) esp_image: Checksum failed. Calculated 0x95 read 0x50 E (367) boot: Factory app partition is not bootable E (367) boot: No bootable app partitions in the partition table ESP-ROM:esp32s2-rc4-20191025 Build:Oct 25 2019 rst:0x3 (RTC_SW_SYS_RST),boot:0x1f (SPI_FAST_FLASH_BOOT) Saved PC:0x40050f10 SPIWP:0xee mode:DIO, clock div:1 load:0x3ffe6100,len:0x4 load:0x3ffe6104,len:0x187c load:0x4004c000,len:0x1688 load:0x40050000,len:0x20fc entry 0x4004c324

marcelkottmann commented 3 years ago

Hi @laldana73 , I doubt this has something to do with esp32-javascript. Seems like the flashed app image is corrupted:

E (367) esp_image: Checksum failed. Calculated 0x95 read 0x50
E (367) boot: Factory app partition is not bootable
E (367) boot: No bootable app partitions in the partition table

The only thing that I see is, that you are using a "dirty" version of esp-idf. I am using release/v4.2 branch which is: v4.2-dev-1983-gccdfbb865

Maybe you can also try a idf.py erase_flash to start with an empty flash.

marcelkottmann commented 3 years ago

Maybe also try to change in your sdkconfig

# CONFIG_SPIRAM_SPEED_40M is not set
CONFIG_SPIRAM_SPEED_80M=y

to

CONFIG_SPIRAM_SPEED_40M=y
#CONFIG_SPIRAM_SPEED_80M is not set

...only a guess...

laldana73 commented 3 years ago

Marcel. I have installed esp-idf 4.2.1 stable with this configuration file sdkconfig.zip and is showing this:

--- idf_monitor on /dev/ttyUSB0 115200 --- --- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H --- 8+}�ESP-ROM:esp32s2-rc4-20191025 Build:Oct 25 2019 rst:0x1 (POWERON),boot:0x1f (SPI_FAST_FLASH_BOOT) SPIWP:0xee mode:DIO, clock div:2 load:0x3ffe6100,len:0x4 load:0x3ffe6104,len:0x1878 load:0x4004c000,len:0x1688 load:0x40050000,len:0x20fc entry 0x4004c320 I (49) boot: ESP-IDF v4.2.1 2nd stage bootloader I (49) boot: compile time 15:17:03 I (49) boot: chip revision: 0 I (51) boot.esp32s2: SPI Speed : 40MHz I (55) boot.esp32s2: SPI Mode : DIO I (60) boot.esp32s2: SPI Flash Size : 4MB I (65) boot: Enabling RNG early entropy source... I (70) boot: Partition Table: I (74) boot: ## Label Usage Type ST Offset Length I (81) boot: 0 nvs WiFi data 01 02 00009000 00006000 I (88) boot: 1 phy_init RF data 01 01 0000f000 00001000 I (96) boot: 2 factory factory app 00 00 00010000 001b0000 I (103) boot: 3 modules Unknown data 01 82 001c0000 00020000 I (111) boot: 4 data Unknown data 01 82 001e0000 00020000 I (118) boot: End of partition table I (123) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f000020 size=0x23520 (144672) map I (172) esp_image: segment 1: paddr=0x00033548 vaddr=0x3ffcb0d0 size=0x02afc ( 11004) load I (176) esp_image: segment 2: paddr=0x0003604c vaddr=0x40024000 size=0x00404 ( 1028) load 0x40024000: _WindowOverflow4 at /home/leonardo/esp/esp-idf/components/freertos/xtensa/xtensa_vectors.S:1730

I (179) esp_image: segment 3: paddr=0x00036458 vaddr=0x40024404 size=0x09bc0 ( 39872) load I (201) esp_image: segment 4: paddr=0x00040020 vaddr=0x40080020 size=0xbb624 (767524) map 0x40080020: _stext at ??:?

I (414) esp_image: segment 5: paddr=0x000fb64c vaddr=0x4002dfc4 size=0x0d10c ( 53516) load 0x4002dfc4: xQueueGiveFromISR at /home/leonardo/esp/esp-idf/components/freertos/queue.c:1349

I (445) boot: Loaded app from partition at offset 0x10000 I (445) boot: Disabling RNG early entropy source... I (445) cache: Instruction cache : size 8KB, 4Ways, cache line size 32Byte I (453) cache: Data cache : size 8KB, 4Ways, cache line size 32Byte I (460) spiram: Found 16MBit SPI RAM device I (465) spiram: SPI RAM mode: sram 40m I (469) spiram: PSRAM initialized, cache is in normal (1-core) mode. I (476) cpu_start: Pro cpu up. I (480) cpu_start: Application information: I (485) cpu_start: Project name: esp32-javascript I (490) cpu_start: App version: 1 I (495) cpu_start: Compile time: May 6 2021 15:16:56 I (501) cpu_start: ELF file SHA256: ce91d58fba3e811b... I (507) cpu_start: ESP-IDF: v4.2.1 I (512) cpu_start: Single core mode I (926) spiram: SPI SRAM memory test OK I (927) heap_init: Initializing. RAM available for dynamic allocation: I (927) heap_init: At 3FFD2368 len 00029C98 (167 KiB): DRAM I (933) heap_init: At 3FFFC000 len 00003A10 (14 KiB): DRAM I (939) cpu_start: Pro cpu start user code I (944) spiram: Adding pool of 2048K of external SPI memory to heap allocator I (1010) cpu_start: Starting scheduler on PRO CPU. I (1018) esp32-javascript: No ctx present: Free memory: 2249716 bytes I (1248) esp32-javascript: Free memory: 2153292 bytes I (1268) esp32-javascript: Initializing SPIFFS I (1288) esp32-javascript: Partition size: total: 1ba31, used: e182 I (1298) esp32-javascript: Initializing SPIFFS I (3268) esp32-javascript: Partition size: total: 1ba31, used: 0 I (3288) esp32-javascript: Loading loader.js ...

I (3498) esp32-javascript: Loading urlparse.js ...

I (3518) esp32-javascript: No ctx present: Self-Socket Test successful!

I (4508) esp32-javascript: Reading file /modules/esp32-javascript/index.js I (4688) esp32-javascript: Load global.js (NEW)... I (5068) esp32-javascript: Reading file /modules/esp32-javascript/global.js I (5798) esp32-javascript: Reading file /modules/esp32-javascript/http.js I (10268) esp32-javascript: Reading file /modules/socket-events/index.js I (15128) esp32-javascript: Reading file /modules/esp32-js-eventloop/index.js I (18418) esp32-javascript: Reading file /modules/esp32-javascript/stringbuffer.js I (21748) esp32-javascript: Reading file /modules/esp32-javascript/boot.js I (27218) esp32-javascript: Reading file /modules/wifi-events/index.js I (31828) esp32-javascript: Reading file /modules/esp32-javascript/configserver.js I (39678) esp32-javascript: Reading file /modules/esp32-javascript/config.js I (42958) esp32-javascript: Reading file /modules/esp32-javascript/firmware-config.js I (52598) esp32-javascript: Loading promise.js and exposing globals (NEW)... I (55568) esp32-javascript: Reading file /modules/esp32-javascript/promise.js I (60798) esp32-javascript: Loading config (NEW)... I (60928) esp32-javascript: Reading file /data/config.js E (61058) esp32-javascript: Failed to open file for reading E (61088) esp32-javascript: An error ocurred while accessing config. Maybe it does not exist. I (61108) esp32-javascript: Loading http.js and exposing globals (NEW)... I (61108) esp32-javascript: Loading fetch.js and exposing globals (NEW)... I (64428) esp32-javascript: Reading file /modules/esp32-javascript/fetch.js I (76748) esp32-javascript: Loading boot.js and exposing main (NEW)... I (76748) esp32-javascript: Loading socket-events (NEW)... I (78588) esp32-javascript: Loading wifi-events (NEW)... I (80748) esp32-javascript: Loading eventloop.js and starting eventloop (NEW)... I (80788) esp32-javascript: Current configuration: I (80878) esp32-javascript: {"access":{"username":"esp32","password":"esp32"}} I (80888) esp32-javascript: Missing wifi SSID configuration: Starting setup mode ... I (80888) esp32-javascript: Missing wifi password configuration: Starting setup mode ... I (80898) esp32-javascript: Starting soft ap mode. W (81108) wifi:alloc eb len=752 type=4 fail

W (81108) wifi:m f beacon l=203

W (81108) wifi:alloc eb len=752 type=4 fail

W (81108) wifi:m f beacon l=203

W (81108) wifi:b a f

Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.

Core 0 register dump: PC : 0x400ec845 PS : 0x00060630 A0 : 0x800ee170 A1 : 0x3ffe65e0
0x400ec845: ieee80211_hostap_attach at ??:?

A2 : 0x00000000 A3 : 0x3ffd0600 A4 : 0x3ffd0b44 A5 : 0x00000000
A6 : 0x00000000 A7 : 0x3ffd05e8 A8 : 0x800ec83d A9 : 0x3ffe6570
A10 : 0x4002ed40 A11 : 0x3ffe65a0 A12 : 0x00000002 A13 : 0x4013554c
0x4002ed40: esp_log_write at /home/leonardo/esp/esp-idf/components/log/log.c:196

0x4013554c: esp_log_writev at /home/leonardo/esp/esp-idf/components/log/log.c:169

A14 : 0x000000b6 A15 : 0x3f003ad4 SAR : 0x00000004 EXCCAUSE: 0x0000001c
EXCVADDR: 0x0000002c LBEG : 0x00000002 LEND : 0x4013554c LCOUNT : 0x400267f1
0x4013554c: esp_log_writev at /home/leonardo/esp/esp-idf/components/log/log.c:169

0x400267f1: _xt_user_exc at /home/leonardo/esp/esp-idf/components/freertos/xtensa/xtensa_vectors.S:627

Backtrace:0x400ec842:0x3ffe65e0 0x400ee16d:0x3ffe6640 0x400f3e29:0x3ffe6670 0x400f57e3:0x3ffe6690 0x400f22b2:0x3ffe66b0 0x400367d4:0x3ffe66d0 0x4002ba89:0x3ffe6700 0x400ec842: ieee80211_hostap_attach at ??:?

0x400ee16d: wifi_softap_start at ??:?

0x400f3e29: wifi_mesh_map_deauth_progress at ??:?

0x400f57e3: wifi_start_process at ??:?

0x400f22b2: ieee80211_ioctl_process at ??:?

0x400367d4: ppTask at ??:?

0x4002ba89: vPortTaskWrapper at /home/leonardo/esp/esp-idf/components/freertos/xtensa/port.c:143

ELF file SHA256: ce91d58fba3e811b

Rebooting... ESP-ROM:esp32s2-rc4-20191025 Build:Oct 25 2019 rst:0x3 (RTC_SW_SYS_RST),boot:0x1f (SPI_FAST_FLASH_BOOT) Saved PC:0x4002545d 0x4002545d: esp_restart_noos_dig at /home/leonardo/esp/esp-idf/components/esp_system/system_api.c:60 (discriminator 1)

SPIWP:0xee mode:DIO, clock div:2 load:0x3ffe6100,len:0x4 load:0x3ffe6104,len:0x1878 load:0x4004c000,len:0x1688 load:0x40050000,len:0x20fc entry 0x4004c320 I (51) boot: ESP-IDF v4.2.1 2nd stage bootloader I (51) boot: compile time 15:17:03 I (51) boot: chip revision: 0 I (53) boot.esp32s2: SPI Speed : 40MHz I (58) boot.esp32s2: SPI Mode : DIO I (62) boot.esp32s2: SPI Flash Size : 4MB I (67) boot: Enabling RNG early entropy source... I (73) boot: Partition Table: I (76) boot: ## Label Usage Type ST Offset Length I (83) boot: 0 nvs WiFi data 01 02 00009000 00006000 I (91) boot: 1 phy_init RF data 01 01 0000f000 00001000 I (98) boot: 2 factory factory app 00 00 00010000 001b0000 I (106) boot: 3 modules Unknown data 01 82 001c0000 00020000 I (113) boot: 4 data Unknown data 01 82 001e0000 00020000 I (121) boot: End of partition table I (125) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f000020 size=0x23520 (144672) map I (174) esp_image: segment 1: paddr=0x00033548 vaddr=0x3ffcb0d0 size=0x02afc ( 11004) load I (178) esp_image: segment 2: paddr=0x0003604c vaddr=0x40024000 size=0x00404 ( 1028) load 0x40024000: _WindowOverflow4 at /home/leonardo/esp/esp-idf/components/freertos/xtensa/xtensa_vectors.S:1730

I (181) esp_image: segment 3: paddr=0x00036458 vaddr=0x40024404 size=0x09bc0 ( 39872) load I (203) esp_image: segment 4: paddr=0x00040020 vaddr=0x40080020 size=0xbb624 (767524) map 0x40080020: _stext at ??:?

I (417) esp_image: segment 5: paddr=0x000fb64c vaddr=0x4002dfc4 size=0x0d10c ( 53516) load 0x4002dfc4: xQueueGiveFromISR at /home/leonardo/esp/esp-idf/components/freertos/queue.c:1349

I (447) boot: Loaded app from partition at offset 0x10000 I (447) boot: Disabling RNG early entropy source... I (448) cache: Instruction cache : size 8KB, 4Ways, cache line size 32Byte I (455) cache: Data cache : size 8KB, 4Ways, cache line size 32Byte I (462) spiram: Found 16MBit SPI RAM device I (467) spiram: SPI RAM mode: sram 40m I (472) spiram: PSRAM initialized, cache is in normal (1-core) mode. I (479) cpu_start: Pro cpu up. I (482) cpu_start: Application information: I (487) cpu_start: Project name: esp32-javascript I (493) cpu_start: App version: 1 I (497) cpu_start: Compile time: May 6 2021 15:16:56 I (503) cpu_start: ELF file SHA256: ce91d58fba3e811b... I (509) cpu_start: ESP-IDF: v4.2.1 I (514) cpu_start: Single core mode I (929) spiram: SPI SRAM memory test OK I (929) heap_init: Initializing. RAM available for dynamic allocation: I (929) heap_init: At 3FFD2368 len 00029C98 (167 KiB): DRAM I (936) heap_init: At 3FFFC000 len 00003A10 (14 KiB): DRAM I (942) cpu_start: Pro cpu start user code I (947) spiram: Adding pool of 2048K of external SPI memory to heap allocator I (1011) cpu_start: Starting scheduler on PRO CPU. I (1019) esp32-javascript: No ctx present: Free memory: 2249716 bytes I (1249) esp32-javascript: Free memory: 2153292 bytes I (1269) esp32-javascript: Initializing SPIFFS I (1289) esp32-javascript: Partition size: total: 1ba31, used: e182 I (1299) esp32-javascript: Initializing SPIFFS I (1319) esp32-javascript: Partition size: total: 1ba31, used: 0 I (1329) esp32-javascript: Loading loader.js ...

I (1539) esp32-javascript: Loading urlparse.js ...

I (1569) esp32-javascript: No ctx present: Self-Socket Test successful!

I (2559) esp32-javascript: Reading file /modules/esp32-javascript/index.js I (2739) esp32-javascript: Load global.js (NEW)... I (3119) esp32-javascript: Reading file /modules/esp32-javascript/global.js I (3849) esp32-javascript: Reading file /modules/esp32-javascript/http.js

laldana73 commented 3 years ago

is crashing when try to start soft ap mode

laldana73 commented 3 years ago

I did some changes in sdkconfig, and now show this

I (78057) esp32-javascript: Current configuration: I (78147) esp32-javascript: {"access":{"username":"esp32","password":"esp32"}} I (78147) esp32-javascript: Missing wifi SSID configuration: Starting setup mode ... I (78157) esp32-javascript: Missing wifi password configuration: Starting setup mode ... I (78157) esp32-javascript: Starting soft ap mode. E (78227) phy_init: failed to allocate memory for RF calibration data

abort() was called at PC 0x400bb1a1 on core 0 0x400bb1a1: esp_phy_load_cal_and_init at /home/leonardo/esp/esp-idf/components/esp_wifi/src/phy_init.c:724 (discriminator 3)

laldana73 commented 3 years ago

Hello Marcel, please could you provide your sdkconfig?

marcelkottmann commented 3 years ago

Hi @laldana73 , I tested your sdkconfig and it worked for me.

Please find here my sdkconfig (created from the defaults): sdkconfig.zip

marcelkottmann commented 3 years ago

Hi @laldana73 , I just tested with esp-idf 4.2.1 and can reproduce the same error you got. So please use https://github.com/espressif/esp-idf/releases/tag/v4.2 instead of 4.2.1 as this is the only supported version currently (also documented in README of esp32-javascript).

laldana73 commented 3 years ago

Hello @marcelkottmann , i have version 4.2 now. and i have the same error. i did some changes in the sdkconfig and now is running, create the acces point, but i am not able to conect. this is the output of the monitor

--- idf_monitor on /dev/ttyUSB0 115200 --- --- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H --- �x�xxx�x����xxx�x�x�x�x���x�x�x��x����x���ESP-ROM:esp32s2-rc4-20191025 Build:Oct 25 2019 rst:0x1 (POWERON),boot:0x1f (SPI_FAST_FLASH_BOOT) SPIWP:0xee mode:DIO, clock div:2 load:0x3ffe6100,len:0x4 load:0x3ffe6104,len:0x1878 load:0x4004c000,len:0x1688 load:0x40050000,len:0x20fc entry 0x4004c320 I (49) boot: ESP-IDF v4.2 2nd stage bootloader I (49) boot: compile time 17:59:59 I (49) boot: chip revision: 0 I (50) boot.esp32s2: SPI Speed : 40MHz I (55) boot.esp32s2: SPI Mode : DIO I (60) boot.esp32s2: SPI Flash Size : 4MB I (64) boot: Enabling RNG early entropy source... I (70) boot: Partition Table: I (73) boot: ## Label Usage Type ST Offset Length I (81) boot: 0 nvs WiFi data 01 02 00009000 00006000 I (88) boot: 1 phy_init RF data 01 01 0000f000 00001000 I (96) boot: 2 factory factory app 00 00 00010000 001b0000 I (103) boot: 3 modules Unknown data 01 82 001c0000 00020000 I (111) boot: 4 data Unknown data 01 82 001e0000 00020000 I (118) boot: End of partition table I (122) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f000020 size=0x24708 (149256) map I (173) esp_image: segment 1: paddr=0x00034730 vaddr=0x3ffcb950 size=0x0333c ( 13116) load I (177) esp_image: segment 2: paddr=0x00037a74 vaddr=0x40024000 size=0x00404 ( 1028) load 0x40024000: _WindowOverflow4 at /home/leonardo/esp/esp-idf/components/freertos/xtensa/xtensa_vectors.S:1730

I (180) esp_image: segment 3: paddr=0x00037e80 vaddr=0x40024404 size=0x08198 ( 33176) load I (200) esp_image: segment 4: paddr=0x00040020 vaddr=0x40080020 size=0xbd8ac (776364) map 0x40080020: _stext at ??:?

I (416) esp_image: segment 5: paddr=0x000fd8d4 vaddr=0x4002c59c size=0x0f3ac ( 62380) load 0x4002c59c: pvTaskGetThreadLocalStoragePointer at /home/leonardo/esp/esp-idf/components/freertos/tasks.c:3543 (discriminator 4)

I (449) boot: Loaded app from partition at offset 0x10000 I (449) boot: Disabling RNG early entropy source... I (450) cache: Instruction cache : size 8KB, 4Ways, cache line size 32Byte I (457) cache: Data cache : size 8KB, 4Ways, cache line size 32Byte I (465) spiram: Found 16MBit SPI RAM device I (469) spiram: SPI RAM mode: sram 40m I (474) spiram: PSRAM initialized, cache is in normal (1-core) mode. I (481) cpu_start: Pro cpu up. I (484) cpu_start: Application information: I (489) cpu_start: Project name: esp32-javascript I (495) cpu_start: App version: 1 I (499) cpu_start: Compile time: May 7 2021 18:30:05 I (506) cpu_start: ELF file SHA256: 864296fdae62b4a0... I (512) cpu_start: ESP-IDF: v4.2 I (516) cpu_start: Single core mode I (931) spiram: SPI SRAM memory test OK I (931) heap_init: Initializing. RAM available for dynamic allocation: I (931) heap_init: At 3FFD3430 len 00028BD0 (162 KiB): DRAM I (938) heap_init: At 3FFFC000 len 00003A10 (14 KiB): DRAM I (944) cpu_start: Pro cpu start user code I (949) spiram: Adding pool of 2048K of external SPI memory to heap allocator I (1015) spi_flash: detected chip: generic I (1016) spi_flash: flash io: dio I (1016) cpu_start: Starting scheduler on PRO CPU. I (1026) esp32-javascript: No ctx present: Free memory: 2245420 bytes I (1256) esp32-javascript: Free memory: 2148996 bytes I (1276) esp32-javascript: Initializing SPIFFS I (1286) esp32-javascript: Partition size: total: 1ba31, used: e182 I (1296) esp32-javascript: Initializing SPIFFS I (1316) esp32-javascript: Partition size: total: 1ba31, used: 0 I (1336) esp32-javascript: Loading loader.js ...

I (1536) esp32-javascript: Loading urlparse.js ...

I (1566) esp32-javascript: No ctx present: Self-Socket Test successful!

I (2526) esp32-javascript: Reading file /modules/esp32-javascript/index.js I (2696) esp32-javascript: Load global.js (NEW)... I (3086) esp32-javascript: Reading file /modules/esp32-javascript/global.js I (3806) esp32-javascript: Reading file /modules/esp32-javascript/http.js I (8196) esp32-javascript: Reading file /modules/socket-events/index.js I (12986) esp32-javascript: Reading file /modules/esp32-js-eventloop/index.js I (16256) esp32-javascript: Reading file /modules/esp32-javascript/stringbuffer.js I (19566) esp32-javascript: Reading file /modules/esp32-javascript/boot.js I (24986) esp32-javascript: Reading file /modules/wifi-events/index.js I (29576) esp32-javascript: Reading file /modules/esp32-javascript/configserver.js I (37376) esp32-javascript: Reading file /modules/esp32-javascript/config.js I (40646) esp32-javascript: Reading file /modules/esp32-javascript/firmware-config.js I (50266) esp32-javascript: Loading promise.js and exposing globals (NEW)... I (53236) esp32-javascript: Reading file /modules/esp32-javascript/promise.js I (58436) esp32-javascript: Loading config (NEW)... I (58566) esp32-javascript: Reading file /data/config.js E (58696) esp32-javascript: Failed to open file for reading E (58716) esp32-javascript: An error ocurred while accessing config. Maybe it does not exist. I (58746) esp32-javascript: Loading http.js and exposing globals (NEW)... I (58746) esp32-javascript: Loading fetch.js and exposing globals (NEW)... I (62066) esp32-javascript: Reading file /modules/esp32-javascript/fetch.js I (74306) esp32-javascript: Loading boot.js and exposing main (NEW)... I (74306) esp32-javascript: Loading socket-events (NEW)... I (76146) esp32-javascript: Loading wifi-events (NEW)... I (78296) esp32-javascript: Loading eventloop.js and starting eventloop (NEW)... I (78346) esp32-javascript: Current configuration: I (78426) esp32-javascript: {"access":{"username":"esp32","password":"esp32"}} I (78436) esp32-javascript: Missing wifi SSID configuration: Starting setup mode ... I (78436) esp32-javascript: Missing wifi password configuration: Starting setup mode ... I (78446) esp32-javascript: Starting soft ap mode. I (78626) phy: phy_version: 603, 72dfd77, Jul 7 2020, 19:57:05, 0, 2 I (87626) esp32-javascript: SoftAP: Connected I (87636) esp32-javascript: Starting config server. E (87746) esp32-javascript: ERROR opening socket

E (87796) esp32-javascript: ERROR binding

E (87796) esp32-javascript: ON ERROR: Socket -1

marcelkottmann commented 3 years ago

Hi @laldana73 , can you please provide your modified sdkconfig, otherwise I have no chance to reproduce this error.

laldana73 commented 3 years ago

sdkconfig.zip

marcelkottmann commented 3 years ago

Hi @laldana73 , I cannot reproduce the error with my device and your sdkconfig. For me it works properly. Can you please try following steps again:

  1. idf.py erase_flash
  2. idf.py fullclean
  3. rm sdkconfig
  4. idf.py -DIDF_TARGET=esp32s2 build flash monitor

The last step creates a new sdkconfig with the defaults.

laldana73 commented 3 years ago

Hello @marcelkottmann , the above procedure, produces the following

--- idf_monitor on /dev/ttyUSB0 115200 --- --- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H --- ����������x�x��x�x�x��xx��x�x�x�x����x���ESP-ROM:esp32s2-rc4-20191025 Build:Oct 25 2019 rst:0x1 (POWERON),boot:0x1f (SPI_FAST_FLASH_BOOT) SPIWP:0xee mode:DIO, clock div:1 load:0x3ffe6100,len:0x4 load:0x3ffe6104,len:0x1878 load:0x4004c000,len:0x1688 load:0x40050000,len:0x20fc entry 0x4004c324 I (46) boot: ESP-IDF v4.2 2nd stage bootloader I (46) boot: compile time 08:59:10 I (46) boot: chip revision: 0 E (47) boot_comm: mismatch chip ID, expected 2, found 0 ESP-ROM:esp32s2-rc4-20191025 Build:Oct 25 2019 rst:0x3 (RTC_SW_SYS_RST),boot:0x1f (SPI_FAST_FLASH_BOOT) Saved PC:0x40050f10 SPIWP:0xee mode:DIO, clock div:1 load:0x3ffe6100,len:0x4 load:0x3ffe6104,len:0x1878 load:0x4004c000,len:0x1688 load:0x40050000,len:0x20fc entry 0x4004c324 I (48) boot: ESP-IDF v4.2 2nd stage bootloader I (48) boot: compile time 08:59:10 I (48) boot: chip revision: 0 E (50) boot_comm: mismatch chip ID, expected 2, found 0 ESP-ROM:esp32s2-rc4-20191025 Build:Oct 25 2019 rst:0x3 (RTC_SW_SYS_RST),boot:0x1f (SPI_FAST_FLASH_BOOT) Saved PC:0x40050f10 SPIWP:0xee mode:DIO, clock div:1 load:0x3ffe6100,len:0x4 load:0x3ffe6104,len:0x1878 load:0x4004c000,len:0x1688 load:0x40050000,len:0x20fc entry 0x4004c324 I (48) boot: ESP-IDF v4.2 2nd stage bootloader I (48) boot: compile time 08:59:10 I (48) boot: chip revision: 0 E (50) boot_comm: mismatch chip ID, expected 2, found 32768 ESP-ROM:esp32s2-rc4-20191025 Build:Oct 25 2019 rst:0x3 (RTC_SW_SYS_RST),boot:0x1f (SPI_FAST_FLASH_BOOT) Saved PC:0x40050f10 SPIWP:0xee mode:DIO, clock div:1 load:0x3ffe6100,len:0x4 load:0x3ffe6104,len:0x1878 load:0x4004c000,len:0x1688 load:0x40050000,len:0x20fc entry 0x4004c324 I (48) boot: ESP-IDF v4.2 2nd stage bootloader I (

laldana73 commented 3 years ago

@marcelkottmann , i have loaded the same binaries to one Esp32-s2 kaluga dev board and this is the result

ESP-ROM:esp32s2-rc4-20191025 Build:Oct 25 2019 rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT) SPIWP:0xee mode:DIO, clock div:1 load:0x3ffe6100,len:0x4 load:0x3ffe6104,len:0x1878 load:0x4004c000,len:0x1688 load:0x40050000,len:0x20fc entry 0x4004c324 I (48) boot: ESP-IDF v4.2 2nd stage bootloader I (48) boot: compile time 08:59:10 I (48) boot: chip revision: 0 I (50) boot.esp32s2: SPI Speed : 80MHz I (54) boot.esp32s2: SPI Mode : DIO I (59) boot.esp32s2: SPI Flash Size : 4MB I (64) boot: Enabling RNG early entropy source... I (69) boot: Partition Table: I (73) boot: ## Label Usage Type ST Offset Length I (80) boot: 0 nvs WiFi data 01 02 00009000 00006000 I (88) boot: 1 phy_init RF data 01 01 0000f000 00001000 I (95) boot: 2 factory factory app 00 00 00010000 001b0000 I (102) boot: 3 modules Unknown data 01 82 001c0000 00020000 I (110) boot: 4 data Unknown data 01 82 001e0000 00020000 I (118) boot: End of partition table I (122) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f000020 size=0x24688 (149128) map I (162) esp_image: segment 1: paddr=0x000346b0 vaddr=0x3ffcb940 size=0x0333c ( 13116) load I (165) esp_image: segment 2: paddr=0x000379f4 vaddr=0x40024000 size=0x00404 ( 1028) load 0x40024000: _WindowOverflow4 at /home/leonardo/esp/esp-idf/components/freertos/xtensa/xtensa_vectors.S:1730

I (169) esp_image: segment 3: paddr=0x00037e00 vaddr=0x40024404 size=0x08218 ( 33304) load I (186) esp_image: segment 4: paddr=0x00040020 vaddr=0x40080020 size=0xbd7b8 (776120) map 0x40080020: _stext at ??:?

I (349) esp_image: segment 5: paddr=0x000fd7e0 vaddr=0x4002c61c size=0x0f324 ( 62244) load 0x4002c61c: vTaskDelete at /home/leonardo/esp/esp-idf/components/freertos/tasks.c:1227 (discriminator 4)

I (378) boot: Loaded app from partition at offset 0x10000 I (378) boot: Disabling RNG early entropy source... I (379) cache: Instruction cache : size 8KB, 4Ways, cache line size 32Byte I (386) cache: Data cache : size 8KB, 4Ways, cache line size 32Byte I (393) spiram: Found 16MBit SPI RAM device I (398) spiram: SPI RAM mode: sram 80m I (403) spiram: PSRAM initialized, cache is in normal (1-core) mode. I (410) cpu_start: Pro cpu up. I (413) cpu_start: Application information: I (418) cpu_start: Project name: esp32-javascript I (424) cpu_start: App version: 1 I (428) cpu_start: Compile time: May 8 2021 08:59:01 I (434) cpu_start: ELF file SHA256: a64949835cf42995... I (440) cpu_start: ESP-IDF: v4.2 I (445) cpu_start: Single core mode I (668) spiram: SPI SRAM memory test OK I (668) heap_init: Initializing. RAM available for dynamic allocation: I (668) heap_init: At 3FFD3410 len 00028BF0 (162 KiB): DRAM I (675) heap_init: At 3FFFC000 len 00003A10 (14 KiB): DRAM I (681) cpu_start: Pro cpu start user code I (686) spiram: Adding pool of 2048K of external SPI memory to heap allocator I (756) spi_flash: detected chip: gd I (756) spi_flash: flash io: dio I (756) cpu_start: Starting scheduler on PRO CPU. I (764) esp32-javascript: No ctx present: Free memory: 2244864 bytes I (874) esp32-javascript: Free memory: 2148440 bytes I (884) esp32-javascript: Initializing SPIFFS I (894) esp32-javascript: Partition size: total: 1ba31, used: e182 I (904) esp32-javascript: Initializing SPIFFS I (2484) esp32-javascript: Partition size: total: 1ba31, used: 0 I (2494) esp32-javascript: Loading loader.js ...

I (2604) esp32-javascript: Loading urlparse.js ...

I (2634) esp32-javascript: No ctx present: Self-Socket Test successful!

I (3134) esp32-javascript: Reading file /modules/esp32-javascript/index.js I (3224) esp32-javascript: Load global.js (NEW)... I (3424) esp32-javascript: Reading file /modules/esp32-javascript/global.js I (3804) esp32-javascript: Reading file /modules/esp32-javascript/http.js I (6104) esp32-javascript: Reading file /modules/socket-events/index.js I (8604) esp32-javascript: Reading file /modules/esp32-js-eventloop/index.js I (10304) esp32-javascript: Reading file /modules/esp32-javascript/stringbuffer.js I (12024) esp32-javascript: Reading file /modules/esp32-javascript/boot.js I (14844) esp32-javascript: Reading file /modules/wifi-events/index.js I (17234) esp32-javascript: Reading file /modules/esp32-javascript/configserver.js I (21284) esp32-javascript: Reading file /modules/esp32-javascript/config.js I (22994) esp32-javascript: Reading file /modules/esp32-javascript/firmware-config.js I (28004) esp32-javascript: Loading promise.js and exposing globals (NEW)... I (29544) esp32-javascript: Reading file /modules/esp32-javascript/promise.js I (32254) esp32-javascript: Loading config (NEW)... I (32314) esp32-javascript: Reading file /data/config.js E (32384) esp32-javascript: Failed to open file for reading E (32404) esp32-javascript: An error ocurred while accessing config. Maybe it does not exist. I (32414) esp32-javascript: Loading http.js and exposing globals (NEW)... I (32414) esp32-javascript: Loading fetch.js and exposing globals (NEW)... I (34144) esp32-javascript: Reading file /modules/esp32-javascript/fetch.js I (40514) esp32-javascript: Loading boot.js and exposing main (NEW)... I (40514) esp32-javascript: Loading socket-events (NEW)... I (41474) esp32-javascript: Loading wifi-events (NEW)... I (42594) esp32-javascript: Loading eventloop.js and starting eventloop (NEW)... I (42624) esp32-javascript: Current configuration: I (42664) esp32-javascript: {"access":{"username":"esp32","password":"esp32"}} I (42664) esp32-javascript: Missing wifi SSID configuration: Starting setup mode ... I (42674) esp32-javascript: Missing wifi password configuration: Starting setup mode ... I (42684) esp32-javascript: Starting soft ap mode. W (42724) wifi:malloc buffer fail E (42724) wifi:Expected to init 10 rx buffer, actual is 8 ESP_ERROR_CHECK failed: esp_err_t 0x101 (ESP_ERR_NO_MEM) at 0x4002a780 0x4002a780: _esp_error_check_failed at /home/leonardo/esp/esp-idf/components/esp_common/src/esp_err.c:45

file: "../components/wifi-events/wifi-events.c" line 224 func: setupWifi expression: esp_wifi_init(&cfg)

abort() was called at PC 0x4002a783 on core 0 0x4002a783: _esp_error_check_failed at /home/leonardo/esp/esp-idf/components/esp_common/src/esp_err.c:46

Backtrace:0x4002ac03:0x3ffe0f40 0x4002b431:0x3ffe0f60 0x40034842:0x3ffe0f80 0x4002a783:0x3ffe0ff0 0x4008862c:0x3ffe1010 0x40088785:0x3ffe1170 0x400988dd:0x3ffe1190 0x400989dd:0x3ffe11f0 0x4009c071:0x3ffe1210 0x40098347:0x3ffe1230 0x4009865d:0x3ffe1290 0x400988be:0x3ffe1320 0x400989dd:0x3ffe1380 0x40098a15:0x3ffe13a0 0x400aab7d:0x3ffe13c0 0x400988dd:0x3ffe13e0 0x400989dd:0x3ffe1440 0x4009c071:0x3ffe1460 0x40098347:0x3ffe1480 0x4009865d:0x3ffe14e0 0x400988be:0x3ffe1570 0x400989dd:0x3ffe15d0 0x400aac51:0x3ffe15f0 0x40086e6c:0x3ffe1610 0x400a3979:0x3ffe1630 0x4009983e:0x3ffe1650 0x400998f6:0x3ffe1700 0x400870db:0x3ffe1720 0x400988dd:0x3ffe1740 0x400989dd:0x3ffe17a0 0x4009c071:0x3ffe17c0 0x40098347:0x3ffe17e0 0x4009865d:0x3ffe1840 0x400988be:0x3ffe18d0 0x400989dd:0x3ffe1930 0x40098a15:0x3ffe1950 0x400aa922:0x3ffe1970 0x40086c7c:0x3ffe1990 0x4002b439:0x3ffe19b0 0x4002ac03: panic_abort at /home/leonardo/esp/esp-idf/components/esp_system/panic.c:330

0x4002b431: esp_system_abort at /home/leonardo/esp/esp-idf/components/esp_system/system_api.c:106

0x40034842: abort at /home/leonardo/esp/esp-idf/components/newlib/abort.c:46

0x4002a783: _esp_error_check_failed at /home/leonardo/esp/esp-idf/components/esp_common/src/esp_err.c:46

0x4008862c: setupWifi at /home/leonardo/esp/esp32-javascript/build/../components/wifi-events/wifi-events.c:224 (discriminator 1)

0x40088785: el_createSoftAp at /home/leonardo/esp/esp32-javascript/build/../components/wifi-events/wifi-events.c:271

0x400988dd: duk__handle_call_raw at /home/leonardo/esp/esp32-javascript/build/duk_js_call.c:2268

0x400989dd: duk_handle_call_unprotected at /home/leonardo/esp/esp32-javascript/build/duk_js_call.c:2422

0x4009c071: duk__executor_handle_call at /home/leonardo/esp/esp32-javascript/build/duk_js_executor.c:2690

0x40098347: duk__js_execute_bytecode_inner at /home/leonardo/esp/esp32-javascript/build/duk_js_executor.c:4780

0x4009865d: duk_js_execute_bytecode at /home/leonardo/esp/esp32-javascript/build/duk_js_executor.c:2965

0x400988be: duk__handle_call_raw at /home/leonardo/esp/esp32-javascript/build/duk_js_call.c:2246

0x400989dd: duk_handle_call_unprotected at /home/leonardo/esp/esp32-javascript/build/duk_js_call.c:2422

0x40098a15: duk_call_method at /home/leonardo/esp/esp32-javascript/build/duk_api_call.c:150

0x400aab7d: duk_bi_array_prototype_iter_shared at /home/leonardo/esp/esp32-javascript/build/duk_bi_array.c:1494

0x400988dd: duk__handle_call_raw at /home/leonardo/esp/esp32-javascript/build/duk_js_call.c:2268

0x400989dd: duk_handle_call_unprotected at /home/leonardo/esp/esp32-javascript/build/duk_js_call.c:2422

0x4009c071: duk__executor_handle_call at /home/leonardo/esp/esp32-javascript/build/duk_js_executor.c:2690

0x40098347: duk__js_execute_bytecode_inner at /home/leonardo/esp/esp32-javascript/build/duk_js_executor.c:4780

0x4009865d: duk_js_execute_bytecode at /home/leonardo/esp/esp32-javascript/build/duk_js_executor.c:2965

0x400988be: duk__handle_call_raw at /home/leonardo/esp/esp32-javascript/build/duk_js_call.c:2246

0x400989dd: duk_handle_call_unprotected at /home/leonardo/esp/esp32-javascript/build/duk_js_call.c:2422

0x400aac51: duk_call at /home/leonardo/esp/esp32-javascript/build/duk_api_call.c:137

0x40086e6c: duk__eval_module_source at /home/leonardo/esp/esp32-javascript/build/../components/duk-module-node/duk_module_node.c:247 (discriminator 6)

0x400a3979: duk__handle_safe_call_inner at /home/leonardo/esp/esp32-javascript/build/duk_js_call.c:2475

0x4009983e: duk_handle_safe_call at /home/leonardo/esp/esp32-javascript/build/duk_js_call.c:2720

0x400998f6: duk_safe_call at /home/leonardo/esp/esp32-javascript/build/duk_api_call.c:318

0x400870db: duk__handle_require at /home/leonardo/esp/esp32-javascript/build/../components/duk-module-node/duk_module_node.c:124

0x400988dd: duk__handle_call_raw at /home/leonardo/esp/esp32-javascript/build/duk_js_call.c:2268

0x400989dd: duk_handle_call_unprotected at /home/leonardo/esp/esp32-javascript/build/duk_js_call.c:2422

0x4009c071: duk__executor_handle_call at /home/leonardo/esp/esp32-javascript/build/duk_js_executor.c:2690

0x40098347: duk__js_execute_bytecode_inner at /home/leonardo/esp/esp32-javascript/build/duk_js_executor.c:4780

0x4009865d: duk_js_execute_bytecode at /home/leonardo/esp/esp32-javascript/build/duk_js_executor.c:2965

0x400988be: duk__handle_call_raw at /home/leonardo/esp/esp32-javascript/build/duk_js_call.c:2246

0x400989dd: duk_handle_call_unprotected at /home/leonardo/esp/esp32-javascript/build/duk_js_call.c:2422

0x40098a15: duk_call_method at /home/leonardo/esp/esp32-javascript/build/duk_api_call.c:150

0x400aa922: duk_eval_raw at /home/leonardo/esp/esp32-javascript/build/duk_api_compile.c:43

0x40086c7c: duktape_task at /home/leonardo/esp/esp32-javascript/build/../components/esp32-javascript/esp32-javascript.c:718

0x4002b439: vPortTaskWrapper at /home/leonardo/esp/esp-idf/components/freertos/xtensa/port.c:143

ELF file SHA256: a64949835cf42995

Rebooting... ESP-ROM:esp32s2-rc4-20191025 Build:Oct 25 2019 rst:0x3 (RTC_SW_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT) Saved PC:0x40025545 0x40025545: esp_restart_noos_dig at /home/leonardo/esp/esp-idf/components/esp_system/system_api.c:60 (discriminator 1)

SPIWP:0xee mode:DIO, clock div:1 load:0x3ffe6100,len:0x4 load:0x3ffe6104,len:0x1878 load:0x4004c000,len:0x1688 load:0x40050000,len:0x20fc entry 0x4004c324 I (50) boot: ESP-IDF v4.2 2nd stage bootloader I (50) boot: comp

laldana73 commented 3 years ago

my boads have chip revision : 0 your seems have chip revision : 2

could this be a reason?

marcelkottmann commented 3 years ago

Hi @laldana73 , I think I got it now. It seems like we still do use different esp-idf versions. I use a version cloned directly from espressif/esp-idf git repository branchname is release/v4.2 , but I am using commit hash ccdfbb865e85abbbbf664163fb19342c4e3963d7 . The release page of espressif points to a zip download with version 4.2 or cloning the espressif/esp-idf with branchname v4.2 (without "release/" suffix! ) Using branch esp-idf "v4.2" branch I get the same error (wifi:malloc buffer fail) as you. Please try to use the esp-idf with "release/v4.2" branch (commit hash ccdfbb865e85abbbbf664163fb19342c4e3963d7) and report the result. I have also chip rev 0, the other error i cannot explain.

marcelkottmann commented 3 years ago

Hi @laldana73 , another goog news. For esp-idf v.4.2 branch I already found the setting in sdkconfig which was new introduced and was missing: So if you still want to use the v4.2 branch add CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y

After that it started properly. But please keep in mind that currently esp-javascript is only fully tested with esp-idf release/v4.2 branch.

laldana73 commented 3 years ago

Hi @marcelkottmann i have been not able to install exactly the same comit, then i installed the version 4.2.1 stable and tunning the sdkconfig, with the CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y is working now. i'll be testing the framework Thanks for your support

marcelkottmann commented 3 years ago

All changes were merged to master just now.