Skip to content

Commit 5f661a3

Browse files
authored
Merge pull request #35 from jannic-dev-forks/use_updated_boot2
Use rp2040-boot2 version 0.3 from git
2 parents deca3b8 + 3bce2a8 commit 5f661a3

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

Cargo.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ version = "0.4.0"
1111
# Useful Cortex-M specific functions (e.g. SysTick)
1212
cortex-m = "0.7"
1313
# The Raspberry Pi Pico HAL
14-
rp-pico = "0.5"
14+
rp-pico = { version = "0.6", default-features = false, features = [ "rt", "critical-section-impl", "rom-func-cache" ] }
1515
# Cortex-M run-time (or start-up) code
1616
cortex-m-rt = "0.7"
1717
# The BIOS to OS API
1818
neotron-common-bios = "0.7.0"
1919
# For the RP2040 bootloader
20-
rp2040-boot2 = "0.2"
20+
rp2040-boot2 = "0.3.0"
2121
# For hardware abstraction traits
2222
embedded-hal ="0.2"
2323
# Gives us formatted PC-side logging
@@ -53,3 +53,6 @@ codegen-units = 1
5353
debug = true
5454
# better optimizations
5555
lto = true
56+
57+
[patch.crates-io]
58+
rp2040-boot2 = { version = "0.3.0", git = "https://github.com/rp-rs/rp2040-boot2" }

src/main.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@
3333
#![no_std]
3434
#![no_main]
3535

36+
// The boot2 feature of rp-pico is temporarily disabled, so the version
37+
// of rp2040-boot2 can be overridden. Therefore, BOOT2_FIRMWARE needs to be
38+
// defined here.
39+
#[link_section = ".boot2"]
40+
#[no_mangle]
41+
#[used]
42+
pub static BOOT2_FIRMWARE: [u8; 256] = rp2040_boot2::BOOT_LOADER_W25Q080;
43+
3644
// -----------------------------------------------------------------------------
3745
// Sub-modules
3846
// -----------------------------------------------------------------------------
@@ -310,6 +318,10 @@ fn main() -> ! {
310318

311319
info!("Clocks OK");
312320

321+
info!("SCKDV: {}", unsafe {
322+
(*rp_pico::pac::XIP_SSI::ptr()).baudr.read().bits()
323+
});
324+
313325
// sio is the *Single-cycle Input/Output* peripheral. It has all our GPIO
314326
// pins, as well as some mailboxes and other useful things for inter-core
315327
// communications.

0 commit comments

Comments
 (0)