Skip to content
Open
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
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,24 @@ This library enables you to program Espressif SoCs from various host platforms u

### Supported Target Devices (ESP device being flashed)

| Target | UART | SPI | SDIO | USB CDC ACM |
| :------: | :--: | :-: | :--: | :---------: |
| ESP8266 | ✅ | ❌ | ❌ | ❌ |
| ESP32 | ✅ | ❌ | 🚧 | ❌ |
| ESP32-S2 | ✅ | ❌ | ❌ | ❌ |
| ESP32-S3 | ✅ | ✅ | ❌ | ✅ |
| ESP32-C2 | ✅ | ✅ | ❌ | ❌ |
| ESP32-C3 | ✅ | ✅ | ❌ | ✅ |
| ESP32-H2 | ✅ | ✅ | ❌ | ✅ |
| ESP32-C6 | ✅ | ❌ | ✅ | ✅ |
| ESP32-C5 | ✅ | ❌ | 🚧 | ✅ |
| ESP32-P4 | ✅ | 🚧 | ❌ | ✅ |
| Target | UART | SPI | SDIO | USB CDC ACM |
| :-------: | :--: | :-: | :--: | :---------: |
| ESP8266 | ✅ | ❌ | ❌ | ❌ |
| ESP32 | ✅ | ❌ | 🚧 | ❌ |
| ESP32-S2 | ✅ | ❌ | ❌ | ❌ |
| ESP32-S3 | ✅ | ✅ | ❌ | ✅ |
| ESP32-C2 | ✅ | ✅ | ❌ | ❌ |
| ESP32-C3 | ✅ | ✅ | ❌ | ✅ |
| ESP32-H2 | ✅ | ✅ | ❌ | ✅ |
| ESP32-C6 | ✅ | ❌ | ✅ | ✅ |
| ESP32-C5 | ✅ | ❌ | 🚧 | ✅ |
| ESP32-P4 | ✅ | 🚧 | ❌ | ✅ |
| ESP32-C61 | ✅ | ❌ | ❌ | ❌ |

**Legend**: ✅ Supported | ❌ Not supported | 🚧 Under development

> [!NOTE]
> **Stub support**: ESP8266, ESP32-C5, and ESP32-P4 stub support is under development
> **Stub support**: ESP8266, ESP32-C5, ESP32-P4, and ESP32-C61 stub support is under development

### Public API

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added examples/binaries/RAM_APP/ESP32_C61/app.bin
Binary file not shown.
30 changes: 30 additions & 0 deletions examples/common/example_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,16 @@ extern const uint8_t ESP32_P4_partition_table_bin[];
extern const uint32_t ESP32_P4_partition_table_bin_size;
extern const uint8_t ESP32_P4_partition_table_bin_md5[];

extern const uint8_t ESP32_C61_bootloader_bin[];
extern const uint32_t ESP32_C61_bootloader_bin_size;
extern const uint8_t ESP32_C61_bootloader_bin_md5[];
extern const uint8_t ESP32_C61_hello_world_bin[];
extern const uint32_t ESP32_C61_hello_world_bin_size;
extern const uint8_t ESP32_C61_hello_world_bin_md5[];
extern const uint8_t ESP32_C61_partition_table_bin[];
extern const uint32_t ESP32_C61_partition_table_bin_size;
extern const uint8_t ESP32_C61_partition_table_bin_md5[];

void get_example_binaries(target_chip_t target, example_binaries_t *bins)
{
if (target == ESP8266_CHIP) {
Expand Down Expand Up @@ -267,6 +277,19 @@ void get_example_binaries(target_chip_t target, example_binaries_t *bins)
bins->app.size = ESP32_P4_hello_world_bin_size;
bins->app.md5 = ESP32_P4_hello_world_bin_md5;
bins->app.addr = APPLICATION_ADDRESS;
} else if (target == ESP32C61_CHIP) {
bins->boot.data = ESP32_C61_bootloader_bin;
bins->boot.size = ESP32_C61_bootloader_bin_size;
bins->boot.md5 = ESP32_C61_bootloader_bin_md5;
bins->boot.addr = BOOTLOADER_ADDRESS_V1;
bins->part.data = ESP32_C61_partition_table_bin;
bins->part.size = ESP32_C61_partition_table_bin_size;
bins->part.md5 = ESP32_C61_partition_table_bin_md5;
bins->part.addr = PARTITION_ADDRESS;
bins->app.data = ESP32_C61_hello_world_bin;
bins->app.size = ESP32_C61_hello_world_bin_size;
bins->app.md5 = ESP32_C61_hello_world_bin_md5;
bins->app.addr = APPLICATION_ADDRESS;
} else {
abort();
}
Expand All @@ -289,6 +312,8 @@ extern const uint8_t ESP32_C5_app_bin[];
extern const uint32_t ESP32_C5_app_bin_size;
extern const uint8_t ESP32_P4_app_bin[];
extern const uint32_t ESP32_P4_app_bin_size;
extern const uint8_t ESP32_C61_app_bin[];
extern const uint32_t ESP32_C61_app_bin_size;


void get_example_ram_app_binary(target_chip_t target, example_ram_app_binary_t *bin)
Expand Down Expand Up @@ -334,6 +359,11 @@ void get_example_ram_app_binary(target_chip_t target, example_ram_app_binary_t *
bin->ram_app.size = ESP32_P4_app_bin_size;
break;
}
case ESP32C61_CHIP: {
bin->ram_app.data = ESP32_C61_app_bin;
bin->ram_app.size = ESP32_C61_app_bin_size;
break;
}
default: {
abort();
}
Expand Down
5 changes: 3 additions & 2 deletions include/esp_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ typedef enum {
ESP32H2_CHIP = 7,
ESP32C6_CHIP = 8,
ESP32P4_CHIP = 9,
ESP_MAX_CHIP = 10,
ESP_UNKNOWN_CHIP = 10
ESP32C61_CHIP = 10,
ESP_MAX_CHIP = 11,
ESP_UNKNOWN_CHIP = 11
} target_chip_t;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/esp_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ esp_loader_error_t esp_loader_connect_with_stub(esp_loader_connect_args_t *conne

RETURN_ON_ERROR(loader_detect_chip(&s_target, &s_reg));

if (s_target == ESP32P4_CHIP || s_target == ESP32C5_CHIP) {
if (s_target == ESP32P4_CHIP || s_target == ESP32C5_CHIP || s_target == ESP32C61_CHIP) {
return ESP_LOADER_ERROR_UNSUPPORTED_CHIP;
}

Expand Down
5 changes: 4 additions & 1 deletion src/esp_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ _Static_assert(ESP32C5_CHIP == 6, "Stub order matches target_chip_t enumeration"
_Static_assert(ESP32H2_CHIP == 7, "Stub order matches target_chip_t enumeration");
_Static_assert(ESP32C6_CHIP == 8, "Stub order matches target_chip_t enumeration");
_Static_assert(ESP32P4_CHIP == 9, "Stub order matches target_chip_t enumeration");
_Static_assert(ESP_MAX_CHIP == 10, "Stub order matches target_chip_t enumeration");
_Static_assert(ESP32C61_CHIP == 10, "Stub order matches target_chip_t enumeration");
_Static_assert(ESP_MAX_CHIP == 11, "Stub order matches target_chip_t enumeration");
#endif

const esp_stub_t esp_stub[ESP_MAX_CHIP] = {
Expand Down Expand Up @@ -188,6 +189,8 @@ const esp_stub_t esp_stub[ESP_MAX_CHIP] = {
// placeholder
{},

// placeholder
{},
};

#endif
20 changes: 20 additions & 0 deletions src/esp_targets.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ typedef struct {
#define ESP32C5_SPI_REG_BASE 0x60003000
#define ESP32C6_SPI_REG_BASE 0x60003000
#define ESP32P4_SPI_REG_BASE 0x5008d000
#define ESP32C61_SPI_REG_BASE 0x60003000
#define ESP32xx_SPI_REG_BASE 0x60002000
#define ESP32_SPI_REG_BASE 0x3ff42000

Expand Down Expand Up @@ -254,6 +255,25 @@ static const esp_target_t esp_target[ESP_MAX_CHIP] = {
.chip_id = 18,
},

// ESP32C61
{
.regs = {
.cmd = ESP32C61_SPI_REG_BASE + 0x00,
.usr = ESP32C61_SPI_REG_BASE + 0x18,
.usr1 = ESP32C61_SPI_REG_BASE + 0x1c,
.usr2 = ESP32C61_SPI_REG_BASE + 0x20,
.w0 = ESP32C61_SPI_REG_BASE + 0x58,
.mosi_dlen = ESP32C61_SPI_REG_BASE + 0x24,
.miso_dlen = ESP32C61_SPI_REG_BASE + 0x28,
},
.efuse_base = 0x600B4800,
.chip_magic_value = (const uint32_t[]){ 0x7211606F },
.magic_values_count = 1,
.read_spi_config = spi_config_unsupported,
.mac_efuse_offset = 0x44,
.encryption_in_begin_flash_cmd = true,
.chip_id = 20,
},
};

const target_registers_t *get_esp_target_data(target_chip_t chip)
Expand Down
Loading