Skip to content

Commit

Permalink
Fix minimal example
Browse files Browse the repository at this point in the history
The issue was that IO bank 0 was not out of reset, which is needed for
the errata 5 workaround.
  • Loading branch information
KoviRobi committed Jan 18, 2025
1 parent af78547 commit 98355aa
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion examples/minimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use rp_pico as bsp;

use bsp::entry;
use bsp::hal::pac::interrupt;
use bsp::hal::{clocks::init_clocks_and_plls, pac, usb::UsbBus, watchdog::Watchdog};
use bsp::hal::{clocks::init_clocks_and_plls, pac, usb::UsbBus, watchdog::Watchdog, Sio};

// USB Device support
use usb_device::class_prelude::UsbBusAllocator;
Expand Down Expand Up @@ -40,6 +40,16 @@ fn main() -> ! {
.ok()
.unwrap();

let sio = Sio::new(pac.SIO);

// Need IO bank 0 out of reset for USB
bsp::hal::gpio::Pins::new(
pac.IO_BANK0,
pac.PADS_BANK0,
sio.gpio_bank0,
&mut pac.RESETS,
);

let usb_bus = UsbBusAllocator::new(UsbBus::new(
pac.USBCTRL_REGS,
pac.USBCTRL_DPRAM,
Expand Down

0 comments on commit 98355aa

Please sign in to comment.