This is a bare-metal programming repository for UCT second-year development board. Everything is written from scratch.
- Start-up code written in C
- Linker Script and Makefile
- MCU specific header files for some peripherals
- LCD library
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.
Before you start, ensure you have the following tools installed on your system:
-
Arm GNU Toolchain
- Windows:
- Download the Arm GNU Toolchain for Windows from https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads.
- Install the toolchain by running the installer.
- During installation, specify the installation directory (e.g.,
C:\Program Files (x86)\GNU Arm Embedded Toolchain
). - Add the toolchain's
bin
directory to the system'sPATH
environment variable.
- Linux (Ubuntu):
- Install the Arm GNU Toolchain using the package manager:
sudo apt update sudo apt install gcc-arm-none-eabi
- Install the Arm GNU Toolchain using the package manager:
- Windows:
-
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'sPATH
environment variable.
- Linux (Ubuntu):
- Install OpenOCD using the package manager:
sudo apt update sudo apt install openocd
- Install OpenOCD using the package manager:
- Windows:
-
Make
- Windows:
- Download the Windows binary distribution of Make from https://gnuwin32.sourceforge.net/packages/make.htm.
- Install Make by running the installer.
- Add the Make
bin
directory to the system'sPATH
environment variable.
- Linux (Ubuntu):
- Install Make using the package manager:
sudo apt update sudo apt install make
- Install Make using the package manager:
- Windows:
- Go to the project folder containing the Makefile.
- Open that folder in the terminal.
- Type
make flash
.
- User LED0 will blink every second.
- You will see the message on the LCD screen:
"Hello World!!" "Welcome!"
https://openocd.org/doc/pdf/openocd.pdf https://openocd.org/pages/documentation.html
https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html
https://www.gnu.org/software/make/manual/make.html
https://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_chapter/ld_3.html