f1_common: fix MFS flash allocation for STM32F103RCT6 used on dual_rev1 (#260)

(cherry picked from commit 258d33e8a7b79846afd4e0db791d87476b9d2041)

Co-authored-by: Andrey Gusakov <dron0gus@gmail.com>
This commit is contained in:
rusefillc 2023-05-29 19:07:23 -04:00 committed by GitHub
parent 4022b40b31
commit 96a40b4da4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 5 deletions

View File

@ -6,15 +6,30 @@
#include "hal_mfs.h"
// Storage
// TODO: runtime detection?
static const MFSConfig mfscfg1 = {
.flashp = (BaseFlash *)&EFLD1,
.erased = 0xFFFFFFFFU,
#ifdef STM32F103xB
/* 128K flash device with 1K pages
* use last 8 pages for settings
* one bank is 4K */
.bank_size = 4096U,
.bank0_start = 120U,
.bank0_sectors = 4U,
.bank1_start = 124U,
.bank1_sectors = 4U
#endif
#ifdef STM32F103xE
/* 256K flash device with 2K pages
* use last 8 pages for settings
* one bank is 8K */
.bank_size = 8096U,
.bank0_start = 120U,
.bank0_sectors = 4U,
.bank1_start = 124U,
.bank1_sectors = 4U
#endif
};
static MFSDriver mfs1;

View File

@ -41,11 +41,9 @@
/*
* MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h.
*/
* see ChibiOS/os/common/ext/ST/STM32F1xx/stm32f1xx.h:
* STM32F103xE is for STM32F103RC */
#define STM32F103xE
// TODO:
//#define STM32F103xC
/*
* IO pins assignments.
*/