MicroPython on ESP-WROOM-32

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
Pithon
Posts: 5
Joined: Sat Aug 27, 2016 3:59 pm

MicroPython on ESP-WROOM-32

Post by Pithon » Sat May 27, 2017 9:47 pm

Hi all,

How do I install MicroPython on the ESP-WROOM-32 module using Windows?

Thanks.

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

Re: MicroPython on ESP-WROOM-32

Post by Roberthh » Sun May 28, 2017 6:24 am

You can do so using esptool.py v2.0, which is for instance here: https://github.com/espressif/esptool/tr ... 524b688ade
If you have a bar ESp32Wrrom, you have to connect an usb/serial adapter to rx/tx of UART0 and pull GPIO0 low for bootloading.
Development board may have the usb/serial already installed.
A precompiled imange can be found on the micropython download page http://micropython.org/download/
In case you want to install the esp-idf, of which esptool is a part of, look here: http://esp-idf.readthedocs.io/en/latest ... et-esp-idf
If you want to build the micropython binaries yourself, it might be easier to install a Linux VM as the development environment.

wr300000
Posts: 32
Joined: Sun Jan 14, 2018 3:54 pm

Re: MicroPython on ESP-WROOM-32

Post by wr300000 » Wed May 23, 2018 1:38 pm

done
Last edited by wr300000 on Tue May 29, 2018 1:22 am, edited 2 times in total.

wr300000
Posts: 32
Joined: Sun Jan 14, 2018 3:54 pm

Re: MicroPython on ESP-WROOM-32

Post by wr300000 » Wed May 23, 2018 4:51 pm

I'm using NodeMCU-32s (ESP WROOM-32), running esptool v2.0beta2, erased completed and flashed completed on esp32-20180523-v1.9.4-85-gdf9b7e8f.bin file. Everything is fine with positive screen response during flashing I didn't see any error during erasing and flashing MicroPython on my NodeMCU-32s.
Once I open PUTTY to communicate with my NodeMCU so It's looping by below texts. Could you suggest me on this error ? What should I do next ?

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:QIO, clock div:2
load:0x3fff0018,len:4
load:0x0aa0a20a,len:679547529
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:QIO, clock div:2
load:0x3fff0018,len:4
load:0x0aa0a20a,len:679547529
ets Jun 8 2016 00:22:57

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

Re: MicroPython on ESP-WROOM-32

Post by Roberthh » Wed May 23, 2018 6:11 pm

Did you flash the binary at address 0x1000 ? So the command for flashing is something like:

python esptool. py --chip esp32 --port <portname> --baud 460800 write_flash -z --flash_mode dio --flash_freq 40m 0x1000 filename

wr300000
Posts: 32
Joined: Sun Jan 14, 2018 3:54 pm

Re: MicroPython on ESP-WROOM-32

Post by wr300000 » Wed May 23, 2018 11:17 pm

I've reflashed my NodeMCU-32s without holding IO0 sw, changed to latest esptool v2.3.1, changed to latest bin file so the result is good but still see some error message before getting Python prompt , please see below list. Could you kindly suggest more ?
rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:4524
load:0x40078000,len:0
load:0x40078000,len:12720
entry 0x4007ad38
I (378) cpu_start: Pro cpu up.
I (378) cpu_start: Single core mode
I (378) heap_init: Initializing. RAM available for dynamic allocation:
I (382) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (388) heap_init: At 3FFC55E8 len 0001AA18 (106 KiB): DRAM
I (394) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (400) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (407) heap_init: At 40090794 len 0000F86C (62 KiB): IRAM
I (413) cpu_start: Pro cpu start user code
I (207) cpu_start: Starting scheduler on PRO CPU.
OSError: [Errno 2] ENOENT <-------- " WHAT DOES IT MEAN ? "
MicroPython v1.9.4-85-gdf9b7e8f on 2018-05-23; ESP32 module with ESP32
Type "help()" for more information.
>>>

User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: MicroPython on ESP-WROOM-32

Post by devnull » Thu May 24, 2018 1:36 am

OSError: [Errno 2] ENOENT <-------- " WHAT DOES IT MEAN ? "
When uPy starts up, it first runs boot.py and then main.py

If one of these files is missing your will get this 'warning' rather than error, so it's normal.

You can always create a dummy main.py file with just 'pass' and the warning will go away:

/main.py

Code: Select all

pass

wr300000
Posts: 32
Joined: Sun Jan 14, 2018 3:54 pm

Re: MicroPython on ESP-WROOM-32

Post by wr300000 » Thu May 24, 2018 6:43 am

Thank you all, it's working...have a great day.

User avatar
Len
Posts: 3
Joined: Sat May 26, 2018 6:36 pm

Re: MicroPython on ESP-WROOM-32

Post by Len » Sat May 26, 2018 6:51 pm

I have been getting a bunch of repeating garbage on my PuTTy when I tried to connect to the ESP32. The addition of "--flash_freq 40m 0x1000" to the command line for esptool as suggested above fixed the problem. Thanks.

I know the 0x1000 is the offset into flash, but what is the 40m?

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

Re: MicroPython on ESP-WROOM-32

Post by Roberthh » Mon May 28, 2018 11:41 am

see the documentation of the esptool.py:
Flash Frequency (--flash_freq, -ff)

Clock frequency for SPI flash interactions. Valid values are keep, 40m, 26m, 20m, 80m (MHz). The default is keep, which keeps whatever value is already in the image file. This parameter can also be specified using the environment variable ESPTOOL_FF.

The flash chip connected to most chips works with 40MHz clock speeds, but you can try lower values if the device won't boot. The highest 80MHz flash clock speed will give best performance, but may cause crashing if the flash or board designis not capable of this speed.

Post Reply