cancel
Showing results for 
Search instead for 
Did you mean: 

HRTIMER System Fault

avieira95
Associate

How to enable HRTIMER system faults? I have successfully used faults coming from other peripherals to turn off HRTIMER outputs (e.g. internal comparators), but can't get system hard faults to produce the same result. I have enabled all faults in the SYSCFG_CFGR2 register. What else needs to be configured?

Thanks!

4 REPLIES 4
AScha.3
Chief III

I think, you have to write in the hard fault INT , what you (it..) should do then.

void HardFault_Handler(void)
{
  /* USER CODE BEGIN HardFault_IRQn 0 */

  /* USER CODE END HardFault_IRQn 0 */
  while (1)
  {

----------------------------
void BusFault_Handler(void)
{
  /* USER CODE BEGIN BusFault_IRQn 0 */

  /* USER CODE END BusFault_IRQn 0 */
  while (1)
  {
    /* USER CODE BEGIN W1_BusFault_IRQn 0 */
    /* USER CODE END W1_BusFault_IRQn 0 */
  }
}

/**
  * @brief This function handles Undefined instruction or illegal state.
  */
void UsageFault_Handler(void)
{
  /* USER CODE BEGIN UsageFault_IRQn 0 */

 

Same in other handlers...what it should do then. Only you know, what should happen then. 

If you feel a post has answered your question, please click "Accept as Solution".

From the datasheet it looks like this is something that should run in hardware, the same as the Fault Inputs 1 - 6. As long as the HRTIMER instance is "Fault State" is set to "Inactive", any fault should immediately turn it off, without explicitly instructing it to do so in the Fault Handler

 

From the Reference Manual:  Once the fault signal is conditioned as explained above, it is routed to the timing units. For any of them, the 6 fault channels are enabled using bits FLT1EN to FLT6EN in the HRTIM_FLTxR register, and they can be selected simultaneously (the sysfault is automatically enabled as long as the output is protected by the fault mechanism).  

Maybe i misunderstood : what you can enable in hardware...ok.

I just was thinking, you ask for other events (fault conditions), that are not in the avail conditions.

from rm :

AScha3_0-1727984617419.png

The "fault" is at first a hardware problem: overcurrent, overvoltage etc. , then the timer stops. = protection.

The other is : what if the software or the cpu has a problem? Then ->

AScha3_1-1727984784358.png

The sysfault is enabled in syscfg ->

AScha3_1-1727988229571.png

 

AScha3_0-1727988186887.png

 

All other "bad" conditions and errors are up to you: write, what should happen then... (cpu or HAL lib cannot know it.)

An example for a problem in the running program is "debug" : what should happen, if debug starts and stops the cpu/program : should timer run on or should it switch off all outputs ? You have to decide, whats good in your system and set the behavior accordingly. 

Was this your question ...?

If you feel a post has answered your question, please click "Accept as Solution".
Christian N
ST Employee
This post has been escalated to the ST Online Support Team for additional assistance. We'll contact you directly.