@web-font-path: "roboto-debian.css";
Loading...
Searching...
No Matches
pico_multicore

Adds support for running code on, and interacting with the second processor core (core 1). More...

Topics

 fifo
 Functions for the inter-core FIFOs.
 
 doorbell
 Functions related to doorbells which a core can use to raise IRQs on itself or the other core.
 
 lockout
 Functions to enable one core to force the other core to pause execution in a known state.
 

Macros

#define SIO_FIFO_IRQ_NUM(core)
 Returns the irq_num_t for the FIFO IRQ on the given core.
 

Functions

void multicore_reset_core1 (void)
 Reset core 1.
 
void multicore_launch_core1 (void(*entry)(void))
 Run code on core 1.
 
void multicore_launch_core1_with_stack (void(*entry)(void), uint32_t *stack_bottom, size_t stack_size_bytes)
 Launch code on core 1 with stack.
 
void multicore_launch_core1_raw (void(*entry)(void), uint32_t *sp, uint32_t vector_table)
 Launch code on core 1 with no stack protection.
 

Detailed Description

Adds support for running code on, and interacting with the second processor core (core 1).

Example

Macro Definition Documentation

◆ SIO_FIFO_IRQ_NUM

#define SIO_FIFO_IRQ_NUM ( core)

Returns the irq_num_t for the FIFO IRQ on the given core.

On RP2040 each core has a different IRQ number: SIO_IRQ_PROC0 and SIO_IRQ_PROC1.

Note this macro is intended to resolve at compile time, and does no parameter checking

Function Documentation

◆ multicore_launch_core1()

void multicore_launch_core1 ( void(* entry )(void))

Run code on core 1.

Wake up (a previously reset) core 1 and enter the given function on core 1 using the default core 1 stack (below core 0 stack).

core 1 must previously have been reset either as a result of a system reset or by calling multicore_reset_core1

core 1 will use the same vector table as core 0

Parameters
entryFunction entry point
See also
multicore_reset_core1

◆ multicore_launch_core1_raw()

void multicore_launch_core1_raw ( void(* entry )(void),
uint32_t * sp,
uint32_t vector_table )

Launch code on core 1 with no stack protection.

Wake up (a previously reset) core 1 and start it executing with a specific entry point, stack pointer and vector table.

This is a low level function that does not provide a stack guard even if USE_STACK_GUARDS is defined

core 1 must previously have been reset either as a result of a system reset or by calling multicore_reset_core1

Parameters
entryFunction entry point
spPointer to the top of the core 1 stack
vector_tableaddress of the vector table to use for core 1
See also
multicore_reset_core1

◆ multicore_launch_core1_with_stack()

void multicore_launch_core1_with_stack ( void(* entry )(void),
uint32_t * stack_bottom,
size_t stack_size_bytes )

Launch code on core 1 with stack.

Wake up (a previously reset) core 1 and enter the given function on core 1 using the passed stack for core 1

core 1 must previously have been reset either as a result of a system reset or by calling multicore_reset_core1

core 1 will use the same vector table as core 0

Parameters
entryFunction entry point
stack_bottomThe bottom (lowest address) of the stack
stack_size_bytesThe size of the stack in bytes (must be a multiple of 4)
See also
multicore_reset_core1

◆ multicore_reset_core1()

void multicore_reset_core1 ( void )

Reset core 1.

This function can be used to reset core 1 into its initial state (ready for launching code against via multicore_launch_core1 and similar methods)

Note
this function should only be called from core 0