Giter VIP home page Giter VIP logo

stm32-exploration's Introduction

STM32 Exploration

A set of code examples and comments to teach myself a bit more about microcontrollers.

Info

I've adapted most of the code by following along Vivonomicon's STM32 examples.

The additions to the code presented in the examples are:

  • Porting the examples to other boards (specifically, Nucleo STM32F446RET6)
  • Adding comments for parts that were new to me or to explain certain aspects in more detail
  • Modifications and additions to make the Makefile support multiple targets (F031K6 and F446RE)

Contents

This repository contains code samples and examples to understand aspects of embedded programming from first principles.

  • 01-basic contains linker scripts and ARM Thumb assembly.
  • 02-main contains vector tables and C. It also explores the ELF binary format.
  • 03-gpio takes input via a button and toggles an LED with memory-mapped IO.
  • 04-interrupt does the same thing as 03-gpio but uses interrupts using the NVIC and EXTI peripherals.
  • 05-timer explores the clock peripherals, specifically using the 16MHz HSI oscillator to drive a PLL and core clock (HCLK).
  • 06-freertos explores configuration of and using FreeRTOS to blink LEDs at intervals.
  • 07-rust generates a peripheral access crate using svd2rust, and then blinks LEDs with Rust.

Build and run

Development was done on macOS, so all the makefiles work on macOS. I have not verified that they work on Linux.

To build, make <target-name> should work, where target-name is either f031k6 or f446re.

To run,

  • Run st-util.
  • Type arm-none-eabi-gdb <output-name.elf>.
  • In GDB, target extended-remote :4242.
  • load, and then continue.

For the Rust mini-project, build with cargo build in the appropriate rust-blink directory, and run with openocd and cargo run.

Future

  • I intend to continue learning more about embedded programming with this series! A few fundamentals that I haven't had the time to include the basic communication peripherals (UART, SPI, I2C).

stm32-exploration's People

Contributors

aaronhktan avatar

Stargazers

 avatar

Watchers

 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.