ESP-IDF v6 example code camera-dvp_spi_lcd will not compile

EspAndrew
Posts: 6
Joined: Thu Aug 01, 2024 9:56 pm

ESP-IDF v6 example code camera-dvp_spi_lcd will not compile

Postby EspAndrew » Fri Sep 05, 2025 2:46 pm

I get 1 error when trying to compile

Code: Select all

  ...../camera-dvp_spi_lcd/main/dvp_spi_lcd_main.c:166:18: error: implicit declaration of function 'esp_cam_ctlr_alloc_buffer'; did you mean 'esp_cam_ctlr_get_frame_buffer'? [-Wimplicit-function-declaration]
  166 |     cam_buffer = esp_cam_ctlr_alloc_buffer(cam_handle, cam_buffer_size, EXAMPLE_DVP_CAM_BUF_ALLOC_CAPS);
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                  esp_cam_ctlr_get_frame_buffer
...../camera-dvp_spi_lcd/main/dvp_spi_lcd_main.c:166:16: error: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
In the file example_config.h at line 40 there is:

Code: Select all

#if CONFIG_SPIRAM
#define EXAMPLE_DVP_CAM_BUF_ALLOC_CAPS     (MALLOC_CAP_SPIRAM | MALLOC_CAP_DMA)
but if I click on either MALLOC_CAP_SPIRAM or MALLOC_CAP_DMA and choose Go to Definition it says 'No definition found'.

In sdkconfig.h at line 545 there is

Code: Select all

#define CONFIG_SPIRAM 1
What values should MALLOC_CAP_SPIRAM and MALLOC_CAP_DMA have, and where should they be defined?

ahsrabrifat
Posts: 201
Joined: Sat Jan 18, 2025 2:31 pm

Re: ESP-IDF v6 example code camera-dvp_spi_lcd will not compile

Postby ahsrabrifat » Fri Sep 05, 2025 2:59 pm

Confirm your ESP-IDF version (idf.py --version).

Search in components/esp_cam/include (or similar) whether esp_cam_ctlr_alloc_buffer exists. If not, you’ll need to replace it with heap_caps_malloc(cam_buffer_size, EXAMPLE_DVP_CAM_BUF_ALLOC_CAPS);.

EspAndrew
Posts: 6
Joined: Thu Aug 01, 2024 9:56 pm

Re: ESP-IDF v6 example code camera-dvp_spi_lcd will not compile

Postby EspAndrew » Fri Sep 05, 2025 4:13 pm

ESP-IDF v6.0-dev-986-g5b11d5b26a running on macOS.

I can only find esp_cam_ctlr_alloc_buffer in dvp_spi_lcd_main.c at line 162 right at the beginning of app_main()

Code: Select all

cam_buffer = esp_cam_ctlr_alloc_buffer(cam_handle, cam_buffer_size, EXAMPLE_DVP_CAM_BUF_ALLOC_CAPS);
so its not actually defined anywhere.

I have replaced it with your suggested line and now I get a 5 more errors:

Code: Select all

..../camera-dvp_spi_lcd/main/dvp_spi_lcd_main.c: In function 'lcd_display_init':
..../camera-dvp_spi_lcd/main/dvp_spi_lcd_main.c:96:5:error: implicit declaration of function 'esp_lcd_panel_reset'; did you mean 'esp_lcd_panel_io_del'? [-Wimplicit-function-declaration]
   96 |     esp_lcd_panel_reset(panel_handle);
      |     ^~~~~~~~~~~~~~~~~~~
      |     esp_lcd_panel_io_del
..../camera-dvp_spi_lcd/main/dvp_spi_lcd_main.c:97:5:error: implicit declaration of function 'esp_lcd_panel_init'; did you mean 'esp_lcd_panel_io_del'? [-Wimplicit-function-declaration]
   97 |     esp_lcd_panel_init(panel_handle);
      |     ^~~~~~~~~~~~~~~~~~
      |     esp_lcd_panel_io_del
..../camera-dvp_spi_lcd/main/dvp_spi_lcd_main.c:98:5:error: implicit declaration of function 'esp_lcd_panel_invert_color'; did you mean 'esp_lcd_panel_io_tx_color'? [-Wimplicit-function-declaration]
   98 |     esp_lcd_panel_invert_color(panel_handle, true);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |     esp_lcd_panel_io_tx_color
..../camera-dvp_spi_lcd/main/dvp_spi_lcd_main.c:101:5 error: implicit declaration of function 'esp_lcd_panel_disp_on_off'; did you mean 'esp_lcd_panel_io_del'? [-Wimplicit-function-declaration]
  101 |     esp_lcd_panel_disp_on_off(panel_handle, true);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~
      |     esp_lcd_panel_io_del
..../camera-dvp_spi_lcd/main/dvp_spi_lcd_main.c: In function 's_camera_get_finished_trans':
..../camera-dvp_spi_lcd/main/dvp_spi_lcd_main.c:220:5 error: implicit declaration of function 'esp_lcd_panel_draw_bitmap' [-Wimplicit-function-declaration]
  220 |     esp_lcd_panel_draw_bitmap(ctx->panel_hdl, 0, 0, CONFIG_EXAMPLE_CAM_HRES, CONFIG_EXAMPLE_CAM_VRES, trans->buffer);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~

EspAndrew
Posts: 6
Joined: Thu Aug 01, 2024 9:56 pm

Re: ESP-IDF v6 example code camera-dvp_spi_lcd will not compile

Postby EspAndrew » Sun Sep 07, 2025 12:28 pm

I have now got the example to compile. I had copied the whole dvp_spi_lcd directory to a local project directory and tried to compile it, which gave the errors.
When I compile the dvp_spi_lcd in its original location it compiles properly. The difference is that the example directory ${IDF_PATH}/examples/peripherals/camera also has a directory named common_components at the same level which contains many of the files needed to be included.
So the CMakeLists.txt in its idf_component_register has INCLUDE_DIRS as "." which says to look at the same directory level for include files. They were missing when I copied the example elsewhere and tried to compile.

Gerard
Posts: 7
Joined: Mon Sep 15, 2025 12:53 pm

Re: ESP-IDF v6 example code camera-dvp_spi_lcd will not compile

Postby Gerard » Fri Sep 19, 2025 7:43 pm

I had copied the whole dvp_spi_lcd directory to a local project directory and tried to compile it
I also have that habit, but there is "idf.py create-project-from-example", which may give better results.

Who is online

Users browsing this forum: Applebot, Baidu [Spider], PerplexityBot and 6 guests