STMicroelectronics / STM32CubeG4

STM32Cube MCU Full Package for the STM32G4 series - (HAL + LL Drivers, CMSIS Core, CMSIS Device, MW libraries plus a set of Projects running on all boards provided by ST (Nucleo, Evaluation and Discovery Kits))
Other
182 stars 98 forks source link

Feature request: HRTIM add option to disable fault blanking window #17

Closed ldoesvictron closed 3 years ago

ldoesvictron commented 3 years ago

As of STM32CubeG4 v1.3.0 it is not possible to generate the HRTIM fault lines initialization code without it also calling to HAL_HRTIM_FaultBlankingConfigAndEnable(). Please add the option for the blanking window to be either disabled or enabled to the Fault Lines Configuration window in CubeMX.

ALABSTM commented 3 years ago

Hi @ldoesvictron,

If I understand correctly, you would like to configure HRTIM's fault lines without enabling the blanking. The issue you are facing is that with Cube MX, function HAL_HRTIM_FaultBlankingConfigAndEnable() is called from the MX_HRTIM1_Init() which automatically enables the blanking (as pointed out in the note below). https://github.com/STMicroelectronics/STM32CubeG4/blob/3e5243a22addb3cd323dba491eaf43c85ff448f3/Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_hrtim.c#L4184

Actually, this is rather a HAL-related point than a Cube MX- one. As a solution, may I suggest the following:

  /* USER CODE BEGIN HRTIM1_Init 2 */
+  __HAL_HRTIM_FAULT_BLANKING_DISABLE(&hhrtim1, HRTIM_FAULT_1);
  /* USER CODE END HRTIM1_Init 2 */

I hope this helps. Do not hesitate otherwise.

With regards,

ALABSTM commented 3 years ago

Hi @ldoesvictron,

I hope you are fine. Please allow me to close this issue as not reply has been received from your side since a couple of months. Do not hesitate to reopen it if you think it is still relevant.

With regards,