Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PSRAM support to ESP32S2 #3315

Merged
merged 1 commit into from
Aug 27, 2020
Merged

Add PSRAM support to ESP32S2 #3315

merged 1 commit into from
Aug 27, 2020

Conversation

tannewt
Copy link
Member

@tannewt tannewt commented Aug 21, 2020

When configured the CircuitPython heap will be on the external RAM.
When not available, the heap will be 48k inside the IDF heap.

When configured the CircuitPython heap will be on the external RAM.
When not available, the heap will be 48k inside the IDF heap.
@tannewt tannewt added enhancement espressif applies to multiple Espressif chips labels Aug 21, 2020
@tannewt tannewt added this to the 6.0.0 milestone Aug 21, 2020
@tannewt tannewt requested a review from ladyada August 21, 2020 23:47
@ladyada
Copy link
Member

ladyada commented Aug 21, 2020

hi want me to test on hardware?

@tannewt
Copy link
Member Author

tannewt commented Aug 22, 2020

If you like. I tested on WROVER and FeatherS2 on stream.

@ladyada
Copy link
Member

ladyada commented Aug 22, 2020

ok this loaded onto my saola but i cant seem to get displayio demo on oled running

import board
import busio
import displayio
import adafruit_displayio_ssd1306
displayio.release_displays()

print(dir(board))
i2c = busio.I2C(board.IO8, board.IO9)
display_bus = displayio.I2CDisplay(i2c, device_address=0x3d)
display = adafruit_displayio_ssd1306.SSD1306(display_bus, width=128, height=64)

->

13:31:29.471 -> �[0;32mI (862) cpu_start: Starting scheduler on PRO CPU.�[0m
13:31:42.631 -> Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.
13:31:42.631 -> 
13:31:42.631 -> Core  0 register dump:
13:31:42.631 -> PC      : 0x400aa917  PS      : 0x00060e30  A0      : 0x800b0ddb  A1      : 0x3ffce390  
13:31:42.631 -> A2      : 0x00000000  A3      : 0x00000000  A4      : 0x00000000  A5      : 0x3ffce180  
13:31:42.631 -> A6      : 0x3ff7fc70  A7      : 0x00000001  A8      : 0x800a9e39  A9      : 0x3ffce370  
13:31:42.631 -> A10     : 0x3f00f0ec  A11     : 0x00000000  A12     : 0x3ffcae70  A13     : 0xffffff30  
13:31:42.677 -> A14     : 0x3ffc624c  A15     : 0x00000004  SAR     : 0x00000018  EXCCAUSE: 0x0000001c  
13:31:42.677 -> EXCVADDR: 0x00000004  LBEG    : 0x3ffcae70  LEND    : 0xffffff30  LCOUNT  : 0x40029051  
13:31:42.677 -> 
13:31:42.677 -> Backtrace:0x400aa914:0x3ffce390 0x400b0dd8:0x3ffce3b0 0x400b1e75:0x3ffce3d0 0x400ad213:0x3ffce3f0 0x40091836:0x3ffce410 0x4008d795:0x3ffce430 0x4008d895:0x3ffce450 0x4009abf2:0x3ffce470 0x400918e6:0x3ffce510 0x4008d795:0x3ffce540 0x4008d7c2:0x3ffce560 0x400a747b:0x3ffce580 0x400a77ba:0x3ffce630 0x4009d859:0x3ffce650 0x4009d922:0x3ffce680 0x4009dbcb:0x3ffce6d0 0x4009dd9b:0x3ffce6f0 0x400b7609:0x3ffce710 0x4002dea9:0x3ffce740
13:31:42.724 -> 
13:31:42.724 -> 
13:31:42.724 -> ELF file SHA256: 3b524f297f3f1a35
13:31:42.724 -> 
13:31:42.724 -> CPU halted.

i dont know if its related - this is my first time in a long time trying out circuitpy on esp32s!

@hierophect
Copy link
Collaborator

I'll try a control from main today. That error indicates some kind of invalid memory access, but not a null dereference as per EXCVADDR being nonzero.

@tannewt
Copy link
Member Author

tannewt commented Aug 25, 2020

@ladyada What module does your Saola have? Does it have PSRAM? I suspect your issue may not be related to this PR.

@microdev1
Copy link
Collaborator

I tested PSRAM support on microS2 and it works. 👍

repl_micro_s2_psram

@jerryneedell
Copy link
Collaborator

Works on my saola_wrover

Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 6.0.0-alpha.2-358-gf39708abb on 2020-08-26; Saola 1 w/Wrover with ESP32S2
>>> import gc
>>> gc.mem_free()
2048784
>>> ```

@hierophect
Copy link
Collaborator

I can confirm a null reference exception when attempting to use DisplayIO on the Saola Wrover. Investigating.

@hierophect
Copy link
Collaborator

@ladyada @tannewt I've confirmed that the issue with DisplayIO also happens on main and thus is probably unrelated to this PSRAM update. I've opened a new issue for it here: #3334. @ladyada if you'd like to keep testing this PR, I think most other sketches should still work, you just got unlucky with the one you tried landing on a new bug! It only occurs when the screen is physically plugged in, so removing it should allow you to recover your filesystem.

@dhalbert
Copy link
Collaborator

Should I wait for this for 6.0.0-alpha.3?

@tannewt
Copy link
Member Author

tannewt commented Aug 27, 2020

@dhalbert Want to approve? Seems like it's ready to go in.

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, and has been confirmed as working. Thanks!

@dhalbert dhalbert merged commit 6100027 into adafruit:main Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement espressif applies to multiple Espressif chips
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants