cancel
Showing results for 
Search instead for 
Did you mean: 

All functions with Interrupt handling files like the STM32H7XX_IT.C must be marked as __weak

Rajeev Arora
Senior

Dear @Khouloud ZEMMELI​ 

Please review my below request. The STM32CubeMX generated code does not mark functions present with the Interrupt Related C file as __weak.

https://github.com/STMicroelectronics/STM32CubeH7/issues/175

Please help fix the issue.

Thanks,

Rajeev

3 REPLIES 3
TDK
Guru

Functions in STM32H7XX_IT.C are meant to be modified for your application, hence the inclusion of USER CODE sections. They are part of your user code and are deliberately not marked weak.

If you feel a post has answered your question, please click "Accept as Solution".
SSimm.5
Associate

I fully agree they should be marked as "__weak". I have an established set of approved handlers for projects that reside in a library. There would be nothing wrong , as far as I can tell, having these functions marked as such. I honestly don't understand the reason for it being otherwise. Is there a way I can change a template so that this is not the case?

I suppose that someone that didn't have their own library that implemented these handlers would then end up with __weak versions in their USER CODE and __weak versions deep in the HAL/LL... and then which one would the compiler choose?