From d4743061fa39ed87d6fe5403c39d511946d96cfa Mon Sep 17 00:00:00 2001 From: Jan Niehusmann Date: Thu, 11 Aug 2022 11:56:36 +0000 Subject: [PATCH] Use generic boot loader for rp2040-hal examples Those examples should be independent of a specific board. The generic boot loader increases their compatibility. --- rp2040-hal/Cargo.toml | 2 +- rp2040-hal/examples/adc.rs | 2 +- rp2040-hal/examples/blinky.rs | 2 +- rp2040-hal/examples/dht11.rs | 2 +- rp2040-hal/examples/gpio_in_out.rs | 2 +- rp2040-hal/examples/gpio_irq_example.rs | 2 +- rp2040-hal/examples/i2c.rs | 2 +- rp2040-hal/examples/lcd_display.rs | 2 +- rp2040-hal/examples/multicore_fifo_blink.rs | 2 +- rp2040-hal/examples/multicore_polyblink.rs | 2 +- rp2040-hal/examples/pio_blink.rs | 2 +- rp2040-hal/examples/pio_proc_blink.rs | 2 +- rp2040-hal/examples/pio_side_set.rs | 2 +- rp2040-hal/examples/pio_synchronized.rs | 2 +- rp2040-hal/examples/pwm_blink.rs | 2 +- rp2040-hal/examples/rom_funcs.rs | 2 +- rp2040-hal/examples/spi.rs | 2 +- rp2040-hal/examples/uart.rs | 2 +- rp2040-hal/examples/watchdog.rs | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/rp2040-hal/Cargo.toml b/rp2040-hal/Cargo.toml index 2b86b06..3d7e87e 100644 --- a/rp2040-hal/Cargo.toml +++ b/rp2040-hal/Cargo.toml @@ -35,7 +35,7 @@ defmt = { version = ">=0.2.0, <0.4", optional = true } [dev-dependencies] cortex-m-rt = "0.7" panic-halt = "0.2.0" -rp2040-boot2 = "0.2.0" +rp2040-boot2 = "0.2.1" hd44780-driver = "0.4.0" pio-proc = "0.2.0" dht-sensor = "0.2.1" diff --git a/rp2040-hal/examples/adc.rs b/rp2040-hal/examples/adc.rs index a752fe5..749d276 100644 --- a/rp2040-hal/examples/adc.rs +++ b/rp2040-hal/examples/adc.rs @@ -34,7 +34,7 @@ use hal::pac; /// need this to help the ROM bootloader get our code up and running. #[link_section = ".boot2"] #[used] -pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_W25Q080; +pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_GENERIC_03H; /// External high-speed crystal on the Raspberry Pi Pico board is 12 MHz. Adjust /// if your board has a different frequency diff --git a/rp2040-hal/examples/blinky.rs b/rp2040-hal/examples/blinky.rs index a2a25f2..39d8225 100644 --- a/rp2040-hal/examples/blinky.rs +++ b/rp2040-hal/examples/blinky.rs @@ -32,7 +32,7 @@ use rp2040_hal::clocks::Clock; /// need this to help the ROM bootloader get our code up and running. #[link_section = ".boot2"] #[used] -pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_W25Q080; +pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_GENERIC_03H; /// External high-speed crystal on the Raspberry Pi Pico board is 12 MHz. Adjust /// if your board has a different frequency diff --git a/rp2040-hal/examples/dht11.rs b/rp2040-hal/examples/dht11.rs index 6dbf8ab..3b3028f 100644 --- a/rp2040-hal/examples/dht11.rs +++ b/rp2040-hal/examples/dht11.rs @@ -37,7 +37,7 @@ use hal::Clock; /// need this to help the ROM bootloader get our code up and running. #[link_section = ".boot2"] #[used] -pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_W25Q080; +pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_GENERIC_03H; /// External high-speed crystal on the Raspberry Pi Pico board is 12 MHz. Adjust /// if your board has a different frequency diff --git a/rp2040-hal/examples/gpio_in_out.rs b/rp2040-hal/examples/gpio_in_out.rs index 2703058..f01e793 100644 --- a/rp2040-hal/examples/gpio_in_out.rs +++ b/rp2040-hal/examples/gpio_in_out.rs @@ -31,7 +31,7 @@ use embedded_hal::digital::v2::OutputPin; /// need this to help the ROM bootloader get our code up and running. #[link_section = ".boot2"] #[used] -pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_W25Q080; +pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_GENERIC_03H; /// External high-speed crystal on the Raspberry Pi Pico board is 12 MHz. Adjust /// if your board has a different frequency diff --git a/rp2040-hal/examples/gpio_irq_example.rs b/rp2040-hal/examples/gpio_irq_example.rs index 3fc3d6f..d374590 100644 --- a/rp2040-hal/examples/gpio_irq_example.rs +++ b/rp2040-hal/examples/gpio_irq_example.rs @@ -54,7 +54,7 @@ use rp2040_hal::gpio::Interrupt::EdgeLow; /// need this to help the ROM bootloader get our code up and running. #[link_section = ".boot2"] #[used] -pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_W25Q080; +pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_GENERIC_03H; /// External high-speed crystal on the Raspberry Pi Pico board is 12 MHz. Adjust /// if your board has a different frequency diff --git a/rp2040-hal/examples/i2c.rs b/rp2040-hal/examples/i2c.rs index 2acf21b..719ccee 100644 --- a/rp2040-hal/examples/i2c.rs +++ b/rp2040-hal/examples/i2c.rs @@ -31,7 +31,7 @@ use hal::pac; /// need this to help the ROM bootloader get our code up and running. #[link_section = ".boot2"] #[used] -pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_W25Q080; +pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_GENERIC_03H; /// External high-speed crystal on the Raspberry Pi Pico board is 12 MHz. Adjust /// if your board has a different frequency diff --git a/rp2040-hal/examples/lcd_display.rs b/rp2040-hal/examples/lcd_display.rs index 0781d02..99c0b19 100644 --- a/rp2040-hal/examples/lcd_display.rs +++ b/rp2040-hal/examples/lcd_display.rs @@ -37,7 +37,7 @@ use hal::pac; /// need this to help the ROM bootloader get our code up and running. #[link_section = ".boot2"] #[used] -pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_W25Q080; +pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_GENERIC_03H; /// External high-speed crystal on the Raspberry Pi Pico board is 12 MHz. Adjust /// if your board has a different frequency diff --git a/rp2040-hal/examples/multicore_fifo_blink.rs b/rp2040-hal/examples/multicore_fifo_blink.rs index 6826ee7..d1f6ae6 100644 --- a/rp2040-hal/examples/multicore_fifo_blink.rs +++ b/rp2040-hal/examples/multicore_fifo_blink.rs @@ -37,7 +37,7 @@ use embedded_hal::digital::v2::ToggleableOutputPin; /// need this to help the ROM bootloader get our code up and running. #[link_section = ".boot2"] #[used] -pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_W25Q080; +pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_GENERIC_03H; /// External high-speed crystal on the Raspberry Pi Pico board is 12 MHz. Adjust /// if your board has a different frequency diff --git a/rp2040-hal/examples/multicore_polyblink.rs b/rp2040-hal/examples/multicore_polyblink.rs index 2744def..2ac5ce6 100644 --- a/rp2040-hal/examples/multicore_polyblink.rs +++ b/rp2040-hal/examples/multicore_polyblink.rs @@ -35,7 +35,7 @@ use embedded_hal::digital::v2::ToggleableOutputPin; /// need this to help the ROM bootloader get our code up and running. #[link_section = ".boot2"] #[used] -pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_W25Q080; +pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_GENERIC_03H; /// External high-speed crystal on the Raspberry Pi Pico board is 12 MHz. Adjust /// if your board has a different frequency diff --git a/rp2040-hal/examples/pio_blink.rs b/rp2040-hal/examples/pio_blink.rs index 0913607..06bee1d 100644 --- a/rp2040-hal/examples/pio_blink.rs +++ b/rp2040-hal/examples/pio_blink.rs @@ -14,7 +14,7 @@ use rp2040_hal as hal; #[link_section = ".boot2"] #[used] -pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_W25Q080; +pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_GENERIC_03H; #[entry] fn main() -> ! { diff --git a/rp2040-hal/examples/pio_proc_blink.rs b/rp2040-hal/examples/pio_proc_blink.rs index fab202f..117638d 100644 --- a/rp2040-hal/examples/pio_proc_blink.rs +++ b/rp2040-hal/examples/pio_proc_blink.rs @@ -14,7 +14,7 @@ use rp2040_hal as hal; #[link_section = ".boot2"] #[used] -pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_W25Q080; +pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_GENERIC_03H; #[entry] fn main() -> ! { diff --git a/rp2040-hal/examples/pio_side_set.rs b/rp2040-hal/examples/pio_side_set.rs index 1fcc39d..15ca165 100644 --- a/rp2040-hal/examples/pio_side_set.rs +++ b/rp2040-hal/examples/pio_side_set.rs @@ -16,7 +16,7 @@ use rp2040_hal as hal; #[link_section = ".boot2"] #[used] -pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_W25Q080; +pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_GENERIC_03H; #[entry] fn main() -> ! { diff --git a/rp2040-hal/examples/pio_synchronized.rs b/rp2040-hal/examples/pio_synchronized.rs index 096b885..dac13c9 100644 --- a/rp2040-hal/examples/pio_synchronized.rs +++ b/rp2040-hal/examples/pio_synchronized.rs @@ -16,7 +16,7 @@ use rp2040_hal as hal; #[link_section = ".boot2"] #[used] -pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_W25Q080; +pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_GENERIC_03H; #[entry] fn main() -> ! { diff --git a/rp2040-hal/examples/pwm_blink.rs b/rp2040-hal/examples/pwm_blink.rs index ee894ec..e96b641 100644 --- a/rp2040-hal/examples/pwm_blink.rs +++ b/rp2040-hal/examples/pwm_blink.rs @@ -33,7 +33,7 @@ use hal::pac; /// need this to help the ROM bootloader get our code up and running. #[link_section = ".boot2"] #[used] -pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_W25Q080; +pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_GENERIC_03H; /// The minimum PWM value (i.e. LED brightness) we want const LOW: u16 = 0; diff --git a/rp2040-hal/examples/rom_funcs.rs b/rp2040-hal/examples/rom_funcs.rs index 548400f..e2008ba 100644 --- a/rp2040-hal/examples/rom_funcs.rs +++ b/rp2040-hal/examples/rom_funcs.rs @@ -31,7 +31,7 @@ use hal::Clock; /// need this to help the ROM bootloader get our code up and running. #[link_section = ".boot2"] #[used] -pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_W25Q080; +pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_GENERIC_03H; /// External high-speed crystal on the Raspberry Pi Pico board is 12 MHz. Adjust /// if your board has a different frequency diff --git a/rp2040-hal/examples/spi.rs b/rp2040-hal/examples/spi.rs index 0f67fe7..e567629 100644 --- a/rp2040-hal/examples/spi.rs +++ b/rp2040-hal/examples/spi.rs @@ -35,7 +35,7 @@ use hal::pac; /// need this to help the ROM bootloader get our code up and running. #[link_section = ".boot2"] #[used] -pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_W25Q080; +pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_GENERIC_03H; /// External high-speed crystal on the Raspberry Pi Pico board is 12 MHz. Adjust /// if your board has a different frequency diff --git a/rp2040-hal/examples/uart.rs b/rp2040-hal/examples/uart.rs index a3ff431..9e06f73 100644 --- a/rp2040-hal/examples/uart.rs +++ b/rp2040-hal/examples/uart.rs @@ -34,7 +34,7 @@ use rp2040_hal::clocks::Clock; /// need this to help the ROM bootloader get our code up and running. #[link_section = ".boot2"] #[used] -pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_W25Q080; +pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_GENERIC_03H; /// External high-speed crystal on the Raspberry Pi Pico board is 12 MHz. Adjust /// if your board has a different frequency diff --git a/rp2040-hal/examples/watchdog.rs b/rp2040-hal/examples/watchdog.rs index ecdeff2..07094f4 100644 --- a/rp2040-hal/examples/watchdog.rs +++ b/rp2040-hal/examples/watchdog.rs @@ -34,7 +34,7 @@ use rp2040_hal::clocks::Clock; /// need this to help the ROM bootloader get our code up and running. #[link_section = ".boot2"] #[used] -pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_W25Q080; +pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_GENERIC_03H; /// External high-speed crystal on the Raspberry Pi Pico board is 12 MHz. Adjust /// if your board has a different frequency