Skip to main content
Rajeev Arora
Senior
August 31, 2021
Question

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

  • August 31, 2021
  • 3 replies
  • 1018 views

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

This topic has been closed for replies.

3 replies

TDK
August 31, 2021

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
Visitor II
June 20, 2022

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?

Terry Greeniaus
Senior
June 21, 2022

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?