picotool load file.bin -o 0x11000000 always fails with second flash chip present and configured
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cpp
- Domain
- cli, embedded-iot
Research direction
Start at the load_guts function and inspect the flash-size validation around the reported comparison. Reproduce picotool load file.bin -o 0x11000000 with a configured second flash chip, then verify the command succeeds without regressing the flash-size error for an out-of-range offset.
Written by the indexing model from the issue text.
Description
Failure:
ERROR: File size 0x100 starting at 0x1000000 is too big to fit in flash size 0x200000
Appears to be due to a bug in #121 where an offset is compared against an address. Offending line and proposed fix which I've tested.
@@ -5277,7 +5278,7 @@ bool load_guts(picoboot::connection con, iostream_memory_access &file_access) {
uint32_t size_guess = guess_flash_size(raw_access);
if (size_guess > 0) {
// Skip check when targeting PSRAM, which is anything above 0x11000000
- if (flash_start_offset < FLASH_END_RP2040 && (flash_start_offset + flash_data_size) > size_guess) {
+ if (flash_start_offset < (FLASH_END_RP2040 - FLASH_START) && (flash_start_offset + flash_data_size) > size_guess) {
if (flash_start_offset) {
fail(ERROR_NOT_POSSIBLE, "File size 0x%x starting at 0x%x is too big to fit in flash size 0x%x", flash_data_size, flash_start_offset, size_guess);
} else {
- Dominant language
- C++
- Stars
- 999
- Forks
- 189
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from raspberrypi/picotool
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
raspberrypi/picotool#347 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
raspberrypi/picotool#348 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
raspberrypi/picotool#344 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
raspberrypi/picotool#330 · 1 comment ·
-
Improve discoverability of family names and improve the user experience in related error messages Open
raspberrypi/picotool#305 · 6 comments · 1 reaction · 1 assignee ·
All issues in raspberrypi/picotool
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
infiniflow/infinity#3502 ·