Moddable-OpenSource / moddable

Tools for developers to create truly open IoT products using standard JavaScript on low cost microcontrollers.
http://www.moddable.com
1.35k stars 238 forks source link

[Win10] esp32c3 fails to build #996

Closed Sineos closed 1 year ago

Sineos commented 1 year ago

I would like to build for an esp32c3. It fails with (all relevant environment information should be in the first few lines)

Starting build process...
Host system check: Windows 10 Pro
MCU Build system check: p1.0.0-rc.1 + #8ca3f6c @ m3.5.1-57-g7be4b23 (x86)
HOME directory check: C:\Users\souls
Creating build environment for platform esp32/esp32c3.
Working directory: \Users\souls\.node-red\mcu-plugin-cache\b33dc2xt18n
$IDF_PATH is defined: C:\Espressif\frameworks\esp-idf-v4.4.3
$IDF_TOOLS_PATH is defined: C:\Espressif
$IDF_PYTHON_ENV_PATH is not defined.
> cd \Users\souls\.node-red\mcu-plugin-cache\b33dc2xt18n
Creating build batch file...
> cmd.exe build.bat

C:\Users\souls\.node-red\mcu-plugin-cache\b33dc2xt18n>CALL "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars32.bat" 
**********************************************************************
** Visual Studio 2022 Developer Command Prompt v17.0
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x86'
Setting PYTHONNOUSERSITE, was not set
Using Python in C:\Espressif\python_env\idf4.4_py3.8_env\Scripts\
Python 3.8.7
Using Git in C:\Espressif\tools\idf-git\2.34.2\cmd\
git version 2.34.1.windows.1
Setting IDF_PATH: C:\Espressif\frameworks\esp-idf-v4.4.3

Adding ESP-IDF tools to PATH...
Not using an unsupported version of tool cmake found in PATH: 3.24.202208181.
Not using an unsupported version of tool ninja found in PATH: 1.11.0.
    C:\Espressif\tools\xtensa-esp32-elf\esp-2021r2-patch5-8.4.0\xtensa-esp32-elf\bin
    C:\Espressif\tools\xtensa-esp32s2-elf\esp-2021r2-patch5-8.4.0\xtensa-esp32s2-elf\bin
    C:\Espressif\tools\xtensa-esp32s3-elf\esp-2021r2-patch5-8.4.0\xtensa-esp32s3-elf\bin
    C:\Espressif\tools\riscv32-esp-elf\esp-2021r2-patch5-8.4.0\riscv32-esp-elf\bin
    C:\Espressif\tools\esp32ulp-elf\2.35_20220830\esp32ulp-elf\bin
    C:\Espressif\tools\cmake\3.23.1\bin
    C:\Espressif\tools\openocd-esp32\v0.11.0-esp32-20220706\openocd-esp32\bin
    C:\Espressif\tools\ninja\1.10.2\
    C:\Espressif\tools\idf-exe\1.0.3\
    C:\Espressif\tools\ccache\4.3\ccache-4.3-windows-64
    C:\Espressif\tools\dfu-util\0.9\dfu-util-0.9-win64
    C:\Espressif\frameworks\esp-idf-v4.4.3\tools

Checking if Python packages are up to date...
Python requirements from C:\Espressif\frameworks\esp-idf-v4.4.3\requirements.txt are satisfied.

Done! You can now compile ESP-IDF projects.
Go to the project directory and run:

  idf.py build

FC: Kann C:\USERS\SOULS\PROJECTS\MODDABLE\BUILD\TMP\ESP32\ESP32C3\RELEASE\B33DC2XT18N\XSPROJ-ESP32C3\PARTITIONS.CSV nicht ”ffnen - Datei oder Ordner nicht vorhanden

        1 Datei(en) kopiert.
        1 Datei(en) kopiert.
        1 Datei(en) kopiert.
        1 Datei(en) kopiert.
        1 Datei(en) kopiert.
        1 Datei(en) kopiert.
Reconfiguring ESP-IDF...
warning: user value 1536 on the int symbol FREERTOS_ISR_STACKSIZE (defined at C:/Espressif/frameworks/esp-idf-v4.4.3/components/freertos/Kconfig:223) ignored due to being outside the active range ([2096, 32768]) -- falling back on defaults
Loading defaults file C:/Users/souls/Projects/moddable/build/tmp/esp32/esp32c3/release/b33dc2xt18n/xsProj-esp32c3/sdkconfig.mc...
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/souls/Projects/moddable/build/tmp/esp32/esp32c3/release/b33dc2xt18n/xsProj-esp32c3/build
Executing action: reconfigure
Running cmake in directory c:\users\souls\projects\moddable\build\tmp\esp32\esp32c3\release\b33dc2xt18n\xsproj-esp32c3\build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -DSDKCONFIG_DEFAULTS=C:/Users/souls/Projects/moddable/build/tmp/esp32/esp32c3/release/b33dc2xt18n/xsProj-esp32c3/sdkconfig.mc -DSDKCONFIG_HEADER=C:\Users\souls\Projects\moddable\build\tmp\esp32\esp32c3\release\b33dc2xt18n\xsProj-esp32c3\build\config\sdkconfig.h -DCMAKE_MESSAGE_LOG_LEVEL=ERROR -DDEBUGGER_SPEED=460800 -DIDF_TARGET=esp32c3 -DESP32_SUBCLASS=esp32c3 -DSDKCONFIG_DEFAULTS=C:\Users\souls\Projects\moddable\build\tmp\esp32\esp32c3\release\b33dc2xt18n\xsProj-esp32c3\sdkconfig.mc -DCCACHE_ENABLE=1 c:\users\souls\projects\moddable\build\tmp\esp32\esp32c3\release\b33dc2xt18n\xsproj-esp32c3"...
        1 Datei(en) kopiert.
# cc xsHost.o (strings in flash)
# cc xsHosts.o (strings in flash)
# cc xsPlatform.o (strings in flash)
C:\Users\souls\AppData\Local\Temp\cck7d1na.s: Assembler messages:
C:\Users\souls\AppData\Local\Temp\cck7d1na.s:275: Warning: setting incorrect section attributes for .rodata.mod.0
# cc xsAll.o (strings in flash)
# cc xsAPI.o (strings in flash)
# cc xsArguments.o (strings in flash)
# cc xsArray.o (strings in flash)
# cc xsAtomics.o (strings in flash)
# cc xsBigInt.o (strings in flash)
C:\Users\souls\Projects\moddable\xs\sources\xsBigInt.c: In function 'fxBigInt_uadd_prim':
C:\Users\souls\Projects\moddable\xs\sources\xsBigInt.c:1363:44: warning: passing argument 3 of '__builtin_uadd_overflow' from incompatible pointer type [-Wincompatible-pointer-types]
  if (__builtin_uadd_overflow(ap[i], bp[i], &r)) {
                                            ^~
C:\Users\souls\Projects\moddable\xs\sources\xsBigInt.c:1363:44: note: expected 'unsigned int *' but argument is of type 'txU4 *' {aka 'long unsigned int *'}
C:\Users\souls\Projects\moddable\xs\sources\xsBigInt.c:1368:37: warning: passing argument 3 of '__builtin_uadd_overflow' from incompatible pointer type [-Wincompatible-pointer-types]
   c = __builtin_uadd_overflow(r, c, &rp[i]);
                                     ^~~~~~
C:\Users\souls\Projects\moddable\xs\sources\xsBigInt.c:1368:37: note: expected 'unsigned int *' but argument is of type 'txU4 *' {aka 'long unsigned int *'}
C:\Users\souls\Projects\moddable\xs\sources\xsBigInt.c:1374:41: warning: passing argument 3 of '__builtin_uadd_overflow' from incompatible pointer type [-Wincompatible-pointer-types]
   c = __builtin_uadd_overflow(1, bp[i], &rp[i]);
                                         ^~~~~~
C:\Users\souls\Projects\moddable\xs\sources\xsBigInt.c:1374:41: note: expected 'unsigned int *' but argument is of type 'txU4 *' {aka 'long unsigned int *'}
# cc xsBoolean.o (strings in flash)
# cc xsCode.o (strings in flash)
# cc xsCommon.o (strings in flash)
# cc xsDataView.o (strings in flash)
# cc xsDate.o (strings in flash)
# cc xsDebug.o (strings in flash)
# cc xsError.o (strings in flash)
# cc xsFunction.o (strings in flash)
# cc xsGenerator.o (strings in flash)
# cc xsGlobal.o (strings in flash)
# cc xsJSON.o (strings in flash)
# cc xsLexical.o (strings in flash)
# cc xsMapSet.o (strings in flash)
# cc xsMarshall.o (strings in flash)
# cc xsMath.o (strings in flash)
# cc xsMemory.o (strings in flash)
# cc xsModule.o (strings in flash)
# cc xsNumber.o (strings in flash)
# cc xsObject.o (strings in flash)
# cc xsPromise.o (strings in flash)
# cc xsProperty.o (strings in flash)
# cc xsProxy.o (strings in flash)
# cc xsRegExp.o (strings in flash)
# cc xsRun.o (strings in flash)
# cc xsScope.o (strings in flash)
# cc xsScript.o (strings in flash)
# cc xsSourceMap.o (strings in flash)
# cc xsString.o (strings in flash)
# cc xsSymbol.o (strings in flash)
# cc xsSyntaxical.o (strings in flash)
# cc xsTree.o (strings in flash)
# cc xsType.o (strings in flash)
# cc xsdtoa.o (strings in flash)
# cc xsre.o (strings in flash)
# cc xsmc.o (strings in flash)
C:\Users\souls\AppData\Local\Temp\ccsK075e.s: Assembler messages:
C:\Users\souls\AppData\Local\Temp\ccsK075e.s:1938: Warning: ignoring changed section attributes for .data
# cc e_pow.o (strings in flash)
# nodered2mcu flows
# xsc flows.xsb
# xsc pins\digital.xsb
# xsc neopixel.xsb
# xsc time.xsb
# xsc timer.xsb
# xsc Resource.xsb
# xsc deepEqual.xsb
# xsc structuredClone.xsb
# xsc modules.xsb
# xsc base64.xsb
# xsc hex.xsb
# xsc wifi.xsb
# xsc socket.xsb
# xsc net.xsb
# xsc sntp.xsb
# xsc rpi-ds18b20.xsb
# xsc DS18X20.xsb
# xsc onewire.xsb
# xsc rpi-gpio.xsb
# xsc colors.xsb
# xsc rpi-neopixels.xsb
# xsc crypt.xsb
# xsc httpserver.xsb
# xsc ec.xsb
# xsc ecp.xsb
# xsc modular.xsb
# xsc mont.xsb
# xsc bin.xsb
# xsc securesocket.xsb
# xsc tlssocket.xsb
# xsc fetch.xsb
# xsc httprequest.xsb
# xsc mustache.xsb
# xsc config.xsb
# xsc logical.xsb
# xsc WebSocket.xsb
# xsc websocketnodes.xsb
# xsc lower-case.xsb
# xsc node-red-files.xsb
# xsc template.xsb
# xsc udpnodes.xsb
# xsc nodered.xsb
# xsc main.xsb
# xsc pins\digital\monitor.xsb
# xsc button.xsb
# xsc setup\target.xsb
# xsc setup\network.xsb
# xsc commodetto\Bitmap.xsb
# xsc ~.embedded\io\analog.xsb
# xsc ~.embedded\io\digital.xsb
# xsc ~.embedded\io\digitalbank.xsb
# xsc ~.embedded\io\i2c.xsb
# xsc ~.embedded\implementation\i2csync.xsb
# xsc ~.embedded\io\smbus.xsb
# xsc ~.embedded\implementation\smbussync.xsb
# xsc ~.embedded\io\pwm.xsb
# xsc ~.embedded\io\serial.xsb
# xsc ~.embedded\io\spi.xsb
# xsc ~.embedded\io\provider\MCP23017.xsb
# xsc ~.embedded\io\socket\tcp.xsb
# xsc ~.embedded\io\socket\udp.xsb
# xsc ~.embedded\io\socket\listener.xsb
# xsc system.xsb
# xsc ~.embedded\provider\builtin.xsb
# xsc ~.embedded\network\dns\resolver\udp.xsb
# xsc dns\parser.xsb
# xsc dns\serializer.xsb
# xsc dns.xsb
# xsc mqttclient\config.xsb
# xsc ~.embedded\network\mqtt\client.xsb
# xsc httpserver\config.xsb
# xsc ~.embedded\network\http\server.xsb
# xsc ~.embedded\network\http\server\options\serversendevents.xsb
# xsc ~.embedded\network\http\server\options\webpage.xsb
# xsc ~.embedded\network\http\server\options\websocket.xsb
# xsc text\decoder.xsb
# xsc text\encoder.xsb
# xsc url.xsb
# xsc httpclient\config.xsb
# xsc ~.embedded\network\http\client.xsb
# xsc ssl\alert.xsb
# xsc ssl\cache.xsb
# xsc ssl\cert.xsb
# xsc ssl\changecipher.xsb
# xsc ssl\ciphersuites.xsb
# xsc ssl\constants.xsb
# xsc ssl\error.xsb
# xsc ssl\handshake.xsb
# xsc ssl\prf.xsb
# xsc ssl\record.xsb
# xsc ssl\setup.xsb
# xsc ssl\stream.xsb
# xsc ber.xsb
# xsc curve.xsb
# xsc dsa.xsb
# xsc ecdsa.xsb
# xsc gcm.xsb
# xsc hmac.xsb
# xsc pkcs1_5.xsb
# xsc pkcs1.xsb
# xsc pkcs8.xsb
# xsc rng.xsb
# xsc rsa.xsb
# xsc x509.xsb
# xsc ssl\session.xsb
# xsc httpsclient\config.xsb
# xsc ~.embedded\network\websocket\client.xsb
# xsc csv.xsb
# xsc delay.xsb
# xsc join.xsb
# xsc split.xsb
# xsc batch.xsb
# xsc random.xsb
# xsc sort.xsb
# xsc trigger.xsb
# xsc sensor.xsb
# xsc file.xsb
# xsc ~.embedded\sensor\Temperature\TMP102.xsb
# xsc openweathermap.xsb
# xsc mc\config.xsb
# xsid digital.c.xsi
# xsid modGPIO.c.xsi
# xsid modMonitor.c.xsi
# xsid modneopixel.c.xsi
# xsid neopixel.c.xsi
# xsid modTime.c.xsi
# xsid modTimer.c.xsi
# xsid timer.c.xsi
# xsid modPreference.c.xsi
# xsid Resource.c.xsi
# xsid modInstrumentation.c.xsi
# xsid modLwipSafe.c.xsi
# xsid deepEqual.c.xsi
# xsid structuredClone.c.xsi
# xsid modules.c.xsi
# xsid modBase64.c.xsi
# xsid modHex.c.xsi
# xsid xs6wifi.c.xsi
# xsid modSocket.c.xsi
# xsid modNet.c.xsi
# xsid modResolve.c.xsi
# xsid modsntp.c.xsi
# xsid modSPI.c.xsi
# xsid builtinCommon.c.xsi
# xsid digitalbank.c.xsi
# xsid _i2c.c.xsi
# xsid spi.c.xsi
# xsid moddnsparser.c.xsi
# xsid modonewire.c.xsi
# xsid owb.c.xsi
# xsid owb_gpio.c.xsi
# xsid owb_rmt.c.xsi
# xsid modCrypt.c.xsi
# xsid chacha.c.xsi
# xsid fips180.c.xsi
# xsid fips197.c.xsi
# xsid fips46.c.xsi
# xsid ghash.c.xsi
# xsid rc.c.xsi
# xsid rfc1321.c.xsi
# xsid ec.c.xsi
# xsid modular.c.xsi
# xsid mont.c.xsi
# xsid xsBigIntEx.c.xsi
# xsid bin.c.xsi
# xsid modsecuresocket.c.xsi
# xsid modLogical.c.xsi
# xsid lfs.c.xsi
# xsid lfs_util.c.xsi
# xsid modLittlefs.c.xsi
# xsid nodered.c.xsi
# xsid commodettoBitmap.c.xsi
# xsid _analog.c.xsi
# xsid _pwm.c.xsi
# xsid serial.c.xsi
# xsid tcp.c.xsi
# xsid udp.c.xsi
# xsid system.c.xsi
# xsid textdecoder.c.xsi
# xsid textencoder.c.xsi
# xsid url.c.xsi
# xsid rng.c.xsi
# xsid x509.c.xsi
# xsid modGPIO.h.xsi
# xsid neopixel.h.xsi
# xsid modTimer.h.xsi
# xsid modPreference.h.xsi
# xsid modInstrumentation.h.xsi
# xsid modLwipSafe.h.xsi
# xsid modSocket.h.xsi
# xsid modSPI.h.xsi
# xsid builtinCommon.h.xsi
# xsid owb.h.xsi
# xsid owb_gpio.h.xsi
# xsid owb_rmt.h.xsi
# xsid chacha.h.xsi
# xsid fips180.h.xsi
# xsid fips197.h.xsi
# xsid fips46.h.xsi
# xsid ghash.h.xsi
# xsid kcl.h.xsi
# xsid kcl_symmetric.h.xsi
# xsid rc.h.xsi
# xsid rfc1321.h.xsi
# xsid xsBigIntEx.h.xsi
# xsid lfs.h.xsi
# xsid lfs_util.h.xsi
# xsid commodettoBitmap.h.xsi
# xsl modules
### 2340 instances, 2467 keys, 150 colors, 0 holes
### warning: embedded:network/http/server/options/serversendevents: default: not frozen
### warning: embedded:network/http/server/options/webpage: default: not frozen
### warning: embedded:network/http/server/options/websocket: default: not frozen
### warning: nodered: Node.prototype.send() RED.#compatibility: not frozen
### warning: nodered: Node.prototype.send() RED.#compatibility[Symbol.asyncIterator]() DelayNode() maxKeptMsgsCount() _maxKeptMsgsCount: no const
### warning: nodered: Node.prototype.send() RED.build() msgQueue: no const
### warning: nodered: Node.prototype.send() RED.build() compatibilityClasses: no const
### warning: httpserver: default.add() server: no const
### warning: securesocket: default() Session() cacheManager: not frozen
### warning: fetch: fetch() Client() clients: no const
### warning: mustache: default: not frozen
### warning: mustache: default.tags: not frozen
### warning: mustache: default.clearCache() defaultWriter: not frozen
### warning: mustache: default.clearCache() defaultWriter.templateCache: not frozen
### warning: mustache: default.clearCache() defaultWriter.templateCache._cache: not frozen
### warning: WebSocket: default() URLParts() urlRegExp: no const
### warning: WebSocket: default() URLParts() authorityRegExp: no const
# cc mc.xs.o (slots in flash)
# copy ca.ski
        1 Datei(en) kopiert.
# mcrez resources
Total resource size: 4760 bytes
# cc mc.resources.o (slots in flash)
# cc digital.c.o
# cc modGPIO.c.o
# cc modMonitor.c.o
# cc modneopixel.c.o
# cc neopixel.c.o
# cc modTime.c.o
# cc modTimer.c.o
# cc timer.c.o
# cc modPreference.c.o
C:\Users\souls\Projects\moddable\modules\files\preference\esp32\modPreference.c: In function 'xs_preference_get':
C:\Users\souls\Projects\moddable\modules\files\preference\esp32\modPreference.c:130:59: warning: passing argument 4 of 'nvs_get_str' from incompatible pointer type [-Wincompatible-pointer-types]
  else if (ESP_OK == (err = nvs_get_str(handle, key, NULL, &integer))) {
                                                           ^~~~~~~~
In file included from C:\Espressif\frameworks\esp-idf-v4.4.3\components/nvs_flash/include/nvs_flash.h:21,
                 from C:\Users\souls\Projects\moddable\modules\files\preference\esp32\modPreference.c:25:
C:\Espressif\frameworks\esp-idf-v4.4.3\components/nvs_flash/include/nvs.h:456:87: note: expected 'size_t *' {aka 'unsigned int *'} but argument is of type 'int32_t *' {aka 'long int *'}
 esp_err_t nvs_get_str (nvs_handle_t handle, const char* key, char* out_value, size_t* length);
                                                                               ~~~~~~~~^~~~~~
C:\Users\souls\Projects\moddable\modules\files\preference\esp32\modPreference.c:132:58: warning: passing argument 4 of 'nvs_get_str' from incompatible pointer type [-Wincompatible-pointer-types]
   err = nvs_get_str(handle, key, xsmcToString(xsResult), &integer);
                                                          ^~~~~~~~
In file included from C:\Espressif\frameworks\esp-idf-v4.4.3\components/nvs_flash/include/nvs_flash.h:21,
                 from C:\Users\souls\Projects\moddable\modules\files\preference\esp32\modPreference.c:25:
C:\Espressif\frameworks\esp-idf-v4.4.3\components/nvs_flash/include/nvs.h:456:87: note: expected 'size_t *' {aka 'unsigned int *'} but argument is of type 'int32_t *' {aka 'long int *'}
 esp_err_t nvs_get_str (nvs_handle_t handle, const char* key, char* out_value, size_t* length);
                                                                               ~~~~~~~~^~~~~~
C:\Users\souls\Projects\moddable\modules\files\preference\esp32\modPreference.c:134:60: warning: passing argument 4 of 'nvs_get_blob' from incompatible pointer type [-Wincompatible-pointer-types]
  else if (ESP_OK == (err = nvs_get_blob(handle, key, NULL, &integer))) {
                                                            ^~~~~~~~
In file included from C:\Espressif\frameworks\esp-idf-v4.4.3\components/nvs_flash/include/nvs_flash.h:21,
                 from C:\Users\souls\Projects\moddable\modules\files\preference\esp32\modPreference.c:25:
C:\Espressif\frameworks\esp-idf-v4.4.3\components/nvs_flash/include/nvs.h:463:87: note: expected 'size_t *' {aka 'unsigned int *'} but argument is of type 'int32_t *' {aka 'long int *'}
 esp_err_t nvs_get_blob(nvs_handle_t handle, const char* key, void* out_value, size_t* length);
                                                                               ~~~~~~~~^~~~~~
C:\Users\souls\Projects\moddable\modules\files\preference\esp32\modPreference.c:136:64: warning: passing argument 4 of 'nvs_get_blob' from incompatible pointer type [-Wincompatible-pointer-types]
   err = nvs_get_blob(handle, key, xsmcToArrayBuffer(xsResult), &integer);
                                                                ^~~~~~~~
In file included from C:\Espressif\frameworks\esp-idf-v4.4.3\components/nvs_flash/include/nvs_flash.h:21,
                 from C:\Users\souls\Projects\moddable\modules\files\preference\esp32\modPreference.c:25:
C:\Espressif\frameworks\esp-idf-v4.4.3\components/nvs_flash/include/nvs.h:463:87: note: expected 'size_t *' {aka 'unsigned int *'} but argument is of type 'int32_t *' {aka 'long int *'}
 esp_err_t nvs_get_blob(nvs_handle_t handle, const char* key, void* out_value, size_t* length);
                                                                               ~~~~~~~~^~~~~~
C:\Users\souls\Projects\moddable\modules\files\preference\esp32\modPreference.c: In function 'modPreferenceGet':
C:\Users\souls\Projects\moddable\modules\files\preference\esp32\modPreference.c:251:45: warning: passing argument 4 of 'nvs_get_str' from incompatible pointer type [-Wincompatible-pointer-types]
   else if (!nvs_get_str(handle, key, value, &size)) {
                                             ^~~~~
In file included from C:\Espressif\frameworks\esp-idf-v4.4.3\components/nvs_flash/include/nvs_flash.h:21,
                 from C:\Users\souls\Projects\moddable\modules\files\preference\esp32\modPreference.c:25:
C:\Espressif\frameworks\esp-idf-v4.4.3\components/nvs_flash/include/nvs.h:456:87: note: expected 'size_t *' {aka 'unsigned int *'} but argument is of type 'int32_t *' {aka 'long int *'}
 esp_err_t nvs_get_str (nvs_handle_t handle, const char* key, char* out_value, size_t* length);
                                                                               ~~~~~~~~^~~~~~
C:\Users\souls\Projects\moddable\modules\files\preference\esp32\modPreference.c:255:46: warning: passing argument 4 of 'nvs_get_blob' from incompatible pointer type [-Wincompatible-pointer-types]
   else if (!nvs_get_blob(handle, key, value, &size)) {
                                              ^~~~~
In file included from C:\Espressif\frameworks\esp-idf-v4.4.3\components/nvs_flash/include/nvs_flash.h:21,
                 from C:\Users\souls\Projects\moddable\modules\files\preference\esp32\modPreference.c:25:
C:\Espressif\frameworks\esp-idf-v4.4.3\components/nvs_flash/include/nvs.h:463:87: note: expected 'size_t *' {aka 'unsigned int *'} but argument is of type 'int32_t *' {aka 'long int *'}
 esp_err_t nvs_get_blob(nvs_handle_t handle, const char* key, void* out_value, size_t* length);
                                                                               ~~~~~~~~^~~~~~
# cc Resource.c.o
# cc modInstrumentation.c.o
# cc modLwipSafe.c.o
# cc deepEqual.c.o
C:\Users\souls\AppData\Local\Temp\ccHvIgJR.s: Assembler messages:
C:\Users\souls\AppData\Local\Temp\ccHvIgJR.s:2379: Warning: setting incorrect section attributes for .rodata
# cc structuredClone.c.o
# cc modules.c.o
# cc modBase64.c.o
# cc modHex.c.o
C:\Users\souls\AppData\Local\Temp\ccYLZYDR.s: Assembler messages:
C:\Users\souls\AppData\Local\Temp\ccYLZYDR.s:672: Warning: setting incorrect section attributes for .rodata.mod.0
# cc xs6wifi.c.o
# cc modSocket.c.o
# cc modNet.c.o
# cc modResolve.c.o
# cc modsntp.c.o
# cc modSPI.c.o
# cc builtinCommon.c.o
# cc digitalbank.c.o
# cc _i2c.c.o
# cc spi.c.o
# cc moddnsparser.c.o
# cc modonewire.c.o
# cc owb.c.o
# cc owb_gpio.c.o
# cc owb_rmt.c.o
C:\Users\souls\Projects\moddable\modules\drivers\onewire\esp\owb_rmt.c: In function '_init':
C:\Users\souls\Projects\moddable\modules\drivers\onewire\esp\owb_rmt.c:388:26: error: incompatible types when assigning to type 'volatile union <anonymous>' from type 'int'
         GPIO.enable_w1ts = (0x1 << gpio_num);
                          ^
C:\Users\souls\Projects\moddable\modules\drivers\onewire\esp\owb_rmt.c:392:14: error: 'gpio_dev_t' {aka 'volatile struct gpio_dev_s'} has no member named 'enable1_w1ts'; did you mean 'enable_w1ts'?
         GPIO.enable1_w1ts.data = (0x1 << (gpio_num - 32));
              ^~~~~~~~~~~~
              enable_w1ts
NMAKE : fatal error U1077: 'C:\Espressif\tools\riscv32-esp-elf\esp-2021r2-patch5-8.4.0\riscv32-esp-elf\bin\riscv32-esp-elf-gcc.EXE' : return code '0x1'
Stop.

C:\Users\souls\Projects\moddable\build\tmp\esp32\esp32c3\release\b33dc2xt18n: b33dc2xt18n.zip

This build is from within node-red but it makes no difference if I call the build.batdirectly in ESP-IDF 4.4 CMD

CALL "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars32.bat"
pushd %IDF_PATH%
CALL "C:\Espressif\idf_cmd_init.bat"
popd
mcconfig -m -p esp32/esp32c3 ssid="aaa" password="xxx"

Any pointer would be appreciated. If you need more / other information, just let me know

phoddie commented 1 year ago

Looks like the ESP-IDF defines hardware GPIO access differently on ESP32C3 from other targets. I don't have an ESP32C3 with me to try, but it looks straightforward to resolve the build error.

In owb_rmt.c, try replacing lines 386-393 with:

// attach GPIO to previous pin
#if kCPUESP32C3
        GPIO.enable_w1ts.val = (0x1 << gpio_num);
#else
    if (gpio_num < 32)
    {
        GPIO.enable_w1ts = (0x1 << gpio_num);
    }
    else
    {
        GPIO.enable1_w1ts.data = (0x1 << (gpio_num - 32));
    }
#endif

You'll also need to add this to the includes:

#include "xsHost.h"

Please let me know how it goes. Thanks!

mkellner commented 1 year ago

Also, please use ESP IDF v4.4.2 with esp32c3.

Sineos commented 1 year ago

Many thanks @phoddie. It worked for compiling but then after:

Hash of data verified.
Compressed 3072 bytes to 123...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (123 compressed) at 0x00008000 in 0.1 seconds (effective 327.6 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

Detecting chip type... ESP32-C3
Running ninja in directory c:\users\souls\projects\moddable\build\tmp\esp32\esp32c3\release\b33dc2xt18n\xsproj-esp32c3\build
Executing "ninja flash"...
Done
        1 Datei(en) kopiert.
        1 Datei(en) kopiert.
        1 Datei(en) kopiert.
        1 Datei(en) kopiert.
Executing action: monitor
Serial port COM6
Connecting...--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0xf (SPI_FAST_FLASH_BOOT)
Saved PC:0x4004c97a
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5810,len:0x48
load:0x403cc710,len:0x67c
load:0x403ce710,len:0x2260
entry 0x403cc710
Core dump started (further output muted)
Received   1 kB...
Received   2 kB...
Received   3 kB...
Received   4 kB...
Received   5 kB...
Received   6 kB...

Core dump finished!
Exception in thread Thread-1:
Traceback (most recent call last):
  File "threading.py", line 932, in _bootstrap_inner
Exception in thread Thread-2:
Traceback (most recent call last):
  File "threading.py", line 932, in _bootstrap_inner
  File "threading.py", line 870, in run
  File "threading.py", line 870, in run
  File "subprocess.py", line 1366, in _readerthread
  File "subprocess.py", line 1366, in _readerthread
OSError: [Errno 22] Invalid argument
OSError: [Errno 22] Invalid argument
WARNING: Attempt to terminate the GDB process failed, because it is already terminated. Skip
espcoredump.py v0.4-dev
===============================================================
==================== ESP32 CORE DUMP START ====================

Crashed task handle: 0x3fc9e1f4, name: 'main', GDB name: 'process 1070195188'

================== CURRENT THREAD REGISTERS ===================
ra             0x42005f52   0x42005f52 <modRunMachineSetup+500>
sp             0x3fc9ddd0   0x3fc9ddd0
gp             0x3fc91c00   0x3fc91c00 <country_info_24ghz+224>
tp             0x3fc22920   0x3fc22920
t0             0x4005890e   1074104590
t1             0x420324a4   1107502244
t2             0x600    1536
fp             0x3c1171d8   0x3c1171d8 <gxHeap+79536>
s1             0x3c0d3000   1007497216
a0             0x3fca6360   1070228320
a1             0x1  1
a2             0x3fca618c   1070227852
a3             0xa  10
a4             0x3c0d3000   1007497216
a5             0x42026d32   1107455282
a6             0x74656772   1952802674
a7             0x3fc9df5d   1070194525
s2             0x3fc97000   1070166016
s3             0x0  0
s4             0x0  0
s5             0x0  0
s6             0x0  0
s7             0x0  0
s8             0x0  0
s9             0x0  0
s10            0x0  0
s11            0x0  0
t3             0x20 32
t4             0x100    256
t5             0x40 64
t6             0x200    512
pc             0x42026748   0x42026748 <fxRunID+434>

==================== CURRENT THREAD STACK =====================
#0  0x42026748 in fxRunID (the=the@entry=0x3fca6360, generator=generator@entry=0x0, count=count@entry=1) at C:\\Users\\souls\\Projects\\moddable\\xs\\sources\\xsRun.c:719
#1  0x4200690a in fxRunCount (the=the@entry=0x3fca6360, count=count@entry=1) at C:\\Users\\souls\\Projects\\moddable\\xs\\sources\\xsAPI.c:1201
#2  0x42005f52 in modRunMachineSetup (the=0x3fca6360) at C:\\Users\\souls\\Projects\\moddable\\xs\\platforms\\mc\\xsHosts.c:581
#3  0x4200517c in loop_task (pvParameter=<optimized out>) at C:/Users/souls/Projects/moddable/build/tmp/esp32/esp32c3/release/b33dc2xt18n/xsProj-esp32c3/main/main.c:124
#4  0x4038be8c in prvTaskExitError () at C:/Espressif/frameworks/esp-idf-v4.4.3/components/freertos/port/riscv/port.c:171
Backtrace stopped: frame did not save the PC

======================== THREADS INFO =========================
  Id   Target Id          Frame 
* 1    process 1070195188 0x42026748 in fxRunID (the=the@entry=0x3fca6360, generator=generator@entry=0x0, count=count@entry=1) at C:\\Users\\souls\\Projects\\moddable\\xs\\sources\\xsRun.c:719
  2    process 1070181980 0x4038befe in vPortClearInterruptMask (mask=1) at C:/Espressif/frameworks/esp-idf-v4.4.3/components/freertos/port/riscv/port.c:343
  3    process 1070183864 prvIdleTask (pvParameters=0x0) at C:/Espressif/frameworks/esp-idf-v4.4.3/components/freertos/tasks.c:3928
  4    process 1070177472 0x4038befe in vPortClearInterruptMask (mask=1) at C:/Espressif/frameworks/esp-idf-v4.4.3/components/freertos/port/riscv/port.c:343

==================== THREAD 1 (TCB: 0x3fc9e1f4, name: 'main') =====================
#0  0x42026748 in fxRunID (the=the@entry=0x3fca6360, generator=generator@entry=0x0, count=count@entry=1) at C:\\Users\\souls\\Projects\\moddable\\xs\\sources\\xsRun.c:719
#1  0x4200690a in fxRunCount (the=the@entry=0x3fca6360, count=count@entry=1) at C:\\Users\\souls\\Projects\\moddable\\xs\\sources\\xsAPI.c:1201
#2  0x42005f52 in modRunMachineSetup (the=0x3fca6360) at C:\\Users\\souls\\Projects\\moddable\\xs\\platforms\\mc\\xsHosts.c:581
#3  0x4200517c in loop_task (pvParameter=<optimized out>) at C:/Users/souls/Projects/moddable/build/tmp/esp32/esp32c3/release/b33dc2xt18n/xsProj-esp32c3/main/main.c:124
#4  0x4038be8c in prvTaskExitError () at C:/Espressif/frameworks/esp-idf-v4.4.3/components/freertos/port/riscv/port.c:171
Backtrace stopped: frame did not save the PC

==================== THREAD 2 (TCB: 0x3fc9ae5c, name: 'main') =====================
#0  0x4038befe in vPortClearInterruptMask (mask=1) at C:/Espressif/frameworks/esp-idf-v4.4.3/components/freertos/port/riscv/port.c:343
#1  0x4038bf1e in vPortExitCritical () at C:/Espressif/frameworks/esp-idf-v4.4.3/components/freertos/port/riscv/port.c:295
#2  0x40389ff4 in prvAddNewTaskToReadyList (pxNewTCB=pxNewTCB@entry=0x3fc9e1f4, xCoreID=2147483647, pxTaskCode=0x42005154 <loop_task>) at C:/Espressif/frameworks/esp-idf-v4.4.3/components/freertos/tasks.c:1312
#3  0x4038a252 in xTaskCreatePinnedToCore (pvTaskCode=pvTaskCode@entry=0x42005154 <loop_task>, pcName=pcName@entry=0x3c0d2ad0 \"main\", usStackDepth=usStackDepth@entry=8192, pvParameters=pvParameters@entry=0x0, uxPriority=uxPriority@entry=4, pvCreatedTask=pvCreatedTask@entry=0x0, xCoreID=xCoreID@entry=2147483647) at C:/Espressif/frameworks/esp-idf-v4.4.3/components/freertos/tasks.c:900
#4  0x4200526c in xTaskCreate (pvTaskCode=<optimized out>, pcName=0x3c0d2ad0 \"main\", usStackDepth=8192, pvParameters=0x0, uxPriority=4, pxCreatedTask=0x0) at C:/Espressif/frameworks/esp-idf-v4.4.3/components/freertos/include/freertos/task.h:450
#5  app_main () at C:/Users/souls/Projects/moddable/build/tmp/esp32/esp32c3/release/b33dc2xt18n/xsProj-esp32c3/main/main.c:239
#6  0x420c7f30 in main_task (args=<optimized out>) at C:/Espressif/frameworks/esp-idf-v4.4.3/components/freertos/port/port_common.c:141
#7  0x4038be8c in prvTaskExitError () at C:/Espressif/frameworks/esp-idf-v4.4.3/components/freertos/port/riscv/port.c:171
Backtrace stopped: frame did not save the PC

==================== THREAD 3 (TCB: 0x3fc9b5b8, name: 'IDLE') =====================
#0  prvIdleTask (pvParameters=0x0) at C:/Espressif/frameworks/esp-idf-v4.4.3/components/freertos/tasks.c:3928
#1  0x4038be8c in prvTaskExitError () at C:/Espressif/frameworks/esp-idf-v4.4.3/components/freertos/port/riscv/port.c:171
Backtrace stopped: frame did not save the PC

==================== THREAD 4 (TCB: 0x3fc99cc0, name: 'esp_timer') =====================
#0  0x4038befe in vPortClearInterruptMask (mask=1) at C:/Espressif/frameworks/esp-idf-v4.4.3/components/freertos/port/riscv/port.c:343
#1  0x4038bf1e in vPortExitCritical () at C:/Espressif/frameworks/esp-idf-v4.4.3/components/freertos/port/riscv/port.c:295
#2  0x4038b1b4 in ulTaskGenericNotifyTake (uxIndexToWait=uxIndexToWait@entry=0, xClearCountOnExit=xClearCountOnExit@entry=1, xTicksToWait=xTicksToWait@entry=4294967295) at C:/Espressif/frameworks/esp-idf-v4.4.3/components/freertos/tasks.c:5401
#3  0x42004736 in timer_task (arg=<optimized out>) at C:/Espressif/frameworks/esp-idf-v4.4.3/components/esp_timer/src/esp_timer.c:384
#4  0x4038be8c in prvTaskExitError () at C:/Espressif/frameworks/esp-idf-v4.4.3/components/freertos/port/riscv/port.c:171
Backtrace stopped: frame did not save the PC

======================= ALL MEMORY REGIONS ========================
Name   Address   Size   Attrs
.rtc.force_fast 0x50000010 0x0 RW  
.rtc.data 0x50000010 0x10 RW A
.rtc_noinit 0x50000020 0x0 RW  
.rtc.force_slow 0x50000020 0x0 RW  
.iram0.text 0x40380000 0x112c0 RWXA
.dram0.data 0x3fc91400 0x2270 RW A
.noinit 0x3fc93670 0x0 RW  
.flash.text 0x42000020 0xc825a R XA
.flash.appdesc 0x3c0d0020 0x100 R  A
.flash.rodata 0x3c0d0120 0x7b8c0 RW A
.eh_frame 0x3c14b9e0 0x708 R  A
.iram0.data 0x40391400 0x0 RW  
.iram0.bss 0x40391400 0x0 RW  
.dram0.heap_start 0x3fc97d00 0x0 RW  
.coredump.tasks.data 0x3fc9e1f4 0x154 RW 
.coredump.tasks.data 0x3fc9dd30 0x4b0 RW 
.coredump.tasks.data 0x3fc9ae5c 0x154 RW 
.coredump.tasks.data 0x3fc9ad40 0x110 RW 
.coredump.tasks.data 0x3fc9b5b8 0x154 RW 
.coredump.tasks.data 0x3fc9b510 0xa0 RW 
.coredump.tasks.data 0x3fc99cc0 0x154 RW 
.coredump.tasks.data 0x3fc99ba0 0x110 RW 

===================== ESP32 CORE DUMP END =====================
phoddie commented 1 year ago

It worked for compiling...

Cool. One problem solved.

... but then after..

Yes, I think that's why @mkellner suggested using ESP-IDF 4.4.2. There seems to be an incompatibility with ESP-IDF 4.4.3 and our ESP32C3 support that causes a crash on launch. We haven't had a chance to track that down yet.

Sineos commented 1 year ago

Yes, I think that's why @mkellner suggested using ESP-IDF 4.4.2.

Microsoft Windows [Version 10.0.19045.2364]
(c) Microsoft Corporation. Alle Rechte vorbehalten.

C:\Users\souls>cd c:\Espressif\frameworks\esp-idf-v4.4.2

c:\Espressif\frameworks\esp-idf-v4.4.2>install.bat
Installing ESP-IDF tools
Installing tools: xtensa-esp32-elf, esp32ulp-elf, cmake, openocd-esp32, mconf, ninja, idf-exe, ccache
Skipping xtensa-esp32-elf@1.22.0-80-g6c4433a5-5.2.0 (already installed)
Skipping esp32ulp-elf@2.28.51.20170517 (already installed)
Skipping cmake@3.13.4 (already installed)
Skipping openocd-esp32@v0.10.0-esp32-20190313 (already installed)
Skipping mconf@v4.6.0.0-idf-20190628 (already installed)
Skipping ninja@1.9.0 (already installed)
Skipping idf-exe@1.0.1 (already installed)
Skipping ccache@3.7 (already installed)
Setting up Python environment
Installing Python packages from c:\Espressif\frameworks\esp-idf-v4.4.2\requirements.txt
Requirement already satisfied: setuptools in c:\espressif\python_env\idf3.3_py3.10_env\lib\site-packages (from -r c:\Espressif\frameworks\esp-idf-v4.4.2\requirements.txt (line 4)) (65.6.3)
Requirement already satisfied: pyserial>=3.0 in c:\espressif\python_env\idf3.3_py3.10_env\lib\site-packages (from -r c:\Espressif\frameworks\esp-idf-v4.4.2\requirements.txt (line 8)) (3.5)
Requirement already satisfied: future>=0.15.2 in c:\espressif\python_env\idf3.3_py3.10_env\lib\site-packages (from -r c:\Espressif\frameworks\esp-idf-v4.4.2\requirements.txt (line 9)) (0.18.2)
Requirement already satisfied: cryptography>=2.1.4 in c:\espressif\python_env\idf3.3_py3.10_env\lib\site-packages (from -r c:\Espressif\frameworks\esp-idf-v4.4.2\requirements.txt (line 10)) (38.0.4)
Requirement already satisfied: pyparsing<2.4.0,>=2.0.3 in c:\espressif\python_env\idf3.3_py3.10_env\lib\site-packages (from -r c:\Espressif\frameworks\esp-idf-v4.4.2\requirements.txt (line 11)) (2.3.1)
Requirement already satisfied: cffi>=1.12 in c:\espressif\python_env\idf3.3_py3.10_env\lib\site-packages (from cryptography>=2.1.4->-r c:\Espressif\frameworks\esp-idf-v4.4.2\requirements.txt (line 10)) (1.15.1)
Requirement already satisfied: pycparser in c:\espressif\python_env\idf3.3_py3.10_env\lib\site-packages (from cffi>=1.12->cryptography>=2.1.4->-r c:\Espressif\frameworks\esp-idf-v4.4.2\requirements.txt (line 10)) (2.21)
All done! You can now run:
   export.bat
c:\Espressif\frameworks\esp-idf-v4.4.2>export.bat
Setting IDF_PATH: c:\Espressif\frameworks\esp-idf-v4.4.2

Adding ESP-IDF tools to PATH...
    C:\Espressif\tools\xtensa-esp32-elf\1.22.0-80-g6c4433a5-5.2.0\xtensa-esp32-elf\bin
    C:\Espressif\tools\esp32ulp-elf\2.28.51.20170517\esp32ulp-elf-binutils\bin
    C:\Espressif\tools\cmake\3.13.4\bin
    C:\Espressif\tools\openocd-esp32\v0.10.0-esp32-20190313\openocd-esp32\bin
    C:\Espressif\tools\mconf\v4.6.0.0-idf-20190628\
    C:\Espressif\tools\ninja\1.9.0\
    C:\Espressif\tools\idf-exe\1.0.1\
    C:\Espressif\tools\ccache\3.7\
    C:\Espressif\python_env\idf3.3_py3.10_env\Scripts
    c:\Espressif\frameworks\esp-idf-v4.4.2\tools

Checking if Python packages are up to date...
Python requirements from c:\Espressif\frameworks\esp-idf-v4.4.2\requirements.txt are satisfied.

Done! You can now compile ESP-IDF projects.
Go to the project directory and run:

  idf.py build

c:\Espressif\frameworks\esp-idf-v4.4.2>cd C:\Users\souls\.node-red\mcu-plugin-cache\b33dc2xt18n

C:\Users\souls\.node-red\mcu-plugin-cache\b33dc2xt18n>build.bat

C:\Users\souls\.node-red\mcu-plugin-cache\b33dc2xt18n>CALL "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars32.bat"
**********************************************************************
** Visual Studio 2022 Developer Command Prompt v17.4.3
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x86'
Setting PYTHONNOUSERSITE, was not set
Using Python in c:\Espressif\frameworks\esp-idf-v4.4.2\
Der Befehl "null" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
Using Git in C:\Espressif\tools\idf-git\2.34.2\cmd\
git version 2.34.1.windows.1
Setting IDF_PATH: c:\Espressif\frameworks\esp-idf-v4.4.2

Adding ESP-IDF tools to PATH...
No directories added to PATH:

c:\Espressif\frameworks\esp-idf-v4.4.2\;C:\Espressif\tools\idf-git\2.34.2\cmd\;C:\Espressif;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX86\x86;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\VC\VCPackages;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\bin\Roslyn;C:\Program Files\Microsoft Visual Studio\2022\Community\Team Tools\Performance Tools;C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\\x86;C:\Program Files (x86)\Windows Kits\10\bin\\x86;C:\Program Files\Microsoft Visual Studio\2022\Community\\MSBuild\Current\Bin\amd64;C:\Windows\Microsoft.NET\Framework\v4.0.30319;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\;C:\Espressif\tools\xtensa-esp32-elf\1.22.0-80-g6c4433a5-5.2.0\xtensa-esp32-elf\bin;C:\Espressif\tools\esp32ulp-elf\2.28.51.20170517\esp32ulp-elf-binutils\bin;C:\Espressif\tools\cmake\3.13.4\bin;C:\Espressif\tools\openocd-esp32\v0.10.0-esp32-20190313\openocd-esp32\bin;C:\Espressif\tools\mconf\v4.6.0.0-idf-20190628\;C:\Espressif\tools\ninja\1.9.0\;C:\Espressif\tools\idf-exe\1.0.1\;C:\Espressif\tools\ccache\3.7\;C:\Espressif\python_env\idf3.3_py3.10_env\Scripts;c:\Espressif\frameworks\esp-idf-v4.4.2\tools;C:\Program Files (x86)\VMware\VMware Workstation\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Users\souls\AppData\Local\Programs\Python\Python310\Scripts\;C:\Users\souls\AppData\Local\Programs\Python\Python310\;C:\Users\souls\AppData\Local\Microsoft\WindowsApps;C:\Users\souls\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\souls\AppData\Roaming\npm;C:\Users\souls\AppData\Local\GitHubDesktop\bin;C:\Users\souls\Projects\moddable\build\bin\win\release;;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\VC\Linux\bin\ConnectionManagerExe

Checking if Python packages are up to date...
Python requirements from c:\Espressif\frameworks\esp-idf-v4.4.2\requirements.txt are satisfied.

Done! You can now compile ESP-IDF projects.
Go to the project directory and run:

  idf.py build

C:\Users\souls\.node-red\mcu-plugin-cache\b33dc2xt18n>*** Update required to ESP-IDF v4.4.3
  See update instructions at: https://github.com/Moddable-OpenSource/moddable/blob/public/documentation/devices/esp32.md"Expected ESP IDF v4.4.3, found v3.3.1"
NMAKE : fatal error U1077: 'python' : return code '0x1'
Stop.

Seems I cannot get it to run under 4.4.2. Any pointer to what I have missed?

phoddie commented 1 year ago

It looks like the ESP-IDF version check is incorrect on Windows. When I do the same (build for esp32/esp32c3 with ESP-IDF v4.4.2 installed), there is a recommendation to update but the build continues:

# Reconfiguring ESP-IDF...
Recommend using ESP-IDF v4.4.3 (found v4.4.2)
  See update instructions at: https://github.com/Moddable-OpenSource/moddable/blob/public/documentation/devices/esp32.md

Let's try modifying the versionCheck.py script to do two things:

  1. Print out the expected and found versions of ESP-IDF to see why it is mismatching
  2. Never generate an error on version mismatch to see if that allows your build to progress
Here's a modified version of the script at `$MODDABLE/build/devices/esp32/xsProj-esp32c3/versionCheck.py` ```py import sys if len(sys.argv) < 3: print("Not enough parameters") sys.exit(1) update = " See update instructions at: https://github.com/Moddable-OpenSource/moddable/blob/public/documentation/devices/esp32.md" expected = sys.argv[1] given = sys.argv[2] g = given.split(".") if len(g) < 3: g.append(0) e = expected.split(".") if len(e) < 3: e.append(0) print("EXPECTED ESP-IDF " + expected + " (FOUND " + given + ")") if g[0] == e[0]: if g[1] == e[1]: if g[2] == e[2]: # print("versions are the same.") sys.exit(0) else: if g[2] != e[2]: print("Recommend using ESP-IDF " + expected + " (found " + given + ")") print(update) sys.exit(0); else: # print("minor versions differ. Please update."); print("*** Update required to ESP-IDF " + expected) print(update) sys.exit(0); else: # print("major versions differ. Please update."); print("*** Update required to ESP-IDF " + expected) print(update) sys.exit(0); ```

Would you give that a try and let me know what you find? I'm particularly interested in the output of this line:

print("EXPECTED ESP-IDF " + expected + " (FOUND " + given + ")")

Thanks for the help. (I don't have a Windows machine to try this on!)

Sineos commented 1 year ago

Bummer, I just "fixed" my issue last night: Fixing here means deleting the entire ESP-IDF and installing v4.4.2 via the offline installer. So I have now compile my first node-red-mcu-moddable-cool-thing-stuff 🚀

Originally I had v4.4.3 installed and added v4.4.2 with git-cloning the v4.4.2 tag and following https://docs.espressif.com/projects/esp-idf/en/v3.3/get-started-cmake/index.html#get-started-get-esp-idf-cmake So either I have messed it up along the way (entirely possible) or the whole environment is not particularly happy when two IDFs are installed. Strange tho since all echo %IDF_something% had returned the correct paths.

Thanks a lot for your support!

phoddie commented 1 year ago

No worries. Glad you have things running.

To help diagnose this sort of thing in the future, I made changes to output the ESP-IDF version whenever it doesn't match the expected version (basically (1) above).