Skip to content

This repository contains minimal demos of stm32f0discovery's peripherals with CMSIS.

Notifications You must be signed in to change notification settings

aslansq/embedded_abc

Repository files navigation

all_builds

embedded_abc

This repository contains minimal demos of stm32f0discovery's peripherals with CMSIS.

fun

Why?

It will help you to make connection between datasheet and physical hardware. This is for educational purposes. Main purpose is demonstrating simple communication interfaces. If I have enough time, I ll put more peripherals other than communication.

Goal State Demo Description
Spi 03_spi_bit_bang Simplest way to push data with SPI
Uart 04_uart Pushing data with UART
I2C 05_i2c Pushing data to I2C bus(with fake slave)
More State Demo Description
Core Clock 00_core_clock Well to be able to do anything clocks needs to be setup. Core and bus clock configurations and core clock speed test
Systick 01_systick Systick 1 ms interrupt configuration
Gpio Out 02_gpio_out Explained how board led configuration is done

Prerequisites

  • Install(download and unzip path of your choice) arm-none-eabi-gcc.
  • Create environment variable GCC_ARM_NONE_EABI_BIN_PATH which points to binaries.
  • Install GNU make utility.
  • Install CMake utility.
  • Give execute permission files under shell. chmod +x shell/*.sh
  • After all satisfied, run configure.sh. configure.sh checks prerequisities.

Building

./shell/rebuild_all.sh

Tip

If you have CubeMx installed already, then you could create an environment variable STM32_Programmer_CLI_PATH. It will allow you flash firmware directly to the board.

Example path of mine and how to flash using script.

export STM32_Programmer_CLI_PATH=/opt/st/stm32cubeide_1.17.0/plugins/com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.linux64_2.2.0.202409170845/tools/bin
./shell/rebuild_download.sh 02_gpio_out

Design Choices

  • Every demo should be in a single main.c file
  • Every demo should be compilable by it is own. No shared resources between demos.
  • Only the lines that thought to be as tricky explained.
  • All above choices made to keep it simple.

References

See the references under doc folder.

  • Reference manual of STM32F051R8T6 rm0091
  • Technical reference manual of Cortex-M0 DDI0432C
  • Programming manual of STM32F051R8T6 pm0215
  • Stm32f0discovery board schematic MB1034
  • STM32F051R8T6 datasheet stm32f051r8

Abbreviations and Acronyms

Short form Description
APB Advanced Peripheral Bus
HSI High Speed Internal Oscillator
AHB Advanced High Performance Bus
GPIO General Purpose Input Output
NVIC Nested Vector Interrupt Controller
SPI Serial Peripheral Interface
UART Universal Asynchronous Receiver/Transmitter
I2C Inter-Integrated Circuit Protocol

About

This repository contains minimal demos of stm32f0discovery's peripherals with CMSIS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages