Lenka-12 / STM32F0-BareMetal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bare Metal STM32F051C6

This is a bare-metal programming repository for UCT second-year development board. Everything is written from scratch.

Contents

  • Start-up code written in C
  • Linker Script and Makefile
  • MCU specific header files for some peripherals
  • LCD library

Getting Started with STM32F0xx series

Clone the repository to your local computer. Go to linker script build/stm32_ls.ld and update the RAM and Flash size according to your processor specs. For the UCT board, you do not need to change anything else.

Tools Needed

Before you start, ensure you have the following tools installed on your system:

  1. Arm GNU Toolchain

  2. OpenOCD

    • Windows:
      • Download the Windows distribution of OpenOCD from https://gnutoolchains.com/arm-eabi/openocd/.
      • Extract the downloaded archive to a folder of your choice (e.g., C:\openocd).
      • Add the OpenOCD bin directory to the system's PATH environment variable.
    • Linux (Ubuntu):
      • Install OpenOCD using the package manager:
        sudo apt update
        sudo apt install openocd
  3. Make

    • Windows:
    • Linux (Ubuntu):
      • Install Make using the package manager:
        sudo apt update
        sudo apt install make

Downloading Code to our Board

  1. Go to the project folder containing the Makefile.
  2. Open that folder in the terminal.
  3. Type make flash.

For UCT Devboard

  • User LED0 will blink every second.
  • You will see the message on the LCD screen:
    "Hello World!!"
    "Welcome!"
    

References

Openocd

https://openocd.org/doc/pdf/openocd.pdf https://openocd.org/pages/documentation.html

ToolChain

https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html

Make

https://www.gnu.org/software/make/manual/make.html

LinkerScript

https://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_chapter/ld_3.html

To-do: add more depth info on installation, library usage, and more...

About

License:MIT License


Languages

Language:C 99.9%Language:Makefile 0.1%