GithubHelp home page GithubHelp logo

stm32-base's Introduction

stm32-base

This is a skeleton project for a STM32-based firmware. It uses cmake as a build system. The base project also uses FreeRTOS, though this can easily be stripped out.

Make sure that you also check out the submodules: git submodule update --init --recursive. You will also need the STM32Cube software from ST's website.

The demo app contained within is for the STM32F103CB - it blinks B7. To change the device targeted, make changes in:

  • tools/build.sh
  • tools/flash.jlink
  • .clang_autocomplete

The binary name is stm32-base -- to adjust this, edit tools/build.sh, and CMakeLists.txt.

Systick handler

If you are going FreeRTOS-less, you will need this snippet in main.c to enable things like HAL_Delay.

uint64_t virtualTimer;

void SysTick_Handler(void) {
  HAL_IncTick();
  virtualTimer++;
}

Build.sh

The build script has several targets.

  • build.sh build: build a debug file
  • build.sh debug: upload the debug build to a board via GDB and start a debugger (you must have started GDB yourself)
  • build.sh flash: flash the previous build to a board via a jlink adapter
  • build.sh clean: remove all the temporary build files and cmake junk

Toolchain

  • arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 6.2.1 20161205 (release) [ARM/embedded-6-branch revision 243739]
  • cmake version 3.7.2
  • STM32Cube 1.3.0
  • SEGGER J-Link Commander V6.12f (Compiled Jan 13 2017 16:41:09)

Suggested IDE plugins

I've been using Atom with the autocomplete-clang, build, and linter-clang. This provides autocomplete, cmake-aware building (via .atom-build.yml), and inline error checking.

stm32-base's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

yuracobain

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.