After erasing internal flash using st link utility when i will start storing sum data into internal flash it is going to be in hard-fault.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-09-02 10:56 PM
Hello Everyone,
We are working on STM32F413RH. We are storing sum data into internal flash at some interval of time. Simple mechanism is used, first we are erasing sector and then we are writing our data into internal flash.
But when we are erasing chip via ST link utility and try to store our data, we are getting hard-fault.
Please help us regarding the same.
Thanks and Regards
Milan
Solved! Go to Solution.
- Labels:
-
DEBUG
-
STM32F4 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-09-03 03:30 PM
Try to debug hardfault as usually, i.e. observe stacked values of registers, mainly PC; observe code in disasm/mixed with source, in vicinity (previously to) the address in the stacked PC; observing registers content estimate which instruction caused the problem and trace it back to C source variables content.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-09-02 11:45 PM
I don't understand - fault is result of program running, but when you're programming using STLink, program does not run, so how comes the fault?
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-09-02 11:53 PM
Kindly Share your code in which you are facing Problem !!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-09-03 12:04 AM
We are doing below steps.
1) Load working program and check all the things that it is working properly or not. At the time of writing into internal Flash no error we are found.
2) After checking first step, we checked by connecting on st-link utility that whatever data we are writing into internal flash is stored or not? We successfully got our data and confirm that.
3) After second step we are erasing chip from ST-Link utility. and disconnect from st link utility.
4) Now again we start from first step (by loading same program) but we are getting hard-fault.
Thanks for your reply.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-09-03 12:05 AM
Sorry I can't share code because it is in system where i can not share anything.
We are doing below steps for your information.
1) Load working program and check all the things that it is working properly or not. At the time of writing into internal Flash no error we are found.
2) After checking first step, we checked by connecting on st-link utility that whatever data we are writing into internal flash is stored or not? We successfully got our data and confirm that.
3) After second step we are erasing chip from ST-Link utility. and disconnect from st link utility.
4) Now again we start from first step (by loading same program) but we are getting hard-fault.
Thanks for your reply.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-09-03 03:30 PM
Try to debug hardfault as usually, i.e. observe stacked values of registers, mainly PC; observe code in disasm/mixed with source, in vicinity (previously to) the address in the stacked PC; observing registers content estimate which instruction caused the problem and trace it back to C source variables content.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-09-03 04:49 PM
You'll have to debug your own code.
Sanity check pointers, that you aren't accessing 0xFFFFFFFF.
Make sure you're not erasing running code.
Have a Hard Fault Handler that outputs actionable data, reports the registers and inspect the disassembly at the fault.​
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-09-09 02:59 AM
Thanks for your reply.
As per your suggestion we have checked on dis-assembly window. And we found that due to UART peripheral we are accessing NULL address.
That is the reason we are getting hard-fault.
Thanks
