unsafe fn start_core1_init<F>() -> !
    where
        F: FnOnce(),
    {
        // disables interrupts
        unsafe {
            xtensa_lx::interrupt::set_mask(0);
        }

        // reset cycle compare registers
        xtensa_lx::timer::set_ccompare0(0);
        xtensa_lx::timer::set_ccompare1(0);
        xtensa_lx::timer::set_ccompare2(0);

        unsafe extern "C" {
            static mut _init_start: u32;
        }

        // move vec table
        let base = core::ptr::addr_of!(_init_start);
        unsafe {
            core::arch::asm!("wsr.vecbase {0}", in(reg) base, options(nostack));
            // switch to new stack
            xtensa_lx::set_stack_pointer(unwrap!(APP_CORE_STACK_TOP));
        }

        // Trampoline to run from the new stack.
        // start_core1_run should _NEVER_ be inlined
        // as we rely on the function call to use
        // the new stack.
        unsafe { Self::start_core1_run::<F>() }
    }
When we get here, the core is out of reset, with a stack setup by ROM
code

We need to initialize the CPU fully, and setup the new stack to use the
stack provided by the user.
esp-hal/src/soc/esp32s3/cpu_control.rs