Can not guess flash more than 16MB correctly
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- embedded-iot
Research direction
Start at the guess_flash_size function and inspect how its max_size limit controls flash detection. Reproduce the two-16M-chip case, then verify that the chosen scalable configuration lets picotool recognize the full flash and that info, load, and save continue to work.
Written by the indexing model from the issue text.
Description
I designed a development board with two 16M flash chips and correctly configured the opt parameters, but picotool can only recognize 16M of space.I found an issue in the source code of guess_flash_size
// Read at decreasing power-of-two addresses until we don't see the boot pages again
const int min_size = 16 * PAGE_SIZE;
const int max_size = 8 * 1024 * 1024;
int size;
for (size = max_size; size >= min_size; size >>= 1) {
auto new_pages = access.read_vector<uint8_t>(FLASH_START + size, 2 * PAGE_SIZE);
if (!std::equal(first_two_pages.begin(), first_two_pages.end(), new_pages.begin())) break;
}
return size * 2;
Then I change the max_size to 16x1024x1024,All the picotool functions,such as info /load/save .. can run correctly.
Considering future scalability, there should be a better configuration option to address this issue.
- 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
-
picotool load file.bin -o 0x11000000 always fails with second flash chip present and configured Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
raspberrypi/picotool#360 ·
-
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 ·
All issues in raspberrypi/picotool
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Sensor initialization takes very long when `--initial-sim-time` is set to current UNIX timestamp Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
gazebosim/gz-sensors#662 · 1 comment ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
LadybirdBrowser/ladybird#12123 ·