How to store stack info into flash for DA14585 when hard-fault or NMI happens?

Hello, is there a way to get contents in stack and store them into flash when Hard-fault or NMI happen? If it can't write flash in the situation, is there a mechanism to copy them into a block of SRAM which can be kept even when system has been re-started?

Parents Reply
  • Hi OV_renesas,

    Thank you for your quick reply. I want to save stack info into flash when Hard Fault happens, so I can analyze the info to find out which function caused it.

    In function HardFault_HandlerC, I called the interfaces in spi_flash.c to do erase and write operations, but it didn't work, and nothing has been written into flash. These interfaces have already confirmed to work properly in normal process, so I doubt something needs to be taken care of before calling them in  HardFault_HandlerC. Could you please give me some instructions about it?

    Thanks,

    Jerry

Children
No Data