Skip to main content
T J
Senior III
January 17, 2018
Question

adjustment for HAL

  • January 17, 2018
  • 4 replies
  • 898 views
Posted on January 17, 2018 at 03:36

can the HAL programmers please add the __weak attributes to the interrupt routines.

I had to add this one again today:

__weak  void CEC_CAN_IRQHandler(void);  // in stm32f0xx.h

and this one:

__weak void CEC_CAN_IRQHandler(void)    // in stm32f0xx.c

#hal
This topic has been closed for replies.

4 replies

Amel NASRI
ST Technical Moderator
January 17, 2018
Posted on January 17, 2018 at 09:46

Hi @T_J,

The 

CEC_CAN_IRQHandler is defined in the .s files depending on the device you selected.

Then, when needed to be used, you have to add it in the stm32f0xx_it.c and stm32F0xx_it.h, it is up to you to do this.Why do you need it to be declared as weak?

-Amel

To give better visibility on the answered topics, please click on "Best Answer" on the reply which solved your issue or answered your question.
T J
T JAuthor
Senior III
January 17, 2018
Posted on January 17, 2018 at 10:14

I have my own routines:

void HAL_SYSTICK_Callback(void){
 mS++;
 mSint = true;
 if (mS == 1000) {
 secondInt = true;
 mS = 0;
 }
}
void CEC_CAN_IRQHandler(void){
 /* USER CODE BEGIN CEC_CAN_IRQn 0 */
 CAN_IRQFlag = true;
 checkCanRxFifos();
 /* USER CODE END CEC_CAN_IRQn 0 */
 HAL_CAN_IRQHandler(&hcan);
 /* USER CODE BEGIN CEC_CAN_IRQn 1 */
 /* USER CODE END CEC_CAN_IRQn 1 */
}
�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?

Amel NASRI
ST Technical Moderator
January 17, 2018
Posted on January 17, 2018 at 10:48

And then what is the issue? Do you have an error compiling your generated code before adding your own routines?

If yes, please share your .ioc.

To give better visibility on the answered topics, please click on "Best Answer" on the reply which solved your issue or answered your question.