HAL library 09- GENERAL for STM32Fxxx

With this name I mean that in this library, a lot of different stuff, maybe unrelated between, but very useful things will be implemented.

It allows you to make software reset, get reset source, disable or enable global interrupts (NVIC) and more.

It will be updated frequently but for now it’s just a start to use it in your projects.


Read more about new HAL libraries


  • Support for software reset with callback
  • Get reset source, what resets your MCU
  • Disable or enable global NVIC interrupts
  • Get different clock speeds in your system
  • Operate with DWT counter inside Cortex-M4/M7 CPU
    • Precise delay using DWT timer
  • Check if number is odd or even or if it is power of 2
  • Round float numbers
  • Convert float number to integer and decimal parts


  • HAL
  • TM
    • STM32Fxxx HAL
    • defines.h

Functions and enumerations


Project is available on my Github, download all libraries below.

TM STM32 Libraries

STM32 libraries based on STM32Fxxx HAL drivers.


Owner of this site. Also electronic enthusiasts, web developer, 3D printer fan, handball player and more. Big fan of STM32F4 devices. In anticipation of the new Discovery board for STM32F7 lines.

You may also like...

Read before commenting!

Before you make a new comment, make sure you agree with things listed below:

  • - Read post to make sure if it is already posted what you are asking for,
  • - Make sure you have the latest version of libraries used in your project,
  • - Make a clean and grammatically correct written message,
  • - Report as many details as possible, including what have you done so far,
  • - Do NOT post any code here. Use Pastebin,
  • - Do NOT post any error codes here. Use Pastebin,
  • - Specify STM32Fxxx family and used Discovery/EVAL/Nucleo or custom made board,
  • - Make sure your clock is set correct for PLL,
  • - If you are using my HAL drivers, please check this post how to start.
Comment will be deleted on breaking these rules without notification!
  • Pingback: All STM32 HAL libraries - STM32F4 Discovery()

  • Peter Mather

    STM32F4Discovery, SWSTM32

    Is there a way of passing some additional information with a software reset? I have a program that uses software resets to deal with several error conditions and want to pass information to allow the restart to circumvent the problem. This is something easy to do with the PIC32 but I can’t find a way with the STM – any help appreciated.

    • You can use rtc backup ram or general purpose backup ram in f407.

      This ram will not be modified due reset.