Skip to content

feat: Add auto-detect ESP chip via security info and improve test coverage#12

Open
gandarez wants to merge 1 commit intotinygo-org:mainfrom
gandarez:feat/auto-detect-esp
Open

feat: Add auto-detect ESP chip via security info and improve test coverage#12
gandarez wants to merge 1 commit intotinygo-org:mainfrom
gandarez:feat/auto-detect-esp

Conversation

@gandarez
Copy link

@gandarez gandarez commented Mar 13, 2026

  • Refactor chip detection from magic-register-only approach to use GET_SECURITY_INFO command with ChipID fallback via readReg.
  • Add security_info.go for parsing security info responses (12/20 byte variants) and security flag decoding.
  • Expand protocol layer with securityInfo command support and improve test coverage across flasher, protocol, and security_info packages.

This PR is essential to get esp32c6 support in this PR

…erage

Refactor chip detection from magic-register-only approach to use
GET_SECURITY_INFO command with ChipID fallback via readReg. Add
security_info.go for parsing security info responses (12/20 byte
variants) and security flag decoding. Expand protocol layer with
securityInfo command support and improve test coverage across
flasher, protocol, and security_info packages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cmdSync byte = 0x08 // Sync with bootloader
cmdWriteReg byte = 0x09 // Write 32-bit memory-mapped register
cmdReadReg byte = 0x0A // Read 32-bit memory-mapped register
cmdSecurityInfoReg byte = 0x14 // Read security info (chip ID, flash encryption, etc.)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there does not seem to be much change here, it would make reviewer's life easier if the added line was separated by a empty line so as to not change the formatting of the entire declaration group.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

humm that's the identation caused by go fmt. Adding an extra space and getting it merged will make it look very strange.

Comment on lines +24 to +25
cmdSPISetParams byte = 0x0B // Configure SPI flash parameters
cmdSPIAttach byte = 0x0D // Attach SPI flash
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not changed, only cmdSecurityInfoReg was added

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