Hi Nesrine,
Seems icf file is ok, did the code try to write some register in which clock gate is not on? or did the code write to some place in the flash? You may check the following registers when the hardfault happens.

Have a great day,
Kan
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------