1# Magic Key 2 3 4## When to Use 5 6When the system does not respond, you can use the magic key to check whether the system is suspended by an interrupt lock or view the system task running status. 7 8If interrupts are responded, you can use the magic key to check the task CPU percent (CPUP) and locate the task with the highest CPUP. Generally, the task with a higher priority preempts the CPU resources. 9 10 11## How to Configure 12 13The magic key depends on the macro **LOSCFG_ENABLE_MAGICKEY**. 14 15To configure **LOSCFG_ENABLE_MAGICKEY**: 16 171. Run the **make menuconfig** command in **kernel/liteos_a**. 182. Locate the **Debug** option and select **Enable MAGIC KEY**. 19 20This option is selected by default. If it is not selected, the magic key is invalid. 21 22> **NOTE**<br> 23> On **menuconfig**, you can move the cursor to **LOSCFG_ENABLE_MAGICKEY** and enter a question mark (?) to view help information. 24 25## How to Use 26 271. Press **Ctrl+R** to enable the magic key. 28 29 When the UART or USB-to-virtual serial port is connected, press **Ctrl+R**. If "Magic key on" is displayed, the magic key is enabled. To disable it, press **Ctrl+R** again. If "Magic key off" is displayed, the magic key is disabled. 30 31 The functions of the magic key are as follows: 32 33 - **Ctrl+Z**: displays help information about the related magic keys. 34 35 - **Ctrl+T**: displays task information. 36 37 - **Ctrl+P**: allows the system to proactively enter the panic state. After the panic-related information is printed, the system is suspended. 38 39 - **Ctrl+E**: Checks the integrity of the memory pool. If an error is detected, the system displays an error message. If no error is detected, the system displays "system memcheck over, all passed!". 40 41 > **NOTE**<br> 42 > If magic key is enabled, when special characters need to be entered through the UART or USB-to-virtual serial port, avoid using characters the same as the magic keys. Otherwise, the magic key may be triggered by mistake, causing errors in design. 43