Skip to content
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

RP2040 example (already created) #10

Open
ChocolateLoverRaj opened this issue Nov 30, 2024 · 1 comment
Open

RP2040 example (already created) #10

ChocolateLoverRaj opened this issue Nov 30, 2024 · 1 comment

Comments

@ChocolateLoverRaj
Copy link

I modified the stm32f411x_scsi_bbb.rs example to run on a RP2040-based board. Here is my example: https://github.com/ChocolateLoverRaj/auto-boot/tree/aa74717dabebf876fd322e9f58c91cec82a296e4. Should it be added to this repo? If so, how? A different folder for RP2040?

@apohrebniak
Copy link
Owner

Thanks for using the crate!

Well, yes separate examples_stm32 and examples_rp2040 would be the most straightforward option, but my personal preference would be to first try adding a rp2040_scsi_bbb.rs file to the existing examples. I see two issues with the latter approach: different targets and different linker scripts.

For targets, I think, it would be alright to just hide target-depended dependencies(HAL) under cargo features and then build each example separately in CI (with --bin).

The linker problem is a bit more complicated. My idea is to have two liker scripts: e.g. stm32.ld and rp2040.ld and get rid of memory.x. Then, in examples/build.rs, add something like if CARGO_BIN_NAME == "rp2040_scsi_bbb" { println!("cargo:rustc-link-arg=-Trp2040.ld");}.
Perhaps there're more elegant solutions. That's just something from the top if my head

https://docs.rs/cortex-m-rt/latest/cortex_m_rt/#custom-linker-script

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

No branches or pull requests

2 participants