2024-03-24 04:34 AM
I just was testing the bootloader, when it did not respond after writing the flash. Upon inspecting the memory, i found the last 2 bytes have not been written? (i guess the uC went to hard fault or something)
It should not be this way?
Solved! Go to Solution.
2024-03-25 12:50 AM
Yes i should have shown more. I try to be better next time.
I have fixed the issue. I cant believe, that i have found again not just one error.
First, i had a catch implemented, that would not let it come to a wrong memory acces, but this had an error so it came too early.
Second, feof() (C on windows) does not tell you, when you just read the last byte, and have reached the EOF. omfg
And while dealing with this issue, i had several BSOD's. What a nice time i have....
2024-03-24 04:49 AM
> I just was testing the bootloader,
What bootloader?
How do you test it, exactly?
JW
2024-03-24 04:59 AM - edited 2024-03-24 05:11 AM
2024-03-24 07:00 AM
Hi @Tobe ,
you need to check how your programming algorithm is implemented if writing 64-bit at a time or a row of 32 double words . Also if you are reading next bytes or words and in particular while cache and prefetch is active of the flash as it may read an extra byte ( not existing ) by cache / Prefetch line size even not wanted by CPU as speculation . And so hitting a not existing memory to read .
Hope it helps you .
STOne-32
2024-03-24 12:41 PM
Two Bytes or Two Words.
The image doesn't communicate HOW you're failing to do this.
Perhaps have your Error Handler and Hard Fault Handler communicate actionable data about what's failing and what the MCU is objecting too.
2024-03-24 12:59 PM
If i write after 0x0801FFF5, the my uC stopps working. This would be a hard fault i gues??
It does not match the memory range in the datasheet.
2024-03-24 01:03 PM - edited 2024-03-24 01:03 PM
Two words... my bad.
It failed when writing the last 2 words that you can see on the picture (FFF0 - FFF7) which were written anyway). When i write the same, but without the last two bytes, it works without error.
2024-03-24 04:25 PM
Ok, so you've described the nature of the failure multiple times, but not presented any code that illustrates you're failed approach. If you think there's a Hard Fault, that's not hard to confirm or not..
You'd get a Hard Fault if you attempt to read or write beyond the scope of the memory.
Perhaps instrument your code, so it provides output about what's happening, and how it's writing 64-bit aligned double words to the memory.
Your presentation of this needs to get significantly better, or my imagination and telekinesis skills need to get fantastically good..
2024-03-25 12:50 AM
Yes i should have shown more. I try to be better next time.
I have fixed the issue. I cant believe, that i have found again not just one error.
First, i had a catch implemented, that would not let it come to a wrong memory acces, but this had an error so it came too early.
Second, feof() (C on windows) does not tell you, when you just read the last byte, and have reached the EOF. omfg
And while dealing with this issue, i had several BSOD's. What a nice time i have....