YooSHome / SenseCapConfig

SenseCap Indicator - Configure device with Json File to connect to HA and load Sensors/Switches
19 stars 5 forks source link

Undefined combination of 240M module, 80M str mode #2

Closed dsblank closed 7 months ago

dsblank commented 8 months ago

Steps to reproduce:

  1. clone repo
  2. cd SenseCapConfig/ESP32
  3. idf.py -p /dev/ttyUSB0 flash monitor

Using with a SenseCapIndicator, but I didn't get that far.

Did I miss a step?

home/dsblank/esp/esp-idf-v5.2/components/esp_hw_support/mspi_timing_by_mspi_delay.c: In function 'mspi_timing_get_flash_tuning_configs':
/home/dsblank/esp/esp-idf-v5.2/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'?
dsblank commented 8 months ago

Ah, I see. I needed to:

idf.py set-target esp32s3

before build.

dsblank commented 8 months ago

I had to add a few includes to get this to compile:

diff --git a/ESP32/main/model/indicator_btn.c b/ESP32/main/model/indicator_btn.c
index fb8b207..21897dd 100644
--- a/ESP32/main/model/indicator_btn.c
+++ b/ESP32/main/model/indicator_btn.c
@@ -1,6 +1,7 @@
 #include "indicator_btn.h"
 #include "indicator_display.h"
 #include "bsp_btn.h"
+#include "esp_timer.h"

 static uint32_t hold_cnt=0;
 static bool sleep_flag=false;
diff --git a/ESP32/main/model/indicator_display.h b/ESP32/main/model/indicator_display.h
index 9dd917e..656b353 100644
--- a/ESP32/main/model/indicator_display.h
+++ b/ESP32/main/model/indicator_display.h
@@ -3,6 +3,7 @@

 #include "config.h"
 #include "view_data.h"
+#include <time.h>

 #ifdef __cplusplus
 extern "C" {
diff --git a/ESP32/main/model/indicator_ha_config.h b/ESP32/main/model/indicator_ha_config.h
index 3ea5a81..34d9b2b 100644
--- a/ESP32/main/model/indicator_ha_config.h
+++ b/ESP32/main/model/indicator_ha_config.h
@@ -3,6 +3,7 @@

 #include "config.h"
 #include "view_data.h"
+#include <time.h>

 // Define struct for sensors in a page
 typedef struct ha_config_page_sensor
diff --git a/ESP32/main/model/indicator_time.c b/ESP32/main/model/indicator_time.c
index 128cc23..5b772d6 100644
--- a/ESP32/main/model/indicator_time.c
+++ b/ESP32/main/model/indicator_time.c
@@ -3,6 +3,7 @@
 #include "freertos/semphr.h"
 #include "nvs.h"
 #include <stdlib.h>
+#include "esp_timer.h"

 #define DEBUG_TIME 0

diff --git a/ESP32/main/ui/screens/ui_screen_ha_templates.h b/ESP32/main/ui/screens/ui_screen_ha_templates.h
index 6595e63..75d3b38 100644
--- a/ESP32/main/ui/screens/ui_screen_ha_templates.h
+++ b/ESP32/main/ui/screens/ui_screen_ha_templates.h
@@ -4,7 +4,7 @@

 #include "../../model/indicator_ha_config.h"
 #include "../ui.h"
-
+#include <time.h>

 // Define small sensor
@@ -80,4 +80,4 @@ void create_switch_arc(int size, lv_obj_t *parent, ha_switch_t *switch_, int bt_
 void create_switch_slider(int size, lv_obj_t *parent, ha_switch_t *switch_, int bt_x, int bt_y, char *label, char *unit);
 void ui_event_btn(lv_event_t *e);

-#endif
\ No newline at end of file
+#endif
diff --git a/ESP32/main/view_data.h b/ESP32/main/view_data.h
index 4cc02a8..ac519eb 100644
--- a/ESP32/main/view_data.h
+++ b/ESP32/main/view_data.h
@@ -2,6 +2,7 @@
 #define VIEW_DATA_H

 #include "config.h"
+#include <time.h>

 #ifdef __cplusplus
 extern "C"
Yoobe commented 7 months ago

hi,

Sorry for the late reply. the esp version might require adjustment you made. With esp 5.1 it was building fine. I am busy with other projects but I hope to be back on this one in few months to finish the implementation of the screens and widgets based on the json.

Here is what I have done to build the project (from my notes.)

  1. Install esp-idf in #VSCode using extensions (I use VSCode for all my devs).
  2. Install IDF using #esp-idf extension (I tried 5.0.3 and finally used the 5.1)
  3. Start IDF terminal using the plugin (ctrl+shift+p : Open ESP-IDF terminal)
  4. Change the environment variables or eps32 is the default target and will overwrite the settings. $env:IDF_TARGET='esp32s3'
  5. Play with idf.py menuconfig to find the correct settings (PSRAM, SPI, anything else for custom needs), here I had to enable exploratory features to have 120M available for SPI. Otherwise, it is set to 80M by IDF and the 120M setting in the sdkconfig.default is lost at the first build.
  6. Build the firmware as in the wiki with the command idf.py build oridf.py -p PORT build flash monitor