Skip to content

Conversation

@B83C
Copy link

@B83C B83C commented Jan 23, 2026

Thank you for your contribution!

We appreciate the time and effort you've put into this pull request.
To help us review it efficiently, please ensure you've gone through the following checklist:

Submission Checklist 📝

  • I have updated existing examples or added new ones (if applicable).
  • I have used cargo xtask fmt-packages command to ensure that all changed code is formatted correctly.
  • My changes were added to the CHANGELOG.md in the proper section.
  • I have added necessary changes to user code to the latest Migration Guide.
  • My changes are in accordance to the esp-rs developer guidelines

Extra:

Pull Request Details 📖

Use zerocopy in place of references to define PartitionEntry.

Details are provided in issue

Testing

image

command ran:

cd esp-bootloader-esp-idf
cargo test --lib --tests --features "std esp32c3"

Comment on lines +106 to +129
if #[cfg(feature = "esp32")] {
let paddr = unsafe {
((0x3FF10000 as *const u32).read_volatile() & 0xff) << 16
};
} else if #[cfg(feature = "esp32s2")] {
let paddr = unsafe {
(((0x61801000 + 128 * 4) as *const u32).read_volatile() & 0xff) << 16
};
} else if #[cfg(feature = "esp32s3")] {
// Revisit this once we support XiP from PSRAM for ESP32-S3
let paddr = unsafe {
((0x600C5000 as *const u32).read_volatile() & 0xff) << 16
};
} else if #[cfg(any(feature = "esp32c2", feature = "esp32c3"))] {
let paddr = unsafe {
((0x600c5000 as *const u32).read_volatile() & 0xff) << 16
};
} else if #[cfg(any(feature = "esp32c6", feature = "esp32h2"))] {
let paddr = unsafe {
((0x60002000 + 0x380) as *mut u32).write_volatile(0);
(((0x60002000 + 0x37c) as *const u32).read_volatile() & 0xff) << 16
};
} else {
compile_error!("Paddr not defined for the current esp32 device, check if you have enabled it, or raise an issue about it");
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use the PACs here?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think with the exception of H2/C6 we don't have the necessary registers in the SVDs, yet. (Ofc we should add them)

But I think this code is duplicated - so we should at least de-dup it

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.

3 participants