← index #11082Issue #11941
Related · high · value 0.360
QUERY · ISSUE

RP2 SPI: Instantiating with spi=None does not behave sensibly.

openby peterhinchopened 2023-03-20updated 2024-09-02
bugport-rp2

The constructor accepts None as an arg to miso, but still instantiates the default pin.

The clear intent is to create an output-only interface. Either it should reject the arg or (preferably) it should not instantiate a pin. Current behaviour can lead to unexpected pin conflicts.

This should also apply to mosi.

CANDIDATE · ISSUE

ESP32 serie: SPI 2 fails silently when not using a miso pin, and additionally crashes the MCU when the ESP is a ESP32S3

closedby VynDragonopened 2023-07-05updated 2023-07-25
bugport-esp32

On 1.20.0 and master, with ESP-IDF 5.1 and 4.4.5, interacting with SPI bus 2 silently fail without miso pin assigned, this is not the case for SPI 1.

On ESP32S3, this additionaly causes the ESP to throw a panic and reset.

to reproduce on any, initialize the SPI 2 with parameters similar to SPI 1:
display_spi = machine.SPI(2,baudrate=27000000,sck=machine.Pin(18, machine.Pin.OUT),mosi=machine.Pin(13, machine.Pin.OUT))
Any attempts to use the bus after this will result in nothing.

Additionaly, any SPI command on ESP32S3's SPI2 without initializing the full set of pins (sck, mosi, and miso) will instantly crash the ESP and yield no exploitable error message or log.

for example:machine.SPI(2) will result in a panic screen and reset

Expected result

Either a error message like SoftSPI, or the ability to use only 2 pins on regular ESP32 like SPI 1
Additionaly, no crash and panic on ESP32S3.

https://github.com/micropython/micropython/issues/11918

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