2019-12-03 09:55 AM
Hello,
I am experiencing a hard fault when executing the following line of code:
hourly_log.credit = *credit_register.
The screen shot bellow shows the debug window at the time of the fault, with the variables, disassembly view, and registers.
The code in question has been working perfectly on an old 8bit platform, now i'm trying to port it to the STM32 platform, and i'm running into some problems.
I'll appreciate some help with this issue.
Thanks
2019-12-03 10:33 AM
The CM0 can't do unaligned memory reads, ie a 32-bit read from an ODD address 0x20000EF5
So you can't used unaligned pointers in this fashion, you'll need to do a byte wise read and reconstruct the work, or memcpy() to an aligned local variable.