diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2017-11-16 14:45:38 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2017-11-16 14:45:38 +0000 |
commit | 6ff9fd4af9df7d24d66f78ee7bba4088aaca4445 (patch) | |
tree | 47bd564477ce5d80ccfaf19e8bb1a6d35219ba2b | |
parent | 266426242abce8c6306cfcc079b262a6d1089d19 (diff) | |
download | ChibiOS-6ff9fd4af9df7d24d66f78ee7bba4088aaca4445.tar.gz ChibiOS-6ff9fd4af9df7d24d66f78ee7bba4088aaca4445.tar.bz2 ChibiOS-6ff9fd4af9df7d24d66f78ee7bba4088aaca4445.zip |
Bug fixing.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11019 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | os/hal/lib/complex/mfs/mfs.c | 8 | ||||
-rw-r--r-- | testhal/STM32/multi/QSPI-MFS/main.c | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/os/hal/lib/complex/mfs/mfs.c b/os/hal/lib/complex/mfs/mfs.c index 76178cc06..87ff1f365 100644 --- a/os/hal/lib/complex/mfs/mfs.c +++ b/os/hal/lib/complex/mfs/mfs.c @@ -934,7 +934,7 @@ mfs_error_t mfsReadRecord(MFSDriver *mfsp, mfs_id_t id, }
/* Checking if the requested record actually exists.*/
- if (mfsp->descriptors[id - 1U].offset != 0U) {
+ if (mfsp->descriptors[id - 1U].offset == 0U) {
return MFS_ERR_NOT_FOUND;
}
@@ -943,6 +943,12 @@ mfs_error_t mfsReadRecord(MFSDriver *mfsp, mfs_id_t id, return MFS_ERR_INV_SIZE;
}
+ /* Header read from flash.*/
+ RET_ON_ERROR(mfs_flash_read(mfsp,
+ mfsp->descriptors[id - 1U].offset,
+ *np,
+ mfsp->buffer.data8));
+
/* Data read from flash.*/
*np = mfsp->descriptors[id - 1U].size;
RET_ON_ERROR(mfs_flash_read(mfsp,
diff --git a/testhal/STM32/multi/QSPI-MFS/main.c b/testhal/STM32/multi/QSPI-MFS/main.c index ed8db1f38..e468c39f3 100644 --- a/testhal/STM32/multi/QSPI-MFS/main.c +++ b/testhal/STM32/multi/QSPI-MFS/main.c @@ -42,7 +42,7 @@ const M25QConfig m25qcfg1 = { const MFSConfig mfscfg1 = {
(BaseFlash *)&m25q,
0xFFFFFFFFU,
- 131072U,
+ 4096U,
0,
2,
2,
|