Support for ESP32 Quad and Octal SPI on SPI2 and SPI3
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!
Possible bug with Hardware SPI(1) on ESP32-S3
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.