espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.31k stars 7.2k forks source link

Deinitializing SPI bus 'breaks' OV2640 (IDFGH-6877) #8498

Closed JVKran closed 1 month ago

JVKran commented 2 years ago

Environment

Problem Description

When using hardware which consists of an SD-card reader and an OV2640 connected to an ESP32-S3 DevKitC I'm unable to use the OV2640 after unmounting the SD-card. I've narrowed the problem down to spi_bus_free(host.slot); at line 240. When that function isn't called, the camera remains usable.

Expected Behavior

The OV2640 (which I'm using through the esp32-camera component) still works after deinitializing the SPI bus.

Actual Behavior

The OV2640 only prints cam_hal: Failed to get the frame on time!.

Steps to reproduce

  1. Use the attached zip for a complete runnable project, or the GIST linked underneath.
  2. Select the ESP32-S3 as build target.
  3. Build, flash and monitor the project.
  4. Observe taking pictures after spi_bus_free(host.slot); doesn't work.
  5. Change build target to ESP32.
  6. Build, flash and monitor the project.
  7. Observe taking pictures after spi_bus_free(host.slot); still works.

Code to reproduce this issue

See code in GIST or project in sdspi.zip.

JVKran commented 1 month ago

No longer relevant.