ESP32-C3 mini

Posted on
Page
of 4
First Prev
/ 4
  • task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time

    I don't think that's a real problem. I have a feeling on the standard ESP32 build the task watchdog is disabled in menuconfig so you could look at doing that.

    It's just complaining that the espruinoTask process doesn't complete (but we don't expect it to). It should however idle when it's not running code or has user input (see jshSleep) so I'm not sure why that's not enough for the task watchdog

  • Seems interesting, however I don't really understand how I could retrieve the stack trace

  • use https://maximeborges.github.io/esp-stack­trace-decoder/
    upload .elf file and enter the Stack trace CPU wise to get detail about the function

      0x40394ffe: newlib_include_assert_impl at /home/yerpj/JP/Espruino/esp-idf-4/esp-id­f/components/newlib/assert.c:97
        0x4038e266: xQueueGenericSend at /home/yerpj/JP/Espruino/esp-idf-4/esp-id­f/components/freertos/queue.c:1043
        0x4038e266: xQueueGenericSend at /home/yerpj/JP/Espruino/esp-idf-4/esp-id­f/components/freertos/queue.c:1043
        0x40393e88: multi_heap_internal_unlock at /home/yerpj/JP/Espruino/esp-idf-4/esp-id­f/components/heap/multi_heap.c:148
        0x40393e4c: multi_heap_free_impl at /home/yerpj/JP/Espruino/esp-idf-4/esp-id­f/components/heap/multi_heap.c:214
        0x40380ef4: heap_caps_free at /home/yerpj/JP/Espruino/esp-idf-4/esp-id­f/components/heap/heap_caps.c:383
        0x40395024: free at /home/yerpj/JP/Espruino/esp-idf-4/esp-id­f/components/newlib/heap.c:40
    
    

    I have currently no experience to investigate this ESP behaviour, but at the same time it seems legit to point at the heap being full.
    I hope that people used to work with ESP32 will have good time tinkering with this ESP32-C3 and eventually provide improvements.

  • Like @Gordon said it might be fixed with disable or increase settings in the sdkconfig

    cd targets/esp32/IDF4
    idf.py menuconfig
    

    and try to find the relevant secion and setting.


    1 Attachment

    • Bildschirmfoto 2024-05-23 um 15.09.23.jpg
  • use jump to find settings


    1 Attachment

    • Bildschirmfoto 2024-05-23 um 15.18.01.jpg
  • Hi, im slowly getting to a position to build Espruino for the C3. Ive put Ubuntu v24.4 on an old dell 3050 for this. Im not experienced with Ubuntu just to say.

    I think I have the same issue as @Jean-Philippe_Rey when running '>sudo BOARD=ESP32C3_IDF4 RELEASE=1' with the error 'idf.py not found'.

    This was after running the provision script and checking that idf.py did run in Espruino and Espruino/bin from the terminal prompt.

    I found putting the directory names in front of idf.py in the file /Espruino/make/targets/ESP32_IDF4.make fixed this.

    When running the Espruino build line, Im getting past theis idf.py not found error now and hitting another error 'packaging cannot be imported' . So something missing in my ubuntu, I suppose. But idf.py will build a bin on its own in the idf/examples??
    Ill push on. Ive only got a little time over the next couple weeks.

  • I think I have the same issue as @Jean-Philippe_Rey when running '>sudo BOARD=ESP32C3_IDF4 RELEASE=1' with the error 'idf.py not found'.

    what guide tells you to run sudo?

    see https://forum.espruino.com/conversations­/395499/?offset=50#17389052

  • Thanks @fanoush , i get your point, Ill blast the Espruino clone and try again without the sudo.

  • the point was also that maybe you or Jean-Philippe_Rey were following some outdated/broken guide/README so would be good to fix that

  • No doc told me to run sudo. I was unable to execute some script for whatever reason and with sudo it didn't complain. I am very bad at Linux and permission mechanisms, but I learned that giving rights in a proper way was better than using sudo everytime ;-)

  • Me also, I cant find a guide that uses sudo, but was in my notes, an error on my part.

    And now without Sudo, in a clean git clone of Espruino, without any changes to the make files:

    source ./scripts/provision.sh ESP32C3_IDF4
    BOARD=ESP32C3_IDF4 RELEASE=1 make flash

    Is building to completion (i will sort flashing). :)

    Thanks again @fanoush. I appreciate your help.

  • use this export

    export PORT=<your serial port>
    
  • Thanks @MaBe and others got both the mini and OLIMEX c3-Devkit (link above) flashed today. Both working in the WebIDE , ESP32.reboot() and .getstate() working, program upload from IDE is good. Connected to WIFI ok. Looking very good. Im off for a couple of weeks but will test properly on return. Will look the i2C and IO first. Great job folks.

  • Hi, ive been working with the ESP32-C3 build for a few weeks now and have to say the new cmake build method seems very robust. Ive had success using it on my Linux box inside VS code terminal, using some of the ESP-IDF extension functions as well **. (I could make notes on that if useful to anyone).

    So as others advised above, the build steps in Linux terminal, high level are:

    git clone https://github.com/espruino/Espruino.git­
    cd espruino

    (check which usb port board is plugged into with > ls /dev )

    export PORT=/dev/ttyACM0 (or whatever port)

    source ./scripts/provision.sh ESP32C3_IDF4
    BOARD=ESP32C3_IDF4 DEBUG=1 make flash (note no sudos anywhere :)

    I am also using BINDIR=. on the make command because it creates a build structure seemingly more typical for cmake and enables debugging as provided by VS code with the idf extensions.

    The debug single step and break points seems to be working (not used in earnest) with some code not liking to be paused (as expected). The JTAG usb connection is pretty neat in that OpenOCD can run on the com port AND the espruino WebIDE can connect simultaneously over the one USB connection. Ive been able to set break points in the VScode UI while using the webIDE to drive Espruino in the webIDE. Note Ive not been able to run OpenOCD on the waveshare ESP-C3-Zero but it runs on the Olimex ESP33-c3DevkitLipo .

    Im conscious the goal is to move to ESP-IDF v5 , im trying to build a set of wifi tests, refactoring @tve s esp8266 tests that I hope will help. Hopefully along the lines of @Gordon s previous generic test approach. Ive just ordered an Original Espruino wifi board to baseline the tests.

    Anyway learning allot :). Any suggestions always welcome.

    ** the main tricks to get working in Vs code was to add the required project config files to the espruino folder after cloning, added by running the extension command >ESP-IDF: Add .vscode Configuration Folder command.
    and then to build espruino with the BIN dir set to the espruino folder itself

    BOARD=ESP32C3_IDF4 RELEASE=1 make flash BINDIR=.
    or
    BOARD=ESP32C3_IDF4 DEBUG=1 make flash BINDIR=.
    So that the build intermediate files and build output are in /Espruino/build and Main folder is /Espruino/main containing CMakeLists.txt

  • im trying to build a set of wifi tests, refactoring @tve s esp8266 tests

    please also check this tests from @Wilberforce

    https://github.com/espruino/Espruino/tre­e/master/targets/esp32/tests

  • @MaBe Got it thanks , I missed those. :)

  • Thanks! Really interesting to know you're having luck with OpenOCD - I never even considered trying that, but it'll make debugging miles less painful.

    Just FYI I'm aware the builds are a bit tricky for most users to get started with, so I'm now building C3 as a part of the GitHub actions (cutting edge) and they're available at https://www.espruino.com/binaries/travis­/master/

  • Many thanks, hope we get more tester on board for those devices.

  • Great, I understand the OpenOCD is an espressif tweaked version that handles the C3 USB/JTAG setup, and gets pulled in from the ESP-IDF folders after the ESP-IDF install and export scripts are run. I used the instructions here.

  • Has anyone had any luck with the ESP32C3 ADC? I could really do with it for a customer's board, and I've been trying here but can't get it to work. First call returns full range (4095) and all other calls seem to return 0.

    As far as I can tell it's calling adc1_config_width, adc1_config_channel_atten, adc1_get_raw as expected but it's just not getting anything out.

  • Hi @Gordon , I had a quick go this eve and analogRead(0) behaves for me the same as you describe on my two different devices. I tried single stepping with Vscode debug as mentioned above, but didn’t work well.
    In case you’ve not seen there is an ESP-IDF example,
    See the file /Espruino/esp-idf-4/esp-idf/examples/per­ipherals/adc/single_read/single_read/mai­n/single_read.c

  • Thanks! I did give it a go and as far as I can see we do basically all the same stuff other than the calibration (but that happens after adc1_get_raw anyway)?

    I wondered whether it was related to having to set the pin state to 'analog' as in some microcontrollers, but I don't see that as an option here.

    The odd thing is I really thought that it would be pretty google-able to see other people with the same issue, but I can't turn up anything obvious at all!

  • Hi @Gordon , Ive had another go at the analogRead(), But without success. I have been able to build the ESP-IDF example sited above and single step in VScode as basline. It does work. So board is capable !? Ive tried:

    • comparing the idf config files of working example and Espruino build- no obvious relevent differences.
    • Ive filled the espruino readADC() with debug prints and it looks like all the parameters for the main calls into esp-idf are the same on the the multiple runs of analogRead .
    • Ive put initADC () inside readADC() so ADC is initialised on each run of analogRead();
    • and changed #define adc_channel_max 5 //sga changed from 8
      All with no joy . Ugg

    The example does use a different call to the IDF for the raw read.: esp_adc_cal_raw_to_voltage() and relies on a calibration function. Im happy to have a go at refactoring the espruino version to use this , at least as proof of concept. (my C coding is at the cut and past level ) but downing tools for today. Did you have any other ideas ?


    2 Attachments

    • Screenshot from 2024-07-12 15-08-13.png
    • Screenshot from 2024-07-12 15-23-55.png
  • Thanks for giving it a try!

    That example does this, right?

            adc_raw[0][0] = adc1_get_raw(ADC1_EXAMPLE_CHAN0);
            ESP_LOGI(TAG_CH[0][0], "raw  data: %d", adc_raw[0][0]);
            if (cali_enable) {
                voltage = esp_adc_cal_raw_to_voltage(adc_raw[0][0]­, &adc1_chars);
                ESP_LOGI(TAG_CH[0][0], "cali data: %d mV", voltage);
            }
    

    So we are still using adc1_get_raw in both cases? And I guess it returns something other than 4095 or 0 when you run the example?

    Hard to know really - I'm off next week so I won't get a chance to give this a try, but I wonder if it's related to pin state? Like if you could check the contents of the various registers for GPIO0 in the example and Espruino I wonder if they are the same?

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

ESP32-C3 mini

Posted by Avatar for Jurand @Jurand

Actions