pub fn init_primary(
config: Config,
shared_data: &'static MaybeUninit<SharedData>,
) -> PeripheralsExpand description
Initialize the embassy-stm32 HAL with the provided configuration.
This function does the actual initialization of the hardware, in contrast to init_secondary or try_init_secondary.
Any core can do the init, but it’s important only one core does it.
This returns the peripheral singletons that can be used for creating drivers.
This should only be called once at startup, otherwise it panics.
A hardware semaphore is used to coordinate the init with the second core. The notification sent at the end of this function is a level, not an event: a secondary core that starts (or restarts) after this function has completed observes it immediately. Any stale notification from a previous run of this core is discarded before the hardware is initialized, so a secondary core cannot mistake it for this run’s notification.