I'm very new to embedded and trying to figure out correct way of setting USB communication with nRF52840-DK.
For nrf52840-hal
(v0.16.0) there is an example I tried to follow. To get peripherals example uses the following:
let periph = nrf52840_hal::pac::Peripherals::take().unwrap();
...
let usb_bus = UsbBusAllocator::new(Usbd::new(UsbPeripheral::new(periph.USBD, &clocks)));
But I also wanted to get LED's, so I followed blinky example from nrf52840-dk-bsp
(v0.2.0).
And here is the issue: when I'm getting board with
use nrf52840_dk_bsp::{Board, ...};
...
let mut nrf52 = Board::take().unwrap();
there is no nrf52.USBD
available.
If I try to do
let mut nrf52 = nrf52840_dk_bsp::Board::take().unwrap();
let periph = nrf52840_hal::pac::Peripherals::take().unwrap();
I see in debugger, that execution stuck at let periph = nrf52840_hal::pac::Peripherals::take().unwrap();
I suspect that I'm cooking it wrong, but struggle to find clear example or guide.