Skip to content

Rustup support #96

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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Rustup support #96

wants to merge 12 commits into from

Conversation

paulober
Copy link
Collaborator

@paulober paulober commented Oct 1, 2024

No description provided.

@paulober
Copy link
Collaborator Author

paulober commented Oct 1, 2024

Note to myself squash before merge

@will-v-pi
Copy link
Collaborator

Now that RP2350 support has been added to probe-rs (probe-rs/probe-rs#3005), I think we can simplify the rust integration to use the "Debugger for probe-rs" extension rather then Cortex-Debug for debugging rust code. This has full support for defmt, so should be easier to integrate.

@paulober
Copy link
Collaborator Author

paulober commented Feb 9, 2025

Now that RP2350 support has been added to probe-rs (probe-rs/probe-rs#3005), I think we can simplify the rust integration to use the "Debugger for probe-rs" extension rather then Cortex-Debug for debugging rust code. This has full support for defmt, so should be easier to integrate.

I'll look into it. Im currently very busy, but I may find some time in a few weeks.

@paulober
Copy link
Collaborator Author

@will-v-pi Just updated the generator to use probe-rs but I can't get the defmt rtt (on RP2350) working again.
Any idea what the old config was that worked?

@will-v-pi
Copy link
Collaborator

I think the config used by https://github.com/rp-rs/rp2040-project-template was working for me

@paulober
Copy link
Collaborator Author

I think the config used by https://github.com/rp-rs/rp2040-project-template was working for me

Also for the Pico 2?

@will-v-pi
Copy link
Collaborator

I think the config used by https://github.com/rp-rs/rp2040-project-template was working for me

Also for the Pico 2?

I haven’t tried, but my hope is that with the probe-rs support it should just be a case of changing the chip name in the config?

@paulober
Copy link
Collaborator Author

paulober commented Apr 1, 2025

@will-v-pi
The current version of this branch generates the config stuff for rp2350 but it doesn't work for me on macOS. I get pkg size could not be determined errors with the pico probe or it connected but no defmt.

It seems like the issue was the missing DEFMT_LOG flag.

Signed-off-by: paulober <[email protected]>
Copy link
Collaborator

@will-v-pi will-v-pi left a comment

Choose a reason for hiding this comment

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

This is looking great, thanks! I've tested with RP2040 and RP2350, and the only big issue I've found is that RP2350 Risc-V debugging doesn't seem to work, with probe-rs throwing an error. Do you see an error too when doing that? If it's a prope-rs issue, then probably worth putting a note somewhere, so we don't get a bunch of bug reports?

Couple of thoughts:

  • We should remove the -f flag from the Run Project picotool command, as rust projects won't work with that unless you've added it manually
  • Now rp235x-hal is on crates.io, we can get rid of the submodule and just have rp235x-hal = { version = "0.3", features = ["rt", "critical-section-impl"] } etc in the Cargo.toml
  • My new Switch Build Type command isn't getting disabled, like the other CMake commands - probably just missed when rebasing?
  • The Debug Project button throws an error "Configuration 'rp2040-project' is missing in 'launch.json'" - I'm guessing that just needs a rename in the command?
  • Could we add a Reload Window prompt after switching chips? I've found the existing Restart prompt from rust-analyzer can take a while to restart, and if you click Compile during that time it can get into a broken state

Other than that, this is looking excellent!

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.

2 participants