Skip to main content
Super User
January 13, 2022
Question

Missing HardFault_IRQn values in CubeF4 v1.26.2 and CubeF7 v1.16.1 and 1.16.2

  • January 13, 2022
  • 2 replies
  • 1730 views

CubeF4 version 1.26.2 and CubeF7 version 1.16.1 and 1.16.2 are missing the enum value for HardFault_IRQn in all of the device specific include files (ex. stm32f429xx.h and stm32f746xx.h). It may be missing in earlier versions, I did not check. CubeMX does generate code for a HardFault_Handler().

    This topic has been closed for replies.

    2 replies

    Super User
    January 13, 2022

    Not sure it's a bug as much as a design choice. I don't think it was ever there. What functionality is lacking as a result of it not being defined?

    Most (all?) of the functions which that IRQn_Type as a parameter cannot take HardFault_IRQn (if it existed) as a value since you can't disable it or change its priority. Of course they can't take NonMaskableInt_IRQn either and it's defined.

    Edit: although they exist in H7 CMSIS files so it's certainly inconsistent.

    Bob SAuthor
    Super User
    January 14, 2022

    This doesn't affect any code generated from CubeMX. My custom fault handler code passes the fault/IRQ number to a common reporting/handling function. When porting my code from L4xx/G4xx to F7xx and F4xx CPUs I got compiler errors for the missing value. Yeah, it is a minor thing, but as you said, inconsistent with (at least) the L4, G4 and H7 files.