EFM32 Cortex-M firmware project from scratch – step by step

Most popular microcontrollers come with IDEs and tools provided by the manufacturer, like NXP, STM, TI or Silicon Labs. IDEs are commonly based on Eclipse and creating a project for almost any chip in those IDEs is usually just a click away, so why would you ever want to make such a project from scratch, gather all header files, libraries and scripts? Read to find out why and how 🙂
Continue reading “EFM32 Cortex-M firmware project from scratch – step by step”

Git – confirmation before commit

I use Git for version control of all my projects. Every repository of course has many branches that I try to systematize like: stable, devel, experimental, per-feature etc. Many times I have run into the problem of committing my changes to the branch I did not intended to. Git shows you the branch and changed files when entering the commit message, but when you do that 50 times a day you are doomed to loose focus (and commit your experimental stuff into a stable branch 🙂 ).

My solution to this problem is a simple pre-commit hook that reads the name of the branch and prompts for confirmation, if the name of the branch is on a watchlist.
Continue reading “Git – confirmation before commit”

Using the internal EEPROM of STM32L

Most STM32 microcontrollers feature an internal EEPROM. It is useful for storing settings or calibration data. Regular flash (that stores code) can also be used, but the EEPROM can be updated byte-by-byte and is independent from regular flash. This may come handy during application updating, as whole flash can be simply erased without affecting the EEPROM.

I wrote a generic driver for keeping settings in the EEPROM based on the standard peripherals library for STM32L, that is easier to understand than the official demos from ST. It was tested on an STM32L151RC.
Continue reading “Using the internal EEPROM of STM32L”