# 4 Methods for Saving Crash Dump ## 4.1 Saving Crash Dump to FLASH 1. menuconfig Configuration
`(Top) → RTOS → RT-Thread Components → Utilities → Enable save assert context in flash. `
![alt text](./assets/crash/crash001.png)
2. Space Allocation (File System)
Configure the space and partition for crash dump in the flash_map excel table. For file-based saving, you can directly specify SIZE/partition/subdirectory (for reference, the flash_map excel table is currently supported only by solution schemes). You can also create your own file storage.
![alt text](./assets/crash/crash002.png)
In the flash_map excel table, configure the space and partition for crash dump. You can use a shared buffer by specifying the partition name of the shared buffer in the partition field. The address/SIZE/partition type can be automatically obtained using the formula shown in the following image.
![alt text](./assets/crash/crash008.png)
3. Data Export
After a terminal crash, the data will be saved to the configured location. After rebooting, you can export the data using the `SiFli_BLE` mobile app. The installation package (apk) and source code for the SiFli app can be downloaded from GitHub:
[SiFli APP Demo Release](https://github.com/OpenSiFli/SiFli_OTA_APP/releases/tag/1.0.10)
[SiFli_OTA_APP Demo](https://github.com/OpenSiFli/SiFli_OTA_APP) The steps are as follows:
![alt text](./assets/crash/crash003.png)![alt text](./assets/crash/crash004.png)![alt text](./assets/crash/crash005.png)![alt text](./assets/crash/crash006.png)![alt text](./assets/crash/crash007.png)
4. Data Parsing
Use the following tool to parse the exported file, and you can then analyze the crash dump using the trace32 tool.
![alt text](./assets/crash/crash010.png)

![alt text](./assets/crash/crash009.png)
For analysis methods, refer to the section:
[6.2 Using Trace32 to Restore Hcpu Crash Dump](../tools/trace32.md#Mark_Using_Trace32_to_Restore_Hcpu_Crash_Dump)