Giter Site home page Giter Site logo

Comments (8)

anticitizn avatar anticitizn commented on July 23, 2024 2

Hello, I was just confronted with this as well. The cause is that the program is trying to allocate memory in PSRAM, but by default the PSRAM component is not included. You have to add esp_psram yourself like this:

./main/CMakeLists.txt

idf_component_register(SRCS take_picture.c
                        PRIV_INCLUDE_DIRS .
                        PRIV_REQUIRES nvs_flash esp_psram)

A minimal test to see if PSRAM is working:

#include <esp_psram.h>

size_t psram_size = esp_psram_get_size();
printf("PSRAM size: %d bytes\n", psram_size);

Also make sure to set your PSRAM to the correct mode (Octal or Quad, depending on your board) in idf.py menuconfig or the VSCode extension, or whatever you use to configure that. Espressif's development environment is a bit confusing..

from esp32-camera.

1308470235 avatar 1308470235 commented on July 23, 2024 2

The problem was solved by adding this parameter .fb_location = CAMERA_FB_IN_DRAM,

from esp32-camera.

ahmedtariqh avatar ahmedtariqh commented on July 23, 2024

I have just the same error!
tried with arduino framework and the code works great!
it seems that the idf is missing something in the camera initialization

from esp32-camera.

anticitizn avatar anticitizn commented on July 23, 2024

Another thing which seems to cause me grief is this line in the camera config in take_picture.c:

    //XCLK 20MHz or 10MHz for OV2640 double FPS (Experimental)
    .xclk_freq_hz = 20000000,

My camera apparently didn't like the 20 MHz mode and only worked sporadically. When I changed it to 10000000 Hz, it started working fine.

from esp32-camera.

anticitizn avatar anticitizn commented on July 23, 2024

That solved your issue precisely because PSRAM (slow but big external RAM) was not enabled. DRAM (small but fast internal ram) however is quite small so you can only take quite small pictures, SVGA and below I believe. If you need bigger resolutions try the fix above.

from esp32-camera.

1308470235 avatar 1308470235 commented on July 23, 2024

Hello, I was just confronted with this as well. The cause is that the program is trying to allocate memory in PSRAM, but by default the PSRAM component is not included. You have to add esp_psram yourself like this:你好,我刚刚也遇到了这个问题。原因是程序试图在 PSRAM 中分配内存,但默认情况下不包括 PSRAM 组件。你必须像这样添加自己:你好,我也刚刚遇到了这个问题。原因是程序试图在 PSRAM 中分配内存,但默认情况下不包括 PSRAM 组件。你必须这样添加自己:

./main/CMakeLists.txt./main/CMakeLists.txt./main/CMakeLists.txt

idf_component_register(SRCS take_picture.c
                        PRIV_INCLUDE_DIRS .
                        PRIV_REQUIRES nvs_flash esp_psram)

A minimal test to see if PSRAM is working:检查 PSRAM 是否正常工作的最小测试:查看PSRAM是否正常工作的最小测试:

#include <esp_psram.h>

size_t psram_size = esp_psram_get_size();
printf("PSRAM size: %d bytes\n", psram_size);

Also make sure to set your PSRAM to the correct mode (Octal or Quad, depending on your board) in idf.py menuconfig or the VSCode extension, or whatever you use to configure that. Espressif's development environment is a bit confusing..另请确保在 VSCode 扩展或任何用于配置的内容中将 PSRAM 设置为正确的模式(八进制或四进制,具体取决于您的主板)。乐鑫的开发环境有点混乱..此外,请确保将 PSRAM 设置为正确的模式(八进制或四进制,具体取决于您的主板)或 VSCode 扩展,或用于配置该扩展的任何内容。乐鑫的开发环境有点混乱。

thank you Although I don’t understand much, I’m very grateful. The problem has been solved.

from esp32-camera.

1308470235 avatar 1308470235 commented on July 23, 2024

That solved your issue precisely because PSRAM (slow but big external RAM) was not enabled. DRAM (small but fast internal ram) however is quite small so you can only take quite small pictures, SVGA and below I believe. If you need bigger resolutions try the fix above.这恰恰解决了您的问题,因为 PSRAM(缓慢但大的外部 RAM)未启用。然而,DRAM(小但快速的内部内存)非常小,因此您只能拍摄很小的照片,我相信是 SVGA 及以下。如果您需要更大的分辨率,请尝试上面的修复。

Can you write a simple example? I didn't understand how you solved it. I think you're right. I combined the ap example with the camera example and got an error again. I think it's the problem you mentioned.

from esp32-camera.

github-actions avatar github-actions commented on July 23, 2024

This issue appears to be stale. Please close it if its no longer valid.

from esp32-camera.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.