AnsweredAssumed Answered

CubeMX "user code" request

Question asked by Laureg on Mar 31, 2017
Latest reply on Apr 10, 2017 by Laureg

Hi, I would like to sugest an insertion of "user code" entry in the MX_xxx_Init() functions between the Peripheral init and its NVIC config, like:

 

......
  GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
  GPIO_InitStruct.Pull = GPIO_PULLUP;
  HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>  HERE <<<<<<<<<<<<<<<<<<<<<<<<<<<<<

/* EXTI interrupt init*/
HAL_NVIC_SetPriority(EXTI0_IRQn, 5, 0);
HAL_NVIC_EnableIRQ(EXTI0_IRQn);

......

 

Because in my application when this code is executed it will generate an INT, hanging my application in an fault (as its posts to an RTOS queue not yet created)

 

So I would like the option to insert "  __HAL_GPIO_EXTI_CLEAR_IT(0xFF);" before initializing interrupts of the peripheral...

Or better, create one MX_Init Function where all interrupts will be created, so the user can remove the automatic call to this function and call it after cleaning all int bits...


Outcomes