cancel
Showing results for 
Search instead for 
Did you mean: 

adjustment for HAL

T J
Lead
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
4 REPLIES 4
Amel NASRI
ST Employee
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 Accept as Solution on the reply which solved your issue or answered your question.

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 */
}
�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?

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 Accept as Solution on the reply which solved your issue or answered your question.

Posted on January 17, 2018 at 11:20

My code compiles ok, but I have to insert the __weak directive every time...