aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2022-07-17 00:33:30 +0200
committerDario Nieuwenhuis <[email protected]>2022-07-17 00:33:30 +0200
commit13c88a9ca3e4a192677a184baa7e6ac12646797d (patch)
treed66efdeb07bfb41e17d6343b78a260820463d941 /examples
parent4205eef3ec46840fff77eb45cdadcbd51938b798 (diff)
Obtain the firmware blobs from the user instead of hardcoding magic flash addrs.
Diffstat (limited to 'examples')
-rw-r--r--examples/rpi-pico-w/src/main.rs15
1 files changed, 13 insertions, 2 deletions
diff --git a/examples/rpi-pico-w/src/main.rs b/examples/rpi-pico-w/src/main.rs
index 475c69067..633c1b2b3 100644
--- a/examples/rpi-pico-w/src/main.rs
+++ b/examples/rpi-pico-w/src/main.rs
@@ -43,6 +43,17 @@ async fn net_task(stack: &'static Stack<cyw43::NetDevice<'static>>) -> ! {
43async fn main(spawner: Spawner, p: Peripherals) { 43async fn main(spawner: Spawner, p: Peripherals) {
44 info!("Hello World!"); 44 info!("Hello World!");
45 45
46 // Include the WiFi firmware and CLM.
47 let fw = include_bytes!("../../../firmware/43439A0.bin");
48 let clm = include_bytes!("../../../firmware/43439A0_clm.bin");
49
50 // To make flashing faster for development, you may want to flash the firmwares independently
51 // at hardcoded addresses, instead of baking them into the program with `include_bytes!`:
52 // probe-rs-cli download 43439A0.bin --format bin --chip RP2040 --base-address 0x10100000
53 // probe-rs-cli download 43439A0.clm_blob --format bin --chip RP2040 --base-address 0x10140000
54 //let fw = unsafe { core::slice::from_raw_parts(0x10100000 as *const u8, 224190) };
55 //let clm = unsafe { core::slice::from_raw_parts(0x10140000 as *const u8, 4752) };
56
46 let pwr = Output::new(p.PIN_23, Level::Low); 57 let pwr = Output::new(p.PIN_23, Level::Low);
47 let cs = Output::new(p.PIN_25, Level::High); 58 let cs = Output::new(p.PIN_25, Level::High);
48 let clk = Output::new(p.PIN_29, Level::Low); 59 let clk = Output::new(p.PIN_29, Level::Low);
@@ -54,11 +65,11 @@ async fn main(spawner: Spawner, p: Peripherals) {
54 let spi = ExclusiveDevice::new(bus, cs); 65 let spi = ExclusiveDevice::new(bus, cs);
55 66
56 let state = forever!(cyw43::State::new()); 67 let state = forever!(cyw43::State::new());
57 let (mut control, runner) = cyw43::new(state, pwr, spi).await; 68 let (mut control, runner) = cyw43::new(state, pwr, spi, fw).await;
58 69
59 spawner.spawn(wifi_task(runner)).unwrap(); 70 spawner.spawn(wifi_task(runner)).unwrap();
60 71
61 let net_device = control.init().await; 72 let net_device = control.init(clm).await;
62 73
63 //control.join_open("MikroTik-951589").await; 74 //control.join_open("MikroTik-951589").await;
64 control.join_wpa2("DirbaioWifi", "HelloWorld").await; 75 control.join_wpa2("DirbaioWifi", "HelloWorld").await;