Skip to content

Commit

Permalink
add esp32c5 eco1 magic number
Browse files Browse the repository at this point in the history
  • Loading branch information
brianignacio5 committed Oct 14, 2024
1 parent e561a56 commit fdda416
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions examples/typescript/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ <h4 align="center">A Serial Flasher utility for Espressif chips</h4>
</div>
<div align="center">
<a class="btn btn-info" href="./docs/index.html">View the API Documentation</a>

<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" id="debugLogging" value="">
<label class="form-check-label" for="debugLogging">Show Debug log</label>
</div>
</div>
<div class="container" id="main">
<hr/>
Expand Down
3 changes: 3 additions & 0 deletions examples/typescript/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ const lblConnTo = document.getElementById("lblConnTo");
const table = document.getElementById("fileTable") as HTMLTableElement;
const alertDiv = document.getElementById("alertDiv");

const debugLogging = document.getElementById("debugLogging") as HTMLInputElement;

// This is a frontend example of Esptool-JS using local bundle file
// To optimize use a CDN hosted version like
// https://unpkg.com/[email protected]/bundle.js
Expand Down Expand Up @@ -92,6 +94,7 @@ connectButton.onclick = async () => {
transport,
baudrate: parseInt(baudrates.value),
terminal: espLoaderTerminal,
debugLogging: debugLogging.checked,
} as LoaderOptions;
esploader = new ESPLoader(flashOptions);

Expand Down
5 changes: 3 additions & 2 deletions src/esploader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ async function magic2Chip(magic: number): Promise<ROM | null> {
const { ESP32C6ROM } = await import("./targets/esp32c6.js");
return new ESP32C6ROM();
}
case 0x1101406f: {
case 0x1101406f:
case 0x63e1406f: {
const { ESP32C5ROM } = await import("./targets/esp32c5.js");
return new ESP32C5ROM();
}
Expand Down Expand Up @@ -680,7 +681,7 @@ export class ESPLoader {
this.info("\n\r", false);

if (!detecting) {
const chipMagicValue = (await this.readReg(0x40001000)) >>> 0;
const chipMagicValue = (await this.readReg(this.CHIP_DETECT_MAGIC_REG_ADDR)) >>> 0;
this.debug("Chip Magic " + chipMagicValue.toString(16));
const chip = await magic2Chip(chipMagicValue);
if (this.chip === null) {
Expand Down

0 comments on commit fdda416

Please sign in to comment.