MicroPython on ESP32 with SPIRAM support
-
- Posts: 5
- Joined: Thu Nov 16, 2017 9:25 pm
Re: MicroPython on ESP32 with SPIRAM support
@loboris it worked
thank you. I will spend a bit of time playing with it
thank you. I will spend a bit of time playing with it
-
- Posts: 5
- Joined: Thu Nov 16, 2017 9:25 pm
Re: MicroPython on ESP32 with SPIRAM support
by the way, i found a difference, not sure if important, micropython-esp32 master you can do both import uhashlib and import hashlib. In your repo only the latter works.
Not a problem but I was surprised because your repo is up to date
Not a problem but I was surprised because your repo is up to date
-
- Posts: 5
- Joined: Thu Nov 16, 2017 9:25 pm
Re: MicroPython on ESP32 with SPIRAM support
Another difference I found with code working on micropython-esp32 (same device)
and if I comment the buttons code out, it then fails with
I'm sorry I'm a noob
Code: Select all
from machine import Pin
pin = Pin(39, Pin.IN, Pin.PULL_DOWN) # <- fails here
#pin.init(pin.IN)
#pin.irq(trigger=Pin.IRQ_FALLING, handler=lambda x: print(x))
Traceback (most recent call last):
File "main.py", line 2, in <module>
ValueError: pins 34~39 do not have pull-up or pull-down circuitry
Code: Select all
from machine import Pin, SPI
spi = SPI(
-1,
baudrate=1200000,
miso=Pin(19),
mosi=Pin(23),
sck=Pin(18)
Traceback (most recent call last):
File "main.py", line 2, in <module>
OSError: error initializing spi
-
- Posts: 5
- Joined: Thu Nov 16, 2017 9:25 pm
Re: MicroPython on ESP32 with SPIRAM support
Some small update:
after disabling what doesn't work (display, buttons, see previous comments). i tested a bit the performance of my code using your micropython repository vs vanilla micropython-esp32 repository and things are nice!
For my code I get 20%+ more performance on your repository. I also tried the threading library and I was hoping it used both cores but looks like it doesn't.
Is there any 'advanced' way to use both cores with micropython other than writing some C module? the code i have is actually faster without using threads right now (and shares no state or locks)
after disabling what doesn't work (display, buttons, see previous comments). i tested a bit the performance of my code using your micropython repository vs vanilla micropython-esp32 repository and things are nice!
For my code I get 20%+ more performance on your repository. I also tried the threading library and I was hoping it used both cores but looks like it doesn't.
Is there any 'advanced' way to use both cores with micropython other than writing some C module? the code i have is actually faster without using threads right now (and shares no state or locks)
Re: MicroPython on ESP32 with SPIRAM support
@ClockToshi
GPIOs 34-39 are input-only and do not have internal pull-up or pull-down circuitry, so this error is improvement over master MicroPython-ESP32.
This port uses only hardware SPI, you can only select SPI.HSPI (1) ir SPI.VSPI(2) as spi ID.
AFAIK, uhashlib does not exist in master MicroPithon-ESP32 port.
Some of the internal task/servers are running on the different core than main MPy task. Most of the wifi stack runs on different core, so there should be an improvement when running on both cores. I'm working on enabling MicroPython threads to run on different core and some other improvements related to dual core usage, but I don'e expect to push them before the end of this year.
What exactly does not work in display ?
GPIOs 34-39 are input-only and do not have internal pull-up or pull-down circuitry, so this error is improvement over master MicroPython-ESP32.
This port uses only hardware SPI, you can only select SPI.HSPI (1) ir SPI.VSPI(2) as spi ID.
AFAIK, uhashlib does not exist in master MicroPithon-ESP32 port.
Some of the internal task/servers are running on the different core than main MPy task. Most of the wifi stack runs on different core, so there should be an improvement when running on both cores. I'm working on enabling MicroPython threads to run on different core and some other improvements related to dual core usage, but I don'e expect to push them before the end of this year.
What exactly does not work in display ?
Re: MicroPython on ESP32 with SPIRAM support
loboris,
I am building and testing it on HELTEC WIFI KIT 32( no SPI-RAM, with SSD1366 oled). it works well. The embedded telnetd and ftpd are very useful. thanks for your great work
there are some issues:
if I enable bluetooth in menuconfig, i got CPU halt.
I set timezone to CST-8 in menuconfig, rebuild and flash, after rtc.ntp_sync(), time.gmtime() returns correct, but time.localtime() returns wrong time. It should be +0800 but i got -0800 time.
machine.Timer() not work yet. hoping your new commits will fix it
sometime, while threads is exiting, run '_thread.list()' cause core crash.
I am building and testing it on HELTEC WIFI KIT 32( no SPI-RAM, with SSD1366 oled). it works well. The embedded telnetd and ftpd are very useful. thanks for your great work
there are some issues:
if I enable bluetooth in menuconfig, i got CPU halt.
I set timezone to CST-8 in menuconfig, rebuild and flash, after rtc.ntp_sync(), time.gmtime() returns correct, but time.localtime() returns wrong time. It should be +0800 but i got -0800 time.
machine.Timer() not work yet. hoping your new commits will fix it
sometime, while threads is exiting, run '_thread.list()' cause core crash.
Re: MicroPython on ESP32 with SPIRAM support
Anybody know how to access the built-in hall sensor ?
Re: MicroPython on ESP32 with SPIRAM support
Bluetooth does not work, BT module will be (temporarily) removed from build in next commit.ruf wrote: ↑Tue Nov 21, 2017 7:22 amif I enable bluetooth in menuconfig, i got CPU halt.
I set timezone to CST-8 in menuconfig, rebuild and flash, after rtc.ntp_sync(), time.gmtime() returns correct, but time.localtime() returns wrong time. It should be +0800 but i got -0800 time.
machine.Timer() not work yet. hoping your new commits will fix it
sometime, while threads is exiting, run '_thread.list()' cause core crash.
I've tested with timezone set to CST-8 in menuconfig, and the time is returned correctly:
Code: Select all
>>> time.gmtime()
(2017, 11, 22, 14, 36, 14, 4, 326)
>>> time.localtime()
(2017, 11, 22, 22, 36, 21, 4, 326)
>>>
>>> time.strftime("%c",time.gmtime())
'Wed Nov 22 14:50:13 2017'
>>> time.strftime("%c",time.localtime())
'Wed Nov 22 22:50:16 2017'
>>>
Please, test the _thread.list issue after nex commit.
Last edited by loboris on Wed Nov 22, 2017 2:50 pm, edited 2 times in total.
Re: MicroPython on ESP32 with SPIRAM support
Wondering why is the reset reason RTC WDT reset when a hard reset is performed ??
Code: Select all
FreeRTOS running on BOTH CORES, MicroPython task started on App Core.
Reset reason: RTC WDT reset
uPY stack: 19456 bytes
uPY heap: 80000/6752/73248 bytes
MicroPython ESP32_LoBo_v2.0.8 - 2017-11-04 on ESP32 board with ESP32
Type "help()" for more information.