I made an RP2040 board, and am trying to program it in Rust. See modified template at https://github.com/Erhannis/rp2040-project-template/tree/erhannis/raw_rp2040 . Now, since this isn’t a Pico board, I dutifully followed the instructions in the Cargo.toml and uncommented like so:
# If you're not going to use a Board Support Package you'll need these:
rp2040-hal = { version = "0.10", features = ["rt", "critical-section-impl"] }
rp2040-boot2 = "0.3"
and swapped the uses of rp-pico for rp2040-hal.
Weird thing, the code runs fine…IFF I use rp_pico::entry;
. If instead I use rp2040_hal::entry;
, the code doesn’t run, apparently never enters. How is this possible? Looking at rp_pico::entry
, it looks like it just aliases back to rp2040_hal::entry
:
pub extern crate rp2040_hal as hal;
...
#[cfg(feature = "rt")]
pub use hal::entry;
This works:
// use rp2040_hal::entry;
use rp_pico::entry;
and this does not:
use rp2040_hal::entry;
// use rp_pico::entry;
but they should be the same code. What gives?