1#![no_std]
10#![no_main]
11#![deny(missing_docs)]
12
13use core::ptr::addr_of_mut;
14
15use capsules_core::virtualizers::virtual_alarm::VirtualMuxAlarm;
16use components::gpio::GpioComponent;
17use kernel::capabilities;
18use kernel::component::Component;
19use kernel::hil::led::LedHigh;
20use kernel::platform::{KernelResources, SyscallDriverLookup};
21use kernel::process::ProcessArray;
22use kernel::scheduler::round_robin::RoundRobinSched;
23use kernel::{create_capability, debug, static_init};
24
25use stm32f429zi::chip_specs::Stm32f429Specs;
26use stm32f429zi::clocks::hsi::HSI_FREQUENCY_MHZ;
27use stm32f429zi::gpio::{AlternateFunction, Mode, PinId, PortId};
28use stm32f429zi::interrupt_service::Stm32f429ziDefaultPeripherals;
29
30pub mod io;
32
33const NUM_PROCS: usize = 4;
35
36type ChipHw = stm32f429zi::chip::Stm32f4xx<'static, Stm32f429ziDefaultPeripherals<'static>>;
37
38static mut PROCESSES: Option<&'static ProcessArray<NUM_PROCS>> = None;
40static mut CHIP: Option<&'static ChipHw> = None;
41static mut PROCESS_PRINTER: Option<&'static capsules_system::process_printer::ProcessPrinterText> =
42 None;
43
44const FAULT_RESPONSE: capsules_system::process_policies::PanicFaultPolicy =
46 capsules_system::process_policies::PanicFaultPolicy {};
47
48kernel::stack_size! {0x2000}
49
50type TemperatureSTMSensor = components::temperature_stm::TemperatureSTMComponentType<
51 capsules_core::virtualizers::virtual_adc::AdcDevice<'static, stm32f429zi::adc::Adc<'static>>,
52>;
53type TemperatureDriver = components::temperature::TemperatureComponentType<TemperatureSTMSensor>;
54
55struct STM32F429IDiscovery {
58 console: &'static capsules_core::console::Console<'static>,
59 ipc: kernel::ipc::IPC<{ NUM_PROCS as u8 }>,
60 led: &'static capsules_core::led::LedDriver<
61 'static,
62 LedHigh<'static, stm32f429zi::gpio::Pin<'static>>,
63 4,
64 >,
65 button: &'static capsules_core::button::Button<'static, stm32f429zi::gpio::Pin<'static>>,
66 adc: &'static capsules_core::adc::AdcVirtualized<'static>,
67 alarm: &'static capsules_core::alarm::AlarmDriver<
68 'static,
69 VirtualMuxAlarm<'static, stm32f429zi::tim2::Tim2<'static>>,
70 >,
71 temperature: &'static TemperatureDriver,
72 gpio: &'static capsules_core::gpio::GPIO<'static, stm32f429zi::gpio::Pin<'static>>,
73
74 scheduler: &'static RoundRobinSched<'static>,
75 systick: cortexm4::systick::SysTick,
76}
77
78impl SyscallDriverLookup for STM32F429IDiscovery {
80 fn with_driver<F, R>(&self, driver_num: usize, f: F) -> R
81 where
82 F: FnOnce(Option<&dyn kernel::syscall::SyscallDriver>) -> R,
83 {
84 match driver_num {
85 capsules_core::console::DRIVER_NUM => f(Some(self.console)),
86 capsules_core::led::DRIVER_NUM => f(Some(self.led)),
87 capsules_core::button::DRIVER_NUM => f(Some(self.button)),
88 capsules_core::adc::DRIVER_NUM => f(Some(self.adc)),
89 capsules_core::alarm::DRIVER_NUM => f(Some(self.alarm)),
90 capsules_extra::temperature::DRIVER_NUM => f(Some(self.temperature)),
91 kernel::ipc::DRIVER_NUM => f(Some(&self.ipc)),
92 capsules_core::gpio::DRIVER_NUM => f(Some(self.gpio)),
93 _ => f(None),
94 }
95 }
96}
97
98impl
99 KernelResources<
100 stm32f429zi::chip::Stm32f4xx<
101 'static,
102 stm32f429zi::interrupt_service::Stm32f429ziDefaultPeripherals<'static>,
103 >,
104 > for STM32F429IDiscovery
105{
106 type SyscallDriverLookup = Self;
107 type SyscallFilter = ();
108 type ProcessFault = ();
109 type Scheduler = RoundRobinSched<'static>;
110 type SchedulerTimer = cortexm4::systick::SysTick;
111 type WatchDog = ();
112 type ContextSwitchCallback = ();
113
114 fn syscall_driver_lookup(&self) -> &Self::SyscallDriverLookup {
115 self
116 }
117 fn syscall_filter(&self) -> &Self::SyscallFilter {
118 &()
119 }
120 fn process_fault(&self) -> &Self::ProcessFault {
121 &()
122 }
123 fn scheduler(&self) -> &Self::Scheduler {
124 self.scheduler
125 }
126 fn scheduler_timer(&self) -> &Self::SchedulerTimer {
127 &self.systick
128 }
129 fn watchdog(&self) -> &Self::WatchDog {
130 &()
131 }
132 fn context_switch_callback(&self) -> &Self::ContextSwitchCallback {
133 &()
134 }
135}
136
137unsafe fn setup_dma(
139 dma: &stm32f429zi::dma::Dma2,
140 dma_streams: &'static [stm32f429zi::dma::Stream<'static, stm32f429zi::dma::Dma2>; 8],
141 usart1: &'static stm32f429zi::usart::Usart<stm32f429zi::dma::Dma2>,
142) {
143 use stm32f429zi::dma::Dma2Peripheral;
144 use stm32f429zi::usart;
145
146 dma.enable_clock();
147
148 let usart1_tx_stream = &dma_streams[Dma2Peripheral::USART1_TX.get_stream_idx()];
149 let usart1_rx_stream = &dma_streams[Dma2Peripheral::USART1_RX.get_stream_idx()];
150
151 usart1.set_dma(
152 usart::TxDMA(usart1_tx_stream),
153 usart::RxDMA(usart1_rx_stream),
154 );
155
156 usart1_tx_stream.set_client(usart1);
157 usart1_rx_stream.set_client(usart1);
158
159 usart1_tx_stream.setup(Dma2Peripheral::USART1_TX);
160 usart1_rx_stream.setup(Dma2Peripheral::USART1_RX);
161
162 cortexm4::nvic::Nvic::new(Dma2Peripheral::USART1_TX.get_stream_irqn()).enable();
163 cortexm4::nvic::Nvic::new(Dma2Peripheral::USART1_RX.get_stream_irqn()).enable();
164}
165
166unsafe fn set_pin_primary_functions(
168 syscfg: &stm32f429zi::syscfg::Syscfg,
169 gpio_ports: &'static stm32f429zi::gpio::GpioPorts<'static>,
170) {
171 use kernel::hil::gpio::Configure;
172
173 syscfg.enable_clock();
174
175 gpio_ports.get_port_from_port_id(PortId::G).enable_clock();
176
177 gpio_ports.get_pin(PinId::PG14).map(|pin| {
179 pin.make_output();
180
181 let debug_gpios = static_init!([&'static dyn kernel::hil::gpio::Pin; 1], [pin]);
183 kernel::debug::initialize_debug_gpio::<
184 <ChipHw as kernel::platform::chip::Chip>::ThreadIdProvider,
185 >();
186 kernel::debug::assign_gpios(debug_gpios);
187 });
188
189 gpio_ports.get_port_from_port_id(PortId::A).enable_clock();
190
191 gpio_ports.get_pin(PinId::PA09).map(|pin| {
194 pin.set_mode(Mode::AlternateFunctionMode);
195 pin.set_alternate_function(AlternateFunction::AF7);
197 });
198 gpio_ports.get_pin(PinId::PA10).map(|pin| {
199 pin.set_mode(Mode::AlternateFunctionMode);
200 pin.set_alternate_function(AlternateFunction::AF7);
202 });
203
204 gpio_ports.get_pin(PinId::PA00).map(|pin| {
206 pin.enable_interrupt();
212 });
213 cortexm4::nvic::Nvic::new(stm32f429zi::nvic::EXTI0).enable(); gpio_ports.get_port_from_port_id(PortId::B).enable_clock();
221 gpio_ports.get_port_from_port_id(PortId::C).enable_clock();
222 gpio_ports.get_port_from_port_id(PortId::D).enable_clock();
223 gpio_ports.get_port_from_port_id(PortId::E).enable_clock();
224 gpio_ports.get_port_from_port_id(PortId::F).enable_clock();
225 gpio_ports.get_port_from_port_id(PortId::H).enable_clock();
227
228 gpio_ports.get_pin(PinId::PA03).map(|pin| {
230 pin.set_mode(stm32f429zi::gpio::Mode::AnalogMode);
231 });
232
233 gpio_ports.get_pin(PinId::PC00).map(|pin| {
235 pin.set_mode(stm32f429zi::gpio::Mode::AnalogMode);
236 });
237
238 gpio_ports.get_pin(PinId::PC03).map(|pin| {
240 pin.set_mode(stm32f429zi::gpio::Mode::AnalogMode);
241 });
242
243 gpio_ports.get_pin(PinId::PF03).map(|pin| {
245 pin.set_mode(stm32f429zi::gpio::Mode::AnalogMode);
246 });
247
248 gpio_ports.get_pin(PinId::PF05).map(|pin| {
250 pin.set_mode(stm32f429zi::gpio::Mode::AnalogMode);
251 });
252
253 gpio_ports.get_pin(PinId::PF10).map(|pin| {
255 pin.set_mode(stm32f429zi::gpio::Mode::AnalogMode);
256 });
257}
258
259unsafe fn setup_peripherals(tim2: &stm32f429zi::tim2::Tim2) {
261 cortexm4::nvic::Nvic::new(stm32f429zi::nvic::USART1).enable();
263
264 tim2.enable_clock();
266 tim2.start();
267 cortexm4::nvic::Nvic::new(stm32f429zi::nvic::TIM2).enable();
268}
269
270#[inline(never)]
276unsafe fn start() -> (
277 &'static kernel::Kernel,
278 STM32F429IDiscovery,
279 &'static stm32f429zi::chip::Stm32f4xx<'static, Stm32f429ziDefaultPeripherals<'static>>,
280) {
281 stm32f429zi::init();
282
283 kernel::deferred_call::initialize_deferred_call_state::<
285 <ChipHw as kernel::platform::chip::Chip>::ThreadIdProvider,
286 >();
287
288 let rcc = static_init!(stm32f429zi::rcc::Rcc, stm32f429zi::rcc::Rcc::new());
290 let clocks = static_init!(
291 stm32f429zi::clocks::Clocks<Stm32f429Specs>,
292 stm32f429zi::clocks::Clocks::new(rcc)
293 );
294 let syscfg = static_init!(
295 stm32f429zi::syscfg::Syscfg,
296 stm32f429zi::syscfg::Syscfg::new(clocks)
297 );
298 let exti = static_init!(
299 stm32f429zi::exti::Exti,
300 stm32f429zi::exti::Exti::new(syscfg)
301 );
302 let dma1 = static_init!(stm32f429zi::dma::Dma1, stm32f429zi::dma::Dma1::new(clocks));
303 let dma2 = static_init!(stm32f429zi::dma::Dma2, stm32f429zi::dma::Dma2::new(clocks));
304 let peripherals = static_init!(
305 Stm32f429ziDefaultPeripherals,
306 Stm32f429ziDefaultPeripherals::new(clocks, exti, dma1, dma2)
307 );
308
309 peripherals.init();
310 let base_peripherals = &peripherals.stm32f4;
311
312 setup_peripherals(&base_peripherals.tim2);
313
314 set_pin_primary_functions(syscfg, &base_peripherals.gpio_ports);
315
316 setup_dma(
317 dma2,
318 &base_peripherals.dma2_streams,
319 &base_peripherals.usart1,
320 );
321
322 let processes = components::process_array::ProcessArrayComponent::new()
324 .finalize(components::process_array_component_static!(NUM_PROCS));
325 PROCESSES = Some(processes);
326
327 let board_kernel = static_init!(kernel::Kernel, kernel::Kernel::new(processes.as_slice()));
329
330 let chip = static_init!(
331 stm32f429zi::chip::Stm32f4xx<Stm32f429ziDefaultPeripherals>,
332 stm32f429zi::chip::Stm32f4xx::new(peripherals)
333 );
334 CHIP = Some(chip);
335
336 base_peripherals.usart1.enable_clock();
343 let uart_mux = components::console::UartMuxComponent::new(&base_peripherals.usart1, 115200)
344 .finalize(components::uart_mux_component_static!());
345
346 (*addr_of_mut!(io::WRITER)).set_initialized();
347
348 let memory_allocation_capability = create_capability!(capabilities::MemoryAllocationCapability);
351 let process_management_capability =
352 create_capability!(capabilities::ProcessManagementCapability);
353
354 let console = components::console::ConsoleComponent::new(
356 board_kernel,
357 capsules_core::console::DRIVER_NUM,
358 uart_mux,
359 )
360 .finalize(components::console_component_static!());
361 components::debug_writer::DebugWriterComponent::new::<
363 <ChipHw as kernel::platform::chip::Chip>::ThreadIdProvider,
364 >(
365 uart_mux,
366 create_capability!(capabilities::SetDebugWriterCapability),
367 )
368 .finalize(components::debug_writer_component_static!());
369
370 let gpio_ports = &base_peripherals.gpio_ports;
374
375 let led = components::led::LedsComponent::new().finalize(components::led_component_static!(
376 LedHigh<'static, stm32f429zi::gpio::Pin>,
377 LedHigh::new(gpio_ports.get_pin(stm32f429zi::gpio::PinId::PG13).unwrap()),
378 LedHigh::new(gpio_ports.get_pin(stm32f429zi::gpio::PinId::PG14).unwrap()),
379 LedHigh::new(gpio_ports.get_pin(stm32f429zi::gpio::PinId::PB13).unwrap()),
380 LedHigh::new(gpio_ports.get_pin(stm32f429zi::gpio::PinId::PC05).unwrap()),
381 ));
382
383 let button = components::button::ButtonComponent::new(
385 board_kernel,
386 capsules_core::button::DRIVER_NUM,
387 components::button_component_helper!(
388 stm32f429zi::gpio::Pin,
389 (
390 gpio_ports.get_pin(stm32f429zi::gpio::PinId::PA00).unwrap(),
391 kernel::hil::gpio::ActivationMode::ActiveHigh,
392 kernel::hil::gpio::FloatingState::PullNone
393 )
394 ),
395 )
396 .finalize(components::button_component_static!(stm32f429zi::gpio::Pin));
397
398 let tim2 = &base_peripherals.tim2;
401 let mux_alarm = components::alarm::AlarmMuxComponent::new(tim2).finalize(
402 components::alarm_mux_component_static!(stm32f429zi::tim2::Tim2),
403 );
404
405 let alarm = components::alarm::AlarmDriverComponent::new(
406 board_kernel,
407 capsules_core::alarm::DRIVER_NUM,
408 mux_alarm,
409 )
410 .finalize(components::alarm_component_static!(stm32f429zi::tim2::Tim2));
411
412 let gpio = GpioComponent::new(
414 board_kernel,
415 capsules_core::gpio::DRIVER_NUM,
416 components::gpio_component_helper!(
417 stm32f429zi::gpio::Pin,
418 0 => gpio_ports.get_pin(PinId::PG09).unwrap(), 1 => gpio_ports.pins[6][14].as_ref().unwrap(), 2 => gpio_ports.pins[5][15].as_ref().unwrap(), 3 => gpio_ports.pins[4][13].as_ref().unwrap(), 4 => gpio_ports.pins[5][14].as_ref().unwrap(), 5 => gpio_ports.pins[4][11].as_ref().unwrap(), 6 => gpio_ports.pins[4][9].as_ref().unwrap(), 7 => gpio_ports.pins[5][13].as_ref().unwrap(), 8 => gpio_ports.pins[5][12].as_ref().unwrap(), 9 => gpio_ports.pins[3][15].as_ref().unwrap(), 10 => gpio_ports.pins[3][14].as_ref().unwrap(), 11 => gpio_ports.pins[0][7].as_ref().unwrap(), 12 => gpio_ports.pins[0][6].as_ref().unwrap(), 13 => gpio_ports.pins[0][5].as_ref().unwrap(), 14 => gpio_ports.pins[1][9].as_ref().unwrap(), 15 => gpio_ports.pins[1][8].as_ref().unwrap(), 16 => gpio_ports.pins[2][6].as_ref().unwrap(), 17 => gpio_ports.pins[1][15].as_ref().unwrap(), 18 => gpio_ports.pins[1][13].as_ref().unwrap(), 19 => gpio_ports.pins[1][12].as_ref().unwrap(), 20 => gpio_ports.pins[0][15].as_ref().unwrap(), 21 => gpio_ports.pins[2][7].as_ref().unwrap(), 26 => gpio_ports.pins[1][6].as_ref().unwrap(), 27 => gpio_ports.pins[1][2].as_ref().unwrap(), 28 => gpio_ports.pins[3][13].as_ref().unwrap(), 29 => gpio_ports.pins[3][12].as_ref().unwrap(), 30 => gpio_ports.pins[3][11].as_ref().unwrap(), 31 => gpio_ports.pins[4][2].as_ref().unwrap(), 33 => gpio_ports.pins[1][0].as_ref().unwrap(), 34 => gpio_ports.pins[4][0].as_ref().unwrap(), 35 => gpio_ports.pins[1][11].as_ref().unwrap(), 36 => gpio_ports.pins[1][10].as_ref().unwrap(), 37 => gpio_ports.pins[4][15].as_ref().unwrap(), 38 => gpio_ports.pins[4][14].as_ref().unwrap(), 39 => gpio_ports.pins[4][12].as_ref().unwrap(), 40 => gpio_ports.pins[4][10].as_ref().unwrap(), 41 => gpio_ports.pins[4][7].as_ref().unwrap(), 42 => gpio_ports.pins[4][8].as_ref().unwrap(), 43 => gpio_ports.pins[2][8].as_ref().unwrap(), 44 => gpio_ports.pins[2][9].as_ref().unwrap(), 45 => gpio_ports.pins[2][10].as_ref().unwrap(), 46 => gpio_ports.pins[2][11].as_ref().unwrap(), 47 => gpio_ports.pins[2][12].as_ref().unwrap(), 48 => gpio_ports.pins[3][2].as_ref().unwrap(), 49 => gpio_ports.pins[6][2].as_ref().unwrap(), 50 => gpio_ports.pins[6][3].as_ref().unwrap(), 51 => gpio_ports.pins[3][7].as_ref().unwrap(), 52 => gpio_ports.pins[3][6].as_ref().unwrap(), 53 => gpio_ports.pins[3][5].as_ref().unwrap(), 54 => gpio_ports.pins[3][4].as_ref().unwrap(), 55 => gpio_ports.pins[3][3].as_ref().unwrap(), 56 => gpio_ports.pins[4][2].as_ref().unwrap(), 57 => gpio_ports.pins[4][4].as_ref().unwrap(), 58 => gpio_ports.pins[4][5].as_ref().unwrap(), 59 => gpio_ports.pins[4][6].as_ref().unwrap(), 60 => gpio_ports.pins[4][3].as_ref().unwrap(), 61 => gpio_ports.pins[5][8].as_ref().unwrap(), 62 => gpio_ports.pins[5][7].as_ref().unwrap(), 63 => gpio_ports.pins[5][9].as_ref().unwrap(), 64 => gpio_ports.pins[6][1].as_ref().unwrap(), 65 => gpio_ports.pins[6][0].as_ref().unwrap(), 66 => gpio_ports.pins[3][1].as_ref().unwrap(), 67 => gpio_ports.pins[3][0].as_ref().unwrap(), 68 => gpio_ports.pins[5][0].as_ref().unwrap(), 69 => gpio_ports.pins[5][1].as_ref().unwrap(), 70 => gpio_ports.pins[5][2].as_ref().unwrap(), 71 => gpio_ports.pins[0][7].as_ref().unwrap() ),
514 )
515 .finalize(components::gpio_component_static!(stm32f429zi::gpio::Pin));
516
517 let adc_mux = components::adc::AdcMuxComponent::new(&base_peripherals.adc1)
519 .finalize(components::adc_mux_component_static!(stm32f429zi::adc::Adc));
520
521 let temp_sensor = components::temperature_stm::TemperatureSTMComponent::new(
522 adc_mux,
523 stm32f429zi::adc::Channel::Channel18,
524 2.5,
525 0.76,
526 )
527 .finalize(components::temperature_stm_adc_component_static!(
528 stm32f429zi::adc::Adc
529 ));
530
531 let temp = components::temperature::TemperatureComponent::new(
532 board_kernel,
533 capsules_extra::temperature::DRIVER_NUM,
534 temp_sensor,
535 )
536 .finalize(components::temperature_component_static!(
537 TemperatureSTMSensor
538 ));
539
540 let adc_channel_0 =
541 components::adc::AdcComponent::new(adc_mux, stm32f429zi::adc::Channel::Channel3)
542 .finalize(components::adc_component_static!(stm32f429zi::adc::Adc));
543
544 let adc_channel_1 =
545 components::adc::AdcComponent::new(adc_mux, stm32f429zi::adc::Channel::Channel10)
546 .finalize(components::adc_component_static!(stm32f429zi::adc::Adc));
547
548 let adc_channel_2 =
549 components::adc::AdcComponent::new(adc_mux, stm32f429zi::adc::Channel::Channel13)
550 .finalize(components::adc_component_static!(stm32f429zi::adc::Adc));
551
552 let adc_channel_3 =
553 components::adc::AdcComponent::new(adc_mux, stm32f429zi::adc::Channel::Channel9)
554 .finalize(components::adc_component_static!(stm32f429zi::adc::Adc));
555
556 let adc_channel_4 =
557 components::adc::AdcComponent::new(adc_mux, stm32f429zi::adc::Channel::Channel15)
558 .finalize(components::adc_component_static!(stm32f429zi::adc::Adc));
559
560 let adc_channel_5 =
561 components::adc::AdcComponent::new(adc_mux, stm32f429zi::adc::Channel::Channel8)
562 .finalize(components::adc_component_static!(stm32f429zi::adc::Adc));
563
564 let adc_syscall =
565 components::adc::AdcVirtualComponent::new(board_kernel, capsules_core::adc::DRIVER_NUM)
566 .finalize(components::adc_syscall_component_helper!(
567 adc_channel_0,
568 adc_channel_1,
569 adc_channel_2,
570 adc_channel_3,
571 adc_channel_4,
572 adc_channel_5
573 ));
574
575 let process_printer = components::process_printer::ProcessPrinterTextComponent::new()
576 .finalize(components::process_printer_text_component_static!());
577 PROCESS_PRINTER = Some(process_printer);
578
579 let process_console = components::process_console::ProcessConsoleComponent::new(
581 board_kernel,
582 uart_mux,
583 mux_alarm,
584 process_printer,
585 Some(cortexm4::support::reset),
586 )
587 .finalize(components::process_console_component_static!(
588 stm32f429zi::tim2::Tim2
589 ));
590 let _ = process_console.start();
591
592 let scheduler = components::sched::round_robin::RoundRobinComponent::new(processes)
593 .finalize(components::round_robin_component_static!(NUM_PROCS));
594
595 let stm32f429i_discovery = STM32F429IDiscovery {
596 console,
597 ipc: kernel::ipc::IPC::new(
598 board_kernel,
599 kernel::ipc::DRIVER_NUM,
600 &memory_allocation_capability,
601 ),
602 adc: adc_syscall,
603 led,
604 temperature: temp,
605 button,
606 alarm,
607 gpio,
608
609 scheduler,
610 systick: cortexm4::systick::SysTick::new_with_calibration(
611 (HSI_FREQUENCY_MHZ * 1_000_000) as u32,
612 ),
613 };
614
615 debug!("Initialization complete. Entering main loop");
621
622 extern "C" {
624 static _sapps: u8;
626 static _eapps: u8;
628 static mut _sappmem: u8;
630 static _eappmem: u8;
632 }
633
634 kernel::process::load_processes(
635 board_kernel,
636 chip,
637 core::slice::from_raw_parts(
638 core::ptr::addr_of!(_sapps),
639 core::ptr::addr_of!(_eapps) as usize - core::ptr::addr_of!(_sapps) as usize,
640 ),
641 core::slice::from_raw_parts_mut(
642 core::ptr::addr_of_mut!(_sappmem),
643 core::ptr::addr_of!(_eappmem) as usize - core::ptr::addr_of!(_sappmem) as usize,
644 ),
645 &FAULT_RESPONSE,
646 &process_management_capability,
647 )
648 .unwrap_or_else(|err| {
649 debug!("Error loading processes!");
650 debug!("{:?}", err);
651 });
652
653 (board_kernel, stm32f429i_discovery, chip)
659}
660
661#[no_mangle]
663pub unsafe fn main() {
664 let main_loop_capability = create_capability!(capabilities::MainLoopCapability);
665
666 let (board_kernel, platform, chip) = start();
667 board_kernel.kernel_loop(&platform, chip, Some(&platform.ipc), &main_loop_capability);
668}