Hi Omar:
Thanks for your kindly reply, please see my answer below.
Could you please share with me the memory configuration?
A: Please refer below fig for more details.
EdwardLiao33_0-1686799079250.png
EdwardLiao33_1-1686799079252.png
EdwardLiao33_2-1686799079237.png
EdwardLiao33_3-1686799079153.png
At the moment of crash, to what direction are you trying to access?
A: An crash occurred before entering the function "mflash_drv_sector_erase_internal". At the moment, input value sector_addr=0x240000.
EdwardLiao33_4-1686799079120.png
EdwardLiao33_5-1686799079260.png
Additionally, Add the following to the FreeRTOSConfig.h
#define configTASK_RETURN_ADDRESS 0
A: The constants define has been added on the file. please refer fig below.
EdwardLiao33_6-1686799079606.png
Best Regards
Edward