1# Magic Key 2 3 4## When to Use<a name="section2350114718546"></a> 5 6When 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. 7 8If 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 resources. 9 10## How to Use<a name="section3305151511559"></a> 11 121. Configure the macro **LOSCFG\_ENABLE\_MAGICKEY**. 13 14The magic key depends on the **LOSCFG\_ENABLE\_MAGICKEY** macro. Before using the magic key, select **Enable MAGIC KEY** on **menuconfig**. 15 16**Enable MAGIC KEY**: **Debug** ---\> **Enable MAGIC KEY** 17 18The magic key cannot be used if this macro is disabled. 19 20> **NOTE:** 21>On **menuconfig**, you can move the cursor to **LOSCFG\_ENABLE\_MAGICKEY** and type a question mark \(?\) to view help information. 22 232. Press **Ctrl+R** to enable the magic key. 24 25When the UART or USB-to-virtual serial port is connected, press **Ctrl+R**. If "Magic key on" is displayed, the magic key is enabled. 26 27To disable the magic key, press **Ctrl+R** again. If "Magic key off" is displayed, the magic key is disabled. 28 29You can use the magic key combinations as follows: 30 31- **Ctrl+Z**: displays help information about the related magic keys. 32 33- **Ctrl+T**: displays task information. 34 35- **Ctrl+P**: allows the system to proactively enter the panic state. After the panic-related information is printed, the system is suspended. 36 37- **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!". 38 39 40> **NOTICE:** 41>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 the original design. 42 43