← index #12124Issue #8634
Related · high · value 1.123
QUERY · ISSUE

Support for ESP32 Quad and Octal SPI on SPI2 and SPI3

openby shantzis62opened 2023-07-30updated 2024-08-22

I have an ESP32S3 project that requires a high bandwidth between the MCU and an external device. The only feature blocking the use of micropython is its lack of support for ESP32's multi-line SPI (Quad and Octal). I looked over the SPI code in ports/esp32 and it looks pretty doable. I'm considering adding it and sending a PR. Before I do so, though, I'm wondering how I should expose it in a module. I think the most sensible thing would be to create a separate esp32.QSPI class (and perhaps an esp32.OctalSPI class).

I'd be interested in hearing what people think.

Thanks!

CANDIDATE · ISSUE

Possible bug with Hardware SPI(1) on ESP32-S3

closedby beyonloopened 2022-05-05updated 2025-04-24
port-esp32

Hi all.

I'm using the ESP32-S3-WROOM-1 (N8R2 - 8MB Flash and 2 MB RAM), specifically this kit: ESP32-S3-DEVKITC-1-N8R2

The hardware SPI is working just on the SPI(2). The SPI(1) do not works.

As I know, the ESP32-S3, like as the ESP32 has two free Hardware SPI to use (SPI 1 and SPI 2). It has 4 in total, but two SPI (SPI 3 and SPI 4) are used by the RAM/FLASH. So, should works Hardware SPI number 1 and number 2, right?

Follow the tests with the ESP32-S3:

>>> import os
>>> os.uname()
(sysname='esp32', nodename='esp32', release='1.18.0', version='v1.18 on 2022-05-05', machine='ESP32S3 module (spiram) with ESP32S3')
>>> 
>>> from machine import SPI, Pin
>>> 
>>> spi  = SPI(1, baudrate=5_000_000, phase=1, sck=Pin(15), mosi=Pin(16), miso=Pin(17))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: invalid configuration
>>> 
>>> spi  = SPI(2, baudrate=5_000_000, phase=1, sck=Pin(15), mosi=Pin(16), miso=Pin(17))
>>> 
>>> spi  = SPI(3, baudrate=5_000_000, phase=1, sck=Pin(15), mosi=Pin(16), miso=Pin(17))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: SPI(3) doesn't exist
>>> 
>>> spi  = SPI(4, baudrate=5_000_000, phase=1, sck=Pin(15), mosi=Pin(16), miso=Pin(17))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: SPI(4) doesn't exist
>>> 

Follow below the same test with the ESP32:

>>> import os
>>> os.uname()
(sysname='esp32', nodename='esp32', release='1.18.0', version='v1.18 on 2022-01-17', machine='ESP32 module with ESP32')
>>> 
>>> from machine import SPI, Pin
>>> spi  = SPI(1, baudrate=5_000_000, phase=1, sck=Pin(15), mosi=Pin(16), miso=Pin(17))
>>> 
>>> spi  = SPI(2, baudrate=5_000_000, phase=1, sck=Pin(15), mosi=Pin(16), miso=Pin(17))
>>> 
>>> spi  = SPI(3, baudrate=5_000_000, phase=1, sck=Pin(15), mosi=Pin(16), miso=Pin(17))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: SPI(3) doesn't exist
>>> spi  = SPI(4, baudrate=5_000_000, phase=1, sck=Pin(15), mosi=Pin(16), miso=Pin(17))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: SPI(4) doesn't exist
>>> 

I missed some configuration or is really a BUG?

Thank you.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied