First STM32F7xx libraries are out!

After one day spending trying to make a good implementation of libraries for future use, I decided to switch to HAL drivers because of STM32F7 line which does not have STD drivers.

So I decided to make libraries that way, that are supported also with STM32F4xx lines. Each line uses HAL driver for it’s version, but all projects are done in a way that you select target in Keil uVision (F4 or F7), click rebuild and everything is setup and ready for start.

Supported devices

For start, I have to say that you need to have installed newest packs in Keil (if you use it) for F7 and F4 lines to be able to use these libraries and projects provided by me. I’ve managed to get properly in working state these boards:

  • STM32F4-Discovery with HSE 8MHz clock
  • STM32F429-Discovery with HSE 8MHz clock
  • STM32F401-Discovery with HSI 8MHz clock
  • STM32F439-EVAL with HSE 25MHz clock
  • STM32F401-Nucleo with HSE 8MHz and HSI 16MHz clock
  • STM32F411-Nucleo with HSE 8MHz and HSI 16MHz clock
  • STM32F7-Discovery with HSE 8MHz

My plan is to support F0 series also, because with F4/F7 series you get mainstream power, but F0 can be used for small projects. There is not need for F1,F2 or F3.

Current libraries

So, for start, I’ve made these libraries (Already posted on Github) which are compatible with F4 and F7 lines:

  • RCC: For setting up clock control for your board, supporting internal or external clock, support for enabling I and D cache for F7 series
  • GPIO: For controlling GPIO pins
  • DELAY: For delay functions using Systick and DWT counter
  • EXTI: For external interrupts
  • DISCO: For leds and buttons for all F4 nucleo board, F4 discovery boards, F439 Eval board and F7-Discovery board
  • ONEWIRE: For onewire-based devices like DS18B20
  • DS18B20: For controlling/reading DS18B20 temperature sensor
  • USART: For communication with UART protocol
  • SPI: For SPI communication
  • GENERAL: General library for different things
  • CRC: CRC calculation unit
  • SDRAM: For SDRAM communication on F429-Discovery/Eval and F7-Discovery boards
  • LCD: Single library for STM32F7-Discovery, STM32F439-Eval and STM32F429-Discovery LCD boards using LTDC and DMA2D
  • BUTTON: To control multiple buttons using STM3Fxxx devices
  • FFT: FFT example using LCD
  • IWDG: Independent watchdog library
  • RNG: Generate random number in STM32Fxxx
  • CPU LOAD: Measure CPU load using sleep mode and DWT counter
  • STRING: Create strings on STM32Fxxx devices
  • ROTARY ENCODER: Rotary encoder for STM32Fxxx devices
  • I2C: To use up to 4 I2C peripherals at a time
  • TOUCH: For touch controllers on STM32F7-Disco and STM32F439-Eval boards (built-in) or any other touch controller user can imagine with support for touch orientation to match LCD orientation.
  • RTC: For internal RTC on F4 and F7 lines

All libraries are tested on these boards:

  • STM32F7-Discovery
  • STM32F429-Discovery
  • STM32F439-EVAL

For now, libraries are only available on my Github account where you can download it with default project for Keil uVision. Libraries are almost fully compatible with my previous for STD drivers on F4xx lines. Only some functions are added/changed because now are used HAL drivers and not STD anymore.

You can select your target in Keil uVision (F4xx or F7xx) and hit rebuild and then download. You are ready to RUN!

I’m waiting for your opinion about that feature supporting more series with single library file.


This is a simple example from my “project template” used for turn on and off leds with button.

Check my GITHUB account with new repository for new library system.


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

    Hi! it’s nice to see libs for this board! I’m waiting to my board arribe to start test it!

  • Peter Mather

    Hi Tilen

    Many thanks for your continuing great work. Your examples make the transition to HAL much easier (now essential to run the F7). Have you looked at the new “System Workbench for STM32” development environment yet? Unfortunately no proper support for the F7 on Coocox, and with the 32k limit with Keil, the Workbench looks like a good solution but doesn’t seem very intuitive.

    If you ever get bored it would be great to have a library for writing flash sectors from within a program

    Thanks again


    • Hi,

      I have just installed this system and never work anything serious with it.
      I have a library for flash programming about 1 year on my computer, but was never released for public. You need separate bootloader for that to write main program to flash which has sector offset. For advanced users, this is easy to be done by theirself, but for beginners, I have to explain how to build program then which has vector offset and so on.
      Like I said: pretty complicated for beginners and very easy for advanced users.
      Library also supports writing settings to flash and reading “on the fly” if you have any configrations.

  • manu


    i use the hal libs for a stm32f746. There is a small mistake in one header file (CMSIS/device/stm32f746xx.h)

    #define DBGMCU_APB1_FZ_DBG_TIM8_STOP 0x00000002U
    should be replaced with the following, else the __HAL_DBGMCU_FREEZE_TIM8() macro dose not compile

    #define DBGMCU_APB2_FZ_DBG_TIM8_STOP 0x00000002U

    as far as i checked the rest of the macro code is ok (target adress and value)

    do you know who to contact?

    thanks ­čÖé