ESP32-C3 mini

Posted on
Page
of 6
  • Also not shown above but I'm confident I managed to set IO_MUX_GPIO2_REG to x001802 inside my modified Espruino build readADC() before any IDF calls , using api calls in the EspIdf GPIO library. Including gpio_reset_pin()
    and still experienced the same behaviour on multiple analogRead calls, dispute the register being set as above.
    So not sure at all where to go, it does seem Espruino is putting the ADC peripheral in a bad state somehow.

    Edit .. I did not try to modify the Espruino ESP32 pin setting code in jshardware.c, which as you say earlier does not currently have an analog option. And I further note that the esp32-c3 IDF ADC library for IDF v5 is very different to the current and current Espruino ADC handling will need a rewrite anyway. Also current GPIO calls in jshardware.c are using HAL level calls and not the IDF GPIO library API so it looks like quite a bit of change and testing to get to v5 in this area.

  • link: https://www.espruino.com/binaries/travis/master/
    We will continue to pay attention to your community in the future

  • Thanks for the update and for checking with the registers changed! It's interesting that the function changed so much in SDK5 though...

    I wonder whether maybe there's something about the fact we're using HAL calls for GPIO? Maybe the IDF is expecting something to be in one state but because we set it at a lower level it's different?

  • The esp32 c3 mini is my new favorite board of the esp family. Yes it could be flash easily the same way as any other and the fact I have found it is way easier than all the other i had done esp8266, esp01, esp 32, esp s2. One notable of the the c3 is even without visible antenna the range is great. The esp32 is the one i had most trouble to the point that i returned them all (bought 3 times) even with external antenna hook up. I kept getting flash failure with wifi not connected from the same distance I had no problem with any other board.

    The cost of the esp32 c3 mini is about the same as the esp8266 so it does not make sense with the latter. It is tiny small that makes it even better. 99% of the time people use these esp with most of the pins and feature NOT use. My choice is good enough for my application no more no less. My favorite one is the esp32 c3 mini and the esp01.

  • May I ask if the AnalogRead of Espruino ESP32 C3 mini can be used normally now?

  • Not yet, no. If you were able to help with the debugging effort to find out why it isn't working it would be hugely appreciated.

  • Do you have a solution for the Analog Read of your ESP32-C3-MINI

  • Thanks @MaBe I saw this but ill check the detail again.

  • May I ask if the AnalogRead of Espruino ESP32 C3 mini can be used normally now?

  • No, it's still not working. I don't have time to work on this at the moment, but hopefully in a month or so I'll have a bit more time.

    About the only thing I can think for now is to comment out all the pin state setting code in Espruino's jshardware.c and see if that fixes it, and if it does we can at least work back from there.

  • @Gordon and folks , Im confident ive stumbled into a workaround for the analog read issue. It seems using adc1_get_raw(channel) a second time inside readADC will always return a value. Unlike the first time it is used which will retun zero accept the first time it used after a reboot.

    My environment currently has too many changes in it (and my GIT knowhow wanting) to offer aPR with the change and ive not tested the simple version of a change. But I suggest repeating line 147 in jshardwareanalog.c , as in the attached , "int value = adc1_get_raw(channel) " ; so that readADC always returns the second assignment of value. This should provide a work around. (Probs dont want the 'int' on the second assignment. ill leave details to a C pro )

    In my highly modified version this seems to work .

    Background .. To get to this point I was trying to determine if it was just the multiple calls to adc1_get_raw that caused the issue or it was making a call and going back into Espruino, before the next call , causing the issue. So know knowing a second call always returns a value , I suspect the latter and that espruino is somehow upsetting the adc peripherial , however a raw read sorts it out for an immediate subsequent call.

    What a mess lol ... ive spent hours on this.

    I hope someone can try this simple change for us.


    1 Attachment

    • Untitled picture.png
  • Nice and many thanks for your effort. I will give it a try over the weekend.

    you can call git on command line:
    git status show the files that are changed
    git diff filname show changes
    git checkout filname revert changes

  • @SimonGAndrews this is awesome, thank you so much for spending so much time looking into this! I just tested and it seems to work great - I've now put the change in, so any cutting edge builds (or 2v25 when released) should have a working ADC!

  • @Gordon Many thanks!

  • Great news, thanks.

  • var wifi = require("Wifi");
    var ssid = 'FOFStudioWifi';
    var password = 'FOFStudioWifiQQ';
    wifi.connect(ssid, {password: password}, function() {
        
    });
    

    WIFI-ERRER

    assert failed: jsvUnLockInline jsvar.c:865 (jsvGetLocks(var)>0)
    Core 0 register dump:
    MEPC : 0x403808c0 RA : 0x4038d64e SP : 0x3fcbd4d0 GP : 0x3fc98e00
    TP : 0x3fc7c170 T0 : 0x37363534 T1 : 0x7271706f T2 : 0x33323130
    S0/FP : 0x00000088 S1 : 0x00000001 A0 : 0x3fcbd50c A1 : 0x3fc9a9dd
    A2 : 0x00000001 A3 : 0x00000029 A4 : 0x00000001 A5 : 0x3fca0000
    A6 : 0x7a797877 A7 : 0x76757473 S2 : 0x00000009 S3 : 0x3fcbd61f
    S4 : 0x3fc9a9dc S5 : 0x00000003 S6 : 0x00000000 S7 : 0x3fcbd790
    S8 : 0x00000000 S9 : 0x4200de20 S10 : 0x00000000 S11 : 0x00000000
    T3 : 0x6e6d6c6b T4 : 0x6a696867 T5 : 0x66656463 T6 : 0x62613938
    MSTATUS : 0x00001881 MTVEC : 0x40380001 MCAUSE : 0x00000007 MTVAL : 0x00000000
    MHARTID : 0x00000000
    Stack memory:
    3fcbd4d0: 0x00000000 0x3fcbd541 0x3c178494 0x40394ff0 0x3fc9ab1c 0x3c178494 0x3fc9af0c 0x3c17918d
    3fcbd4f0: 0x3fc9ab2c 0x3fcbd504 0x3fc9ab30 0x3c179828 0x3fc9a9dc 0x00353638 0x420261d0 0x65737361
    3fcbd510: 0x66207472 0x656c6961 0x6a203a64 0x6e557673 0x6b636f4c 0x696c6e49 0x6a20656e 0x72617673
    3fcbd530: 0x383a632e 0x28203536 0x4776736a 0x6f4c7465 0x28736b63 0x29726176 0x0029303e 0x4202aa18
    3fcbd550: 0x00000000 0x00000016 0x00000004 0x420261d0 0x00000000 0x3fcbd5d1 0x3fcbd5d0 0x42026192
    3fcbd570: 0x00000004 0x00000000 0x420261d0 0x420261b6 0x00000001 0x3c180825 0x00000000 0x420261d8
    3fcbd590: 0x00008105 0x00000003 0x3fcbd6f9 0x00000013 0x00000014 0x3fcbd6f8 0x3fcc9d50 0x42013200
    3fcbd5b0: 0x0000000a 0x3fcc9d42 0x3fcbd5dc 0x4201b5e2 0x3fcc9d42 0x3fcbd6f8 0x00000020 0x42017002
    3fcbd5d0: 0x00000003 0x00000000 0x00000000 0x00000000 0x00000000 0x0000000d 0x3fcc9da4 0x00000000
    3fcbd5f0: 0x3fcc9d42 0x3fcc9da4 0x3fcc8bd0 0x420131fa 0x3fcc9d42 0x3fcc9da4 0x3fcc9d5e 0x4200de6a
    3fcbd610: 0x00000001 0x00000005 0x00000000 0x00000000 0x3fcc9da4 0x3fcc9e22 0x3fcc9e06 0x42013200
    3fcbd630: 0x3fcc9da4 0x3fcc9cd2 0x3fcc9e06 0x42017b3a 0x3fcc9e14 0x00000005 0x00000000 0x00000000
    3fcbd650: 0x3fcc9da4 0x0000007d 0x0000007d 0x42045a52 0x3fcc9da4 0x00000000 0x00000086 0x42046f3e
    3fcbd670: 0x3fcc9da4 0x00000000 0x00000086 0x42020392 0x0000000a 0x00000000 0x00000069 0x0000008a
    3fcbd690: 0x00000000 0x3fcc8a8e 0x3fcc8a9c 0x00000063 0x00000010 0x3fcc8a3a 0x00000000 0x3fcbd790
    3fcbd6b0: 0x00000000 0x00000000 0x3fcc9da4 0x420203e0 0x00000000 0x000000aa 0x000000aa 0x4201f5d6
    3fcbd6d0: 0x00000000 0x3fcc9d42 0x3fcc9d42 0x42013200 0x00000001 0x3fcc9d42 0x3fcc9d34 0x53464f46
    3fcbd6f0: 0x69647574 0x6669576f 0x00000069 0x3fcbd790 0x00000000 0x000000aa 0x000000aa 0x4201f748
    3fcbd710: 0x00000003 0x00000003 0x00000000 0x420477f4 0x00000000 0x3fcc8a3a 0x00000000 0x3fcbd790
    3fcbd730: 0x3fcc9d42 0x3fcc9d5e 0x3fcc9da4 0x3fcbd790 0x00000010 0x3fcc8a3a 0x00000007 0x420175bc
    3fcbd750: 0x3fcc9d18 0x00000002 0x00000000 0x3fcbd790 0x3fcc9d18 0x00000001 0x00000003 0x3fcbd790
    3fcbd770: 0x00000010 0x3fcc8a3a 0x3fcc87a8 0x00000003 0x3fcc9d18 0x4200de20 0x3fcbd8a0 0x42022e82
    3fcbd790: 0x3fcc9d42 0x3fcc9d5e 0x3fcc9da4 0x3fcc9d50 0x00000000 0x3fcbd970 0x3fcc9d26 0x3fcc8a3a
    3fcbd7b0: 0x3fcc9d18 0x00000028 0x00000028 0x42046206 0x00000000 0x00000001 0x3fcbd8a0 0x42046f3e
    3fcbd7d0: 0x00000000 0x00000001 0x3fcbd8a0 0x42022bec 0x3fcc8914 0x3fcbd970 0x3fcc9d18 0x3fcc9d26
    3fcbd7f0: 0x3fcc9d34 0x00000000 0x3fcc9d34 0x42013200 0x3fcc9d34 0x3fcc9d34 0x3fcc9d26 0x42014d68
    3fcbd810: 0x00000001 0x3fcbd970 0x3fcc9d18 0x3fcbd970 0x3fcc9d26 0x3fcc9d26 0x3fcc9d18 0x42013c10
    3fcbd830: 0x3fcc9d26 0x3fcc8a3a 0x3fcc9d26 0x4201e97a 0x00000000 0x00000080 0xfffffff3 0x3fcc8a3a
    3fcbd850: 0x00000001 0x3fcbd970 0x3fcc9d26 0x3fcbd8ac 0x3fcc88f8 0x00000080 0x00000189 0x00000000
    3fcbd870: 0x00000000 0x00000001 0x00000001 0x3fcc8a8e 0x00000000 0x00000000 0x00000000 0x00000000
    3fcbd890: 0x00000000 0x3fcc9d18 0x3fcc9d26 0x4201f93a 0x00000007 0x00000073 0x3fcbd8ec 0x3fcc8a3a
    3fcbd8b0: 0x3fcc8922 0x00000000 0x00000000 0x3fcc9c70 0x3fcc9ce0 0x00000080 0x00000080 0x4201fa6a
    ELF file SHA256: ebacf89e19576d86
    Rebooting...
    ESP-ROM:esp32c3-api1-20210207
    Build:Feb 7 2021
    rst:0x3 (RTC_SW_SYS_RST),boot:0xc (SPI_FAST_FLASH_BOOT)
    Saved PC:0x403806ba
    SPIWP:0xee
    mode:DIO, clock div:1
    load:0x3fcd5810,len:0x1684
    load:0x403cc710,len:0x934
    load:0x403ce710,len:0x2e74
    entry 0x403cc710
    ;32mI (15) boot: ESP-IDF v4.4.7 2nd stage bootloaderm
    ;32mI (15) boot: compile time 10:07:49m
    ;32mI (15) boot: chip revision: v0.4m
    ;32mI (17) boot.esp32c3: SPI Speed : 80MHzm
    ;32mI (22) boot.esp32c3: SPI Mode : DIOm
    ;32mI (26) boot.esp32c3: SPI Flash Size : 4MBm
    ;32mI (31) boot: Enabling RNG early entropy source...m
    ;32mI (37) boot: Partition Table:m
    ;32mI (40) boot: ## Label Usage Type ST Offset Lengthm
    ;32mI (47) boot: 0 nvs WiFi data 01 02 00009000 00006000m
    ;32mI (55) boot: 1 phy_init RF data 01 01 0000f000 00001000m
    ;32mI (62) boot: 2 factory factory app 00 00 00010000 001f4000m
    ;32mI (70) boot: 3 flash Unknown data 01 40 00310000 00010000m
    ;32mI (77) boot: 4 js_code Unknown data 01 06 00320000 00040000m
    ;32mI (85) boot: 5 storage Unknown data 01 06 00360000 000a0000m
    ;32mI (92) boot: End of partition tablem
    ;32mI (96) esp_image: segment 0: paddr=00010020 vaddr=3c170020 size=42288h (270984) mapm
    ;32mI (148) esp_image: segment 1: paddr=000522b0 vaddr=3fc98600 size=03030h ( 12336) loadm
    ;32mI (151) esp_image: segment 2: paddr=000552e8 vaddr=40380000 size=0ad30h ( 44336) loadm
    ;32mI (162) esp_image: segment 3: paddr=00060020 vaddr=42000020 size=168240h (1475136) mapm
    ;32mI (397) esp_image: segment 4: paddr=001c8268 vaddr=4038ad30 size=0d830h ( 55344) loadm
    ;32mI (408) esp_image: segment 5: paddr=001d5aa0 vaddr=50000000 size=00018h ( 24) loadm
    ;32mI (416) boot: Loaded app from partition at offset 0x10000m
    ;32mI (416) boot: Disabling RNG early entropy source...m
    ;32mI (428) cpu_start: Unicore appm
    ;32mI (429) cpu_start: Pro cpu up.m
    ;32mI (437) cpu_start: Pro cpu start user codem
    ;32mI (437) cpu_start: cpu freq: 160000000m
    ;32mI (437) cpu_start: Application information:m
    ;32mI (440) cpu_start: Project name: espruinom
    ;32mI (445) cpu_start: App version: RELEASE_2V24-4-gff487e008m
    ;32mI (452) cpu_start: Compile time: Aug 12 2024 10:08:05m
    ;32mI (458) cpu_start: ELF file SHA256: ebacf89e19576d86...m
    ;32mI (464) cpu_start: ESP-IDF: v4.4.7m
    ;32mI (468) cpu_start: Min chip rev: v0.3m
    ;32mI (473) cpu_start: Max chip rev: v1.99 m
    ;32mI (478) cpu_start: Chip rev: v0.4m
    ;32mI (483) heap_init: Initializing. RAM available for dynamic allocation:m
    ;32mI (490) heap_init: At 3FCA5A60 len 00036CB0 (219 KiB): DRAMm
    ;32mI (496) heap_init: At 3FCDC710 len 00002950 (10 KiB): STACK/DRAMm
    ;32mI (503) heap_init: At 50000028 len 00001FD8 (7 KiB): RTCRAMm
    ;32mI (510) spi_flash: detected chip: winbondm
    ;32mI (514) spi_flash: flash io: diom
    ;32mI (518) sleep: Configure to isolate all GPIO pins in sleep statem
    ;32mI (524) sleep: Enable automatic switching of GPIO sleep configurationm
    ;32mI (532) coexist: coexist rom version 9387209m
    ;32mI (537) cpu_start: Starting scheduler.m

  • user158605

    Did you try creating a dedicated topic, with a relevant title, starting with a nice message like "hello guys, how are you doing", and explaining a bit your problem, and what you expect?

  • Thank you for your answer. My English is not very good, so it's difficult for me to describe it. I need to create a new blog theme now

  • I have published a new blog with the following link:
    https://forum.espruino.com/conversations/398575/

  • Hi, after our detailed testing; Confirm that WiFi is indeed unable to connect properly; Unable to output information after using WiFi connection code; There is no connection record even when checking the router device

    var WIFI_NAME = "123";
    var WIFI_OPTIONS = { password : "123456789" };
    
    var wifi = require("Wifi");
    wifi.scan(function (err, networks) {
        console.log(err, networks);
        wifi.connect(WIFI_NAME, WIFI_OPTIONS, function(err) {
          if (err) {
            console.log("Connection error: "+err);
            return;
          }
          console.log("Connected!");
        });
    });
    
    
  • please stop posing same issue in this conversation too.

  • Hello everyone. I've been disconnected for the past three months. I wanted to make progress and help out, but I couldn't focus until the holidays.

  • I've just started getting back into the project. I already have the environment downloaded from GitHub and the ESP-IDF 4. Furthermore, I've tested both ESP32C3 and ESP32, and both generate the firmware without errors. I haven't tried uploading the firmware to the boards yet.

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

ESP32-C3 mini

Posted by Avatar for Jurand @Jurand

Actions