MicroPython on ESP32 with SPIRAM support

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
patrick.pollet
Posts: 16
Joined: Fri Apr 29, 2016 7:08 pm

Re: MicroPython on ESP-WROVER with 4MB of psRAM

Post by patrick.pollet » Mon Oct 09, 2017 11:17 pm

Ok, thanks.

I did not understood the warning as an issue, but the reboot yes :-)
Especially because it never occurred before with the same ESP32 board, same cable and same computer.

I will retry with a laboratory power supply.

patrick.pollet
Posts: 16
Joined: Fri Apr 29, 2016 7:08 pm

Re: MicroPython on ESP-WROVER with 4MB of psRAM

Post by patrick.pollet » Tue Oct 10, 2017 1:01 pm

Perhaps the following may help someone else.
After using a laboratory power supply to power the ESP32 i had better results but the brownout detection did not totaly disappear (even with this power supply able to deliver 3A).
And after a while it became more and more frequent.
Finally i decided to use another new ESP32 Wrover and everything works like a charm, no more brownout detection until now (even with a simple usb cable as power supply).

Perhaps the first ESP32 Wrover became weak after a while .... Perhaps it did not like to be solder in a reflow oven (as it was done)...

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: MicroPython on ESP-WROVER with 4MB of psRAM

Post by pythoncoder » Wed Oct 11, 2017 9:55 am

Might there be a poor solder joint on your first PCB?
Peter Hinch
Index to my micropython libraries.

patrick.pollet
Posts: 16
Joined: Fri Apr 29, 2016 7:08 pm

Re: MicroPython on ESP-WROVER with 4MB of psRAM

Post by patrick.pollet » Wed Oct 11, 2017 12:49 pm

@pythoncoder :

Yes maybe, but i already checked all the joints with a binocular and it seems nice and regular.
So it's not my preferred hypothesis but the devil is often in the solder joints ... ;)

Capstan
Posts: 117
Joined: Sun Jan 29, 2017 4:03 pm
Location: Texas, USA

Re: MicroPython on ESP-WROVER with 4MB of psRAM

Post by Capstan » Mon Oct 16, 2017 11:31 pm

>>> import uos
>>> uos.listdir()
['\x00\x00\x00\x00\x00\x00\x00\x00.\x00\x00\x00', '\x00\x00\x00\x00\x00\x00\x00\x00.\x00\x00\x00',
...etc for a few dozen lines. But then the files that I actually did download to the device are shown. Is
there a filesystem setting I am missing in the build menu?

Capstan
Posts: 117
Joined: Sun Jan 29, 2017 4:03 pm
Location: Texas, USA

Re: MicroPython on ESP-WROVER with 4MB of psRAM

Post by Capstan » Tue Oct 17, 2017 3:26 pm

I erased flash and reflashed, the problem disappeared...

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

Re: MicroPython on ESP-WROVER with 4MB of psRAM

Post by devnull » Sat Oct 21, 2017 10:47 am

I have my own build bash scripts and logical folder structure for the esp8266, esp32 and wipy and have now included the lobo version.
But I need a couple of things:

1. Currently I have a script to generate symbolic links to the modules folder, but how do I add my own frozen modules in lobo ?
2. What is the esptool command line needed to directly use esptool rather than your scripts ?

This works with the official ESP32 build, but does not work with this repo ??

Code: Select all

/Volumes/Data/uPython/bash/../build/esptool/esptool.py --chip esp32 --port /dev/tty.usbserial-DN02N7EB --baud 460800 write_flash --compress -fs 4MB -fm dio -ff 40m 0x1000 latest.bin
In my situation, the build computer is different from the flash computer, the device is sparkfun esp32 thing, and all my compiled files are named latest.bin, it is the original MicroPython.bin file renamed and moved to a different location.

Code: Select all

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:0x3f400020,len:317888
ets Jun  8 2016 00:22:57
Update
OK, solved the device flashing, there are actually 4 files required, and also found the frozen folder.

loboris
Posts: 344
Joined: Fri Oct 02, 2015 6:19 pm

Re: MicroPython on ESP-WROVER with 4MB of psRAM

Post by loboris » Tue Oct 24, 2017 2:19 pm

:!: Update
  • esp-idf updated to the latest master branch commits
  • added gsm module
    • PPPoS support, all network functions works the same as with WiFi
    • connect and disconnect methods to go online/offline
    • SMS support, delete, send or read received messages, on_sms_received callback
    • execute any AT command and get the response, even the complex commands like send message or read from filesystem (Simcom) are supported. You can easily build complex python script to execute any sequence of AT commands.
    • WiFi in AP mode can be used while connected to the Internet via GSM/PPPoS
  • display module updated
    • added support for STMPE610 touch controller (as on Adafruit TFT FeatherWing)
    • added touch calibration tpcalib frozen module
    • added paint module in examples folder
  • fixed bug in i2c functions ssd1306 frozen module
  • added support for NVS memory (to machine module). NVS variables are preserved if power is removed. Available methods:
    • nvs_setint store integer (up to 32bit) to nvs storage
    • nvs_getint retrieve integer from nvs storage
    • nvs_setstr store string to nvs storage
    • nvs_getstr retrievi string from nvs storage
    • nvs_erase erase variable from nvs storage
    • nvs_erase_all erase the whole nvs storage area
  • some fixes and improvements in neopixel module
  • updated logging.py frozen module
  • fixed setting static IP and DNS in wifi STA mode
  • fixed ftp server not working in AP mode
  • some improvements in BUILD.sh script
  • many improvements, additions and bugfixes in various modules
Documentation will be pushed in the following days.

You can support this project by donating via PayPal

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

Re: MicroPython on ESP32 with SPIRAM support

Post by devnull » Wed Oct 25, 2017 10:31 am

Nice, I like the nvs functionality, integers work but strings seem to have a problem:

Code: Select all

>>> import machine as mc
>>> mc.nvs_setint('lastval',1000)
#reboot
>>> mc.nvs_getint('lastval')
1000
So I thought that I could save a JSON string, and tried to extend this but it crashed, maybe it didn't like the single and double quotes:

Code: Select all

>>> mc.nvs_setstr('json','{"x":10}')
>>> mc.nvs_getstr('json')
Guru Meditation Error of type LoadProhibited occurred on core  1. Exception was unhandled.
Register dump:
PC      : 0x400014fd  PS      : 0x00060f30  A0      : 0x8010b179  A1      : 0x3ffbae30  
A2      : 0x00000000  A3      : 0xfffffffc  A4      : 0x000000ff  A5      : 0x0000ff00  
A6      : 0x00ff0000  A7      : 0xff000000  A8      : 0x00000000  A9      : 0x3ffbadd0  
A10     : 0x00000000  A11     : 0x3ffc07b8  A12     : 0x3f410da3  A13     : 0x00000000  
A14     : 0x3ffbae40  A15     : 0x3ffbafc0  SAR     : 0x00000000  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x00000000  LBEG    : 0x400014fd  LEND    : 0x4000150d  LCOUNT  : 0xffffffff  

Backtrace: 0x400014fd:0x3ffbae30 0x4010b176:0x3ffbae40 0x4011e425:0x3ffbae70 0x4011a2fd:0x3ffbae90 0x4011a36d:0x3ffbaeb0 0x40126ced:0x3ffbaed0 0x4011e586:0x3ffbaf70 0x4011a2fd:0x3ffbafe0 0x4011a32a:0x3ffbb000 0x4010e667:0x3ffbb020 0x4010e8c5:0x3ffbb0c0 0x40108541:0x3ffbb100

CPU halted.
But then also tried with a regular string:

Code: Select all

>>> import machine as mc
>>> mc.nvs_setstr('hello','world')
>>> mc.nvs_getstr('hello')
Guru Meditation Error of type LoadProhibited occurred on core  1. Exception was unhandled.
Register dump:
PC      : 0x400014fd  PS      : 0x00060730  A0      : 0x8010b179  A1      : 0x3ffbae30  
A2      : 0x00000000  A3      : 0xfffffffc  A4      : 0x000000ff  A5      : 0x0000ff00  
A6      : 0x00ff0000  A7      : 0xff000000  A8      : 0x00000000  A9      : 0x3ffbadd0  
A10     : 0x00000000  A11     : 0x3ffc07b8  A12     : 0x3ffc7cdc  A13     : 0x00000000  
A14     : 0x3ffbae40  A15     : 0x3ffbafc0  SAR     : 0x00000004  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x00000000  LBEG    : 0x400014fd  LEND    : 0x4000150d  LCOUNT  : 0xffffffff  

Backtrace: 0x400014fd:0x3ffbae30 0x4010b176:0x3ffbae40 0x4011e425:0x3ffbae70 0x4011a2fd:0x3ffbae90 0x4011a36d:0x3ffbaeb0 0x40126ced:0x3ffbaed0 0x4011e586:0x3ffbaf70 0x4011a2fd:0x3ffbafe0 0x4011a32a:0x3ffbb000 0x4010e667:0x3ffbb020 0x4010e8c5:0x3ffbb0c0 0x40108541:0x3ffbb100

CPU halted.

loboris
Posts: 344
Joined: Fri Oct 02, 2015 6:19 pm

Re: MicroPython on ESP32 with SPIRAM support

Post by loboris » Wed Oct 25, 2017 1:50 pm

Thank you for informing about the bug.

It is fixed now and pushed on GitHub.

Code: Select all

>>> import machine as mc
>>> mc.nvs_setstr('json','{"x":10}')
>>> mc.nvs_getstr('json')
'{"x":10}'
>>> mc.reset()
.....
.....
FreeRTOS running on BOTH CORES, MicroPython task started on App Core.

uPY stack size = 19456 bytes
uPY  heap size = 81920 bytes

D (279) intr_alloc: Connected src 34 to int 3 (cpu 1)
Reset reason: Soft CPU reset
D (287) intr_alloc: Connected src 22 to int 4 (cpu 1)
MicroPython ESP32_LoBo_v2.0.6 - 2017-10-24 on ESP32 board with ESP32
Type "help()" for more information.
>>> import machine as mc
>>> mc.nvs_getstr('json')
'{"x":10}'
>>> 

Post Reply