Skip to content

Bsm-B/Stm32-FatFs-FreeRTOS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FreeRTOS & FatFs in Stm32 (Arm® Cortex®-M0)

This project is designed as an example of a STM32CubeIDE-generated system with FreeRTOS multitask feautures and FatFs File System for controlling an SPI-connected MMC/SD memory card .

For more information you can take a look here

Features

  • MultiTask
  • Mutexes & Thread Safety
  • CMSIS-RTOS API Version 1
  • FatFs Application Interface
    • Memory state
    • Manipulation of folders/files
    • Error Messages

Overview

I was created 3 task with different priority and sizes with safe access via mutex to SD card.

  • Blink: Simple Task for Blinking LED
  • SDinfo: Give infomation about SD Card and files
    • Usage Memory, Free Space, List of Files/Folders with details (Date, Type, Path, Name)
  • SDManager: Create, Read, Write, Find Folders/Files

Note

This example was built based on Tutorial created by @kiwih For more information Tutorial: An SD card over SPI.

Original code FatFs without FreeRTOS : Cubeide-sd-card

Installation

This example was created using Stm32f072 discovery kit + Waveshare SD card module In addition, I used Converter USB-UART with PL2303HX to read UART messages

Connections

Since the SPI2 is connected to ST MEMS motion senso ( One of the properties 32F072BDISCOVERY) So I used SPI1 and defined SD_SPI_HANDLE to SPI1

#define SD_SPI_HANDLE hspi1

Finally, In table form the connections are as follows:

SD Adapter side Stm32f072 side
MISO PB4
MOSI PB5
SCLK PA5
CS PB3
3V 3.3V
GND GND

Testing

License

Creative Commons Zero v1.0 Universal

About

STM32 example of FreeRTOS & FatFs for controlling an SPI-connected MMC/SD memory card

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published