Library 54- General library for STM32F4xx devices

For 54th lib I decided to make it’s name to be “General”. 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.



  • 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 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


    • STM32F4xx
    • STM32F4xx RCC
  • TM
    • defines.h
    • attributes.h

Functions and enumerations


  • Example shows how to get reset source and how to get frequencies inside your system.

Project is available on my Github, download library below.


Owner of this site. Application engineer, currently employed by STMicroelectronics. Exploring latest technologies and owner of different libraries posted on Github.

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!