Skip to content

Adding support for a microcontroller

Maxime Vincent edited this page Jul 17, 2020 · 2 revisions

Welcome to the ucregview wiki!

How to add support for a new microcontroller?

Adding a new microcontroller is relatively easy:

Step 1: Edit makefile rules

-> Add a new directory: ucregview/targets/<your_micro> -> Add a new rules.mk file in that directory. You can copy another rules.mk file, and start from there.

Step 2: Add files for you specific microcontroller

-> Add a new directory: ucregview/st/<your_micro> -> You basically need at least 3 flies:

  1. linker script, that will put all output section into the "REGISTERS" section (.registers)
  2. H-file: with all the hardware register definitions (easiest is when they are structs)
  3. C-file: An allocation of each of those structs, at the right memory address (Linker script can put a certain section at a certain address, and a GCC attribute can easily put a specific struct in a specific section).

Where to find the right source / header files?

Different sources are available:

  • Keil PACKs are interesting. They are basically .zip files and contain the headers and linker script you need: https://www.keil.com/dd2/pack/#/eula-container
  • The manufacturer (ST, NXP, ...) should also provide board support packages (BSPs) with these files inside. Try their support pages.