Skip to content

Commit 038ede3

Browse files
ccli8adbridge
authored andcommitted
Fix page size in flash IAP
In Mbed OS, page size is program unit, which is different than FMC definition. After fixing page size, we can pass NVSTORE test (mbed-os-features-nvstore-tests-nvstore-functionality).
1 parent 7138038 commit 038ede3

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

targets/TARGET_NUVOTON/TARGET_M451/flash_api.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ static const sector_info_t sectors_info[] = {
6565
};
6666

6767
static const flash_target_config_t flash_target_config = {
68-
.page_size = 0x800, // 2 KB
68+
.page_size = 4, // 4 bytes
69+
// Here page_size is program unit, which is different than FMC definition.
6970
.flash_start = 0x0,
7071
.flash_size = 0x40000, // 256 KB
7172
.sectors = sectors_info,

targets/TARGET_NUVOTON/TARGET_M480/flash_api.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ static const sector_info_t sectors_info[] = {
6969
};
7070

7171
static const flash_target_config_t flash_target_config = {
72-
.page_size = 0x200, // 512 bytes
72+
.page_size = 4, // 4 bytes
73+
// Here page_size is program unit, which is different than FMC definition.
7374
.flash_start = 0x0,
7475
.flash_size = 0x80000, // 512 KB
7576
.sectors = sectors_info,

targets/TARGET_NUVOTON/TARGET_NUC472/flash_api.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ static const sector_info_t sectors_info[] = {
6767
};
6868

6969
static const flash_target_config_t flash_target_config = {
70-
.page_size = 0x800, // 2 KB
70+
.page_size = 4, // 4 bytes
71+
// Here page_size is program unit, which is different than FMC definition.
7172
.flash_start = 0x0,
7273
.flash_size = 0x80000, // 512 KB
7374
.sectors = sectors_info,

0 commit comments

Comments
 (0)