Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion firmware_p4/components/Drivers/st7789/st7789.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#define BL_LEDC_MODE LEDC_LOW_SPEED_MODE
#define BL_LEDC_CH LEDC_CHANNEL_0
#define BL_LEDC_RES LEDC_TIMER_13_BIT
#define BL_LEDC_FREQ 5000
#define BL_LEDC_FREQ 4000
#define DISPLAY_CONFIG_PATH "/assets/config/screen/screen_config.conf"

static const char *TAG = "ST7789_DRIVER";
Expand Down
4 changes: 4 additions & 0 deletions firmware_p4/components/Service/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,13 @@ idf_component_register(SRCS

# Embed C5 Firmware Binary into Service component (used by c5_flasher)
set(C5_BIN_PATH "${CMAKE_SOURCE_DIR}/../firmware_c5/build/TentacleOS_C5.bin")
set(C5_FIRMWARE_EMBEDDED 0)
if(EXISTS ${C5_BIN_PATH})
target_add_binary_data(${COMPONENT_LIB} "${C5_BIN_PATH}" BINARY)
set(C5_FIRMWARE_EMBEDDED 1)
message(STATUS "Embedding C5 Firmware: ${C5_BIN_PATH}")
else()
message(WARNING "C5 Firmware binary not found at ${C5_BIN_PATH}. Firmware update feature will be disabled.")
endif()

target_compile_definitions(${COMPONENT_LIB} PRIVATE C5_FIRMWARE_EMBEDDED=${C5_FIRMWARE_EMBEDDED})
7 changes: 7 additions & 0 deletions firmware_p4/components/Service/c5_flasher/c5_flasher.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ static const char *TAG = "C5_FLASHER";
#define FLASH_BLOCK_SIZE 1024

// Access to embedded binary symbols
#if C5_FIRMWARE_EMBEDDED
extern const uint8_t c5_firmware_bin_start[] asm("_binary_TentacleOS_C5_bin_start");
extern const uint8_t c5_firmware_bin_end[] asm("_binary_TentacleOS_C5_bin_end");
#endif

// ESP Serial Protocol Constants
#define ESP_ROM_BAUD 115200
Expand Down Expand Up @@ -104,8 +106,13 @@ void c5_flasher_reset_normal(void) {

esp_err_t c5_flasher_update(const uint8_t *bin_data, uint32_t bin_size) {
if (!bin_data) {
#if C5_FIRMWARE_EMBEDDED
bin_data = c5_firmware_bin_start;
bin_size = c5_firmware_bin_end - c5_firmware_bin_start;
#else
ESP_LOGE(TAG, "Embedded C5 firmware is unavailable");
return ESP_ERR_NOT_FOUND;
#endif
}

if (bin_size == 0) {
Expand Down
4 changes: 2 additions & 2 deletions firmware_p4/partitions.csv
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ otadata, data, ota, , 8K,
phy_init, data, phy, , 4K,
ota_0, app, ota_0, 0x20000, 4M,
ota_1, app, ota_1, , 4M,
storage, data, fat, , 6M,
assets, data, littlefs, , 16M,
storage, data, fat, , 3M,
assets, data, littlefs, , 4M,
Loading
Loading