Micropython on ESP32-C3

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
User avatar
cederom
Posts: 16
Joined: Tue Oct 26, 2021 1:37 am
Contact:

Re: Micropython on ESP32-C3

Post by cederom » Sun Jan 16, 2022 10:25 pm

reppad wrote:
Wed Oct 27, 2021 1:04 pm
This is not the only solution, there are other ways: uPyloader, mpremote, ampy, rshell ...
RSHELL IS A DISASTER AND CAN DESTROY YOUR FILESYSTEM. AVOID! :-)

When using rshell rsync -m . / it will remove all files on your computer that you have access to. Last parameter should be /pyboard or whatever board name is, but when upper script cannot obtain board name, rshell will start deleting all files for your machine. This is a joke and should never even have this possibility. Do not use that application its dangerous!!! I have reported that issue at upstream but I will never come back to this program.
--
CeDeROM, SQ7MHZ, https://www.tomek.cedro.info

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Micropython on ESP32-C3

Post by dhylands » Mon Jan 17, 2022 9:55 pm

Using

Code: Select all

rm -r /
will also do the same thing.

I think it would be good to recognize some known bad directories to use as a destination (like / or $HOME).

If you're not sure which directory something refers to, then you should use the ls command. i.e.

Code: Select all

ls /
would have shown you that you were selecting the wrong directory.

bazooka07
Posts: 6
Joined: Wed Nov 03, 2021 3:45 pm

Re: Micropython on ESP32-C3

Post by bazooka07 » Tue Jan 18, 2022 9:00 am

Hello,

I'm working on Ubuntu 21.04.
I have build with success the last release (V1.18) of Micropython with the following commands :

Code: Select all

git clone https://github.com/micropython/micropython.git 
cd micropython
git checkout v1.18
docker run --rm -v $PWD:/project -w /project -it espressif/idf:release-v4.3
# Now, we are working in Docker
make -C mpy-cross clean
make -C mpy-cross
make BOARD=GENERIC -C ports/esp32 clean
make BOARD=GENERIC -C ports/esp32
#Hit Ctrl-D to leave Docker
esptool.py --chip esp32c3 erase_flash
esptool.py -b 460800 --before default_reset --after hard_reset --chip esp32c3  write_flash --flash_mode dio --flash_size detect --flash_freq 80m 0x0 ports/esp32/build-GENERIC_C3/firmware.bin
After flashing, my "ESP32-C3 LilyGo-T-OI-PLUS" board runs fine.

But if I am using espressif/idf:release-v4.4, alfter flashing myboard fails with this error message :
Rebooting...
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0xc (RTC_SW_CPU_RST),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x403806fc
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd6100,len:0xe3c
load:0x403ce000,len:0x6f4
load:0x403d0000,len:0x28ec
entry 0x403ce000
Guru Meditation Error: Core 0 panic'ed (Store access fault). Exception was unhandled.

Core 0 register dump:
MEPC : 0x42077ae2 RA : 0x42077ab2 SP : 0x3fcc45d0 GP : 0x3fc93400
TP : 0x3fc9b694 T0 : 0x00000000 T1 : 0x4038c694 T2 : 0x00000000
S0/FP : 0x3fc9c060 S1 : 0x00000000 A0 : 0x00000000 A1 : 0x00000000
A2 : 0x00000009 A3 : 0xfffffdff A4 : 0x3fcc4ca8 A5 : 0x00000000
A6 : 0x00000000 A7 : 0x3fcc0704 S2 : 0x3fcc45fc S3 : 0x4038183e
S4 : 0x00000000 S5 : 0x00000000 S6 : 0x00000000 S7 : 0x00000000
S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x00000000 T4 : 0x00000000 T5 : 0x00000000 T6 : 0x00000000
MSTATUS : 0x00001881 MTVEC : 0x40380001 MCAUSE : 0x00000007 MTVAL : 0x00000008
MHARTID : 0x00000000

Stack memory:
3fcc45d0: 0xa5a5a5a5 0x00001000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x42005e52
3fcc45f0: 0x3fcc0b44 0x00001000 0x3fc9757c 0x3fcc4ca8 0x00000000 0x00000000 0x00000000 0x42005cc2
.....
How can I fix that with espressif/idf:release-v4.4 ?

Notice I change ports/esp32/modules/_boot.py like this :
https://gist.github.com/bazooka07/4eb77 ... eb899fe7fe

User avatar
cederom
Posts: 16
Joined: Tue Oct 26, 2021 1:37 am
Contact:

Re: Micropython on ESP32-C3

Post by cederom » Sat Mar 26, 2022 3:47 am

Hello world :-)

Some more questions on ESP32-C3: there seems to be a USB Serial/JTAG port that I would like to use on ESP32-C3-WROOM-02 instead UART0 RX/TX so I do not have to use USB-UART converter but USB directly. I would like to use that port for firmware upload and REPL/CLI with my firmware.
1. Does that USB Serial/JTAG work with MicroPython?
2. Did anyone work with that port to Flash and REPL/CLI with the device?
3. If USB Serial/JTAG port works already, is it enabled by default or I have to rebuild MicroPython on my own to use that USB port not the UART0?
4. If USB Serial/JTAG port does not work yet, can I redirect UART0 RX/TX to that USB pins by default (and use USB-UART converter with those pins) to have more future proof design that would work directly with USB when driver is ready?

Any hints welcome :-)
--
CeDeROM, SQ7MHZ, https://www.tomek.cedro.info

User avatar
reppad
Posts: 10
Joined: Mon Aug 16, 2021 10:46 am

Re: Micropython on ESP32-C3

Post by reppad » Mon Mar 28, 2022 9:28 am

Hi cederom,
cedrom wrote:
Sat Mar 26, 2022 3:47 am
1. Does that USB Serial/JTAG work with MicroPython?
2. Did anyone work with that port to Flash and REPL/CLI with the device?
3. If USB Serial/JTAG port works already, is it enabled by default or I have to rebuild MicroPython on my own to use that USB port not the UART0?
4. If USB Serial/JTAG port does not work yet, can I redirect UART0 RX/TX to that USB pins by default (and use USB-UART converter with those pins) to have more future proof design that would work directly with USB when driver is ready?
There is a firmware variant for C3 that uses the integrated USB Serial Controller for REPL: https://micropython.org/download/esp32c3-usb/

To use it you just need to wire +5V, GND, D+ (GPIO19) and D- (GPIO18) to an USB connector: https://docs.espressif.com/projects/esp ... nsole.html

Not sure because I don't use the integrated USB but you will probably have to manually put the C3 in download mode before flashing and disable auto-reset before and after flashing using --before and --after parameters in esptool (because esptool probably can't assert DTR/RTS lines to resetting MCU or putting it in flash mode with internal USB controller)

adrennes
Posts: 1
Joined: Wed Oct 26, 2016 9:03 pm

Re: Micropython on ESP32-C3

Post by adrennes » Mon Jul 17, 2023 11:53 am

Hi,
I dont know if this is the right place to ask my question.
I bought some OLIMEX ESP32-C3-devkit-Lipo rev 1, and try to implement
Micropython with THONNY. I tried many versions available on micropython.org
recent and older: nothing works. Erase phase seelms OK, write seems OK when
no other errors happen (like error 2, like invalid header value, ...).
Could somebody tell me which version is suited for this OLIMEX ?
NB: the Espressif module is ESP32-C3-MINI-1
Thanks.
adrennes

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Micropython on ESP32-C3

Post by Roberthh » Mon Jul 17, 2023 1:07 pm

The version with USB shoudl be the right one: https://micropython.org/download/esp32c3-usb/
Please try to connect to the board using a simple serial terminal emulator like PuTTY or screen or the like. Thonny is not always working.
Note: This site will be discontinued. Plwease post question now at the GitHub Discussions Site for MicroPython https://github.com/orgs/micropython/discussions

Post Reply