flash m5stack fisheyes camera ov2640



  • Hello,

    I am a beginner and I want to flash my camera :
    I try with ESP-IDF but i have an error with my Windows10.
    It'll be to simple with Arduino.
    I just want to connect this cam to supervisor.
    Now, I can't use it. Cant you help me please

    Thank you


  • M5Stack

    Hey @Tchill73 if you want to use the stock firmware you can use the m5burner tool https://m5stack.com/pages/download if you have your own firmware its better to use esptool



  • Hello @Tchill73, please post the Arduino error message. I used m5stack cam with ESP-IDF and it worked fine.



  • Hello, tank you for your reply.

    I tried with the firmeware for the camera F but it does not work.
    M5camera V1.0.0
    error :
    17:37:46.943 -> E (90518) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
    17:37:46.943 -> E (90518) task_wdt: - IDLE0 (CPU 0)
    17:37:46.943 -> E (90518) task_wdt: Tasks currently running:
    17:37:46.943 -> E (90518) task_wdt: CPU 0: main
    17:37:46.943 -> E (90518) task_wdt: CPU 1: IDLE1

    I try with ESP-IDF (Windows 10)
    5stack-cam-psram-master\m5stack-cam-psram-master\wifi\wifi_sta\firmware\Camera F
    I am sure there is not much missing

    The error is :

    'FAILED: esp-idf/main/CMakeFiles/__idf_main.dir/main.c.obj
    ccache C:.espressif\tools\xtensa-esp32-elf\esp-2020r1-8.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-gcc.exe -DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -Iconfig -I../main -I../../../../components/newlib/platform_include -I../../../../components/freertos/include -I../../../../components/freertos/xtensa/include -I../../../../components/heap/include -I../../../../components/log/include -I../../../../components/lwip/include/apps -I../../../../components/lwip/include/apps/sntp -I../../../../components/lwip/lwip/src/include -I../../../../components/lwip/port/esp32/include -I../../../../components/lwip/port/esp32/include/arch -I../../../../components/soc/src/esp32/. -I../../../../components/soc/src/esp32/include -I../../../../components/soc/include -I../../../../components/esp_rom/include -I../../../../components/esp_common/include -I../../../../components/esp_system/include -I../../../../components/xtensa/include -I../../../../components/xtensa/esp32/include -I../../../../components/esp32/include -I../../../../components/driver/include -I../../../../components/driver/esp32/include -I../../../../components/esp_ringbuf/include -I../../../../components/efuse/include -I../../../../components/efuse/esp32/include -I../../../../components/espcoredump/include -I../../../../components/esp_timer/include -I../../../../components/soc/soc/esp32/. -I../../../../components/soc/soc/esp32/include -I../../../../components/soc/soc/esp32/../include -I../../../../components/vfs/include -I../../../../components/esp_wifi/include -I../../../../components/esp_wifi/esp32/include -I../../../../components/esp_event/include -I../../../../components/esp_netif/include -I../../../../components/esp_eth/include -I../../../../components/tcpip_adapter/include -I../../../../components/app_trace/include -I../../../../components/mbedtls/port/include -I../../../../components/mbedtls/mbedtls/include -I../../../../components/mbedtls/esp_crt_bundle/include -I../../../../components/bootloader_support/include -I../../../../components/app_update/include -I../../../../components/spi_flash/include -I../../../../components/wpa_supplicant/include -I../../../../components/wpa_supplicant/port/include -I../../../../components/wpa_supplicant/include/esp_supplicant -I../../../../components/nvs_flash/include -I../../../../components/pthread/include -I../../../../components/perfmon/include -I../../../../components/asio/asio/asio/include -I../../../../components/asio/port/include -I../../../../components/cbor/port/include -I../../../../components/coap/port/include -I../../../../components/coap/port/include/coap -I../../../../components/coap/libcoap/include -I../../../../components/coap/libcoap/include/coap2 -I../../../../components/console -I../../../../components/nghttp/port/include -I../../../../components/nghttp/nghttp2/lib/includes -I../../../../components/esp-tls -I../../../../components/esp_adc_cal/include -I../../../../components/esp_gdbstub/include -I../../../../components/tcp_transport/include -I../../../../components/esp_http_client/include -I../../../../components/esp_http_server/include -I../../../../components/esp_https_ota/include -I../../../../components/protobuf-c/protobuf-c -I../../../../components/protocomm/include/common -I../../../../components/protocomm/include/security -I../../../../components/protocomm/include/transports -I../../../../components/mdns/include -I../../../../components/esp_local_ctrl/include -I../../../../components/sdmmc/include -I../../../../components/esp_serial_slave_link/include -I../../../../components/esp_websocket_client/include -I../../../../components/expat/expat/expat/lib -I../../../../components/expat/port/include -I../../../../components/wear_levelling/include -I../../../../components/fatfs/diskio -I../../../../components/fatfs/vfs -I../../../../components/fatfs/src -I../../../../components/freemodbus/common/include -I../../../../components/idf_test/include -I../../../../components/idf_test/include/esp32 -I../../../../components/jsmn/include -I../../../../components/json/cJSON -I../../../../components/libsodium/libsodium/src/libsodium/include -I../../../../components/libsodium/port_include -I../../../../components/mqtt/esp-mqtt/include -I../../../../components/openssl/include -I../../../../components/spiffs/include -I../../../../components/ulp/include -I../../../../components/unity/include -I../../../../components/unity/unity/src -I../../../../components/wifi_provisioning/include -I../components/esp32-camera/driver/include -I../components/esp32-camera/conversions/include -mlongcalls -Wno-frame-address -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -ggdb -Og -std=gnu99 -Wno-old-style-declaration -D_GNU_SOURCE -DIDF_VER="v4.2-dev-1126-gd85d3d969" -DESP_PLATFORM -MD -MT esp-idf/main/CMakeFiles/__idf_main.dir/main.c.obj -MF esp-idf\main\CMakeFiles__idf_main.dir\main.c.obj.d -o esp-idf/main/CMakeFiles/__idf_main.dir/main.c.obj -c ../main/main.c
    In file included from ../main/main.c:15:
    ../../../../components/esp_event/include/esp_event_loop.h:2:2: warning: #warning "esp_event_loop.h is deprecated, please include esp_event.h instead" [-Wcpp]
    #warning "esp_event_loop.h is deprecated, please include esp_event.h instead"
    ^~~~~~~
    In file included from ../main/main.c:9:
    ../main/main.c: In function 'event_handler':
    ../main/main.c:238:47: warning: passing argument 1 of 'ip4addr_ntoa' from incompatible pointer type [-Wincompatible-pointer-types]
    ESP_LOGI(TAG, "got ip:%s", ip4addr_ntoa(&event->event_info.got_ip.ip_info.ip));
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../../../components/log/include/esp_log.h:329:137: note: in definition of macro 'ESP_LOG_LEVEL'
    if (level==ESP_LOG_ERROR ) { esp_log_write(ESP_LOG_ERROR, tag, LOG_FORMAT(E, format), esp_log_timestamp(), tag, ##VA_ARGS); }
    ^~~~~~~~~~~
    ../../../../components/log/include/esp_log.h:296:38: note: in expansion of macro 'ESP_LOG_LEVEL_LOCAL'
    #define ESP_LOGI( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_INFO, tag, format, ##VA_ARGS)
    ^~~~~~~~~~~~~~~~~~~
    ../main/main.c:238:7: note: in expansion of macro 'ESP_LOGI'
    ESP_LOGI(TAG, "got ip:%s", ip4addr_ntoa(&event->event_info.got_ip.ip_info.ip));
    ^~~~~~~~
    In file included from ../../../../components/lwip/lwip/src/include/lwip/ip_addr.h:43,
    from ../../../../components/tcpip_adapter/include/tcpip_adapter_types.h:18,
    from ../../../../components/tcpip_adapter/include/tcpip_adapter.h:24,
    from ../../../../components/esp_netif/include/esp_netif.h:35,
    from ../../../../components/esp_event/include/esp_event_legacy.h:22,
    from ../../../../components/esp_event/include/esp_event.h:26,
    from ../../../../components/esp_wifi/include/esp_wifi.h:64,
    from ../main/main.c:11:
    ../../../../components/lwip/lwip/src/include/lwip/ip4_addr.h:207:7: note: expected 'const ip4_addr_t *' {aka 'const struct ip4_addr *'} but argument is of type 'esp_ip4_addr_t *' {aka 'struct esp_ip4_addr *'}
    char *ip4addr_ntoa(const ip4_addr_t *addr);
    ^~~~~~~~~~~~
    In file included from ../main/main.c:9:
    ../main/main.c:238:47: warning: passing argument 1 of 'ip4addr_ntoa' from incompatible pointer type [-Wincompatible-pointer-types]
    ESP_LOGI(TAG, "got ip:%s", ip4addr_ntoa(&event->event_info.got_ip.ip_info.ip));
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../../../components/log/include/esp_log.h:330:137: note: in definition of macro 'ESP_LOG_LEVEL'
    else if (level==ESP_LOG_WARN ) { esp_log_write(ESP_LOG_WARN, tag, LOG_FORMAT(W, format), esp_log_timestamp(), tag, ##VA_ARGS); }
    ^~~~~~~~~~~
    ../../../../components/log/include/esp_log.h:296:38: note: in expansion of macro 'ESP_LOG_LEVEL_LOCAL'
    #define ESP_LOGI( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_INFO, tag, format, ##VA_ARGS)
    ^~~~~~~~~~~~~~~~~~~
    ../main/main.c:238:7: note: in expansion of macro 'ESP_LOGI'
    ESP_LOGI(TAG, "got ip:%s", ip4addr_ntoa(&event->event_info.got_ip.ip_info.ip));
    ^~~~~~~~
    In file included from ../../../../components/lwip/lwip/src/include/lwip/ip_addr.h:43,
    from ../../../../components/tcpip_adapter/include/tcpip_adapter_types.h:18,
    from ../../../../components/tcpip_adapter/include/tcpip_adapter.h:24,
    from ../../../../components/esp_netif/include/esp_netif.h:35,
    from ../../../../components/esp_event/include/esp_event_legacy.h:22,
    from ../../../../components/esp_event/include/esp_event.h:26,
    from ../../../../components/esp_wifi/include/esp_wifi.h:64,
    from ../main/main.c:11:
    ../../../../components/lwip/lwip/src/include/lwip/ip4_addr.h:207:7: note: expected 'const ip4_addr_t *' {aka 'const struct ip4_addr *'} but argument is of type 'esp_ip4_addr_t *' {aka 'struct esp_ip4_addr *'}
    char *ip4addr_ntoa(const ip4_addr_t *addr);
    ^~~~~~~~~~~~
    In file included from ../main/main.c:9:
    ../main/main.c:238:47: warning: passing argument 1 of 'ip4addr_ntoa' from incompatible pointer type [-Wincompatible-pointer-types]
    ESP_LOGI(TAG, "got ip:%s", ip4addr_ntoa(&event->event_info.got_ip.ip_info.ip));
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../../../components/log/include/esp_log.h:331:137: note: in definition of macro 'ESP_LOG_LEVEL'
    else if (level==ESP_LOG_DEBUG ) { esp_log_write(ESP_LOG_DEBUG, tag, LOG_FORMAT(D, format), esp_log_timestamp(), tag, ##VA_ARGS); }
    ^~~~~~~~~~~
    ../../../../components/log/include/esp_log.h:296:38: note: in expansion of macro 'ESP_LOG_LEVEL_LOCAL'
    #define ESP_LOGI( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_INFO, tag, format, ##VA_ARGS)
    ^~~~~~~~~~~~~~~~~~~
    ../main/main.c:238:7: note: in expansion of macro 'ESP_LOGI'
    ESP_LOGI(TAG, "got ip:%s", ip4addr_ntoa(&event->event_info.got_ip.ip_info.ip));
    ^~~~~~~~
    In file included from ../../../../components/lwip/lwip/src/include/lwip/ip_addr.h:43,
    from ../../../../components/tcpip_adapter/include/tcpip_adapter_types.h:18,
    from ../../../../components/tcpip_adapter/include/tcpip_adapter.h:24,
    from ../../../../components/esp_netif/include/esp_netif.h:35,
    from ../../../../components/esp_event/include/esp_event_legacy.h:22,
    from ../../../../components/esp_event/include/esp_event.h:26,
    from ../../../../components/esp_wifi/include/esp_wifi.h:64,
    from ../main/main.c:11:
    ../../../../components/lwip/lwip/src/include/lwip/ip4_addr.h:207:7: note: expected 'const ip4_addr_t *' {aka 'const struct ip4_addr *'} but argument is of type 'esp_ip4_addr_t *' {aka 'struct esp_ip4_addr *'}
    char *ip4addr_ntoa(const ip4_addr_t *addr);
    ^~~~~~~~~~~~
    In file included from ../main/main.c:9:
    ../main/main.c:238:47: warning: passing argument 1 of 'ip4addr_ntoa' from incompatible pointer type [-Wincompatible-pointer-types]
    ESP_LOGI(TAG, "got ip:%s", ip4addr_ntoa(&event->event_info.got_ip.ip_info.ip));
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../../../components/log/include/esp_log.h:332:137: note: in definition of macro 'ESP_LOG_LEVEL'
    else if (level==ESP_LOG_VERBOSE ) { esp_log_write(ESP_LOG_VERBOSE, tag, LOG_FORMAT(V, format), esp_log_timestamp(), tag, ##VA_ARGS); }
    ^~~~~~~~~~~
    ../../../../components/log/include/esp_log.h:296:38: note: in expansion of macro 'ESP_LOG_LEVEL_LOCAL'
    #define ESP_LOGI( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_INFO, tag, format, ##VA_ARGS)
    ^~~~~~~~~~~~~~~~~~~
    ../main/main.c:238:7: note: in expansion of macro 'ESP_LOGI'
    ESP_LOGI(TAG, "got ip:%s", ip4addr_ntoa(&event->event_info.got_ip.ip_info.ip));
    ^~~~~~~~
    In file included from ../../../../components/lwip/lwip/src/include/lwip/ip_addr.h:43,
    from ../../../../components/tcpip_adapter/include/tcpip_adapter_types.h:18,
    from ../../../../components/tcpip_adapter/include/tcpip_adapter.h:24,
    from ../../../../components/esp_netif/include/esp_netif.h:35,
    from ../../../../components/esp_event/include/esp_event_legacy.h:22,
    from ../../../../components/esp_event/include/esp_event.h:26,
    from ../../../../components/esp_wifi/include/esp_wifi.h:64,
    from ../main/main.c:11:
    ../../../../components/lwip/lwip/src/include/lwip/ip4_addr.h:207:7: note: expected 'const ip4_addr_t *' {aka 'const struct ip4_addr *'} but argument is of type 'esp_ip4_addr_t *' {aka 'struct esp_ip4_addr *'}
    char *ip4addr_ntoa(const ip4_addr_t *addr);
    ^~~~~~~~~~~~
    In file included from ../main/main.c:9:
    ../main/main.c:238:47: warning: passing argument 1 of 'ip4addr_ntoa' from incompatible pointer type [-Wincompatible-pointer-types]
    ESP_LOGI(TAG, "got ip:%s", ip4addr_ntoa(&event->event_info.got_ip.ip_info.ip));
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../../../components/log/include/esp_log.h:333:137: note: in definition of macro 'ESP_LOG_LEVEL'
    else { esp_log_write(ESP_LOG_INFO, tag, LOG_FORMAT(I, format), esp_log_timestamp(), tag, ##VA_ARGS); }
    ^~~~~~~~~~~
    ../../../../components/log/include/esp_log.h:296:38: note: in expansion of macro 'ESP_LOG_LEVEL_LOCAL'
    #define ESP_LOGI( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_INFO, tag, format, ##VA_ARGS)
    ^~~~~~~~~~~~~~~~~~~
    ../main/main.c:238:7: note: in expansion of macro 'ESP_LOGI'
    ESP_LOGI(TAG, "got ip:%s", ip4addr_ntoa(&event->event_info.got_ip.ip_info.ip));
    ^~~~~~~~
    In file included from ../../../../components/lwip/lwip/src/include/lwip/ip_addr.h:43,
    from ../../../../components/tcpip_adapter/include/tcpip_adapter_types.h:18,
    from ../../../../components/tcpip_adapter/include/tcpip_adapter.h:24,
    from ../../../../components/esp_netif/include/esp_netif.h:35,
    from ../../../../components/esp_event/include/esp_event_legacy.h:22,
    from ../../../../components/esp_event/include/esp_event.h:26,
    from ../../../../components/esp_wifi/include/esp_wifi.h:64,
    from ../main/main.c:11:
    ../../../../components/lwip/lwip/src/include/lwip/ip4_addr.h:207:7: note: expected 'const ip4_addr_t *' {aka 'const struct ip4_addr *'} but argument is of type 'esp_ip4_addr_t *' {aka 'struct esp_ip4_addr *'}
    char *ip4addr_ntoa(const ip4_addr_t *addr);
    ^~~~~~~~~~~~
    ../main/main.c:239:17: error: incompatible types when assigning to type 'ip4_addr_t' {aka 'struct ip4_addr'} from type 'esp_ip4_addr_t' {aka 'struct esp_ip4_addr'}
    s_ip_addr = event->event_info.got_ip.ip_info.ip;
    ^
    ../main/main.c: In function 'wifi_init_softap':
    ../main/main.c:266:3: warning: 'tcpip_adapter_init' is deprecated [-Wdeprecated-declarations]
    tcpip_adapter_init();
    ^~~~~~~~~~~~~~~~~~
    In file included from ../../../../components/esp_netif/include/esp_netif.h:35,
    from ../../../../components/esp_event/include/esp_event_legacy.h:22,
    from ../../../../components/esp_event/include/esp_event.h:26,
    from ../../../../components/esp_wifi/include/esp_wifi.h:64,
    from ../main/main.c:11:
    ../../../../components/tcpip_adapter/include/tcpip_adapter.h:34:6: note: declared here
    void tcpip_adapter_init(void) attribute ((deprecated));
    ^~~~~~~~~~~~~~~~~~
    ../main/main.c:267:3: warning: 'esp_event_loop_init' is deprecated [-Wdeprecated-declarations]
    ESP_ERROR_CHECK(esp_event_loop_init(event_handler, NULL));
    ^~~~~~~~~~~~~~~
    In file included from ../../../../components/esp_event/include/esp_event.h:26,
    from ../../../../components/esp_wifi/include/esp_wifi.h:64,
    from ../main/main.c:11:
    ../../../../components/esp_event/include/esp_event_legacy.h:227:11: note: declared here
    esp_err_t esp_event_loop_init(system_event_cb_t cb, void *ctx) attribute ((deprecated));
    ^~~~~~~~~~~~~~~~~~~
    [926/936] Building C object esp-idf/esp32-camera/CMakeFiles/__idf_esp32-camera.dir/driver/camera.c.obj
    In file included from ../components/esp32-camera/driver/camera.c:22:
    ../../../../components/esp32/include/rom/lldesc.h:1:2: warning: #warning rom/lldesc.h is deprecated, please use esp32/rom/lldesc.h instead [-Wcpp]
    #warning rom/lldesc.h is deprecated, please use esp32/rom/lldesc.h instead
    ^~~~~~~
    In file included from ../components/esp32-camera/driver/private_include/camera_common.h:6,
    from ../components/esp32-camera/driver/camera.c:35:
    ../../../../components/esp32/include/rom/lldesc.h:1:2: warning: #warning rom/lldesc.h is deprecated, please use esp32/rom/lldesc.h instead [-Wcpp]
    #warning rom/lldesc.h is deprecated, please use esp32/rom/lldesc.h instead
    ^~~~~~~
    [927/936] Building CXX object esp-idf/esp32-camera/CMakeFiles/__idf_esp32-camera.dir/conversions/to_jpg.cpp.obj
    In file included from ../components/esp32-camera/conversions/to_jpg.cpp:16:
    ../../../../components/esp32/include/esp_spiram.h:1:2: warning: #warning esp_spiram.h has been replaced by esp32/spiram.h, please include esp32/spiram.h instead [-Wcpp]
    #warning esp_spiram.h has been replaced by esp32/spiram.h, please include esp32/spiram.h instead'

    ninja: build stopped: subcommand failed.
    ninja failed with exit code 1



  • Can you post your folder Sdkconfig please
    maybe , there is an incorrect parameter.



  • @Tchill73 Which esp-idf version did you use? You can get the Version with: $ git describe



  • @sheepdog said in flash m5stack fisheyes camera ov2640:

    Which esp-idf version did you use? You can get the Version with: $ git describe

    In the begining with esp-idf v4.2
    And with esp-idf 3.3 realease
    can't finish "build"

    Adding ESP-IDF tools to PATH...
    Not using an unsupported version of tool xtensa-esp32-elf found in PATH: esp-2020r1-8.2.0.
    Not using an unsupported version of tool cmake found in PATH: 3.16.4.
    Not using an unsupported version of tool openocd-esp32 found in PATH: v0.10.0-esp32-20200406.
    Not using an unsupported version of tool ninja found in PATH: 1.10.0.
    C:\Users\oxyrace.espressif\tools\xtensa-esp32-elf\1.22.0-80-g6c4433a5-5.2.0\xtensa-esp32-elf\bin
    C:\Users\oxyrace.espressif\tools\esp32ulp-elf\2.28.51.20170517\esp32ulp-elf-binutils\bin
    C:\Users\oxyrace.espressif\tools\cmake\3.13.4\bin
    C:\Users\oxyrace.espressif\tools\openocd-esp32\v0.10.0-esp32-20190313\openocd-esp32\bin
    C:\Users\oxyrace.espressif\tools\mconf\v4.6.0.0-idf-20190628
    C:\Users\oxyrace.espressif\tools\ninja\1.9.0
    C:\Users\oxyrace.espressif\tools\idf-exe\1.0.1
    C:\Users\oxyrace.espressif\tools\ccache\3.7
    C:\Users\oxyrace.espressif\python_env\idf3.3_py3.8_env\Scripts

    [836/837] Linking CXX executable camera.elf
    FAILED: camera.elf
    cmd.exe /C "cd . && C:\Users\oxyrace.espressif\tools\xtensa-esp32-elf\1.22.0-80-g6c4433a5-5.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-g++.exe -mlongcalls -nostdlib @CMakeFiles\camera.elf.rsp -o camera.elf && cd ."
    esp-idf/main/libmain.a(main.c.obj):(.literal.app_main+0x18): undefined reference to led_brightness' esp-idf/main/libmain.a(main.c.obj): In functionapp_main':
    D:\ESP32\esp-idf\examples\m5stack\wifi\wifi_sta\build/../main/main.c:89: undefined reference to `led_brightness'
    collect2.exe: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.
    ninja failed with exit code 1