Questions about Unaligned memory accesses and Hard Faults
I am using STM32CubeIDE for a project using custom hardware with a STM32G0B1CBT6.
I recently hit a bug where my code was doing a 32-bit write to an address that wasn't on a 32-bit boundary (off by 2 bytes) and a Hard Fault was generated.
I've corrected the code to avoid this, but this same code worked OK on an earlier project - which used Keil uVision and a STM32F103C8T6.
I've seen references to compiler options to control this behavior, but I've not found them in CubeIDE or Keil. Am I wrong here? Or can someone point me to where those options might be? Or is this some kind of difference between these two chips?
Also: I'm on the fence about whether this is a good feature or not. On the one hand, avoiding unaligned memory seems fairly easy. On the other hand, Hard Faults really cause havoc in my world.
