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 ESP32 with SPIRAM support

Post by loboris » Thu Jan 25, 2018 6:14 pm

@OutoftheBOTS_

If 80MHz Flash & 80MHz SPIRAM mode is used, Display and SPI modules will only be able to use HSPI_HOST (default for both).

@cartere

I've never tried FileZilla server. Try to search for Curl issues with FileZilla server. If there is one, it will be common for all Curl clients.
If you need the ftp server on Windows, have you tried to install IIS (Internet Information Services) which also includes ftp server.

OutoftheBOTS_
Posts: 847
Joined: Mon Nov 20, 2017 10:18 am

Re: MicroPython on ESP32 with SPIRAM support

Post by OutoftheBOTS_ » Thu Jan 25, 2018 7:41 pm

I am using filezilla successfully on windows 10 PC to tranfer/edit files. I tried to use a FTP plugin for note++ and it could read/create directories but wouldn't transfer files, and WinSCP same problem and I even tried command line options for FTP and same again. I did a lot of googling and it seems windows likes to block passive FTP transfers as a security measure. Linux doesn't do the same and passive FTP is easy to get work on Linux. With all the googling I did on FTP problems on windows it seems that filezilla was the only software that was able to do passive transfer and everyone wasn't sure how filezilla got around windows blocking of passive FTP.

@laboris do you plan to add active FTP transfer at any stage??

demoontz
Posts: 18
Joined: Wed Feb 15, 2017 12:39 pm

Re: MicroPython on ESP32 with SPIRAM support

Post by demoontz » Fri Jan 26, 2018 3:56 pm

guys, how about other modules? now i have SH1106, this other oled display, how i can use/import module from micropython repo?

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

Re: MicroPython on ESP32 with SPIRAM support

Post by Roberthh » Fri Jan 26, 2018 4:16 pm

A driver is here: https://github.com/robert-hh/SH1106 or other made by @deshipu. They are pure python code, so you have just to store them on the ESP32 and use. No need to make a C-Language driver.

fisheggs
Posts: 2
Joined: Sat Jan 06, 2018 5:05 am

Re: MicroPython on ESP32 with SPIRAM support

Post by fisheggs » Sat Jan 27, 2018 12:58 am

With my git repository at

commit 7b97da288973b9c07722458238ef95f4fff2ee07 (HEAD -> master, origin/master, origin/HEAD)
Author: Boris Lovosevic <loboris@gmail.com>
Date: Wed Jan 24 09:59:19 2018 +0100

Builds without error, but when booting the board, I get

[code]
rst:0x1 (POWERON_RESET),boot:0x3f (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x3f (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:5680
ho 0 tail 12 room 4
load:0x40078000,len:0
load:0x40078000,len:13756
entry 0x40078fcc
I (30) boot: ESP-IDF v3.1-dev-207-g2ddee729 2nd stage bootloader
I (30) boot: compile time 11:38:46
I (32) boot: Enabling RNG early entropy source...
I (36) boot: SPI Speed : 40MHz
I (40) boot: SPI Mode : DIO
I (44) boot: SPI Flash Size : 4MB
I (48) boot: Partition Table:
I (52) boot: ## Label Usage Type ST Offset Length
I (59) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (67) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (74) boot: 2 MicroPython factory app 00 00 00010000 001d0000
I (82) boot: 3 internalfs Unknown data 01 82 001e0000 00220000
I (89) boot: End of partition table
I (93) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x67480 (423040) map
I (249) esp_image: segment 1: paddr=0x000774a8 vaddr=0x3ffc0000 size=0x08b68 ( 35688) load
I (263) esp_image: segment 2: paddr=0x00080018 vaddr=0x400d0018 size=0x137ef0 (1277680) map
I (707) esp_image: segment 3: paddr=0x001b7f10 vaddr=0x3ffc8b68 size=0x01624 ( 5668) load
I (710) esp_image: segment 4: paddr=0x001b953c vaddr=0x40080000 size=0x00400 ( 1024) load
I (714) esp_image: segment 5: paddr=0x001b9944 vaddr=0x40080400 size=0x1ece0 (126176) load
I (775) esp_image: segment 6: paddr=0x001d862c vaddr=0x400c0000 size=0x0006c ( 108) load
I (775) esp_image: segment 7: paddr=0x001d86a0 vaddr=0x50000000 size=0x00904 ( 2308) load
I (803) boot: Loaded app from partition at offset 0x10000
I (803) boot: Disabling RNG early entropy source...
I (805) spiram: SPI RAM mode: flash 40m sram 40m
I (808) spiram: PSRAM initialized, cache is in low/high (2-core) mode.
I (816) cpu_start: Pro cpu up.
I (819) cpu_start: Starting app cpu, entry point is 0x40081664
I (0) cpu_start: App cpu up.
I (1719) spiram: SPI SRAM memory test OK
I (1720) heap_init: Initializing. RAM available for dynamic allocation:
D (1720) heap_init: New heap initialised at 0x3ffaff10
I (1725) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
D (1731) heap_init: New heap initialised at 0x3ffda240
I (1736) heap_init: At 3FFDA240 len 00005DC0 (23 KiB): DRAM
I (1742) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (1749) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
D (1755) heap_init: New heap initialised at 0x4009f0e0
I (1761) heap_init: At 4009F0E0 len 00000F20 (3 KiB): IRAM
I (1767) cpu_start: Pro cpu start user code
I (1772) spiram: Adding pool of 4096K of external SPI memory to heap allocator
I (1780) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations
E (1788) cpu_start: Could not reserve internal/DMA pool!
abort() was called at PC 0x40081506 on core 0

Backtrace: 0x40090948:0x3ffe3bb0 0x40090a3b:0x3ffe3bd0 0x40081506:0x3ffe3bf0 0x4
008184b:0x3ffe3c20 0x40078c82:0x3ffe3c40 0x40078d35:0x3ffe3c70 0x40078fa6:0x3ffe
3cb0 0x400790ee:0x3ffe3e70 0x40007c31:0x3ffe3eb0 0x4000073d:0x3ffe3f20

CPU halted.
[/code]

Any suggestions?

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

Re: MicroPython on ESP32 with SPIRAM support

Post by loboris » Sat Jan 27, 2018 8:15 am

@fisheggs

Have you made any changes to the default configurationonfig) or the code ?

You can try to set
→ Component config → ESP32-specific → SPI RAM config → Reserve this amount of bytes for data.... to lower value (e.g. 16384)
or set
→ Component config → ESP32-specific → SPI RAM config → SPI RAM access method to Make RAM allocatable using heap_caps_malloc

fisheggs
Posts: 2
Joined: Sat Jan 06, 2018 5:05 am

Re: MicroPython on ESP32 with SPIRAM support

Post by fisheggs » Sat Jan 27, 2018 8:31 am

Ah hah! Somehow "SPI RAM access method" had been changed to "Make RAM allocatable using malloc()" instead of "Make RAM allocatable using heap_caps_malloc". I'm not sure how, because I _know_ I had it set that way for the previous build.

Thanks for the help.

BTW, how does one turn BBCode on? I found "Enable BBCode by default:" in the "Edit posting defaults", but I still see "BBCode is OFF
Smilies are ON" next to the posting area.

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

Re: MicroPython on ESP32 with SPIRAM support

Post by dhylands » Sat Jan 27, 2018 6:51 pm

The first few posts for a member are moderated and bbcode is disabled. It will automatically be enabled once you get past those first few.

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

Re: MicroPython on ESP32 with SPIRAM support

Post by loboris » Sat Jan 27, 2018 8:24 pm

:!:
Updates summary:
Jan 13. ~ 27.
  • Fixed bug in spiffs driver affecting uos.listdir()
  • Fixed bug in unmounting sdcard causing issues with rshell
  • Updated PWM module, float values accepted in duty function
  • Updated RTC module, improved smpt functions, some bugs fixed
  • Updated utime module, added utime.ticks_base() function
  • Bug fix: LAN class not added to the network module
  • Fixed bug in machine.Timer preventing extended timers to function as intended
  • Updated OTA module, allow setting boot partition also for ota types
  • Updated SSH & Curl modules, some bugs fixed, latest libcurl version used
  • Updated mDNS module, now built with latest esp-idf mdns componnent, some api changes, see the Wiki
  • Updated _thread module, some bugfixes, thread lock / unlock implemented.
    Wiki page updated, detailed Example added
  • Full Onewire/ds18x20 module documentation added
  • Many other Wiki pages updated, more updates/additions soon...
  • Updated esp-idf to the latest commit (Jan 26, 2018)
  • Added ARM Xtenssa toolchain, Build on Raspberry Pi and other ARM systems is now possible, thanks to Benoit Despatis for building the toolchain on Raspberry Pi.
  • Added -fno-stack-protector in mpy-cross Makefile to address the issues on some operating systems
Individual prebuilt firmware zip archives for various configurations are now available for download.
You can support this project by donating via PayPal
Thanks to all who donated.

User avatar
on4aa
Posts: 70
Joined: Sat Nov 11, 2017 8:41 pm
Location: Europe
Contact:

Re: MicroPython on ESP32 with SPIRAM support

Post by on4aa » Sat Jan 27, 2018 9:30 pm

Dear loboris,
First off, thank you for all your efforts.

However, to leave out any legal conundrums; Would you mind putting your software licensing terms in the root folder of your GitHub repository?
As it currently stands, it looks like the MIT license only applies to certain parts of your software.

Sorry, for sounding so serious, but it is out of necessity.
Serge

Post Reply