ESP32-C3 mini

Posted on
Page
of 6
  • You sure you tried the latest? That's what I got before but then I made a few more tweaks

    No, more stuff to pull, great!

  • I will create a new issue for ESP32_IDF4 to collect stuff that need to be fixed and try to fix them.

    edit: https://github.com/espruino/Espruino/issues/2499

  • Just FYI, BOARD=ESP32C3_IDF4 RELEASE=1 make flash now works on the supermini - it builds and runs.

    For some reason it only outputs to the console when it prints a newline (I think it's a USB CDC thing) but otherwise it appears to be able to toggle IO file (D8 is the LED, D9 is the button)

    edit: watches, wifi and BLE all work. I guess some of PWM/ADC/etc will be broken, but hopefully now those will be pretty easy to fix if there are problems found

  • first point to try is neopixel

  • Do a pull now - that should now work

  • OK I really tried to figure it out on my own but I am really stuck. I made the following

    • git clone https://github.com/espruino/Espruino.git
    • cd Espruino
    • sudo ./scripts/provision.sh ESP32C3_IDF4 :(there I had to remove some 'f' after the opening parenthesis in outputs like fatal(f'Error while parsing, check checksum file ({err})'), don't know why, but it worked. EDIT: OK this was introduced in Python 3.6 and I am using Python 3.5. Problem solved at this stage.
    • sudo BOARD=ESP32C3_IDF4 RELEASE=1 make flash: there it stops and says /bin/sh: idf.py: command not found

      yerpj@PC3376:~/Espruino$ sudo BOARD=ESP32C3_IDF4 RELEASE=1 make flash
      MAKE CMAKEFILE
      -I/home/yerpj/Espruino -I/home/yerpj/Espruino/targets -I/home/yerpj/Espruino/src  -I/home/yerpj/Espruino/libs/compression -I/home/yerpj/Espruino/libs/compression/heatshrink -I/home/yerpj/Espruino/libs/graphics -I/home/yerpj/Espruino/libs/network -I/home/yerpj/Espruino/libs/network -I/home/yerpj/Espruino/libs/network/http -I/home/yerpj/Espruino/libs/network/js -I/home/yerpj/Espruino/libs/network/esp32 -I/home/yerpj/Espruino/libs/bluetooth -I/home/yerpj/Espruino/libs/neopixel -I/home/yerpj/Espruino/targets/esp32 -I/home/yerpj/Espruino/gen
      ================================== Generating platform configs
      ================================== Generating pin info
      ================================== Generating pin info
      ================================== Generating JS wrappers
      WRAPPERSOURCES = src/jswrap_array.c src/jswrap_arraybuffer.c src/jswrap_dataview.c src/jswrap_date.c src/jswrap_error.c src/jswrap_functions.c src/jswrap_json.c src/jswrap_number.c src/jswrap_object.c src/jswrap_regexp.c src/jswrap_string.c src/jswrap_modules.c src/jswrap_math.c src/jswrap_espruino.c src/jswrap_flash.c src/jswrap_interactive.c src/jswrap_io.c src/jswrap_pin.c src/jswrap_pipe.c src/jswrap_process.c src/jswrap_onewire.c src/jswrap_promise.c src/jswrap_serial.c src/jswrap_storage.c src/jswrap_spi_i2c.c src/jswrap_stepper.c src/jswrap_stream.c src/jswrap_waveform.c libs/compression/jswrap_heatshrink.c libs/graphics/jswrap_graphics.c libs/network/jswrap_net.c libs/network/http/jswrap_http.c libs/network/js/jswrap_jsnetwork.c libs/network/jswrap_wifi.c libs/network/esp32/jswrap_esp32_network.c targets/esp32/jswrap_esp32.c libs/bluetooth/jswrap_bluetooth.c libs/neopixel/jswrap_neopixel.c
      DEFINES = -DGIT_COMMIT=e3e68c7 -DNO_ASSERT -DRELEASE -DBUILDNUMBER="184" -DESP32C3_IDF4 -DESP_PLATFORM -DESP32=1 -DESP_STACK_SIZE=25000 -DJSVAR_MALLOC -DUSE_FONT_6X8 -DUSE_DEBUGGER -DUSE_TAB_COMPLETE -DUSE_HEATSHRINK -DUSE_GRAPHICS -DUSE_NET -DUSE_NETWORK_JS -DUSE_ESP32 -DBLUETOOTH -DUSE_NEOPIXEL -DESP32 -DESPR_DEFINES_ON_COMMANDLINE -DEMBEDDED
      cp /home/yerpj/Espruino/targets/esp32/IDF4/sdkconfig_c3 bin/sdkconfig
      cp /home/yerpj/Espruino/targets/esp32/IDF4/CMakeLists.txt bin
      cp /home/yerpj/Espruino/targets/esp32/IDF4/partitions.csv bin
      cd bin && idf.py build
      /bin/sh: idf.py: command not found
      make/targets/ESP32_IDF4.make:46: recipe for target 'bin/espruino_2v21.184_esp32c3.bin' failed
      make: *** [bin/espruino_2v21.184_esp32c3.bin] Error 127
      yerpj@PC3376:~/Espruino$
      

    Any idea what I am missing?

  • looks like some env are missing, run source esp-idf-4/esp-idf/export.sh

  • Thank you for your suggestion. It seems however that it does not solve the problem:

    yerpj@PC3376:~/Espruino$ source esp-idf-4/esp-idf/export.sh
    Setting IDF_PATH to '/home/yerpj/Espruino/esp-idf-4/esp-idf'
    Detecting the Python interpreter
    Checking "python" ...
    Checking "python3" ...
    Python 3.5.2
    "python3" has been detected
    Adding ESP-IDF tools to PATH...
    yerpj@IICT-PC3376:~/Espruino$ sudo BOARD=ESP32C3_IDF4 RELEASE=1 make flash
    cp /home/yerpj/Espruino/targets/esp32/IDF4/sdkconfig_c3 bin/sdkconfig
    cp /home/yerpj/Espruino/targets/esp32/IDF4/CMakeLists.txt bin
    cp /home/yerpj/Espruino/targets/esp32/IDF4/partitions.csv bin
    cd bin && idf.py build
    /bin/sh: idf.py: command not found
    make/targets/ESP32_IDF4.make:46: recipe for target 'bin/espruino_2v21.184_esp32c3.bin' failed
    make: *** [bin/espruino_2v21.184_esp32c3.bin] Error 127
    
  • Hmm, AFSIK sudo is not passing your environment vars, can you run the make statment without sudo, or include the source statement into the sudo call.

  • I tried without sudo, same results.
    I will stop there in order not to pollute this thread right now with my issues, it could be that I am trying with WSL. I will try with native linux and see what happens.
    Anyway, thank you @MaBe for your help.

  • First of all, thank you to everyone here for doing such a great job.
    I have an ESP32 C3 board with LuatOS. After pulling the latest code and build it, I flashed it and executed it successfully. I can use the BLE tool to scan for a signal named "Espruino 178c".
    But after connecting to the serial port via 115200 baud, I can see normal Espruino output, including the command prompt, I just can't enter any code, can anyone help me?

  • Yes, this is an open issue, but you can connect via BLE that works for me. Feel free to add further findings you detect during your tests to this issue.

    Edit: via Espruino WebIDE

  • OK, thank you!

  • @Jean-Philippe_Rey You need to do the same thing you'd do for other Espruino boards. No sudo, but use source ./scripts/provision.sh ESP32C3_IDF4. Now you've run as sudo you might need to sudo rm -rf esp-idf-4 bin so that you can actually overwrite the superuser files from your normal install.

    @Tengfei I think you should find the the terminal works ok - it just doesn't show you what you're typing until you hit enter

  • I tried same procedure on another laptop, also using WSL, and it works. Thank you for your help!

  • Warning! Before buying an ESP32-C3 board, ensure the chip has internal flash memory OR the board is equiped with flash memory. The cheap ones on Aliexpress are assembled with an ESP32-C3 without any flash. More info on that here


    1 Attachment

    • Screenshot 2024-05-18 07.33.02.png
  • Great news to see these developments to catch up the esp32 builds to newer IDF versions and to move away from the existing build to cmake method. I’m following closely and will try to help with testing.
    This looks a usefull esp-c3 board (2 in the post) that supports the ESP-PROG-C which may help with debugging. https://thepihut.com/products/olimex-esp32-c3-devkit-lipo-risc-v-development-board

    @rgomezwap glad to see your work getting closer to Main stream and thanks to @Gordon particularly and @MaBe for running with this.

  • Thanks!

    @Jean-Philippe_Rey thanks for the heads-up. Did you have one? That's rubbish - I'm not sure the board even has the SPI pins brought out, so the board itself is basically useless. I assume that was probably just a bad batch that got sent out :(

  • Not sure it was a bad batch, anyway I ordered new ESP32-C3 ICs and will try to solder them on my PCBs. It will be a good exercise. In the meantime I will also try with external SPI memory, just for the fun .

    What I have learned, like many, is that Ali Express will only provide you with what you pay for. Conclusion : never select the cheapest product ;-)

  • The C3 lack of output until newline issue is now fixed

    edit: and SSL - small pages seem to fetch ok, but it might crash on bigger stuff

  • I also follow the development. It's fantastic that there's finally a new line for the new boards and the new IDF. Honestly, I haven't had time yet, but my plan is to try the new system and focus on ESP32. I want to help with what I would have done for the ESP32-S3, which is still not implemented.

    I hope to take a day off work soon and push the project forward.

  • That's be great, thanks! I've tried to do it in such a way that the code changes for the S3 are still there, so it should be possible to add an S3 build pretty easily

  • @rgomezwap have you fixed the socket issue?

    WiFi & MQTT is not working stable on any IDF.
    https://github.com/MaBecker/Espruino/blob/a9892806d2dca2b19ff843f8295f51f72fc959bf/libs/network/esp32/network_esp32.c#L113

    Edit: It's an issue that can happen when using MQTT-S from storage on ESP32

    Edit: both version work, mqtt reconnect can only work when connection to access point is still valid.

  • OK now with a ESP32-C3F it works as expected

     ____                 _
    |  __|___ ___ ___ _ _|_|___ ___
    |  __|_ -| . |  _| | | |   | . |
    |____|___|  _|_| |___|_|_|_|___|
             |_| espruino.com
     2v22.2 (c) 2024 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    >process.env
    ={
      VERSION: "2v22.2",
      GIT_COMMIT: "fdbf0bfd2",
      BOARD: "ESP32C3_IDF4",
      RAM: 409600, FLASH: 0, STORAGE: 262144,
      SERIAL: "70041d32-dacc",
      CONSOLE: "Serial1",
      MODULES: "Flash,Storage,hea" ... "i,crypto,neopixel",
      EXPTR: 1008207732 }
    >ESP32.getState()
    ={
      sdkVersion: "v4.4.7",
      freeHeap: 34608, BLE: true, Wifi: true, minHeap: 33312 }
    
    

    Some debug information is still printed out on the terminal, seems to be linked to watchdog timer. I am not sure what to do with it, however it seems not to prevent ESP32 to work, at least as a basic webserver.

    ;31mE (195821) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:m
    ;31mE (195821) task_wdt:  - IDLE (CPU 0)m
    ;31mE (195821) task_wdt: Tasks currently running:m
    ;31mE (195821) task_wdt: CPU 0: espruinoTaskm
    
  • @Jean-Philippe_Rey: use https://maximeborges.github.io/esp-stacktrace-decoder/

    upload .elf file and enter the Stack trace CPU wise to get detail about the function

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

ESP32-C3 mini

Posted by Avatar for Jurand @Jurand

Actions