cancel
Showing results for 
Search instead for 
Did you mean: 

Force hard fault

thealbertdev
Associate III

Hello,

I have a project where one of the requirements is to activate the iwdt in some defined circumstances, and refresh it in other circumstances also defined. I need to collect evidence of the correct implementation of iwdt in such a way that the acceptance criteria of these requirements are validated. (And the code can not be modified during the test to put some while(1) that makes iwdt to be triggered, or add some function pointer to a non valid address. The code must be validated as it will be flashed in the product).

I had thought to force a hard fault using the STM32CubeProgrammer. Is it possible? Is it possible for example to make the program jump to a not allowed address (e.g. set the PC register to 0x0000000000) to force a hard fault on request to test the iwdt? The idea is to automate the tests, so being able to do it using the cli commands of the STM32CubeProgrammer would be a great help.

Thank you very much in advance.

10 REPLIES 10

Thanks for the examples! Now I have understood you better and I think we are on the same wavelength ;)

Although I like the approach of having a test button, I am forced to trigger the test through the STM32CubeProgrammer since unfortunately the device has only one reset button connected directly to the power management module :grinning_face_with_sweat: (POR)

Thank you very much once again 🙇🏻‍