Giter Site home page Giter Site logo

halsimov / stm32-base Goto Github PK

View Code? Open in Web Editor NEW

This project forked from prtzl/stm32

0.0 0.0 0.0 1.31 MB

Base project for STM32 with a bunch of ways to build on all platforms

License: GNU General Public License v3.0

C++ 0.03% C 99.58% Assembly 0.17% Makefile 0.14% CMake 0.07% Dockerfile 0.01%

stm32-base's Introduction

STM32 project template

This repository holds all the possible tools and templates for building and developing STM32 projects.
Firmware is configured with CMake and can be built in multiple ways.

I don't expect you to use all of the files found here or all the lines in the configuration files (Makefile, CMakeLists.txt, etc.). Make sure to read them and remove what you don't need.

I will also try to make this repository as cross platform as possible. Currently I've tested it on Windows 10 and Linux (Fedora 35, Nixos, Ubuntu 20.04). Any problems regarding a specific distribution will be mentioned in the workflows.

Example

You can utilize everything in root of the repository. It holds an example project built around STM32F407VG on a discovery board. It blinks the onboard blue LED and prints "Hello, world" over SWO.

Workflow

There are a few options to build the CMake project. Approaches differ in dependency management and source control, which is important when you might work in a team or share your projects online. Pros and cons will be listed for each method in its guide. The following guides are available:

First way is to use the provided Makefile for native development on your computer, You have to install the required dependencies on your computer, matching or exceeding the minimum required versions.

Second way is using a container tool like docker or podman with or without additional dependencies, like docker-compose or make.

Third way is using nix with provided flake.nix.

Code style

Before committing code, format all source files. I have provided a set of rules for clang-format, which you can apply to all source files.

You can do it for a specific file: clang-format -i <path to source file>

Or with a shell script:

for file in $(find . -name '*.[ch]' -or -name '*.[ch]pp'); do clang-format -i $file; done

Or with provided makefile:

make format: formats all source files in root using host installed clang-format.
make format-container: formats all source files in root using container installed clang-format.

Extra tool tips

I have provided a document, where I write about tools and commands that you can use to aid your development.

Extra code tips

I have provided a document, where I write about useful options for writing and debugging code.

stm32-base's People

Contributors

halsimov avatar prtzl 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.