This chapter introduces CPU architecture porting and BSP porting. The CPU architecture porting part will be introduced in conjunction with the Cortex-M CPU architecture. Real Time-Thread's (RT-Thread) libcpu abstraction layer provides a unified set of CPU architecture porting interfaces downward. This part of the interface includes global interrupt switch functions, thread context switch functions, OS Tick configuration and interrupt functions, cache, and so on. Regardless of kernel code or user code, there may be some variables that need to be used in multiple threads or interrupts. If there is no corresponding protection mechanism, it may lead to critical section problems. The ARM Cortex-M kernel offers a system tick timer: SysTick. After the SysTick count overflows, it enters the SysTick interrupt handler function, and RTOS typically uses SysTick as the OS Tick.