Closed robert-hh closed 5 years ago
Hello Robert,
I think the function argument is misleading... please refer to the ESP32 Technical Reference manual.
The alt argument here expects the signal number (see Table 17 in the TRM).
It seems that if you assign a signal to a pin, such as U0RXD_in/out (14) it is unassigned from the original GPIO pin, for example you loose the REPL if you try p=Pin('P11', Pin.IN, alt=14) I believe the reason it crashes when passing 1 (signal SPIQ_in/out) is that the processor no longer has access to the flash and SRAM because the quad spi IO signal is being re-routed to a new pin.
We should probably add some code to not allow such "dangerous" IO re-assignments. And check the documentation to make sure it properly explains what this argument does. Thanks a lot for bringing it up.
OK. That was just a blind trial, not considering the TRM. I'll close that for now. But at least it should be documented.
Trying to set the alternate function on a Pin causes a core dump. Dump below: