Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP32-S3 bootloader stub #72

Merged
merged 1 commit into from
Jun 14, 2022
Merged

Conversation

duncandrennan
Copy link
Contributor

@duncandrennan
Copy link
Contributor Author

  • Updated to use 4.4.1-r1
  • Committed the stubs

@rojer
Copy link
Contributor

rojer commented Jun 12, 2022

i've made the C3 stub work and cleaned up some stuff in the process.
please rebase over latest master.

@duncandrennan
Copy link
Contributor Author

Working on this to align it with what you've done

@duncandrennan
Copy link
Contributor Author

duncandrennan commented Jun 13, 2022

I don't quite follow your EFUSE system in esp32c3.go. You have

const (
	EFUSE_BASE = 0x60008800
)

func GetChipDescr(rr esp.RegReader) (string, error) {
	block1_word3, err := rr.ReadReg(EFUSE_BASE + 0x44 + (3 * 4))

but when I look at the technical manual it has EFUSE base as 0x6001_A000, and I don't really follow the 0x44 + (3 * 4). I see from the IDF that,

WAFER_VERSION,                        EFUSE_BLK1,  114,    3,     WAFER version 0:A
PKG_VERSION,                          EFUSE_BLK1,  117,    3,     Package version

With each efuse block being 256 bits (32 bytes, 8 32-bit words), I'm not making the connection to the 0x44 and (3 * 4)

The -S3 has the PGK_VERSION in the same location within the efuse as the -C3, but the base address is different. Could you please clarify as I'd like to get this correct for the -S3.

@duncandrennan
Copy link
Contributor Author

Ok, I get it now. soc.h has the base address (which for the -C3 differs from the technical manual), and I understand the 0x44 + (3 * 4)

@duncandrennan
Copy link
Contributor Author

I've rebased and tested that it works to read/write flash for both the -S3 and the -C3. I did have to rebuild the 4.4.1-r2 docker image to make it work (the one on docker hub doesn't have the -S3 files in it)

@rojer
Copy link
Contributor

rojer commented Jun 14, 2022

re: efuse address - tbh, i drew my inspiration from esptool.py directly, and masterfully borrowed the formula it is using :)

ok, this looks good. we should probably dedup uart.c as it's a copy-paste job across 3 platforms, but this can be done later.
thanks for this!

@rojer rojer merged commit 2d81566 into mongoose-os:master Jun 14, 2022
@rojer
Copy link
Contributor

rojer commented Jun 14, 2022

I did have to rebuild the 4.4.1-r2 docker image to make it work (the one on docker hub doesn't have the -S3 files in it)

i built and pushed 4.4.1-r2. i'm not updating sdk.version yet, will do along with basic C3 support

@duncandrennan duncandrennan deleted the esp32-s3 branch June 15, 2022 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants