Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FatFS fixes for F7 series #1538

Merged
merged 4 commits into from
Jan 22, 2020
Merged

FatFS fixes for F7 series #1538

merged 4 commits into from
Jan 22, 2020

Conversation

networkfusion
Copy link
Member

Description

Use our own diskio.c file for FatFS since the ChibiOS project is unwilling to add it.

TODO (as seperate PR's)
Use our own (up to date) FatFS repo
Add read cache invalidation to the chibios_contrib version.

How Has This Been Tested?

Testing is still to be completed!

Screenshots

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@nfbot
Copy link
Member

nfbot commented Jan 21, 2020

Hi @networkfusion,

I'm nanoFramework bot.
Thank you for your contribution!

A human will be reviewing it shortly. 😉

targets/CMSIS-OS/ChibiOS/FatFS/fatfs_diskio.c Outdated Show resolved Hide resolved
if (mmcStartSequentialWrite(&FATFS_HAL_DEVICE, sector))
return RES_ERROR;
// invalidate cache on buffer
cacheBufferFlush(buff, MMCSD_BLOCK_SIZE*count);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here but inside the while. Similar reason, if we don't flush the cache the data chunk to be written could be still have older data.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeap

@josesimoes josesimoes added Series: STM32xx Everything related specifically with STM32 targets Breaking-change labels Jan 21, 2020
@networkfusion
Copy link
Member Author

BTW, why is this a breaking change?

@josesimoes
Copy link
Member

josesimoes commented Jan 22, 2020

BTW, why is this a breaking change?

It's a breaking change more in the sense that's breaking with ChibiOS code. From a code perspective it looks lile more an enhacement along with a bug fix (for F7).

@josesimoes
Copy link
Member

Just edited the code to make a couple of adjustments and add proper comments.

@networkfusion
Copy link
Member Author

Just edited the code to make a couple of adjustments and add proper comments.

Fine by me... I am guessing the read commands also need adding to the contrib repo for it to work as expected?

Once this is merged, I will add the changes so that we can seperate from the FatFS zip in chibiOS to using our own git repo...

@networkfusion
Copy link
Member Author

Also, I am guessing we need to adjust the FatFS source once separated to we can align buffers?

@josesimoes
Copy link
Member

Also, I am guessing we need to adjust the FatFS source once separated to we can align buffers?

That's absolutely mandatory for cache invalidate otherwise will mess up with the adjacent memory.

@josesimoes josesimoes merged commit 1929a5e into develop Jan 22, 2020
@josesimoes josesimoes deleted the develop-fatfs-stm32 branch January 22, 2020 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Series: STM32xx Everything related specifically with STM32 targets Type: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants