Page 1 of 1

Soft Reboot and SPI

Posted: Wed Jul 06, 2022 7:57 pm
by PM-TPI
# vspi = causes a reboot

Code: Select all

MPY: soft reboot
boot
SmartLOG Start
power latched...
tft backlight set...
Initialize WiFi
WiFi... Activated
Initialize BLE
Bluetooth... Activated
Ambient Sensor... Activated
  # vspi = SPI(2, miso=Pin(19), mosi=Pin(23), sck=Pin(18))   causes.....
E (41926) spi_master: spi_master_deinit_driver(270): not all CSses freed
assertion "atomic_load(&lock->dev[i]) == (intptr_t)NULL" failed: file "/mnt/c/SmartLOG/FW/Build/esp-idf/components/driver/spi_bus_lock.c", line 560, function: spi_bus_deinit_lock

abort() was called at PC 0x401eebe0 on core 0
I am not able to use any file upload tools like mpremote, rshell, and others

see...
https://github.com/dhylands/rshell/issues/27
Apparently this soft-reset maintains the raw REPL status and does not revert to friendly REPL.
But since my ESP32 crashes on the soft reset because the ili9341 driver doesn't cleanly unload,
it doesn't get a raw REPL when it expects one.
I tried the -s version of rshell and it works!!!
But I would need to modify every tool.
I'd rather fix the cause... soft rest causes reboot

and also...
ESP32 - SPI not being reset across soft-reset #4103
https://github.com/micropython/micropython/issues/4103
@dpgeorge
esp32/machine_hw_spi: Make HW SPI objects statically allocated. …
da72bb6
This aligns more closely with the hardware, that there are two, fixed HW
SPI peripherals. And it allows to recreate the HW SPI objects without
error, as well as create them again after a soft reset.

Fixes issue #4103.
I am using 1.17, should have the fix.

Any suggestions or help greatly appreciated !!!