espressif / esp-who

Face detection and recognition framework
Other
1.64k stars 458 forks source link

The examples are not running completely correct and they are compiled with a lot of warnings. (AIV-475) #191

Open helmutAtGithub opened 2 years ago

helmutAtGithub commented 2 years ago

Please do not be angry about this headline. I am an old man (60 years old). We were used to compile our code without warnings and and no crash.

  1. No example is compiled without warnings. Only one application does not crash => human_face_detection in terminal
  2. This errors I got in motion detection: W (998) cam_hal: Failed to get the frame on time!

A stack overflow => I think an endless loop or something like this .....
ERROR A stack overflow in task who_camera has been detected.

Backtrace:0x40081cda:0x3ffc8460 0x4008ff91:0x3ffc8480 0x400939ad:0x3ffc84a0 0x40091cf7:0x3ffc8520 0x40090088:0x3ffc8550 0x4009003a:0x3ffc8570 0x400e6123:0x00000001 |<-CORRUPTED A kernel panic !!!!! 0x40081cda: panic_abort at /home/lumi/esp32Eye/esp-idf/components/esp_system/panic.c:393

0x4008ff91: esp_system_abort at /home/lumi/esp32Eye/esp-idf/components/esp_system/system_api.c:112

0x400939ad: vApplicationStackOverflowHook at /home/lumi/esp32Eye/esp-idf/components/freertos/port/xtensa/port.c:490

0x40091cf7: vTaskSwitchContext at /home/lumi/esp32Eye/esp-idf/components/freertos/tasks.c:3296

0x40090088: _frxt_dispatch at /home/lumi/esp32Eye/esp-idf/components/freertos/port/xtensa/portasm.S:432

0x4009003a: _frxt_int_exit at /home/lumi/esp32Eye/esp-idf/components/freertos/port/xtensa/portasm.S:231

0x400e6123: cam_task at /home/lumi/esp32Eye/esp-who/components/esp32-camera/driver/cam_hal.c:111

Rebooting... ets Jun 8 2016 00:22:57

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:1880 load:0x40078000,len:15348 load:0x40080400,len:3708 0x40080400: _init at ??:?

entry 0x400805fc I (361) psram: This chip is ESP32-D0WD I (361) spiram: Found 64MBit SPI RAM device I (362) spiram: SPI RAM mode: flash 80m sram 80m I (364) spiram: PSRAM initialized, cache is in low/high (2-core) mode. I (371) cpu_start: Pro cpu up. I (375) cpu_start: Starting app cpu, entry point is 0x400817f4 0x400817f4: call_start_cpu1 at /home/lumi/esp32Eye/esp-idf/components/esp_system/port/cpu_start.c:150

I (368) cpu_start: App cpu up. I (397) cpu_start: Pro cpu start user code I (397) cpu_start: cpu freq: 240000000 I (397) cpu_start: Application information: I (402) cpu_start: Project name: motion_detection_web I (408) cpu_start: App version: v0.9.3-140-gbb0357d-dirty I (414) cpu_start: Compile time: Dec 9 2021 02:53:07 I (420) cpu_start: ELF file SHA256: 43a4b22797e95f74... I (426) cpu_start: ESP-IDF: v4.3-beta3-1066-g233dc30fb I (433) heap_init: Initializing. RAM available for dynamic allocation: I (440) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM I (446) heap_init: At 3FFBDD98 len 00022268 (136 KiB): DRAM I (452) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM I (459) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM I (465) heap_init: At 4009CBD8 len 00003428 (13 KiB): IRAM I (471) spiram: Adding pool of 4096K of external SPI memory to heap allocator I (480) spi_flash: detected chip: generic I (484) spi_flash: flash io: qio I (490) cpu_start: Starting scheduler on PRO CPU. I (0) cpu_start: Starting scheduler on APP CPU. I (498) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations I (548) wifi:wifi driver task: 3ffcfb98, prio:23, stack:6656, core=0 I (548) system_api: Base MAC address is not set I (548) system_api: read default base MAC address from EFUSE I (558) wifi:wifi firmware version: eb52264 I (558) wifi:wifi certification version: v7.0 I (558) wifi:config NVS flash: enabled I (568) wifi:config nano formating: disabled I (568) wifi:Init data frame dynamic rx buffer num: 32 I (568) wifi:Init management frame dynamic rx buffer num: 32 I (578) wifi:Init management short buffer num: 32 I (578) wifi:Init static tx buffer num: 16 I (588) wifi:Init tx cache buffer num: 32 I (588) wifi:Init static rx buffer size: 1600 I (598) wifi:Init static rx buffer num: 10 I (598) wifi:Init dynamic rx buffer num: 32 I (598) wifi_init: rx ba win: 6 I (608) wifi_init: tcpip mbox: 32 I (608) wifi_init: udp mbox: 6 I (618) wifi_init: tcp mbox: 6 I (618) wifi_init: tcp tx win: 5744 I (618) wifi_init: tcp rx win: 5744 I (628) wifi_init: tcp mss: 1440 I (628) wifi_init: WiFi IRAM OP enabled I (638) wifi_init: WiFi RX IRAM OP enabled I (638) camera wifi: wifi_init_softap finished.SSID:Motion Detection password: I (648) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07 I (738) wifi:mode : softAP (ac:67:b2:56:95:1d) I (738) wifi:Total power save buffer number: 8 I (738) wifi:Init max length of beacon: 752/752 I (738) wifi:Init max length of beacon: 752/752 I (748) wifi:Set ps type: 0

I (748) who_camera: Camera module is ESP-EYE I (748) gpio: GPIO[13]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 I (758) gpio: GPIO[14]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 I (768) gpio: GPIO[5]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:2 I (778) cam_hal: cam init ok I (778) sccb: pin_sda 18 pin_scl 23 I (798) camera: Detected camera at address=0x30 I (798) camera: Detected OV2640 camera I (798) camera: Camera PID=0x26 VER=0x42 MIDL=0x7f MIDH=0xa2 I (878) esp32 ll_cam: node_size: 2560, nodes_per_line: 1, lines_per_node: 1, dma_half_buffer_min: 2560, dma_half_buffer: 15360, lines_per_half_buffer: 6, dma_buffer_size: 30720, image_size: 153600
I (878) cam_hal: buffer_size: 30720, half_buffer_size: 15360, node_buffer_size: 2560, node_cnt: 12, total_cnt: 10 I (888) cam_hal: Allocating 153600 Byte frame buffer in PSRAM I (898) cam_hal: Allocating 153600 Byte frame buffer in PSRAM I (908) cam_hal: cam config ok I (908) ov2640: Set PLL: clk_2x: 0, clk_div: 3, pclk_auto: 1, pclk_div: 8

W (988) cam_hal: Failed to get the frame on time! A hal for all the cams is much to complex !!! (By the way this error is in all examples which are crashing !!!!) ERROR A stack overflow in task who_camera has been detected.

Backtrace:0x40081cda:0x3ffc8460 0x4008ff91:0x3ffc8480 0x400939ad:0x3ffc84a0 0x40091cf7:0x3ffc8520 0x40090088:0x3ffc8550 0x4009003a:0x3ffc8570 0x400e6123:0x00000001 |<-CORRUPTED 0x40081cda: panic_abort at /home/lumi/esp32Eye/esp-idf/components/esp_system/panic.c:393

0x4008ff91: esp_system_abort at /home/lumi/esp32Eye/esp-idf/components/esp_system/system_api.c:112

0x400939ad: vApplicationStackOverflowHook at /home/lumi/esp32Eye/esp-idf/components/freertos/port/xtensa/port.c:490

0x40091cf7: vTaskSwitchContext at /home/lumi/esp32Eye/esp-idf/components/freertos/tasks.c:3296

0x40090088: _frxt_dispatch at /home/lumi/esp32Eye/esp-idf/components/freertos/port/xtensa/portasm.S:432

0x4009003a: _frxt_int_exit at /home/lumi/esp32Eye/esp-idf/components/freertos/port/xtensa/portasm.S:231

0x400e6123: cam_task at /home/lumi/esp32Eye/esp-who/components/esp32-camera/driver/cam_hal.c:111

ELF file SHA256: 43a4b22797e95f74

Rebooting...

I think the main problem is one code for different cams . These leads to a not endless complexity. The best way is to have code for each cam separated. driver and everything for espEye Devkit for example. You should use C++ and separate data and functionality (State, Automat and Materials). Every State has a set of materials and a set of automats and executes this materials and then transit into the next state. I implemented already a library AutomatAndMaterialEmbedded for such purposes. I used design pattern for a good reusing effect. (States as Strategy implemented as an Envelope/Letter System, Materials as simple Composite, Automats as Decorater in an Envelope/Letter System, and a special Factory System to create all this objects) There are code templates for each kind of class ... This would be a nice task, but I would need help to separate all this code.

Best regards Helmut

TiramisuJ commented 2 years ago

@helmutAtGithub I am sorry to bring you a bad experience.

  1. Some warnings come from functions defined but not used in esp-who, some from strange code written for algorithm acceleration, and some from unstable esp-idf. We will try to eliminate these warnings, but it will take some time.
  2. W (998) cam_hal: Failed to get the frame on time! This error is caused by a bug in esp32-camera. you can refer to #184 to fix this bug .

  3. May be due to different configurations,we did not find this stack overflow problem when test esp-who on my esp-eye ,You can temporarily increase the stack size (from 1024 to 4096) to solve this problem (esp-who/components/modules/camera/who_camera.c line86)
  4. Any questions, you can feedback in time.
helmutAtGithub commented 2 years ago

Am 2021-12-09 04:37, schrieb Jiong:

@helmutAtGithub [2] I am sorry to bring you a bad experience.

  • Some warnings come from functions defined but not used in esp-who, some from strange code written for algorithm acceleration, and some from unstable esp-idf. We will try to eliminate these warnings, but it will take some time.

W (998) cam_hal: Failed to get the frame on time! This error is caused by a bug in esp32-camera. you can refer to #184 [1] to fix this bug .

  • May be due to different configurations,we did not find this stack overflow problem when test esp-who on my esp-eye ,You can temporarily increase the stack size (from 1024 to 4096) to solve this problem (esp-who/components/modules/camera/who_camera.c line86)
  • Any questions, you can feedback in time.

-- You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub [3], or unsubscribe [4]. Triage notifications on the go with GitHub Mobile for iOS [5] or Android [6].

Hi Jiong,

thank you very much for your mail. And it is no bad experience !!!! That is our job and we love our job. In every error we will find a way to increase our knowledge. So I will have a look to the points you tell me. And my knowledge will increase by your support.

I want to start to separate the code for espEye into the framework I told you. Is it possible that I can ask you for details. I will show you thee code implemented with the framework.

Best regards to you and let us increase our knowledge together.

Helmut

Links:

[1] https://github.com/espressif/esp-who/issues/184 [2] https://github.com/helmutAtGithub [3] https://github.com/espressif/esp-who/issues/191#issuecomment-989478948 [4] https://github.com/notifications/unsubscribe-auth/AT7SFK23Q73UO33Y4M2RUXLUQAP7NANCNFSM5JVJY2JA [5] https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&amp;mt=8&amp;pt=524675 [6] https://play.google.com/store/apps/details?id=com.github.android&amp;referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub