Skip to content

Use zerocopy in place of references for the definition of PartitionEntry#4839

Open
B83C wants to merge 8 commits into
esp-rs:mainfrom
B83C:use_zerocopy
Open

Use zerocopy in place of references for the definition of PartitionEntry#4839
B83C wants to merge 8 commits into
esp-rs:mainfrom
B83C:use_zerocopy

Conversation

@B83C

@B83C B83C commented Jan 23, 2026

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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

@bugadani bugadani added the status:awaiting-response Awaiting a response from the author label Feb 2, 2026
@github-actions github-actions Bot added the merge-conflict Merge conflict detected. Automatically added/removed by CI. label Jun 16, 2026
@github-actions

Copy link
Copy Markdown

New commits in main have made this PR unmergeable. Please resolve the conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-conflict Merge conflict detected. Automatically added/removed by CI. status:awaiting-response Awaiting a response from the author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants