Giter VIP home page Giter VIP logo

stm32_mw_fatfs's Introduction

Middleware FatFS MCU Component

latest tag

Overview

STM32Cube is an STMicroelectronics original initiative to ease developers' life by reducing efforts, time and cost.

STM32Cube covers the overall STM32 products portfolio. It includes a comprehensive embedded software platform delivered for each STM32 series.

  • The CMSIS modules (core and device) corresponding to the ARM(tm) core implemented in this STM32 product.
  • The STM32 HAL-LL drivers, an abstraction layer offering a set of APIs ensuring maximized portability across the STM32 portfolio.
  • The BSP drivers of each evaluation, demonstration or nucleo board provided for this STM32 series.
  • A consistent set of middleware libraries such as RTOS, USB, FatFS, graphics, touch sensing library...
  • A full set of software projects (basic examples, applications, and demonstrations) for each board provided for this STM32 series.

Two models of publication are proposed for the STM32Cube embedded software:

  • The monolithic MCU Package: all STM32Cube software modules of one STM32 series are present (Drivers, Middleware, Projects, Utilities) in the repository (usual name STM32Cubexx, xx corresponding to the STM32 series).
  • The MCU component: each STM32Cube software module being part of the STM32Cube MCU Package, is delivered as an individual repository, allowing the user to select and get only the required software functions.

Description

This stm32_mw_fatfs MCU component repository is one element common to all STM32Cube MCU embedded software packages, providing the FatFS MCU Middleware part.

Release note

  • Details about the content of this release are available in the release note here.
  • Details about the updates made by STMicroelectronics are available in the release note here.

Compatibility information

Please refer to the release note in the repository of the STM32Cube firmware you are using to know which version of this middleware library to use with other components' versions (e.g., other middleware libraries, drivers). It is crucial that you use a consistent set of versions.

Troubleshooting

Please refer to the CONTRIBUTING.md guide.

stm32_mw_fatfs's People

Contributors

alabstm avatar motla avatar rjmstm avatar rkoustm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stm32_mw_fatfs's Issues

Incorrect usage of osMessageQueuePut

This issue is present in code generated by CubeMX 6.6.1.

The following lines all pass NULL to the uint8_t msg_prio parameter, causing a compiler warning:

warning: passing argument 3 of 'osMessageQueuePut' makes integer from pointer without a cast [-Wint-conversion]

osMessageQueuePut(SDQueueID, (const void *)&msg, NULL, 0);

osMessageQueuePut(SDQueueID, (const void *)&msg, NULL, 0);

osMessageQueuePut(SDQueueID, (const void *)&msg, NULL, 0);

The issue may be due to some copy-paste programming. The osMessageQueueGet API does take a pointer:

osStatus_t osMessageQueueGet (osMessageQueueId_t mq_id, void *msg_ptr, uint8_t *msg_prio, uint32_t timeout)

but osMessageQueuePut takes the msg_prio by value:

osStatus_t osMessageQueuePut (osMessageQueueId_t mq_id, const void *msg_ptr, uint8_t msg_prio, uint32_t timeout)

Alignment of buffers in ff.h

I am using FatFS library on STM32H723 MCU with FreeRTOS and DMA. I have encountered the issue mentioned here on the forum. When buffers are not aligned, file access functions like f_read return FR_INT_ERR as cache coherency operations probably don't work as expected. Turning the ENABLE_SCRATCH_BUFFER and ENABLE_SD_DMA_CACHE_MAINTENANCE defines on in sd_diskio.c template also does not help. I do not know if ST is able to fix those issues in the library, but the fix is simple, change

BYTE win[_MAX_SS]; /* Disk access window for Directory, FAT (and file data at tiny cfg) */

to

BYTE win[_MAX_SS] __attribute__((aligned(32)));

and

BYTE buf[_MAX_SS]; /* File private data read/write window */

to

BYTE buf[_MAX_SS] __attribute__((aligned(32)));.

Then the issue goes away completely.

disk is always considered as initialized

Hello,

I am new to github so please forgive me if this is not the way how to report this kind of problems.

I am convinced there is a bug in "diskio.c" template. Template is provided by ChaN, but concrete implementatiton is made by ST. As the result of this bug disk is always considered as initialized even if the initialization phase failed.

DSTATUS disk_initialize (
	BYTE pdrv				/* Physical drive nmuber to identify the drive */
)
{
  DSTATUS stat = RES_OK;

  if(disk.is_initialized[pdrv] == 0)
  {
    disk.is_initialized[pdrv] = 1;   // <---------------------------- ALWAYS MARKED AS INITIALIZED
    stat = disk.drv[pdrv]->disk_initialize(disk.lun[pdrv]);
  }
  return stat;
}

I think more relevant solution would be something like

DSTATUS disk_initialize (
	BYTE pdrv				/* Physical drive nmuber to identify the drive */
)
{
  DSTATUS stat = RES_OK;

  if(disk.is_initialized[pdrv] == 0)
  {
    stat = disk.drv[pdrv]->disk_initialize(disk.lun[pdrv]);
    disk.is_initialized[pdrv] = !(stat & STA_NOINIT);  // <------- checking for noinit flag set during initialization (indicating that initialization failed)
  }
  return stat;
}

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.