Skip to content

Conversation

@Kytezign
Copy link
Contributor

@Kytezign Kytezign commented Oct 3, 2025

When assembled the jmp and wrap/wrap_target are relative to the start of the program. When added into instruction memory the addresses they point to have to be offset.

Fixed by adding the program offset when loading the program into the pio memory. Without this, jmp and wrap could point to a different program (the first one loaded)

When assembled the jmp and wrap/wrap_target are relative to the start of the program.  When added into instruction memory the addresses they point to have to be offset.
@Kytezign Kytezign requested a review from mattnite October 5, 2025 17:54
@Kytezign
Copy link
Contributor Author

Kytezign commented Oct 7, 2025

@mattnite,
Is there something more you are waiting on for this one? I think I've resolved all the requested changes.

@Grazfather
Copy link
Collaborator

It would be fantastic if you added a test problem that demonstrated the issue and the fix.

@Kytezign
Copy link
Contributor Author

Kytezign commented Oct 7, 2025

@Grazfather
You mean in the commit? Or are you just looking for more details about the issue in the comments?

@Grazfather
Copy link
Collaborator

Grazfather commented Oct 7, 2025 via email

@Kytezign Kytezign changed the title rp2040 pio: offset jmp and wrap behaviors when program is added rp2040 pio: fixing absolute addressing of jmp and wrap by adding the program offset when loading the program into the pio memory. Without this, jmp and wrap could point to a different program (the first one loaded) Oct 7, 2025
@Kytezign
Copy link
Contributor Author

Kytezign commented Oct 7, 2025

@Grazfather

I updated the title to give some indication of the problem and how this fixes it.

@Grazfather Grazfather changed the title rp2040 pio: fixing absolute addressing of jmp and wrap by adding the program offset when loading the program into the pio memory. Without this, jmp and wrap could point to a different program (the first one loaded) rp2040 pio: Fix absolute addressing of jmp and wrap Oct 8, 2025
@Grazfather
Copy link
Collaborator

I actually mixed up which PR I was replying to (I was on my phone).

In #702 I would like for you to explain the update better in the title because when merged it'll be easier to spot what you are updating and why via commit history.

@Kytezign
Copy link
Contributor Author

Kytezign commented Oct 8, 2025

@Grazfather
Ok. I'm not the author of #702 I'll let them handle that request. Is there anything more I can do for this PR?

@Grazfather
Copy link
Collaborator

Yeah my mistake! that's what I get for commenting via email.

@Grazfather
Copy link
Collaborator

It looks good to me but I will let Matt give final approval.

@Kytezign
Copy link
Contributor Author

Not sure what if anything needs to be done about this, but my changes here are solving a subset of the problems addressed by #633 in a slightly different (simpler?) way.

Copy link
Contributor

@mattnite mattnite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about the wait @Kytezign, it's just been a busy period of time for me. I should be faster to merge in the future

@mattnite mattnite merged commit 32ffff4 into ZigEmbeddedGroup:main Oct 12, 2025
49 checks passed
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.

3 participants