Code Monkey home page Code Monkey logo

stm32cube-gcc's Introduction

STM32Cube Makefile

This is a template application for the STM32 ARM microcontrollers that compiles with GNU tools.

It serves as a quick-start for those who do not wish to use an IDE, but rather develop in a text editor of choice and build from the command line.

Target Overview

  • all Builds the target ELF binary.
  • program Flashes the ELF binary to the target board.
  • debug Launches GDB and connects to the target.
  • cube Downloads the most recent STM32Cube version from the ST website and extract it to cube.
  • template Copies a simple example/template, startup code and a linker script from the cube to your src directory.
  • clean Remove all files and directories which have been created during the compilation.

Installing

Before building, you must install the GNU compiler toolchain. I'm using the the gnu-none-eabi triple shipped with recent Debian and Ubuntu versions:

sudo apt-get install gcc-arm-none-eabi binutils-arm-none-eabi

You also might want to install some other libraries and debuggers:

sudo apt-get install openocd gdb-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib

Source code

Your source code has to be put in the src directory. Dont forget to add your source files in the Makefile.

Programming and debugging code on the board

First, make sure you have OpenOCD installed and in your path (see above). Recent versions already come with full support for the discovery and nucleus boards. Then connect your board, and load the application by saying:

make program

To load the program and debug it using GDB, simply use the debug target:

make debug

GDB connects to the board by launching OpenOCD in the background. See this blog post for info about how it works.

UDEV Rules for the Discovery Boards

If you are not able to communicate with the Discovery board without root privileges you should add appropriate udev rules.

stm32cube-gcc's People

Contributors

stv0g avatar fhgd avatar akohlsmith avatar tabboud avatar

Watchers

Robbie Cao avatar  avatar

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.