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

Using SubType::Custom to generate a partition table causes panic when flashing #28

Open
cs-clarence opened this issue Dec 30, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@cs-clarence
Copy link

Using SubType::Custom when generating a partition table causes panic when flashing:

Partition::new(
  "fs",
  Type::Data,
  SubType::Custom(0x83), // littlefs 
  0x810_000, // App offsets must be multiples of 0x10000 (64KB)
  0x600_000,
  false,
);

a snippet used to generate a partition table file

Unfortunately, panic occurs when flashing:

Error:   × Main thread panicked.
  ├─▶ at /home/rencedm112/.cargo/registry/src/index.crates.io-6f17d22bba15001f/esp-idf-part-0.4.1/src/partition/mod.rs:171:56
  ╰─▶ called `Option::unwrap()` on a `None` value
  help: set the `RUST_BACKTRACE=1` environment variable to display a backtrace.

The panic occurs here:

/// Create a [SubType::Data] variant from an integer value
pub fn data(value: u8) -> Self {
    Self::Data(DataType::from_repr(value as usize).unwrap())
}

the panic occurs because 0x832 subtype is not recognized, which causes DataType::from_repr() to return Option::None

@jessebraham jessebraham added the bug Something isn't working label Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

2 participants