-
Notifications
You must be signed in to change notification settings - Fork 116
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
Esp32s2 support #31
Esp32s2 support #31
Conversation
* Remove `cargo_project` it fails to parse complex config.toml * Instead, retrieve the artifact paths from the cargo build invokation * Use `anyhow` to handle errors instead of unwraps
* use the chip detect "register" and magic values instead of uart date reg * Add esp32s2 bootloader
Refer to the following lines in params = struct.pack('<IIII', erase_size, num_blocks, self.FLASH_WRITE_SIZE, offset)
if isinstance(self, (ESP32S2ROM, ESP32S3BETA2ROM, ESP32S3ROM, ESP32C3ROM, ESP32C6BETAROM, ESP32H2ROM)) and not self.IS_STUB:
params += struct.pack('<I', 1 if begin_rom_encrypted else 0) Chips newer than the ESP32 must have an additional field in Unfortunately, since the chip is defined at runtime we can't |
added the rom encryption parameter in a very hacky way for now, the flashing looks to go fine now. It now crashes in the bootloader with an "invalid partition table error"
|
@@ -138,6 +138,16 @@ struct BeginParams { | |||
offset: u32, | |||
} | |||
|
|||
#[derive(Zeroable, Pod, Copy, Clone, Debug)] | |||
#[repr(C)] | |||
struct BeginParamsS2 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This encrypted
field applies to all chips except the ESP8266/ESP32 as far as I know. This should probably be the default struct, and we can have a BeginParamsLegacy
or something to that effect instead for the older chips.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking of having some way of having per-chip command/parameter structs or otherwise moving some of the flashing logic to the chips.
A WIP PR for esp32s2 support.
I can't actually flash anything at the moment, the bootloader returns
InvalidMessage
:Any ideas?
Once I figure out whats going on, I think we can probably merge the esp32 & esp32s2 modules by expanding the
Chip
trait.Builds on top of #29 & #30