1# Magic Key<a name="EN-US_TOPIC_0000001133846498"></a> 2 3- [When to Use](#section2350114718546) 4- [How to Use](#section3305151511559) 5 6## When to Use<a name="section2350114718546"></a> 7 8When the system does not respond, you can use the magic key to check whether the system is locked and interrupted \(the magic key also does not respond\) or view the system task running status. 9 10If an interrupt is responded, you can use the magic key to check the task CPU usage \(**cpup**\) and find out the task with the highest CPU usage. Generally, the task with a higher priority preempts the CPU. 11 12## How to Use<a name="section3305151511559"></a> 13 141. Configure the macro **LOSCFG\_ENABLE\_MAGICKEY**. 15 16The magic key depends on the **LOSCFG\_ENABLE\_MAGICKEY** macro. Before using the magic key, select **Enable MAGIC KEY** on **menuconfig**. 17 18**Enable MAGIC KEY**: **Debug** ---\> **Enable MAGIC KEY** 19 20The magic key cannot be used if this macro is disabled. 21 22> **NOTE:** 23>On **menuconfig**, you can move the cursor to **LOSCFG\_ENABLE\_MAGICKEY** and enter a question mark \(?\) to view help information. 24 252. Press **Ctrl+R** to enable the magic key. 26 27When the UART or USB-to-virtual serial port is connected, press **Ctrl+R**. If "Magic key on" is displayed, the magic key is enabled. 28 29To disable the magic key, press **Ctrl+R** again. If "Magic key off" is displayed, the magic key is disabled. 30 31You can use the magic key combinations 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 42> **NOTICE:** 43>If special characters need to be entered through the UART or USB-to-virtual serial port if magic key is enabled, avoid using characters the same as the magic keys. Otherwise, the magic key may be triggered by mistake, causing errors in the original design. 44 45