seeed-solution / sensecap_indicator_esp32 Goto Github PK
View Code? Open in Web Editor NEWSenseCAP Indicator SDK.
Home Page: https://wiki.seeedstudio.com/SenseCAP_Indicator_How_To_Flash_The_Default_Firmware/#ESP-IDF
License: Apache License 2.0
SenseCAP Indicator SDK.
Home Page: https://wiki.seeedstudio.com/SenseCAP_Indicator_How_To_Flash_The_Default_Firmware/#ESP-IDF
License: Apache License 2.0
There are two problems:
921600
. there is no suitable cable for Indicator to connect.During compile of the /examples/indicator_basis, the following errors occurred:
n file included from /home/fabian/Desktop/indicator/SenseCAP_Indicator_ESP32/examples/indicator_basis/main/view/indicator_view.h:4,
from /home/fabian/Desktop/indicator/SenseCAP_Indicator_ESP32/examples/indicator_basis/main/main.c:10:
/home/fabian/Desktop/indicator/SenseCAP_Indicator_ESP32/examples/indicator_basis/main/view_data.h:68:5: error: unknown type name 'time_t'
68 | time_t time; // use when auto_update is true
| ^~~~~~
/home/fabian/Desktop/indicator/SenseCAP_Indicator_ESP32/examples/indicator_basis/main/view_data.h:80:5: error: unknown type name 'time_t'
80 | time_t timestamp;
| ^~~~~~
/home/fabian/Desktop/indicator/SenseCAP_Indicator_ESP32/examples/indicator_basis/main/view_data.h:88:5: error: unknown type name 'time_t'
88 | time_t timestamp;
| ^~~~~~
This can be resolved by including <time.h> in the view_data.h directly.
I have not checked if the time.h is already included within an earlier include, I have checked this problem by getting the newest esp IDF (ESP-IDF v5.1.2-dirty), on an updated Linux machine.
indicator_hr is showing one hour less than it should
Time Auto Update: ON
timezone Europe/Berlin
two possible culprits:
E (9522) esp-tls-mbedtls: mbedtls_ssl_setup returned -0x7F00
E (9523) esp-tls: create_ssl_handle failed
E (9524) esp-tls: Failed to open new connection
E (9534) city: Connection failed...
I (10536) city: Get time zone...
E (10583) esp-tls-mbedtls: mbedtls_ssl_setup returned -0x7F00
E (10584) esp-tls: create_ssl_handle failed
E (10584) esp-tls: Failed to open new connection
E (10595) city: Connection failed...
I (11596) city: Get time zone...
E (11642) esp-tls-mbedtls: mbedtls_ssl_setup returned -0x7F00
E (11643) esp-tls: create_ssl_handle failed
E (11643) esp-tls: Failed to open new connection
IDF version: ESP-IDF v5.4-dev-610-g003f3bb5dc
I have managed to flash the button
and esp32_rp2040_comm
examples without any problems. I've also managed to run console
, including connecting to WiFi and pinging websites. But any example starting with indicator_
fails to boot on device, including indicator_basis
. Find a video and a log from indicator_ha
below. Looking forward for a nudge in a right direction.
--- esp-idf-monitor 1.4.0 on /dev/cu.usbserial-11110 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce2820,len:0x198c
load:0x403c8700,len:0x4
load:0x403c8704,len:0xe5c
load:0x403cb700,len:0x3058
entry 0x403c893c
I (27) boot: ESP-IDF v5.4-dev-610-g003f3bb5dc 2nd stage bootloader
I (27) boot: compile time May 29 2024 13:22:31
I (27) boot: Multicore bootloader
I (31) boot: chip revision: v0.2
I (35) qio_mode: Enabling QIO for flash chip WinBond
I (41) boot.esp32s3: Boot SPI Speed : 80MHz
I (46) boot.esp32s3: SPI Mode : QIO
I (50) boot.esp32s3: SPI Flash Size : 8MB
I (55) boot: Enabling RNG early entropy source...
I (61) boot: Partition Table:
I (64) boot: ## Label Usage Type ST Offset Length
I (71) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (79) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (86) boot: 2 factory factory app 00 00 00010000 00400000
I (94) boot: End of partition table
I (98) esp_image: segment 0: paddr=00010020 vaddr=3c100020 size=12a59ch (1222044) map
I (292) esp_image: segment 1: paddr=0013a5c4 vaddr=3fc9dd00 size=05820h ( 22560) load
I (296) esp_image: segment 2: paddr=0013fdec vaddr=40374000 size=0022ch ( 556) load
I (298) esp_image: segment 3: paddr=00140020 vaddr=42000020 size=f3a18h (997912) map
I (457) esp_image: segment 4: paddr=00233a40 vaddr=4037422c size=19a9ch (105116) load
I (488) boot: Loaded app from partition at offset 0x10000
I (488) boot: Disabling RNG early entropy source...
W (488) boot: after mapping text, starting from paddr=0x00140000 and vaddr=0x42000000, 0x100000 bytes are mapped
W (510) flash HPM: HPM mode is optional feature that depends on flash model. Read Docs First!
W (511) flash HPM: HPM mode with DC adjustment is disabled. Some flash models may not be supported. Read Docs First!
W (520) flash HPM: High performance mode of this flash model hasn't been supported.
I (528) MSPI Timing: Flash timing tuning index: 3
I (533) octal_psram: vendor id : 0x0d (AP)
I (538) octal_psram: dev id : 0x02 (generation 3)
I (544) octal_psram: density : 0x03 (64 Mbit)
I (550) octal_psram: good-die : 0x01 (Pass)
I (555) octal_psram: Latency : 0x01 (Fixed)
I (560) octal_psram: VCC : 0x01 (3V)
I (565) octal_psram: SRF : 0x01 (Fast Refresh)
I (571) octal_psram: BurstType : 0x01 (Hybrid Wrap)
I (577) octal_psram: BurstLen : 0x01 (32 Byte)
I (582) octal_psram: Readlatency : 0x02 (10 cycles@Fixed)
I (589) octal_psram: DriveStrength: 0x00 (1/1)
I (602) MSPI Timing: PSRAM timing tuning index: 2
I (602) esp_psram: Found 8MB PSRAM device
I (604) esp_psram: Speed: 120MHz
I (674) mmu_psram: Read only data copied and mapped to SPIRAM
I (736) mmu_psram: Instructions copied and mapped to SPIRAM
I (736) cpu_start: Multicore app
I (958) esp_psram: SPI SRAM memory test OK
I (966) cpu_start: Pro cpu start user code
I (966) cpu_start: cpu freq: 240000000 Hz
I (966) app_init: Application information:
I (969) app_init: Project name: indicator_ha
I (974) app_init: App version: v1.0.3-beta-31-g895d82a-dirty
I (981) app_init: Compile time: May 29 2024 13:22:13
I (987) app_init: ELF file SHA256: 79ce743f8...
I (992) app_init: ESP-IDF: v5.4-dev-610-g003f3bb5dc
I (999) efuse_init: Min chip rev: v0.0
I (1004) efuse_init: Max chip rev: v0.99
I (1009) efuse_init: Chip rev: v0.2
I (1013) heap_init: Initializing. RAM available for dynamic allocation:
I (1021) heap_init: At 3FCAAC98 len 0003EA78 (250 KiB): RAM
I (1027) heap_init: At 3FCE9710 len 00005724 (21 KiB): RAM
I (1033) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
I (1039) heap_init: At 600FE100 len 00001EE8 (7 KiB): RTCRAM
I (1046) esp_psram: Adding pool of 5952K of PSRAM memory to heap allocator
I (1054) spi_flash: detected chip: winbond
I (1058) spi_flash: flash io: qio
W (1062) i2c: This driver is an old driver, please migrate your application code to adapt `driver/i2c_master.h`
W (1073) ADC: legacy driver is deprecated, please migrate to `esp_adc/adc_oneshot.h`
I (1081) sleep: Configure to isolate all GPIO pins in sleep state
I (1088) sleep: Enable automatic switching of GPIO sleep configuration
I (1096) main_task: Started on CPU0
I (1101) esp_psram: Reserving pool of 32K of internal memory for DMA/internal allocations
I (1109) main_task: Calling app_main()
I (1113) :
_____ _________ ____
/ ___/___ ____ ________ / ____/ | / __ \
\__ \/ _ \/ __ \/ ___/ _ \/ / / /| | / /_/ /
___/ / __/ / / (__ ) __/ /___/ ___ |/ ____/
/____/\___/_/ /_/____/\___/\____/_/ |_/_/
--------------------------------------------------------
Version: v1.0.0 May 29 2024 13:29:24
--------------------------------------------------------
I (1154) i2c_bus: i2c0 bus inited
I (1157) bsp boards: detecting board SenseCAP_Indicator
I (1163) bsp boards: Detected board: [SenseCAP_Indicator]
I (1175) gpio: GPIO[38]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (1199) gpio: GPIO[45]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (1214) gpio: GPIO[41]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (1214) gpio: GPIO[48]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (1625) sx126x: bsp sx126x init
I (1625) sx126x: spi_bus_initialize=0
I (1625) sx126x: spi_bus_add_device=0
I (1629) lvgl_port: Add TP input device to LVGL
I (1762) view: data max:90.0, min:13.0, char max:128.5, min:-25.5
I (1847) sensor-model: sensor history data not find
I (1847) sensor-model: encode status:0, len:2
0x2 0xa4
I (1848) pp: pp rom version: e7ae62f
I (1852) net80211: net80211 rom version: e7ae62f
I (1877) wifi:wifi driver task: 3fcc5f04, prio:23, stack:6656, core=0
I (1878) wifi:wifi firmware version: f9a71af
I (1878) wifi:wifi certification version: v7.0
I (1880) wifi:config NVS flash: enabled
I (1883) wifi:config nano formating: disabled
I (1888) wifi:Init data frame dynamic rx buffer num: 32
I (1893) wifi:Init static rx mgmt buffer num: 5
I (1897) wifi:Init management short buffer num: 32
I (1902) wifi:Init static tx buffer num: 16
I (1905) wifi:Init tx cache buffer num: 32
I (1909) wifi:Init static tx FG buffer num: 2
I (1913) wifi:Init static rx buffer size: 1600
I (1917) wifi:Init static rx buffer num: 10
I (1921) wifi:Init dynamic rx buffer num: 32
I (1925) wifi_init: rx ba win: 6
I (1929) wifi_init: accept mbox: 6
I (1933) wifi_init: tcpip mbox: 32
I (1937) wifi_init: udp mbox: 6
I (1941) wifi_init: tcp mbox: 6
I (1945) wifi_init: tcp tx win: 5760
I (1949) wifi_init: tcp rx win: 5760
I (1953) wifi_init: tcp mss: 1440
I (1957) wifi_init: WiFi IRAM OP enabled
I (1962) wifi_init: WiFi RX IRAM OP enabled
I (1967) wifi-model: Not config wifi, Entry wifi config screen
I (1974) phy_init: phy_version 670,b7bc9b9,Apr 30 2024,10:54:13
I (2008) wifi:mode : sta (30:30:f9:18:04:40)
I (2009) wifi:enable tsf
I (2010) wifi-model: wifi event: WIFI_EVENT_STA_START
I (2010) wifi-model: event: VIEW_EVENT_WIFI_LIST_REQ
I (2010) time: cfg not find
I (3019) time: need update time view
I (3019) time: Thu Jan 1 00:00:02 1970
I (4518) wifi-model: scan ap cont: 0
I (4518) view: event: VIEW_EVENT_TIME_CFG_UPDATE
I (4519) view: event: VIEW_EVENT_TIME
I (4521) view: event: VIEW_DATA_WIFI_LIST
I (4549) display: cfg not find
I (4549) HA: mqtt cfg not find
I (4567) view: event: VIEW_EVENT_DISPLAY_CFG
Type 'help' to get the list of commands.
Use UP/DOWN arrows to navigate through command history.
Press TAB when typing command name to auto-complete.
I (4615) HA: cfg not find
I (4627) HA: mqtt_ha_init
Indicator> Guru Meditation Error: Core 0 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x40381528: 220021a2 348100a0 0008e0cf
0x40381528: vPortClearInterruptMaskFromISR at ~/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:560
(inlined by) xPortEnterCriticalTimeout at ~/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:475
Core 0 register dump:
PC : 0x4038152f PS : 0x00060033 A0 : 0x3fc9e694 A1 : 0x3fcaec80
0x4038152f: vPortClearInterruptMaskFromISR at ~/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:560
(inlined by) xPortEnterCriticalTimeout at ~/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:475
A2 : 0x00000000 A3 : 0x00000001 A4 : 0x803815f6 A5 : 0x3fcaee60
A6 : 0x3fca6f84 A7 : 0x00000001 A8 : 0x82056654 A9 : 0x3fcaee60
A10 : 0x3fc9e694 A11 : 0x3fcb7844 A12 : 0x3fcb7820 A13 : 0x00060023
A14 : 0x00060023 A15 : 0x0000cdcd SAR : 0x00000000 EXCCAUSE: 0x00000000
EXCVADDR: 0x00000000 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000
Backtrace: 0x4038152c:0x3fcaec80 0x3fc9e691:0x3fcaecb0 |<-CORRUPTED
0x4038152c: xPortEnterCriticalTimeout at ~/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:476
ELF file SHA256: 79ce743f8
Rebooting...
Also, photo_demo
doesn't work – just shows white screen all the time. But it at least tries to rotate images (from the logs).
same as #2 , it's the fisrt to download the ESP-IDF toolchain v5 and download this project.
When integrating multiple SenseCAP Indicator devices with systems like Home Assistant, each device publishes data to the same MQTT topic ("indicator/sensor"), leading to conflicts and data management issues. This feature request aims to introduce the ability to customize the MQTT topic per device through terminal commands, allowing users to assign unique topics to each device for easier identification and management.
setmqtt -t <custom_topic>
, to allow users to specify a custom MQTT topic for each SenseCAP Indicator device.setmqtt -t sensecapoffice1
on one device and setmqtt -t sensecapoffice2
on another, each device would publish to its unique MQTT topic, simplifying data management and integration with Home Assistant.Originally posted by @MarcLuethi8356 in #29 (comment)
After flashin (ESP-IDF v5.1) the screen keeps flickering very fast (app is installed), can onyone help?
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DOUT, clock div:1
load:0x3fce3818,len:0x16e0
load:0x403c9700,len:0x4
load:0x403c9704,len:0xc00
load:0x403cc700,len:0x2eb0
entry 0x403c9908
I (27) boot: ESP-IDF v5.1 2nd stage bootloader
I (27) boot: compile time Aug 7 2023 20:39:29
I (27) boot: Multicore bootloader
I (30) boot: chip revision: v0.1
I (34) boot.esp32s3: Boot SPI Speed : 80MHz
I (39) boot.esp32s3: SPI Mode : DOUT
I (43) boot.esp32s3: SPI Flash Size : 8MB
I (48) boot: Enabling RNG early entropy source...
I (53) boot: Partition Table:
I (57) boot: ## Label Usage Type ST Offset Length
I (64) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (72) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (79) boot: 2 factory factory app 00 00 00010000 00400000
I (87) boot: End of partition table
I (91) esp_image: segment 0: paddr=00010020 vaddr=3c0f0020 size=13a930h (1288496) map
I (347) esp_image: segment 1: paddr=0014a958 vaddr=3fc9ae00 size=04cf0h ( 19696) load
I (351) esp_image: segment 2: paddr=0014f650 vaddr=40374000 size=009c8h ( 2504) load
I (353) esp_image: segment 3: paddr=00150020 vaddr=42000020 size=ec76ch (968556) map
I (547) esp_image: segment 4: paddr=0023c794 vaddr=403749c8 size=16360h ( 90976) load
I (578) boot: Loaded app from partition at offset 0x10000
I (578) boot: Disabling RNG early entropy source...
I (589) cpu_start: Multicore app
I (590) octal_psram: vendor id : 0x0d (AP)
I (590) octal_psram: dev id : 0x02 (generation 3)
I (593) octal_psram: density : 0x03 (64 Mbit)
I (598) octal_psram: good-die : 0x01 (Pass)
I (604) octal_psram: Latency : 0x01 (Fixed)
I (609) octal_psram: VCC : 0x01 (3V)
I (614) octal_psram: SRF : 0x01 (Fast Refresh)
I (620) octal_psram: BurstType : 0x01 (Hybrid Wrap)
I (626) octal_psram: BurstLen : 0x01 (32 Byte)
I (631) octal_psram: Readlatency : 0x02 (10 cycles@Fixed)
I (637) octal_psram: DriveStrength: 0x00 (1/1)
I (643) esp_psram: Found 8MB PSRAM device
I (647) esp_psram: Speed: 40MHz
I (767) mmu_psram: Instructions copied and mapped to SPIRAM
I (903) mmu_psram: Read only data copied and mapped to SPIRAM
I (903) cpu_start: Pro cpu up.
I (903) cpu_start: Starting app cpu, entry point is 0x403758b0
0x403758b0: call_start_cpu1 at C:/Espressif/frameworks/esp-idf-v5.1/components/esp_system/port/cpu_start.c:154
I (0) cpu_start: App cpu up.
I (1289) esp_psram: SPI SRAM memory test OK
I (1297) cpu_start: Pro cpu start user code
I (1297) cpu_start: cpu freq: 240000000 Hz
I (1297) cpu_start: Application information:
I (1301) cpu_start: Project name: indicator_openai
I (1306) cpu_start: App version: v5.1
I (1311) cpu_start: Compile time: Aug 7 2023 20:39:19
I (1317) cpu_start: ELF file SHA256: 220daa56bfa5f4d2...
I (1323) cpu_start: ESP-IDF: v5.1
I (1328) cpu_start: Min chip rev: v0.0
I (1333) cpu_start: Max chip rev: v0.99
I (1338) cpu_start: Chip rev: v0.1
I (1343) heap_init: Initializing. RAM available for dynamic allocation:
I (1350) heap_init: At 3FCA7110 len 00042600 (265 KiB): DRAM
I (1356) heap_init: At 3FCE9710 len 00005724 (21 KiB): STACK/DRAM
I (1363) heap_init: At 600FE010 len 00001FF0 (7 KiB): RTCRAM
I (1370) esp_psram: Adding pool of 5952K of PSRAM memory to heap allocator
I (1377) spi_flash: detected chip: winbond
I (1382) spi_flash: flash io: dout
W (1386) ADC: legacy driver is deprecated, please migrate to esp_adc/adc_oneshot.h
I (1394) sleep: Configure to isolate all GPIO pins in sleep state
I (1401) sleep: Enable automatic switching of GPIO sleep configuration
I (1409) app_start: Starting scheduler on CPU0
I (1414) app_start: Starting scheduler on CPU1
I (1414) main_task: Started on CPU0
I (1424) esp_psram: Reserving pool of 32K of internal memory for DMA/internal allocations
I (1432) main_task: Calling app_main()
I (1437) :
I (1477) i2c_bus: i2c0 bus inited
I (1481) bsp boards: detecting board SenseCAP_Indicator
I (1487) bsp boards: Detected board: [SenseCAP_Indicator]
I (1498) gpio: GPIO[38]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (1539) gpio: GPIO[45]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (1576) gpio: GPIO[41]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (1577) gpio: GPIO[48]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (1988) lvgl_port: Add TP input device to LVGL
I (2237) view: data max:90.0, min:13.0, char max:128.5, min:-25.5
I (2388) sensor-model: sensor history data read successful
I (2391) sensor-model: encode status:0, len:2
0x2 0xa4
I (2395) pp: pp rom version: e7ae62f
I (2397) net80211: net80211 rom version: e7ae62f
I (2401) wifi:wifi driver task: 3fcd30a4, prio:23, stack:6656, core=0
I (2411) wifi:wifi firmware version: b2f1f86
I (2412) wifi:wifi certification version: v7.0
I (2414) wifi:config NVS flash: enabled
I (2418) wifi:config nano formating: disabled
I (2422) wifi:Init data frame dynamic rx buffer num: 32
I (2427) wifi:Init management frame dynamic rx buffer num: 32
I (2432) wifi:Init management short buffer num: 32
I (2437) wifi:Init static tx buffer num: 16
I (2441) wifi:Init tx cache buffer num: 32
I (2444) wifi:Init static tx FG buffer num: 2
I (2448) wifi:Init static rx buffer size: 1600
I (2453) wifi:Init static rx buffer num: 10
I (2456) wifi:Init dynamic rx buffer num: 32
Originally posted by @kheek in #6 (comment)
Greetings!
I've previously programmed my SenseCAP Indicator D1 with the ESP-IDF and the example Home Assistant program. It is working fine and is connected to my home network and HA via MQTT.
However, I now want to re-program the unit, but when I plug the unit into my computer using the USB-C connector (I've tried both connectors), the SenseCAP no longer appears as a USB serial device (FYI: When I first programmed the SenseCAP, it appeared as /dev/cu.usbserial-4013110
).
Any ideas what I'm doing wrong? How can I reset the device so that I can reprogram it with new firmware?
Could the photo example be expanded to use the SD Card connected to the RP2040?
The current example is rather limiting with only 20 photos and limited storage.
When I'm building the examples with current master version of ESP-IDF I get following errors:
In file included from /home/gol/esp/esp-idf/components/newlib/platform_include/assert.h:16,
from /home/gol/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/xtensa-esp32s3-elf/sys-include/sys/reent.h:503,
from /home/gol/esp/esp-idf/components/newlib/platform_include/sys/reent.h:9,
from /home/gol/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/xtensa-esp32s3-elf/sys-include/stdlib.h:18,
from /home/gol/esp/esp-idf/components/esp_hw_support/mspi_timing_tuning.c:7:
/home/gol/esp/esp-idf/components/esp_common/include/esp_assert.h:12:27: error: static assertion failed: "FLASH and PSRAM Mode configuration are not supported"
12 | #define ESP_STATIC_ASSERT static_assert
| ^~~~~~~~~~~~~
/home/gol/esp/esp-idf/components/esp_hw_support/port/esp32s3/./mspi_timing_tuning_configs.h:172:1: note: in expansion of macro 'ESP_STATIC_ASSERT'
172 | ESP_STATIC_ASSERT(CHECK_POWER_OF_2(MSPI_TIMING_CORE_CLOCK_MHZ / MSPI_TIMING_PSRAM_MODULE_CLOCK), "FLASH and PSRAM Mode configuration are not supported");
Any idea what's wrong?
Hey,
I'm setting the last version of ESP-IDF framework.
Most of the examples work with no issue ( demos , button , lora) but with Squareline demo project I've encountred the following errors :
In file included from /home/med/esp/esp-idf/components/esp_hw_support/mspi_timing_by_mspi_delay.h:17, from /home/med/esp/esp-idf/components/esp_hw_support/mspi_timing_by_mspi_delay.c:26: /home/med/esp/esp-idf/components/esp_hw_support/mspi_timing_by_mspi_delay.c: In function 'mspi_timing_get_flash_tuning_configs': /home/med/esp/esp-idf/components/esp_hw_support/port/esp32s3/./mspi_timing_tuning_configs.h:178:57: error: 'MSPI_TIMING_FLASH_CONFIG_TABLE_CORE_CLK_240M_MODULE_CLK_80M_STR_MODE' undeclared (first use in this function); did you mean 'MSPI_TIMING_FLASH_CONFIG_TABLE_CORE_CLK_160M_MODULE_CLK_80M_STR_MODE'? 178 | (mspi_timing_config_t) { .tuning_config_table = MSPI_TIMING_##type##_CONFIG_TABLE_CORE_CLK_##core_clock##M_MODULE_CLK_##module_clock##M_##mode, \ | ^~~~~~~~~~~~ /home/med/esp/esp-idf/components/esp_hw_support/port/esp32s3/./mspi_timing_tuning_configs.h:182:66: note: in expansion of macro '__GET_TUNING_CONFIG' 182 | #define _GET_TUNING_CONFIG(type, core_clock, module_clock, mode) __GET_TUNING_CONFIG(type, core_clock, module_clock, mode) | ^~~~~~~~~~~~~~~~~~~ /home/med/esp/esp-idf/components/esp_hw_support/port/esp32s3/./mspi_timing_tuning_configs.h:184:85: note: in expansion of macro '_GET_TUNING_CONFIG' 184 | #define MSPI_TIMING_FLASH_GET_TUNING_CONFIG(core_clock_mhz, module_clock_mhz, mode) _GET_TUNING_CONFIG(FLASH, core_clock_mhz, module_clock_mhz, mode) | ^~~~~~~~~~~~~~~~~~ /home/med/esp/esp-idf/components/esp_hw_support/mspi_timing_by_mspi_delay.c:78:15: note: in expansion of macro 'MSPI_TIMING_FLASH_GET_TUNING_CONFIG' 78 | *config = MSPI_TIMING_FLASH_GET_TUNING_CONFIG(MSPI_TIMING_CORE_CLOCK_MHZ, 80, FLASH_MODE); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/med/esp/esp-idf/components/esp_hw_support/port/esp32s3/./mspi_timing_tuning_configs.h:178:57: note: each undeclared identifier is reported only once for each function it appears in 178 | (mspi_timing_config_t) { .tuning_config_table = MSPI_TIMING_##type##_CONFIG_TABLE_CORE_CLK_##core_clock##M_MODULE_CLK_##module_clock##M_##mode, \ | ^~~~~~~~~~~~ /home/med/esp/esp-idf/components/esp_hw_support/port/esp32s3/./mspi_timing_tuning_configs.h:182:66: note: in expansion of macro '__GET_TUNING_CONFIG' 182 | #define _GET_TUNING_CONFIG(type, core_clock, module_clock, mode) __GET_TUNING_CONFIG(type, core_clock, module_clock, mode) | ^~~~~~~~~~~~~~~~~~~ /home/med/esp/esp-idf/components/esp_hw_support/port/esp32s3/./mspi_timing_tuning_configs.h:184:85: note: in expansion of macro '_GET_TUNING_CONFIG' 184 | #define MSPI_TIMING_FLASH_GET_TUNING_CONFIG(core_clock_mhz, module_clock_mhz, mode) _GET_TUNING_CONFIG(FLASH, core_clock_mhz, module_clock_mhz, mode) | ^~~~~~~~~~~~~~~~~~ /home/med/esp/esp-idf/components/esp_hw_support/mspi_timing_by_mspi_delay.c:78:15: note: in expansion of macro 'MSPI_TIMING_FLASH_GET_TUNING_CONFIG' 78 | *config = MSPI_TIMING_FLASH_GET_TUNING_CONFIG(MSPI_TIMING_CORE_CLOCK_MHZ, 80, FLASH_MODE); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/med/esp/esp-idf/components/esp_hw_support/port/esp32s3/./mspi_timing_tuning_configs.h:179:57: error: 'MSPI_TIMING_FLASH_CONFIG_NUM_CORE_CLK_240M_MODULE_CLK_80M_STR_MODE' undeclared (first use in this function); did you mean 'MSPI_TIMING_FLASH_CONFIG_NUM_CORE_CLK_240M_MODULE_CLK_120M_STR_MODE'? 179 | .available_config_num = MSPI_TIMING_##type##_CONFIG_NUM_CORE_CLK_##core_clock##M_MODULE_CLK_##module_clock##M_##mode, \ | ^~~~~~~~~~~~ /home/med/esp/esp-idf/components/esp_hw_support/port/esp32s3/./mspi_timing_tuning_configs.h:182:66: note: in expansion of macro '__GET_TUNING_CONFIG' 182 | #define _GET_TUNING_CONFIG(type, core_clock, module_clock, mode) __GET_TUNING_CONFIG(type, core_clock, module_clock, mode) | ^~~~~~~~~~~~~~~~~~~ /home/med/esp/esp-idf/components/esp_hw_support/port/esp32s3/./mspi_timing_tuning_configs.h:184:85: note: in expansion of macro '_GET_TUNING_CONFIG' 184 | #define MSPI_TIMING_FLASH_GET_TUNING_CONFIG(core_clock_mhz, module_clock_mhz, mode) _GET_TUNING_CONFIG(FLASH, core_clock_mhz, module_clock_mhz, mode) | ^~~~~~~~~~~~~~~~~~ /home/med/esp/esp-idf/components/esp_hw_support/mspi_timing_by_mspi_delay.c:78:15: note: in expansion of macro 'MSPI_TIMING_FLASH_GET_TUNING_CONFIG' 78 | *config = MSPI_TIMING_FLASH_GET_TUNING_CONFIG(MSPI_TIMING_CORE_CLOCK_MHZ, 80, FLASH_MODE); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/med/esp/esp-idf/components/esp_hw_support/port/esp32s3/./mspi_timing_tuning_configs.h:180:54: error: 'MSPI_TIMING_FLASH_DEFAULT_CONFIG_ID_CORE_CLK_240M_MODULE_CLK_80M_STR_MODE' undeclared (first use in this function); did you mean 'MSPI_TIMING_FLASH_DEFAULT_CONFIG_ID_CORE_CLK_240M_MODULE_CLK_120M_STR_MODE'? 180 | .default_config_id = MSPI_TIMING_##type##_DEFAULT_CONFIG_ID_CORE_CLK_##core_clock##M_MODULE_CLK_##module_clock##M_##mode } | ^~~~~~~~~~~~ /home/med/esp/esp-idf/components/esp_hw_support/port/esp32s3/./mspi_timing_tuning_configs.h:182:66: note: in expansion of macro '__GET_TUNING_CONFIG' 182 | #define _GET_TUNING_CONFIG(type, core_clock, module_clock, mode) __GET_TUNING_CONFIG(type, core_clock, module_clock, mode) | ^~~~~~~~~~~~~~~~~~~ /home/med/esp/esp-idf/components/esp_hw_support/port/esp32s3/./mspi_timing_tuning_configs.h:184:85: note: in expansion of macro '_GET_TUNING_CONFIG' 184 | #define MSPI_TIMING_FLASH_GET_TUNING_CONFIG(core_clock_mhz, module_clock_mhz, mode) _GET_TUNING_CONFIG(FLASH, core_clock_mhz, module_clock_mhz, mode) | ^~~~~~~~~~~~~~~~~~ /home/med/esp/esp-idf/components/esp_hw_support/mspi_timing_by_mspi_delay.c:78:15: note: in expansion of macro 'MSPI_TIMING_FLASH_GET_TUNING_CONFIG' 78 | *config = MSPI_TIMING_FLASH_GET_TUNING_CONFIG(MSPI_TIMING_CORE_CLOCK_MHZ, 80, FLASH_MODE);
While searching the repo I find out that a patch should be done in order for fix these timing issues. So when I tried applying the patch these errors showed up :
med@med:~/esp/esp-idf$ git apply --whitespace=fix ~/SenseCAP_Indicator_ESP32/tools/patch/release5.0_psram_octal_120m.patch error: patch failed: components/esp_hw_support/port/esp32s3/rtc_clk.c:159 error: components/esp_hw_support/port/esp32s3/rtc_clk.c: patch does not apply error: patch failed: components/esp_psram/esp32s3/Kconfig.spiram:87 error: components/esp_psram/esp32s3/Kconfig.spiram: patch does not apply error: patch failed: components/hal/esp32s3/include/hal/spimem_flash_ll.h:575 error: components/hal/esp32s3/include/hal/spimem_flash_ll.h: patch does not apply error: components/spi_flash/esp32s3/mspi_timing_tuning_configs.h: No such file or directory error: components/spi_flash/esp32s3/spi_timing_config.c: No such file or directory error: components/spi_flash/esp32s3/spi_timing_config.h: No such file or directory error: components/spi_flash/spi_flash_timing_tuning.c: No such file or directory error: tools/test_apps/system/flash_psram/sdkconfig.ci.f8r8_120ddr: already exists in working directory error: tools/test_apps/system/flash_psram/sdkconfig.ci.f8r8_120ddr_120ddr: already exists in working directory
I noticed similar issue have been raised but I didn't find a fix to this
Could u please guide me through this ?
When I try to build the indicator_basis example, I get a compile error static assertion failed: "FLASH and PSRAM Mode configuration are not supported
. This happens even after installing the IDF patch, unlike #2.
I have built most of the other examples successfully; only this one fails. It’s odd that I can build the indicator_ha
demo since it’s based on this one, but there are quite a few diffs between their sdkconfig
files, mostly having to do with SPIRAM.
In file included from /Users/snej/Projects/Embedded/esp-idf/components/spi_flash/esp32s3/spi_timing_config.c:15:
/Users/snej/Projects/Embedded/esp-idf/components/spi_flash/esp32s3/spi_timing_config.h:179:1: error: static assertion failed: "FLASH and PSRAM Mode configuration are not supported"
179 | _Static_assert(CHECK_POWER_OF_2(SPI_TIMING_CORE_CLOCK_MHZ / SPI_TIMING_PSRAM_MODULE_CLOCK), "FLASH and PSRAM Mode configuration are not supported");
| ^~~~~~~~~~~~~~
This is what I’ve done:
git checkout v5.0
(I previously had v5.1.1 but the patch installer failed so I went back)cd path/to/esp_idf
install.sh
export.sh
cd path/to/SenseCAP_Indicator_ESP32/examples/indicator_basis
idf.py build
Here’s the git status of the esp-idf
directory, showing the modified files:
HEAD detached at v5.0
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: components/esp_hw_support/port/esp32s3/rtc_clk.c
modified: components/esp_psram/esp32s3/Kconfig.spiram
modified: components/hal/esp32s3/include/hal/spimem_flash_ll.h
modified: components/spi_flash/esp32s3/mspi_timing_tuning_configs.h
modified: components/spi_flash/esp32s3/spi_timing_config.c
modified: components/spi_flash/esp32s3/spi_timing_config.h
modified: components/spi_flash/spi_flash_timing_tuning.c
Untracked files:
(use "git add <file>..." to include in what will be committed)
tools/test_apps/system/flash_psram/sdkconfig.ci.f8r8_120ddr
tools/test_apps/system/flash_psram/sdkconfig.ci.f8r8_120ddr_120ddr
no changes added to commit (use "git add" and/or "git commit -a")
When I tried to build/run the indicator_openai example, (built with esp-idf v5.1.1), I found that multiple Chat GPT requests or DALL-E requests via mbedtls_send_then_recv() cause heap memory leaks so that eventually mbedtls_ssl_setup() will return the error:
**E (58463) openai: mbedtls_ssl_setup returned -0x7f00**
Additionally, in this case the goto exit;
will result in these functions calls:
mbedtls_ssl_session_reset(&ssl);
mbedtls_net_free( &server_fd );
which cause the system to crash if/when mbedtls_ssl_setup() fails.
We can see that with each call to mbedtls_send_then_recv(), the free internal heap size reported by:
esp_get_free_internal_heap_size()
decreases continuously each time a request is sent to either Dall-E or Chat-GPT until there is not enough memory for mbedtls_ssl_setup(). I saw this issue on both the main branch (895d82a) as well as the tags/v1.03 branch.
It looks like mbed TLS resources are not being torn down in accordance with the documentation:
https://mbed-tls.readthedocs.io/en/latest/kb/how-to/mbedtls-tutorial/#teardown
This patch gets rid of the memory leaks and prevents the system from crashing in the event that mbedtls_ssl_setup() returns an error:
diff --git a/examples/indicator_openai/main/model/indicator_openai.c b/examples/indicator_openai/main/model/indicator_openai.c
index bdcfbda..4399500 100644
--- a/examples/indicator_openai/main/model/indicator_openai.c
+++ b/examples/indicator_openai/main/model/indicator_openai.c
@@ -55,13 +55,16 @@ static int mbedtls_send_then_recv(char *p_server, char *p_port, char *p_tx,
mbedtls_ssl_config conf;
mbedtls_net_context server_fd;
+ bool fd_initialized=false;
+ bool session_initialized=false;
+
memset(&entropy,0, sizeof(entropy) );
memset(&ctr_drbg,0, sizeof(ctr_drbg) );
memset(&ssl,0, sizeof(ssl) );
memset(&cacert,0, sizeof(cacert) );
memset(&conf,0, sizeof(conf) );
memset(&server_fd,0, sizeof(server_fd) );
mbedtls_ssl_init(&ssl);
mbedtls_x509_crt_init(&cacert);
mbedtls_ctr_drbg_init(&ctr_drbg);
@@ -121,6 +124,7 @@ static int mbedtls_send_then_recv(char *p_server, char *p_port, char *p_tx,
}
mbedtls_net_init(&server_fd);
+ fd_initialized=true;
ESP_LOGI(TAG, "Connecting to %s:%s...", p_server, p_port);
@@ -130,6 +134,7 @@ static int mbedtls_send_then_recv(char *p_server, char *p_port, char *p_tx,
ESP_LOGE(TAG, "mbedtls_net_connect returned -%x", -ret);
goto exit;
}
+ session_initialized = true;
ESP_LOGI(TAG, "Connected.");
@@ -234,8 +239,17 @@ static int mbedtls_send_then_recv(char *p_server, char *p_port, char *p_tx,
mbedtls_ssl_close_notify(&ssl);
exit:
- mbedtls_ssl_session_reset(&ssl);
- mbedtls_net_free(&server_fd);
+ if (session_initialized) {
+ mbedtls_ssl_session_reset(&ssl);
+ }
+ if (fd_initialized) {
+ mbedtls_net_free( &server_fd );
+ }
+ mbedtls_x509_crt_free( &cacert );
+ mbedtls_ssl_free( &ssl );
+ mbedtls_ssl_config_free( &conf );
+ mbedtls_ctr_drbg_free( &ctr_drbg );
+ mbedtls_entropy_free( &entropy );
if (ret != 0)
{
This fixes the issue and multiple openAI requests can be made. I'm not sure if this issue is also present in other examples since I've only looked at the indicator_openai example.
Additionally, in order to get the example to work properly I had to add the following back into indicator_openai/sdkconfig.defaults:
CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y
CONFIG_LV_USE_PNG=y
git apply --whitespace=fix ../patch//release5.0_psram_octal_120m.patch
error: patch failed: components/spi_flash/spi_flash_timing_tuning.c:230
I was finally able to install the patch after much trouble but now I am getting this error:
error: #error "MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT defined, but not all prerequisites" 904 | #error "MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT defined, but not all prerequisites"
I am trying to flash indicator_ha but nothing I do seems to work.
Please help
I am trying to connect my SenseCap Indicator to the MQTT broker of AWS. As mentioned in the documentation, I have tried configuring the "ha_config.h" file and it shows an error.
Error message :-
E (11483) esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x6C00
I (11484) esp-tls-mbedtls: Certificate verified.
E (11484) esp-tls: Failed to open new connection
E (11495) city: Connection failed...
Can you please add an example of how to use micropython on the device? I tired following general guidance for esp32s3 but can't get REPL over the USB port
Hello,
I'm trying to compile some examples using the Visual Studio Extension ESP-IDF, set to 5.1.
Tried setting it to 4.4.x and I get nowhere.
With 5.1 at least it tries to compile.
But it ends with an error, stating some constants are not declared.
Any ideas how to solve this?
~/SenseCAP_Indicator_ESP32/components/bsp/src/boards/sensecap_indicator_board.c:112:25: error: 'GPIO_NUM_45' undeclared here (not in a function); did you mean 'GPIO_NUM_35'?
112 | .GPIO_LCD_BL = GPIO_NUM_45,
| ^~~~~~~~~~~
| GPIO_NUM_35
~/SenseCAP_Indicator_ESP32/components/bsp/src/boards/sensecap_indicator_board.c:166:25: error: 'GPIO_NUM_40' undeclared here (not in a function); did you mean 'GPIO_NUM_30'?
166 | .GPIO_I2C_SCL = (GPIO_NUM_40),
| ^~~~~~~~~~~
| GPIO_NUM_30
~/SenseCAP_Indicator_ESP32/components/bsp/src/boards/sensecap_indicator_board.c:188:29: error: 'GPIO_NUM_47' undeclared here (not in a function); did you mean 'GPIO_NUM_37'?
188 | .GPIO_SPI_MISO = (GPIO_NUM_47),
| ^~~~~~~~~~~
| GPIO_NUM_37
~/SenseCAP_Indicator_ESP32/components/bsp/src/boards/sensecap_indicator_board.c:189:29: error: 'GPIO_NUM_48' undeclared here (not in a function); did you mean 'GPIO_NUM_38'?
189 | .GPIO_SPI_MOSI = (GPIO_NUM_48),
| ^~~~~~~~~~~
| GPIO_NUM_38
~/SenseCAP_Indicator_ESP32/components/bsp/src/boards/sensecap_indicator_board.c:190:29: error: 'GPIO_NUM_41' undeclared here (not in a function); did you mean 'GPIO_NUM_31'?
190 | .GPIO_SPI_SCLK = (GPIO_NUM_41),
| ^~~~~~~~~~~
| GPIO_NUM_31~/SenseCAP_Indicator_ESP32/components/bsp/src/boards/sensecap_indicator_board.c:112:25: error: 'GPIO_NUM_45' undeclared here (not in a function); did you mean 'GPIO_NUM_35'?
112 | .GPIO_LCD_BL = GPIO_NUM_45,
| ^~~~~~~~~~~
| GPIO_NUM_35
~/SenseCAP_Indicator_ESP32/components/bsp/src/boards/sensecap_indicator_board.c:166:25: error: 'GPIO_NUM_40' undeclared here (not in a function); did you mean 'GPIO_NUM_30'?
166 | .GPIO_I2C_SCL = (GPIO_NUM_40),
| ^~~~~~~~~~~
| GPIO_NUM_30
~/SenseCAP_Indicator_ESP32/components/bsp/src/boards/sensecap_indicator_board.c:188:29: error: 'GPIO_NUM_47' undeclared here (not in a function); did you mean 'GPIO_NUM_37'?
188 | .GPIO_SPI_MISO = (GPIO_NUM_47),
| ^~~~~~~~~~~
| GPIO_NUM_37
~/SenseCAP_Indicator_ESP32/components/bsp/src/boards/sensecap_indicator_board.c:189:29: error: 'GPIO_NUM_48' undeclared here (not in a function); did you mean 'GPIO_NUM_38'?
189 | .GPIO_SPI_MOSI = (GPIO_NUM_48),
| ^~~~~~~~~~~
| GPIO_NUM_38
~/SenseCAP_Indicator_ESP32/components/bsp/src/boards/sensecap_indicator_board.c:190:29: error: 'GPIO_NUM_41' undeclared here (not in a function); did you mean 'GPIO_NUM_31'?
190 | .GPIO_SPI_SCLK = (GPIO_NUM_41),
| ^~~~~~~~~~~
| GPIO_NUM_31
Hi,
Can you make a source for compilation under the 5.1 version od IDF-SDK?
There is a problem with "hack", which cant be applied.
Thank you
I have tried compiling the indicator_ha, indicator_basis & indicator_openai examples and I am able to build and flash the binaries without any problems.
The time however is always wrong, it is 30 minutes behind the actual time, The date and timezone city show correct values, wifi is connected and the monitor shows the correct zone and time are being pulled from the NTP Server.
The displayed time is 12:01 for the below NTP sync.
HTTP/1.1 200 OK
Server: nginx/1.18.0 (Ubuntu)
Date: Fri, 08 Sep 2023 07:01:41 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
177
{"timeZone":"Asia/Kolkata","currentLocalTime":"2023-09-08T12:31:41.8409605","currentUtcOffset":{"seconds":19800,"milliseconds":19800000,"ticks":198000000000,"nanoseconds":19800000000000},"standardUtcOffset":{"seconds":19800,"milliseconds":19800000,"ticks":198000000000,"nanoseconds":19800000000000},"hasDayLightSaving":false,"isDayLightSavingActive":false,"dstInterval":null}
0
In indicator_time.c zone is set to int8_t and in indicator_city.c it is set to float, i tried setting it to float in both locations but that does not help. ( I'm assuming my timezone needs to be UTC+5.5(float) and not UTC+5(int) )
I use sensecap indicator d1pro, I tried some of your examples, they work fine after installing esp-idf 5.0 and completing the patch file but after that I could not run the esp example on my computer. After completing your installation requirements,
I don't understand why I couldn't use any esp-idf samples in your products and other developer kits after initialization.
I don't understand where am I wrong, please help me.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.