ESP32CAM Fehlermeldung

Hallo liebe Spezialisten,
ich habe stundenlang alles abgesucht aber nicht gefunden woher meine Fehlermeldung kommt.

Dies ist die Meldung aus dem Serial Monitor:

E (546) esp_core_dump_flash:`��o core dump partition found!

E (546) esp_core_dump_flash: No core dump partition found!

[ 16][D][esp32-hal-cpu.c:244] setCpuFrequencyMhz(): PLL: 480 / 2 = 240 Mhz, APB: 80000000 Hz

[ 480][I][esp32-hal-psram.c:96] psramInit(): PSRAM enabled

[ 764][D][WiFiGeneric.cpp:1040] _eventCallback(): Arduino Event: 0 - WIFI_READY

Brownout detector was triggered

ets Jul 29 2019 12:21:46

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)

configsip: 0, SPIWP:0xee

clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00

mode:DIO, clock div:1

load:0x3fff0030,len:1184

load:0x40078000,len:13260

load:0x40080400,len:3028

entry 0x400805e4

E (546) esp_core_dump_flash:`�� �ɕ�dump partition found!

E (546) esp_core_dump_flash: No core dump partition found!

[ 16][D][esp32-hal-cpu.c:244] setCpuFrequencyMhz(): PLL: 480 / 2 = 240 Mhz, APB: 80000000 Hz

[ 480][I][esp32-hal-psram.c:96] psramInit(): PSRAM enabled


Dies ist mein Code:

#include "esp_camera.h"
#include <WiFi.h>

//
// WARNING!!! PSRAM IC required for UXGA resolution and high JPEG quality
//            Ensure ESP32 Wrover Module or other board with PSRAM is selected
//            Partial images will be transmitted if image exceeds buffer size
//
//            You must select partition scheme from the board menu that has at least 3MB APP space.
//            Face Recognition is DISABLED for ESP32 and ESP32-S2, because it takes up from 15 
//            seconds to process single frame. Face Detection is ENABLED if PSRAM is enabled as well

// ===================
// Select camera model
// ===================
//#define CAMERA_MODEL_WROVER_KIT // Has PSRAM
//#define CAMERA_MODEL_ESP_EYE // Has PSRAM
//#define CAMERA_MODEL_ESP32S3_EYE // Has PSRAM
//#define CAMERA_MODEL_M5STACK_PSRAM // Has PSRAM
//#define CAMERA_MODEL_M5STACK_V2_PSRAM // M5Camera version B Has PSRAM
//#define CAMERA_MODEL_M5STACK_WIDE // Has PSRAM
//#define CAMERA_MODEL_M5STACK_ESP32CAM // No PSRAM
//#define CAMERA_MODEL_M5STACK_UNITCAM // No PSRAM
#define CAMERA_MODEL_AI_THINKER // Has PSRAM
//#define CAMERA_MODEL_TTGO_T_JOURNAL // No PSRAM
//#define CAMERA_MODEL_XIAO_ESP32S3 // Has PSRAM
// ** Espressif Internal Boards **
//#define CAMERA_MODEL_ESP32_CAM_BOARD
//#define CAMERA_MODEL_ESP32S2_CAM_BOARD
//#define CAMERA_MODEL_ESP32S3_CAM_LCD
//#define CAMERA_MODEL_DFRobot_FireBeetle2_ESP32S3 // Has PSRAM
//#define CAMERA_MODEL_DFRobot_Romeo_ESP32S3 // Has PSRAM
#include "camera_pins.h"

// ===========================
// Enter your WiFi credentials
// ===========================
const char* ssid = "Fritz!Box 7590 CO";
const char* password = "**überschrieben**";

void startCameraServer();
void setupLedFlash(int pin);

void setup() {
  Serial.begin(115200);
  Serial.setDebugOutput(true);
  Serial.println();

  camera_config_t config;
  config.ledc_channel = LEDC_CHANNEL_0;
  config.ledc_timer = LEDC_TIMER_0;
  config.pin_d0 = Y2_GPIO_NUM;
  config.pin_d1 = Y3_GPIO_NUM;
  config.pin_d2 = Y4_GPIO_NUM;
  config.pin_d3 = Y5_GPIO_NUM;
  config.pin_d4 = Y6_GPIO_NUM;
  config.pin_d5 = Y7_GPIO_NUM;
  config.pin_d6 = Y8_GPIO_NUM;
  config.pin_d7 = Y9_GPIO_NUM;
  config.pin_xclk = XCLK_GPIO_NUM;
  config.pin_pclk = PCLK_GPIO_NUM;
  config.pin_vsync = VSYNC_GPIO_NUM;
  config.pin_href = HREF_GPIO_NUM;
  config.pin_sccb_sda = SIOD_GPIO_NUM;
  config.pin_sccb_scl = SIOC_GPIO_NUM;
  config.pin_pwdn = PWDN_GPIO_NUM;
  config.pin_reset = RESET_GPIO_NUM;
  config.xclk_freq_hz = 20000000;
  config.frame_size = FRAMESIZE_UXGA;
  config.pixel_format = PIXFORMAT_JPEG; // for streaming
  //config.pixel_format = PIXFORMAT_RGB565; // for face detection/recognition
  config.grab_mode = CAMERA_GRAB_WHEN_EMPTY;
  config.fb_location = CAMERA_FB_IN_PSRAM;
  config.jpeg_quality = 12;
  config.fb_count = 1;
  
  // if PSRAM IC present, init with UXGA resolution and higher JPEG quality
  //                      for larger pre-allocated frame buffer.
  if(config.pixel_format == PIXFORMAT_JPEG){
    if(psramFound()){
      config.jpeg_quality = 10;
      config.fb_count = 2;
      config.grab_mode = CAMERA_GRAB_LATEST;
    } else {
      // Limit the frame size when PSRAM is not available
      config.frame_size = FRAMESIZE_SVGA;
      config.fb_location = CAMERA_FB_IN_DRAM;
    }
  } else {
    // Best option for face detection/recognition
    config.frame_size = FRAMESIZE_240X240;
#if CONFIG_IDF_TARGET_ESP32S3
    config.fb_count = 2;
#endif
  }

#if defined(CAMERA_MODEL_ESP_EYE)
  pinMode(13, INPUT_PULLUP);
  pinMode(14, INPUT_PULLUP);
#endif

  // camera init
  esp_err_t err = esp_camera_init(&config);
  if (err != ESP_OK) {
    Serial.printf("Camera init failed with error 0x%x", err);
    return;
  }

  sensor_t * s = esp_camera_sensor_get();
  // initial sensors are flipped vertically and colors are a bit saturated
  if (s->id.PID == OV3660_PID) {
    s->set_vflip(s, 1); // flip it back
    s->set_brightness(s, 1); // up the brightness just a bit
    s->set_saturation(s, -2); // lower the saturation
  }
  // drop down frame size for higher initial frame rate
  if(config.pixel_format == PIXFORMAT_JPEG){
    s->set_framesize(s, FRAMESIZE_QVGA);
  }

#if defined(CAMERA_MODEL_M5STACK_WIDE) || defined(CAMERA_MODEL_M5STACK_ESP32CAM)
  s->set_vflip(s, 1);
  s->set_hmirror(s, 1);
#endif

#if defined(CAMERA_MODEL_ESP32S3_EYE)
  s->set_vflip(s, 1);
#endif

// Setup LED FLash if LED pin is defined in camera_pins.h
#if defined(LED_GPIO_NUM)
  setupLedFlash(LED_GPIO_NUM);
#endif

  WiFi.begin(ssid, password);
  WiFi.setSleep(false);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.println("WiFi connected");

  startCameraServer();

  Serial.print("Camera Ready! Use 'http://");
  Serial.print(WiFi.localIP());
  Serial.println("' to connect");
}

void loop() {
  // Do nothing. Everything is done in another task by the web server
  delay(10000);
}

Das sind meine Upload Parameter:
image

Das ist mein ESP32CAM:



Das ist doch recht offensichtlich!
Oder?

1 Like

Eben.

Also am Anfang vom setup() mal diese Zeile einfügen:

WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0);
1 Like

Ich habe den Code eingefügt aber es klappt nicht:

#include "esp_camera.h"
#include <WiFi.h>

//
// WARNING!!! PSRAM IC required for UXGA resolution and high JPEG quality
//            Ensure ESP32 Wrover Module or other board with PSRAM is selected
//            Partial images will be transmitted if image exceeds buffer size
//
//            You must select partition scheme from the board menu that has at least 3MB APP space.
//            Face Recognition is DISABLED for ESP32 and ESP32-S2, because it takes up from 15 
//            seconds to process single frame. Face Detection is ENABLED if PSRAM is enabled as well

// ===================
// Select camera model
// ===================
//#define CAMERA_MODEL_WROVER_KIT // Has PSRAM
//#define CAMERA_MODEL_ESP_EYE // Has PSRAM
//#define CAMERA_MODEL_ESP32S3_EYE // Has PSRAM
//#define CAMERA_MODEL_M5STACK_PSRAM // Has PSRAM
//#define CAMERA_MODEL_M5STACK_V2_PSRAM // M5Camera version B Has PSRAM
//#define CAMERA_MODEL_M5STACK_WIDE // Has PSRAM
//#define CAMERA_MODEL_M5STACK_ESP32CAM // No PSRAM
//#define CAMERA_MODEL_M5STACK_UNITCAM // No PSRAM
#define CAMERA_MODEL_AI_THINKER // Has PSRAM
//#define CAMERA_MODEL_TTGO_T_JOURNAL // No PSRAM
//#define CAMERA_MODEL_XIAO_ESP32S3 // Has PSRAM
// ** Espressif Internal Boards **
//#define CAMERA_MODEL_ESP32_CAM_BOARD
//#define CAMERA_MODEL_ESP32S2_CAM_BOARD
//#define CAMERA_MODEL_ESP32S3_CAM_LCD
//#define CAMERA_MODEL_DFRobot_FireBeetle2_ESP32S3 // Has PSRAM
//#define CAMERA_MODEL_DFRobot_Romeo_ESP32S3 // Has PSRAM
#include "camera_pins.h"

// ===========================
// Enter your WiFi credentials
// ===========================
const char* ssid = "Fritz!Box 7590 CO";
const char* password = "**geändert**";

void startCameraServer();
void setupLedFlash(int pin);

void setup() {

**WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); // neu hinzugefügt**



  Serial.begin(115200);
  Serial.setDebugOutput(true);
  Serial.println();

  camera_config_t config;
  config.ledc_channel = LEDC_CHANNEL_0;
  config.ledc_timer = LEDC_TIMER_0;
  config.pin_d0 = Y2_GPIO_NUM;
  config.pin_d1 = Y3_GPIO_NUM;
  config.pin_d2 = Y4_GPIO_NUM;
  config.pin_d3 = Y5_GPIO_NUM;
  config.pin_d4 = Y6_GPIO_NUM;
  config.pin_d5 = Y7_GPIO_NUM;
  config.pin_d6 = Y8_GPIO_NUM;
  config.pin_d7 = Y9_GPIO_NUM;
  config.pin_xclk = XCLK_GPIO_NUM;
  config.pin_pclk = PCLK_GPIO_NUM;
  config.pin_vsync = VSYNC_GPIO_NUM;
  config.pin_href = HREF_GPIO_NUM;
  config.pin_sccb_sda = SIOD_GPIO_NUM;
  config.pin_sccb_scl = SIOC_GPIO_NUM;
  config.pin_pwdn = PWDN_GPIO_NUM;
  config.pin_reset = RESET_GPIO_NUM;
  config.xclk_freq_hz = 20000000;
  config.frame_size = FRAMESIZE_UXGA;
  config.pixel_format = PIXFORMAT_JPEG; // for streaming
  //config.pixel_format = PIXFORMAT_RGB565; // for face detection/recognition
  config.grab_mode = CAMERA_GRAB_WHEN_EMPTY;
  config.fb_location = CAMERA_FB_IN_PSRAM;
  config.jpeg_quality = 12;
  config.fb_count = 1;
  
  // if PSRAM IC present, init with UXGA resolution and higher JPEG quality
  //                      for larger pre-allocated frame buffer.
  if(config.pixel_format == PIXFORMAT_JPEG){
    if(psramFound()){
      config.jpeg_quality = 10;
      config.fb_count = 2;
      config.grab_mode = CAMERA_GRAB_LATEST;
    } else {
      // Limit the frame size when PSRAM is not available
      config.frame_size = FRAMESIZE_SVGA;
      config.fb_location = CAMERA_FB_IN_DRAM;
    }
  } else {
    // Best option for face detection/recognition
    config.frame_size = FRAMESIZE_240X240;
#if CONFIG_IDF_TARGET_ESP32S3
    config.fb_count = 2;
#endif
  }

#if defined(CAMERA_MODEL_ESP_EYE)
  pinMode(13, INPUT_PULLUP);
  pinMode(14, INPUT_PULLUP);
#endif

  // camera init
  esp_err_t err = esp_camera_init(&config);
  if (err != ESP_OK) {
    Serial.printf("Camera init failed with error 0x%x", err);
    return;
  }

  sensor_t * s = esp_camera_sensor_get();
  // initial sensors are flipped vertically and colors are a bit saturated
  if (s->id.PID == OV3660_PID) {
    s->set_vflip(s, 1); // flip it back
    s->set_brightness(s, 1); // up the brightness just a bit
    s->set_saturation(s, -2); // lower the saturation
  }
  // drop down frame size for higher initial frame rate
  if(config.pixel_format == PIXFORMAT_JPEG){
    s->set_framesize(s, FRAMESIZE_QVGA);
  }

#if defined(CAMERA_MODEL_M5STACK_WIDE) || defined(CAMERA_MODEL_M5STACK_ESP32CAM)
  s->set_vflip(s, 1);
  s->set_hmirror(s, 1);
#endif

#if defined(CAMERA_MODEL_ESP32S3_EYE)
  s->set_vflip(s, 1);
#endif

// Setup LED FLash if LED pin is defined in camera_pins.h
#if defined(LED_GPIO_NUM)
  setupLedFlash(LED_GPIO_NUM);
#endif

  WiFi.begin(ssid, password);
  WiFi.setSleep(false);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.println("WiFi connected");

  startCameraServer();

  Serial.print("Camera Ready! Use 'http://");
  Serial.print(WiFi.localIP());
  Serial.println("' to connect");
}

void loop() {
  // Do nothing. Everything is done in another task by the web server
  delay(10000);
}

Das gibt die Fehlermeldung:

In file included from C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15/tools/sdk/esp32/include/soc/esp32/include/soc/soc.h:19,
                 from C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15/tools/sdk/esp32/include/soc/include/soc/soc_memory_types.h:20,
                 from C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15/tools/sdk/esp32/include/esp_hw_support/include/soc/compare_set.h:12,
                 from C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15/tools/sdk/esp32/include/esp_hw_support/include/soc/spinlock.h:13,
                 from C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15/tools/sdk/esp32/include/freertos/port/xtensa/include/freertos/portmacro.h:42,
                 from C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15/tools/sdk/esp32/include/freertos/include/freertos/portable.h:51,
                 from C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15/tools/sdk/esp32/include/freertos/include/freertos/FreeRTOS.h:63,
                 from C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15\cores\esp32/Arduino.h:33,
                 from C:\Users\HP\AppData\Local\Temp\arduino\sketches\5A2540E5D1D931359E575A4DCF34346A\sketch\CameraWebServerEG.ino.cpp:1:
C:\Users\HP\Documents\Arduino\CameraWebServerEG\CameraWebServerEG.ino: In function 'void setup()':
C:\Users\HP\Documents\Arduino\CameraWebServerEG\CameraWebServerEG.ino:46:16: error: 'RTC_CNTL_BROWN_OUT_REG' was not declared in this scope
 WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); // neu hinzugefügt
                ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15/tools/sdk/esp32/include/esp_common/include/esp_assert.h:35:38: note: in definition of macro 'TRY_STATIC_ASSERT'
             if (__builtin_constant_p(CONDITION) && !(CONDITION)) {          \
                                      ^~~~~~~~~
C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15/tools/sdk/esp32/include/soc/esp32/include/soc/soc.h:96:57: note: in expansion of macro 'IS_DPORT_REG'
 #define ASSERT_IF_DPORT_REG(_r, OP)  TRY_STATIC_ASSERT(!IS_DPORT_REG(_r), (Cannot use OP for DPORT registers use DPORT_##OP));
                                                         ^~~~~~~~~~~~
C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15/tools/sdk/esp32/include/soc/esp32/include/soc/soc.h:175:13: note: in expansion of macro 'ASSERT_IF_DPORT_REG'
             ASSERT_IF_DPORT_REG((addr), WRITE_PERI_REG);                                                               \
             ^~~~~~~~~~~~~~~~~~~
C:\Users\HP\Documents\Arduino\CameraWebServerEG\CameraWebServerEG.ino:46:1: note: in expansion of macro 'WRITE_PERI_REG'
 WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); // neu hinzugefügt
 ^~~~~~~~~~~~~~
C:\Users\HP\Documents\Arduino\CameraWebServerEG\CameraWebServerEG.ino:46:16: note: suggested alternative: 'CONFIG_BROWNOUT_DET'
 WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); // neu hinzugefügt
                ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15/tools/sdk/esp32/include/esp_common/include/esp_assert.h:35:38: note: in definition of macro 'TRY_STATIC_ASSERT'
             if (__builtin_constant_p(CONDITION) && !(CONDITION)) {          \
                                      ^~~~~~~~~
C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15/tools/sdk/esp32/include/soc/esp32/include/soc/soc.h:96:57: note: in expansion of macro 'IS_DPORT_REG'
 #define ASSERT_IF_DPORT_REG(_r, OP)  TRY_STATIC_ASSERT(!IS_DPORT_REG(_r), (Cannot use OP for DPORT registers use DPORT_##OP));
                                                         ^~~~~~~~~~~~
C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15/tools/sdk/esp32/include/soc/esp32/include/soc/soc.h:175:13: note: in expansion of macro 'ASSERT_IF_DPORT_REG'
             ASSERT_IF_DPORT_REG((addr), WRITE_PERI_REG);                                                               \
             ^~~~~~~~~~~~~~~~~~~
C:\Users\HP\Documents\Arduino\CameraWebServerEG\CameraWebServerEG.ino:46:1: note: in expansion of macro 'WRITE_PERI_REG'
 WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); // neu hinzugefügt
 ^~~~~~~~~~~~~~
In file included from c:\users\hp\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\esp-2021r2-patch5-8.4.0\xtensa-esp32-elf\sys-include\sys\reent.h:503,
                 from C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15/tools/sdk/esp32/include/newlib/platform_include/sys/reent.h:17,
                 from c:\users\hp\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\esp-2021r2-patch5-8.4.0\xtensa-esp32-elf\sys-include\stdio.h:60,
                 from C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15\cores\esp32/Arduino.h:27,
                 from C:\Users\HP\AppData\Local\Temp\arduino\sketches\5A2540E5D1D931359E575A4DCF34346A\sketch\CameraWebServerEG.ino.cpp:1:
C:\Users\HP\Documents\Arduino\CameraWebServerEG\CameraWebServerEG.ino:46:16: error: 'RTC_CNTL_BROWN_OUT_REG' was not declared in this scope
 WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); // neu hinzugefügt
                ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15/tools/sdk/esp32/include/soc/esp32/include/soc/soc.h:96:38: note: in expansion of macro 'TRY_STATIC_ASSERT'
 #define ASSERT_IF_DPORT_REG(_r, OP)  TRY_STATIC_ASSERT(!IS_DPORT_REG(_r), (Cannot use OP for DPORT registers use DPORT_##OP));
                                      ^~~~~~~~~~~~~~~~~
C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15/tools/sdk/esp32/include/soc/esp32/include/soc/soc.h:96:57: note: in expansion of macro 'IS_DPORT_REG'
 #define ASSERT_IF_DPORT_REG(_r, OP)  TRY_STATIC_ASSERT(!IS_DPORT_REG(_r), (Cannot use OP for DPORT registers use DPORT_##OP));
                                                         ^~~~~~~~~~~~
C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15/tools/sdk/esp32/include/soc/esp32/include/soc/soc.h:175:13: note: in expansion of macro 'ASSERT_IF_DPORT_REG'
             ASSERT_IF_DPORT_REG((addr), WRITE_PERI_REG);                                                               \
             ^~~~~~~~~~~~~~~~~~~
C:\Users\HP\Documents\Arduino\CameraWebServerEG\CameraWebServerEG.ino:46:1: note: in expansion of macro 'WRITE_PERI_REG'
 WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); // neu hinzugefügt
 ^~~~~~~~~~~~~~
C:\Users\HP\Documents\Arduino\CameraWebServerEG\CameraWebServerEG.ino:46:16: note: suggested alternative: 'CONFIG_BROWNOUT_DET'
 WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); // neu hinzugefügt
                ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15/tools/sdk/esp32/include/soc/esp32/include/soc/soc.h:96:38: note: in expansion of macro 'TRY_STATIC_ASSERT'
 #define ASSERT_IF_DPORT_REG(_r, OP)  TRY_STATIC_ASSERT(!IS_DPORT_REG(_r), (Cannot use OP for DPORT registers use DPORT_##OP));
                                      ^~~~~~~~~~~~~~~~~
C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15/tools/sdk/esp32/include/soc/esp32/include/soc/soc.h:96:57: note: in expansion of macro 'IS_DPORT_REG'
 #define ASSERT_IF_DPORT_REG(_r, OP)  TRY_STATIC_ASSERT(!IS_DPORT_REG(_r), (Cannot use OP for DPORT registers use DPORT_##OP));
                                                         ^~~~~~~~~~~~
C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15/tools/sdk/esp32/include/soc/esp32/include/soc/soc.h:175:13: note: in expansion of macro 'ASSERT_IF_DPORT_REG'
             ASSERT_IF_DPORT_REG((addr), WRITE_PERI_REG);                                                               \
             ^~~~~~~~~~~~~~~~~~~
C:\Users\HP\Documents\Arduino\CameraWebServerEG\CameraWebServerEG.ino:46:1: note: in expansion of macro 'WRITE_PERI_REG'
 WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); // neu hinzugefügt
 ^~~~~~~~~~~~~~
In file included from C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15/tools/sdk/esp32/include/soc/include/soc/soc_memory_types.h:20,
                 from C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15/tools/sdk/esp32/include/esp_hw_support/include/soc/compare_set.h:12,
                 from C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15/tools/sdk/esp32/include/esp_hw_support/include/soc/spinlock.h:13,
                 from C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15/tools/sdk/esp32/include/freertos/port/xtensa/include/freertos/portmacro.h:42,
                 from C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15/tools/sdk/esp32/include/freertos/include/freertos/portable.h:51,
                 from C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15/tools/sdk/esp32/include/freertos/include/freertos/FreeRTOS.h:63,
                 from C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15\cores\esp32/Arduino.h:33,
                 from C:\Users\HP\AppData\Local\Temp\arduino\sketches\5A2540E5D1D931359E575A4DCF34346A\sketch\CameraWebServerEG.ino.cpp:1:
C:\Users\HP\Documents\Arduino\CameraWebServerEG\CameraWebServerEG.ino:46:16: error: 'RTC_CNTL_BROWN_OUT_REG' was not declared in this scope
 WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); // neu hinzugefügt
                ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15/tools/sdk/esp32/include/soc/esp32/include/soc/soc.h:87:34: note: in definition of macro 'ETS_UNCACHED_ADDR'
 #define ETS_UNCACHED_ADDR(addr) (addr)
                                  ^~~~
C:\Users\HP\Documents\Arduino\CameraWebServerEG\CameraWebServerEG.ino:46:1: note: in expansion of macro 'WRITE_PERI_REG'
 WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); // neu hinzugefügt
 ^~~~~~~~~~~~~~
C:\Users\HP\Documents\Arduino\CameraWebServerEG\CameraWebServerEG.ino:46:16: note: suggested alternative: 'CONFIG_BROWNOUT_DET'
 WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); // neu hinzugefügt
                ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\HP\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15/tools/sdk/esp32/include/soc/esp32/include/soc/soc.h:87:34: note: in definition of macro 'ETS_UNCACHED_ADDR'
 #define ETS_UNCACHED_ADDR(addr) (addr)
                                  ^~~~
C:\Users\HP\Documents\Arduino\CameraWebServerEG\CameraWebServerEG.ino:46:1: note: in expansion of macro 'WRITE_PERI_REG'
 WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); // neu hinzugefügt
 ^~~~~~~~~~~~~~

exit status 1

Compilation error: 'RTC_CNTL_BROWN_OUT_REG' was not declared in this scope

Besten Dank.
Ich bin mit einem anderen Kabel einen Schritt weiter.
Das ist die neue Fehlermeldung:

...[  8162][D][WiFiGeneric.cpp:1040] _eventCallback(): Arduino Event: 5 - STA_DISCONNECTED
[  8170][W][WiFiGeneric.cpp:1062] _eventCallback(): Reason: 201 - NO_AP_FOUND
[  8177][D][WiFiGeneric.cpp:1086] _eventCallback(): WiFi AutoReconnect Running
.ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1184
load:0x40078000,len:13260
load:0x40080400,len:3028
entry 0x400805e4
E (546) esp_core_dump_flash:`��o core dump partition found!
E (546) esp_core_dump_flash: No core dump partition found!
[    16][D][esp32-hal-cpu.c:244] setCpuFrequencyMhz(): PLL: 480 / 2 = 240 Mhz, APB: 80000000 Hz
[   480][I][esp32-hal-psram.c:96] psramInit(): PSRAM enabled

[   764][D][WiFiGeneric.cpp:1040] _eventCallback(): Arduino Event: 0 - WIFI_READY
[   847][D][WiFiGeneric.cpp:1040] _eventCallback(): Arduino Event: 2 - STA_START
....[  3277][D][WiFiGeneric.cpp:1040] _eventCallback(): Arduino Event: 5 - STA_DISCONNECTED
[  3285][W][WiFiGeneric.cpp:1062] _eventCallback(): Reason: 201 - NO_AP_FOUND
[  3292][D][WiFiGeneric.cpp:1082] _eventCallback(): WiFi Reconnect Running

Mein Fehler. Du brauchst noch zusätzliche Header:

#include "soc/soc.h"           // Disable brownour problems
#include "soc/rtc_cntl_reg.h"  // Disable brownour problems
#include "driver/rtc_io.h"

Quelle: Randomnerdtutorials

1 Like

Jetzt erhalte ich diese Fehlermeldung:

[2024-04-26T08:18:15.328Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session connected. You can switch to "DEBUG CONSOLE" to see GDB interactions.
"C:\\Users\\HP\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\openocd-esp32\\v0.12.0-esp32-20230921/bin/openocd" -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s "c:\\Users\\HP\\Documents\\Arduino\\CameraWebServerEG" -f "C:/Program Files/Arduino IDE/resources/app/plugins/cortex-debug/extension/support/openocd-helpers.tcl" -f board/esp32-wrover-kit-3.3v.cfg
Open On-Chip Debugger v0.12.0-esp32-20230921 (2023-09-21-13:40)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
CDRTOSConfigure
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
Info : Listening on port 50001 for tcl connections
Info : Listening on port 50002 for telnet connections
Error: unable to open ftdi device with description '*', serial '*' at bus location '*'
C:/Users/HP/AppData/Local/Arduino15/packages/esp32/tools/openocd-esp32/v0.12.0-esp32-20230921/bin/../share/openocd/scripts/target/esp_common.cfg:9: Error: 
at file "C:/Users/HP/AppData/Local/Arduino15/packages/esp32/tools/openocd-esp32/v0.12.0-esp32-20230921/bin/../share/openocd/scripts/target/esp_common.cfg", line 9
[2024-04-26T08:18:15.590Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
GDB server session ended. This terminal will be reused, waiting for next session to start...

Das ist der Code in der esp_common.cfg

# SPDX-License-Identifier: GPL-2.0-or-later
#

set CPU_MAX_ADDRESS 0xFFFFFFFF
source [find bitsbytes.tcl]
source [find memory.tcl]
source [find mmr_helpers.tcl]

catch {[source [find target/esp_version.cfg]]}
set _OPENOCD_VER [ version ]
if { [info exists EXPECTED_VER] && [string first $EXPECTED_VER $_OPENOCD_VER] == -1 } {
    echo "WARNING!!! OpenOCD binary version ($_OPENOCD_VER) doesn't match the .cfg file version ($EXPECTED_VER)"
}

# Riscv Debug Module Registers which are used around esp configuration files.
set _RISCV_ABS_DATA0	0x04
set _RISCV_DMCONTROL	0x10
set _RISCV_ABS_CMD		0x17
set _RISCV_SB_CS		0x38
set _RISCV_SB_ADDR0		0x39
set _RISCV_SB_DATA0		0x3C

# Common ESP chips definitions
set _RTOS "FreeRTOS"
if { [info exists ESP_RTOS] } {
	set _RTOS "$ESP_RTOS"
}

# by default current dir (when OOCD has been started)
set _SEMIHOST_BASEDIR "."
if { [info exists ESP_SEMIHOST_BASEDIR] } {
	set _SEMIHOST_BASEDIR $ESP_SEMIHOST_BASEDIR
}

set _FLASH_SIZE "auto"
if { [info exists ESP_FLASH_SIZE] } {
	set _FLASH_SIZE $ESP_FLASH_SIZE
}

set _ESP_IDF_HOST "0"
if { [info exists ESP_IDF_HOST] } {
	set _ESP_IDF_HOST $ESP_IDF_HOST
}

proc set_esp_common_variables { } {
	global _CHIPNAME _ONLYCPU _ESP_SMP_TARGET
	global _CPUNAME_0 _CPUNAME_1 _TARGETNAME_0 _TARGETNAME_1 _TAPNAME_0 _TAPNAME_1
	global _ESP_WDT_DISABLE _ESP_SOC_RESET _ESP_MEMPROT_IS_ENABLED

	# For now we support dual core at most.
	if { $_ONLYCPU == 1 && $_ESP_SMP_TARGET == 0} {
		set _TARGETNAME_0 				$_CHIPNAME
		set _CPUNAME_0					cpu
		set _TAPNAME_0 					$_CHIPNAME.$_CPUNAME_0
	} else {
		set _CPUNAME_0 					cpu0
		set _CPUNAME_1 					cpu1
		set _TARGETNAME_0 				$_CHIPNAME.$_CPUNAME_0
		set _TARGETNAME_1 				$_CHIPNAME.$_CPUNAME_1
		set _TAPNAME_0 					$_TARGETNAME_0
		set _TAPNAME_1 					$_TARGETNAME_1
	}

	set _ESP_WDT_DISABLE 			"${_CHIPNAME}_wdt_disable"
	set _ESP_SOC_RESET 				"${_CHIPNAME}_soc_reset"
	set _ESP_MEMPROT_IS_ENABLED 	"${_CHIPNAME}_memprot_is_enabled"
}

proc create_esp_jtag { } {
	global _CHIPNAME _CPUNAME_0 _CPUNAME_1 _CPUTAPID _ONLYCPU
	jtag newtap $_CHIPNAME $_CPUNAME_0 -irlen 5 -expected-id $_CPUTAPID
	if { $_ONLYCPU != 1 } {
		jtag newtap $_CHIPNAME $_CPUNAME_1 -irlen 5 -expected-id $_CPUTAPID
	} elseif [info exists _CPUNAME_1] {
		jtag newtap $_CHIPNAME $_CPUNAME_1 -irlen 5 -disable -expected-id $_CPUTAPID
	}
}

proc create_openocd_targets  { } {
	global _TARGETNAME_0 _TARGETNAME_1 _TAPNAME_0 _TAPNAME_1 _RTOS _CHIPNAME _ONLYCPU

	target create $_TARGETNAME_0 $_CHIPNAME -chain-position $_TAPNAME_0 -coreid 0 -rtos $_RTOS
	if { $_ONLYCPU != 1 } {
		target create $_TARGETNAME_1 $_CHIPNAME -chain-position $_TAPNAME_1 -coreid 1 -rtos $_RTOS
		target smp $_TARGETNAME_0 $_TARGETNAME_1
	}
}

proc create_esp_target { ARCH } {
	set_esp_common_variables
	create_esp_jtag
	create_openocd_targets
	configure_esp_flash_settings
	configure_openocd_events $ARCH

	if { $ARCH == "xtensa"} {
		configure_esp_xtensa_default_settings
	} else {
		configure_esp_riscv_default_settings
	}
}

#################### Set event handlers and default settings  ####################

proc configure_event_examine_fail { } {
	global _ESP_IDF_HOST _TARGETNAME_0

	if { $_ESP_IDF_HOST == 1 } {
		$_TARGETNAME_0 configure -event examine-fail {
			esp examine_failed_handler
		}
	}
}

proc configure_event_examine_end { } {
	global _TARGETNAME_0 _TARGETNAME_1 _ONLYCPU

	$_TARGETNAME_0 configure -event examine-end {
		# Need to enable to set 'semihosting_basedir'
		arm semihosting enable
		arm semihosting_resexit enable
		if { [info exists _SEMIHOST_BASEDIR] } {
			if { $_SEMIHOST_BASEDIR != "" } {
				arm semihosting_basedir $_SEMIHOST_BASEDIR
			}
		}
	}

	if { $_ONLYCPU != 1 } {
		$_TARGETNAME_1 configure -event examine-end {
			# Need to enable to set 'semihosting_basedir'
			arm semihosting enable
			arm semihosting_resexit enable
			if { [info exists _SEMIHOST_BASEDIR] } {
				if { $_SEMIHOST_BASEDIR != "" } {
					arm semihosting_basedir $_SEMIHOST_BASEDIR
				}
			}
		}
	}
}

proc configure_event_reset_assert_post { } {
	global _TARGETNAME_0 _TARGETNAME_1 _ONLYCPU

	$_TARGETNAME_0 configure -event reset-assert-post {
		global _ESP_SOC_RESET
		$_ESP_SOC_RESET
	}

	if { $_ONLYCPU != 1 } {
		$_TARGETNAME_1 configure -event reset-assert-post {
			global _ESP_SOC_RESET
			$_ESP_SOC_RESET
		}
	}
}

proc configure_event_gdb_detach { } {
	global _TARGETNAME_0 _TARGETNAME_1 _ONLYCPU

	$_TARGETNAME_0 configure -event gdb-detach {
		$_TARGETNAME_0 esp gdb_detach_handler
	}

	if { $_ONLYCPU != 1 } {
		$_TARGETNAME_1 configure -event gdb-detach {
			$_TARGETNAME_1 esp gdb_detach_handler
		}
	}
}

proc configure_event_halted { } {
	global _TARGETNAME_0

	$_TARGETNAME_0 configure -event halted {
		global _ESP_WDT_DISABLE
	    $_ESP_WDT_DISABLE
	    esp halted_event_handler
	}
}
proc configure_event_gdb_attach { } {
	global _TARGETNAME_0 _TARGETNAME_1 _ONLYCPU _ESP_ARCH

	$_TARGETNAME_0 configure -event gdb-attach {
		if { $_ESP_SMP_BREAK != 0 } {
			$_TARGETNAME_0 xtensa smpbreak BreakIn BreakOut
		}
		# necessary to auto-probe flash bank when GDB is connected and generate proper memory map
		halt 1000
		if { [$_ESP_MEMPROT_IS_ENABLED] } {
			# 'reset halt' to disable memory protection and allow flasher to work correctly
			echo "Memory protection is enabled. Reset target to disable it..."
			reset halt
		}

		if { $_ESP_ARCH == "riscv" } {
			# by default mask interrupts while stepping
			riscv set_maskisr steponly
		}
	}

	if { $_ONLYCPU != 1 } {
		$_TARGETNAME_1 configure -event gdb-attach {
			if { $_ESP_SMP_BREAK != 0 } {
				$_TARGETNAME_1 xtensa smpbreak BreakIn BreakOut
			}
			# necessary to auto-probe flash bank when GDB is connected
			halt 1000
			if { [$_ESP_MEMPROT_IS_ENABLED] } {
				# 'reset halt' to disable memory protection and allow flasher to work correctly
				echo "Memory protection is enabled. Reset target to disable it..."
				reset halt
			}
		}
	}
}

proc configure_openocd_events { ARCH } {
	if { $ARCH == "riscv" } {
		configure_event_halted
	}
	configure_event_examine_fail
	configure_event_examine_end
	configure_event_reset_assert_post
	configure_event_gdb_attach
	configure_event_gdb_detach
}

proc configure_esp_riscv_default_settings { } {
	global _FLASH_SIZE
	if { $_FLASH_SIZE == 0 } {
		gdb_breakpoint_override hard
	}

	riscv set_reset_timeout_sec 2
	riscv set_command_timeout_sec 5
	riscv set_mem_access sysbus progbuf abstract
	riscv set_ebreakm on
	riscv set_ebreaks on
	riscv set_ebreaku on
}

proc configure_esp_xtensa_default_settings { } {
	global _FLASH_SIZE _TARGETNAME_0 _ESP_SMP_BREAK _FLASH_VOLTAGE _CHIPNAME

	$_TARGETNAME_0 xtensa maskisr on
	if { $_ESP_SMP_BREAK != 0 } {
		$_TARGETNAME_0 xtensa smpbreak BreakIn BreakOut
	}

	if { $_FLASH_SIZE == 0 } {
		gdb_breakpoint_override hard
	}

	if { [info exists _FLASH_VOLTAGE] } {
		$_TARGETNAME_0 $_CHIPNAME flashbootstrap $_FLASH_VOLTAGE
	}
}

#################### ESP Stub flasher configuration ####################

proc configure_esp_workarea { TGT WA_ADDR WA_SZ } {
	#WARNING: be careful when selecting working ares for code and data, they should not overlap due to ESP32 physical memory mappings
	$TGT configure -work-area-phys $WA_ADDR -work-area-virt $WA_ADDR -work-area-size $WA_SZ -work-area-backup 1
}

proc configure_esp_workarea_backups { wab_list } {
	set index 0
	foreach tgt [target names] {
		$tgt configure -work-area-backup [lindex $wab_list $index]
		incr $index
	}
}

proc configure_esp_flash_bank { TGT DRV SIZE } {
	set _SIZE SIZE
	if { $SIZE == 0 } {
		echo "WARNING: ESP flash support is disabled!"
		return
	} else {
		if { $SIZE == "auto" } {
			# special value for flash driver
			set _SIZE 0
		}
	}
	# whole flash for programming purposes
	# TODO: remove it when support for GDB's 'load' comand is implemented
	flash bank $TGT.flash $DRV 0x0 $_SIZE 0 0 $TGT
	# So define mapped flash regions as separate flashes
	# OOCD creates memory map using registered flash banks
	flash bank $TGT.irom $DRV 0x0 0 0 0 $TGT
	flash bank $TGT.drom $DRV 0x0 0 0 0 $TGT
}

proc configure_esp_flash_settings { } {
	global _TARGETNAME_0 _TARGETNAME_1 _CHIPNAME _ONLYCPU
	global _WA_ADDR _WA_SIZE _FLASH_SIZE

	configure_esp_workarea $_TARGETNAME_0 $_WA_ADDR $_WA_SIZE
	configure_esp_flash_bank $_TARGETNAME_0 $_CHIPNAME $_FLASH_SIZE

	if { $_ONLYCPU != 1 } {
		configure_esp_flash_bank $_TARGETNAME_1 $_CHIPNAME $_FLASH_SIZE
	}
}

#################### Functions to program ESP chips ####################

# special function to program ESP chip, it differs from the original 'program' that
# it verifies written image by reading flash directly, instead of reading memory mapped flash regions
proc program_esp {filename args} {
	set exit 0
	set compress 0
	set clock_boost 1
	set restore_clock 0
	set encrypt 0

	set flash_list_size [llength [flash list]]
	if { $flash_list_size == 0} {
		program_error "** ESP flash programming is not supported yet! **" $exit
	}

	echo "** program_esp input args <$args> **"

	# Place quotes around the path in case it contains spaces
	set filename "\"$filename\""

	set start_time [clock milliseconds]

	foreach arg $args {
		if {[string equal $arg "verify"]} {
			set verify 1
		} elseif {[string equal $arg "reset"]} {
			set reset 1
		} elseif {[string equal $arg "exit"]} {
			set exit 1
		} elseif {[string equal $arg "compress"]} {
			set compress 1
		} elseif {[string equal $arg "no_clock_boost"]} {
			set clock_boost 0
		} elseif {[string equal $arg "restore_clock"]} {
			set restore_clock 1
		} elseif {[string equal $arg "encrypt"]} {
			set encrypt 1
		} else {
			set address $arg
		}
	}

	if {$clock_boost == 0} {
		set restore_clock 0
	}

	# make sure init is called
	if {[catch {init}] != 0} {
		program_error "** OpenOCD init failed **" 1
	}

	# reset target and call any init scripts
	if {[catch {reset init}] != 0} {
		program_error "** Unable to reset target **" $exit
	}

	set wab_list {}
	foreach tgt [target names] {
		lappend wab_list [$tgt cget -work-area-backup]
		$tgt configure -work-area-backup 0
	}

	if {$compress == 1} {
		eval esp compression "on"
	} else {
		eval esp compression "off"
	}

	# If encrypt == 1, binary encryption will be handled by the chip.
	# Otherwise binary will be written as plaintext.
	if {$encrypt == 1} {
		eval esp encrypt_binary "yes"
	} else {
		eval esp encrypt_binary "no"
	}

	# start programming phase
	echo "** Programming Started **"
	if {[info exists address]} {
		set flash_args "$filename $address"
	} else {
		set flash_args "$filename"
	}

	if {$clock_boost == 1} {
		if {[catch {eval esp flash_stub_clock_boost "on"}] != 0} {
			program_error "** Clock configuration set failed **" $exit
		}
	}

	if {[catch {eval flash write_image erase $flash_args}] == 0} {
		set stop_time [expr {[clock milliseconds] - $start_time}]
		echo "** Programming Finished in $stop_time ms **"
		if {[info exists verify]} {
			# verify phase
			echo "** Verify Started **"
			if {[catch {eval esp verify_bank_hash 0 $flash_args}] == 0} {
				echo "** Verify OK **"
			} else {
				configure_esp_workarea_backups $wab_list
				if {$restore_clock == 1} {
					eval esp flash_stub_clock_boost "off"
				}
				program_error "** Verify Failed **" $exit
			}
		}

		configure_esp_workarea_backups $wab_list

		if {$restore_clock == 1} {
			if {[catch {eval esp flash_stub_clock_boost "off"}] != 0} {
				program_error "** Clock configuration restore failed **" $exit
			}
		}

		if {[info exists reset]} {
			# reset target if requested
			echo "** Resetting Target **"
			reset run
		}
	} else {
		configure_esp_workarea_backups $wab_list
		if {$restore_clock == 1} {
			eval esp flash_stub_clock_boost "off"
		}
		program_error "** Programming Failed **" $exit
	}

	if {$exit == 1} {
		shutdown
	}
	return
}

add_help_text program_esp "write an image to flash, address is only required for binary images. verify, reset, exit, compress, restore_clock and encrypt are optional"
add_usage_text program_esp "<filename> \[address\] \[verify\] \[reset\] \[exit\] \[compress\] \[no_clock_boost\] \[restore_clock\] \[encrypt\]"

proc program_esp_bins {build_dir filename args} {
	set exit 0
	set compress 0
	set clock_boost 1
	set restore_clock 0

	foreach arg $args {
		if {[string equal $arg "reset"]} {
			set reset 1
		} elseif {[string equal $arg "verify"]} {
			set verify 1
		} elseif {[string equal $arg "exit"]} {
			set exit 1
		} elseif {[string equal $arg "compress"]} {
			set compress 1
		} elseif {[string equal $arg "no_clock_boost"]} {
			set clock_boost 0
		} elseif {[string equal $arg "restore_clock"]} {
			set restore_clock 1
		} else {
			echo "** Unsupported arg $arg, skipping **"
		}
	}

	# Open and Read file
	set fp [open [file join $build_dir $filename] r]
	set file_data [read $fp]
	close $fp

	# Decode JSON to dict
	set flasher_args [json::decode $file_data]
	set flasher_args_keys [dict keys $flasher_args]
	set flash_files [dict get $flasher_args flash_files]

	set start_time [clock milliseconds]

	foreach addr [dict keys $flash_files] {
		set bin_file [dict get $flash_files $addr]
		set bin_file_path [file join $build_dir $bin_file]

		# Place quotes around the path in case it contains spaces
		set bin_file_path "\"$bin_file_path\""

		echo "Flashing $bin_file_path at $addr"

		if {[info exists verify]} {
			set flash_args "$bin_file_path $addr verify"
		} else {
			set flash_args "$bin_file_path $addr"
		}

		if {$compress == 1} {
			append flash_args " compress"
		}

		if {$clock_boost == 0} {
			append flash_args " no_clock_boost"
		}

		if {$restore_clock == 1} {
			append flash_args " restore_clock"
		}

		# Search inner 'offset' key in all json objects. 
		# If (offset:address) is matched, get 'encrypted' value from the matched json object.
		foreach key $flasher_args_keys {
			if {[dict exists $flasher_args $key offset]} {
				if { $addr == [dict get $flasher_args $key offset] } {
					set partition_encrypted false
					if { [dict exists $flasher_args $key encrypted] } {
						set partition_encrypted [dict get $flasher_args $key encrypted]
					}
					# If partition->encrypted is true, then stub code must call flash_write_encrypted()
					# To do so, encrypt command set to be yes.
					# We can set it here or better send it as a parameter to the "program_esp" to avoid duplication.
					if { $partition_encrypted == true } {
						append flash_args " encrypt"
					}
				}
			}
		}

		set t1 [clock milliseconds]
		if {[ catch { eval program_esp  $flash_args} ] == 0} {
			set t2 [expr {[clock milliseconds] - $t1}]
			echo "** Flashing done for $bin_file in $t2 ms **"
		} else {
			echo "** Flashing Failed **"
			return -1
		}
	}
	set stop_time [expr {[clock milliseconds] - $start_time}]
	echo "** Total programming time $stop_time ms **"

	# Reset
	if {[info exists reset]} {
		echo "** Resetting Target **"
		reset run
	}

	# Exit
	if {$exit == 1} {
		shutdown
	}

	return 0
}

add_help_text program_esp_bins "write all the images at address specified in flasher_args.json generated while building idf project"
add_usage_text program_esp_bins "<build_dir> flasher_args.json \[verify\] \[reset\] \[exit\] \[compress\] \[no_clock_boost\] \[restore_clock\]"

proc esp_get_mac {args} {
	global _ESP_EFUSE_MAC_ADDR_REG _ESP_ARCH

	foreach arg $args {
		if {[string equal $arg "format"]} {
			set format 1
		}
	}

	if { $_ESP_ARCH == "xtensa" } {
		xtensa set_permissive 1
		set mac_list [read_memory $_ESP_EFUSE_MAC_ADDR_REG 8 6]
		xtensa set_permissive 0
	} else {
		set mac_list [read_memory $_ESP_EFUSE_MAC_ADDR_REG 8 6]
	}

	set i 0
	foreach n $mac_list {
		set mac($i) $n
		incr i
	}

	if {[info exists format]}  {
		format %02x:%02x:%02x:%02x:%02x:%02x $mac(5) $mac(4) $mac(3) $mac(2) $mac(1) $mac(0)
	} else {
		format 0x0000%02x%02x%02x%02x%02x%02x $mac(5) $mac(4) $mac(3) $mac(2) $mac(1) $mac(0)
	}
}

add_help_text esp_get_mac "Print MAC address of the chip. Use a `format` argument to return formatted MAC value"
add_usage_text esp_get_mac "\[format\]"

# arm semihosting must be enabled before calling this function
proc esp_semihost_basedir {dir} {
	foreach tgt [target names] {
		$tgt arm semihosting_basedir $dir
	}
}

Es hat geklappt. Die json waren falsch

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.