Skip to content

Openwide-Ingenierie/generic-microcontroller-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generic microcontroller project

This repository targets Cortex-M and other type of microcontrollers projects either bare metal or OS based. It provide intuitive make targets to help quickly getting into developement stage. By default the hardware abstraction library (HAL) is libopencm3 and the provided OS, if needed, is FreeRTOS. However this projet aim to allow easy OS or HAL changement.

Quick start:

To start a new project edit the config/config.mk file.

In particular you have to :

  • Edit the MCU_TYPE, MCU_FAMILLY, MCU_CORE and ARCH_FLAGS variables to be consistant with your microcontroller
  • Edit the INTERFACE, TRANSPORT and TARGET variables to reflect the debug probe and protocol you are using
  • Edit the OS and HAL variables to select OS and HAL you want to use (see: Using an alternative OS or HAL)

If you need to use libopencm3 and/or FreeRTOS you will have to init and uddate the submodules:

$> git submodule update --init

Main make targets:

  • release: compilation in release mode
  • debug: compilation in debug mode
  • flash: program the binary (release) on the microcontroller target
  • gdb: program the binary (debug) on the target and launch a gdb instance

Folder tree:

  • config/: all configuration related files
  • HAL/: contain the HAL used for the project
  • OS/: contain the OS used for the project
  • blink.* : Blue Pill led blink demo. Uses libopencm3 and a FreeRTOS task.

Using an alternative HAL or OS:

In order to use an alternative HAL you need to:

  • put the alternative HAL in HAL/
  • write a HAL/rules/.mk file using the HAL/rules/template.mk template
  • set the variable HAL in config/config.mk to
  • compile

The steps are the same if you want to add an alternative OS (exept the directory is OS/).

About

A generic starting point for microcontroller-based projects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published