2024-10-09 03:09 AM
Hallo,
I'm compiling with this option <-fpack-struct=1>
Why, with this option, the instruction
<WRITE_REG(hdma->Instance->CBR1, 0U);>
generates hard fault? I don't understand, without changing nothing.
thank you.
Solved! Go to Solution.
2024-10-09 05:46 AM
Either the handle points to an invalid value or you are making an unaligned access. Should be able to debug and investigate one way or the other. Look at the hdma handle and ensure the instance is valid. Look at the hard fault and understand why it occurred. The SCB register will have flags that explain why and where it happened.
The issue is not with the WRITE_REG macro.
2024-10-09 05:46 AM
Either the handle points to an invalid value or you are making an unaligned access. Should be able to debug and investigate one way or the other. Look at the hdma handle and ensure the instance is valid. Look at the hard fault and understand why it occurred. The SCB register will have flags that explain why and where it happened.
The issue is not with the WRITE_REG macro.
2024-10-09 05:52 AM
Hi,
Is CBR1 a valid DMA register?
Kind regards
Pedro
2024-10-09 07:09 AM
> I don't understand, without changing nothing.
But you have changed the compiler option, an important one.
If you've changed anything and things break - undo your changes, re-think and move slower, in smaller steps.
2024-10-09 07:13 AM