Skip to content

rp/pio: fix infinite loop when loading program that wont't fit#5704

Open
trnila wants to merge 1 commit intoembassy-rs:mainfrom
trnila:pio_fix_infinite_loop
Open

rp/pio: fix infinite loop when loading program that wont't fit#5704
trnila wants to merge 1 commit intoembassy-rs:mainfrom
trnila:pio_fix_infinite_loop

Conversation

@trnila
Copy link
Copy Markdown
Contributor

@trnila trnila commented Mar 22, 2026

When the returned address wraps around, the search was retried infinitely as the condition origin < 32 is always satisfied.

The loop condition now checks for wrap around. If it occurs, the loop exits since the entire address space has already been searched from zero address.

Fixes #5657

@trnila trnila force-pushed the pio_fix_infinite_loop branch from d982b44 to 895193d Compare March 22, 2026 15:39
When the returned address wraps around, the search was retried infinitely
as the condition `origin < 32` is always satisfied.

The loop condition now checks for wrap around. If it occurs, the loop
exits since the entire address space has already been searched from zero
address.
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.

PIO try_load_program causes infinite loop instead of InsufficientSpace

1 participant