diff --git a/boards/arty_e21/src/main.rs b/boards/arty_e21/src/main.rs index f987a9cce4..99b53008be 100644 --- a/boards/arty_e21/src/main.rs +++ b/boards/arty_e21/src/main.rs @@ -122,12 +122,15 @@ impl KernelResources ( + &'static kernel::Kernel, + ArtyE21, + &'static arty_e21_chip::chip::ArtyExx<'static, ArtyExxDefaultPeripherals<'static>>, +) { let peripherals = static_init!(ArtyExxDefaultPeripherals, ArtyExxDefaultPeripherals::new()); peripherals.init(); @@ -139,7 +142,6 @@ pub unsafe fn main() { chip.initialize(); let process_mgmt_cap = create_capability!(capabilities::ProcessManagementCapability); - let main_loop_cap = create_capability!(capabilities::MainLoopCapability); let board_kernel = static_init!(kernel::Kernel, kernel::Kernel::new(&PROCESSES)); @@ -296,5 +298,19 @@ pub unsafe fn main() { debug!("{:?}", err); }); - board_kernel.kernel_loop(&artye21, chip, None::<&kernel::ipc::IPC<0>>, &main_loop_cap); + (board_kernel, artye21, chip) +} + +/// Main function called after RAM initialized. +#[no_mangle] +pub unsafe fn main() { + let main_loop_capability = create_capability!(capabilities::MainLoopCapability); + + let (board_kernel, board, chip) = start(); + board_kernel.kernel_loop( + &board, + chip, + None::<&kernel::ipc::IPC<0>>, + &main_loop_capability, + ); }