-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PSRAM does not work in Person Detection example with XIAO ESP32S3 Sense and no PSRAM-related configuration option available in menuconfig (TFMIC-9) #70
Comments
After tens of hours of testing, I discovered a fix (along with more issues, which I have solved). By chance, I discovered that by enabling ESP32 S3 EYE BSP option in menuconfig (instead of the camera pin out of my specific board as an option I added manually), PSRAM would function normally and the system would crash at initializing the camera. The latter part is expected, but the former part gave me the intuition to later discover the fix. The fix is to install the generic BSP dependency: espressif/esp_bsp_generic. I then ran into an issue where when I try to add any dependency through command line, I would get this: Executing action: add-dependency
ERROR: Environment variable "TFLITE_USE_BSP_S3_EYE" is not set I have no idea why this environment variable is related to adding dependencies, nor do I think I changed something I shouldn't to cause this to happen. I got around this problem by adding the dependency directly to the idf_component.yml file, which allowed the project to correctly build with this generic BSP dependency. After which, everything worked out smoothly. PSRAM was successfully initialized and frame buffers were allocated to the PSRAM. I don't have enough technical experience to find out the root cause of this issue, heck, I can't even figure out how the sdkconfig file is generated; I could have just manually added the PSRAM configuration options if I figured out how sdkconfig file worked. That said, this workaround does solve the problem, so I will leave it to the author of this repository to figure out. |
For the lack of psram option, we probably have to add esp_psram component over here:
/cc @tore-espressif regarding the add-dependency issue. |
@chrisy810 Thank you for the detailed report!
EDIT: The second issue will be fixed in upcoming release of idf-component-manager |
@chrisy810 the issues should have been fixed with this change already merged to master: 85fdecd |
When will this change be published with a new release? |
Ok, so I found the correct pin config for the camera on Seeed Studio XIAO ESP32S3 Sense: But HREF and Y9 are outside the range of the kconfig settings for these pins. After adjusting the ranges, settings the custom cam default pins to the ones from the link I do not get the PSRAM error any longer, but instant cpu1 crashes: Boot/Exception log: |
Here is how I configured XIAO ESP32S3 for the person detection example:
Please let me know if you face more issues. I recently completed a TinyML project using XIAO ESP32S3. I should be fairly familiar with the person detection example in this repo, which I used as a framework to build my project upon. |
I need to reinstall esp-idf without VSCode. This managed environment is only causing issues for me. So the main points are indeed the added BSP dependency: espressif/esp_bsp_generic Thanks @chrisy810 ! Oh and merry christmas! |
you can allocate memory for your TensorArena on PSRAM.
|
My board is XIAO ESP32S3 Sense, which has 8MB of PSRAM. When testing out the person detection example, after setting up the camera pins, I was able to successfully run it with camera frame buffers allocated to DRAM. If I allocate to PSRAM, I will receive the error below when initializing. I also was not able to find PSRAM related settings in menuconfig despite being on the latest ESP-IDF version, while these options are available in a new project. My development environment is VSCode on Windows 11. Same issue persists when switching to a different Windows 11 machine with the same setup and source code, and when switching to a different XIAO ESP32S3 Sense instance. PSRAM also functions properly for examples in Arduino IDE that require PSRAM.
The text was updated successfully, but these errors were encountered: