MicroPython on ESP32 with SPIRAM support

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
loboris
Posts: 344
Joined: Fri Oct 02, 2015 6:19 pm

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

Post by loboris » Fri Sep 22, 2017 10:25 am

slzatz wrote:Do I need to do address the vfs_native warnings?
vfs_native warnings are normal on first start when no FatFS formated partition is detected.
The partition is formated and mounted and there will be no more warnings on the next reboot.

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

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

Post by loboris » Fri Sep 22, 2017 10:31 am

cable134 wrote:... I've remarked that you implemented new module functionality as "GSM module and PPPoS support" (MICROPY_USE_GSM).
Is it ready for testing?...
The GSM module and PPPoS support is working, but still under testing. It will be enabled soon.
All network functions (sockets, http/https, curl, mqtt, ... ) are working the same way as with WiFi when PPPoS is started. SMS send/receive is also available. I'm still working on SMS_received callback...

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

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

Post by loboris » Sat Sep 23, 2017 1:54 pm

:!: Update

One of the features of this port is that you can prepare the file system image on host and flash it to ESP32.
Until now, it was only possible for SPIFFS, as of the latest commit, it is also possible for FatFS (thanks to jkearins for his work on mkfatfs).

For more details visit the documentation page.

tulip
Posts: 2
Joined: Sun Sep 24, 2017 12:16 pm

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

Post by tulip » Sun Sep 24, 2017 12:24 pm

loboris, really excited about your work. I'm using your module compiled as of

https://github.com/loboris/MicroPython_ ... ff88e40b0e (a few days ago)

and it works great on an Olimex ESP32-WROVER board. I am noticing that the more recent commit shows uPY heap size as "only" 524288 bytes, whereas last week is was showing 2MB. Is there a menuconfig setting I've missed?

[code]
I (4634) heap_init: Initializing. RAM available for dynamic allocation:
D (4635) heap_init: New heap initialised at 0x3ffae2a0
I (4651) heap_init: At 3FFAE2A0 len 00001D60 (7 KiB): DRAM
D (4670) heap_init: New heap initialised at 0x3ffc4350
I (4686) heap_init: At 3FFC4350 len 0001BCB0 (111 KiB): DRAM
I (4705) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (4725) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
D (4745) heap_init: New heap initialised at 0x4009af60
I (4761) heap_init: At 4009AF60 len 000050A0 (20 KiB): IRAM
...
D (3134) heap_init: New heap initialised at 0x3ffe0440
D (3139) heap_init: New heap initialised at 0x3ffe4350
D (3154) nvs: nvs_flash_init_custom partition=nvs start=9 count=6

FreeRTOS running on BOTH CORES, MicroPython task started on App Core.

uPY stack size = 19456 bytes
uPY heap size = 524288 bytes (in SPIRAM using MEMMAP)
[/code]

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

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

Post by loboris » Sun Sep 24, 2017 6:15 pm

512KB is the minimal heap size when SPIRAM is used. It will be set to that value if you have previously run menuconfig and configured build without SPIRAM.
Default heap size is 2MB (allowed range is 512~4096 KB).

You can configure heap size via menuconfig: → MicroPython → System settings → MicroPython heap size (KB)

If you enable SPIRAM support, I would also suggest to configure:
→ Component config → ESP32-specific → SPI RAM config → Make RAM allocatable using heap_caps_malloc
it may be more compatible with future releases.

The full documentation about the config options will be available soon.

tulip
Posts: 2
Joined: Sun Sep 24, 2017 12:16 pm

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

Post by tulip » Mon Sep 25, 2017 11:03 am

Ah! There it is. Set that, and it works great. Thanks again.

slzatz
Posts: 92
Joined: Mon Feb 09, 2015 1:09 am

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

Post by slzatz » Fri Sep 29, 2017 2:51 am

If anyone has an Adafruit Feather ESP32 and a TFT Featherwing, can you test the following with the latest @loboris code to see if you can initialize and communicate with the TFT. So far I am having no luck and not sure why and would be great to know if this works for someone else.

Code: Select all

import display
tft = display.TFT()
tft.init(tft.ILI9341, miso=19, mosi=18, clk=5, cs=15, dc=33, bgr=True)
I have tried varying the speed (frequency) with no success and have tested a couple of Adafruit ESP32 feathers and TFT featherwings.

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

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

Post by loboris » Sun Oct 08, 2017 10:40 am

:!: Update
  • esp-idf updated
  • bugfixes in display modules
  • added another small font (FONT_DefaultSmall), useful for small 128x160 displays
  • small bugfixes in spi module
  • curl module updated
  • initial support for GSM/PPPoS module, it works well, the documentation will be published soon
  • various small bugfixes and improvements

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 3:02 pm

Hello Loboris,

i just updated source and tools to the last release and so re-compile a firmware but then i had a never seen before problem :

Code: Select all

>>> import network
W (13248) phy_init: failed to load RF calibration data (0x1102), falling back to full calibration

Brownout detector was triggered
As i try to import network, the ESP32 reboot.

Do you have an idea ?

Best regards.

Patrick

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

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

Post by loboris » Mon Oct 09, 2017 7:31 pm

patrick.pollet wrote:... then i had a never seen before problem :

Code: Select all

>>> import network
W (13248) phy_init: failed to load RF calibration data (0x1102), falling back to full calibration

Brownout detector was triggered
The warning message is not an error, it will appear only on the first boot, then wifi callibration data are saved to the NVS memory.
Brownout detector was triggered and reboot means that you have insufficient power. WiFi needs up to 500 mA on start/calibration.
The reason can be bad USB cable, bad connector or the used USB port simply cannot supply enough power.
Try to use different cable or USB port .
There are many discussions on esp32 forum on that problem.

Post Reply