hard fault
Hi
I encountered a strange problem regarding HardFault .
The issue occurs when SW is running on STM32G030K8T6
BUT DOSNT OCCUR when running on STM32G031K8T6 !!!
My SW is basically a power supplyer doing the following
TIM1.4 triggers ADC -> DMA -> IRQ
TIM1.2 outputs some PWM.
From time to time- my SW manipulated the duty cycle of those timer channels.
Once every (say) 1000 calls to the manipulating function the CPU goes to HardFault_Handler.
Checking the address of the machine command prior to the HardFault call (from the stack) reviles:
The address isn’t constant- it differs by 1 command address between trials.
If I pad the code with some NOP(s)- the fault address moves to different command.
Off course: there is no memory error in any of these addresses (most of the commands are not memory related).
One may think that maybe the DMA produced a memory “error”- but the DMA controller doesn’t show any error (DMA_ISR bits TEIFn).
moreover: it doesn’t seem to be that the DMA is capable of triggering a HardFault- but rather- sets a DMA error instead.
All of this- only on STM32G030K8T6 but not on STM32G031K8T6 !!!!
Has anybody encountered such a problem?
Thanks for reading all this
YONA
