Skip to content

Commit a1a13c2

Browse files
committed
LPC54xxx: fixed flash write
1 parent 0518b68 commit a1a13c2

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

config/examples/lpc54606j512.config

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ RAM_CODE?=0
2121
DUALBANK_SWAP?=0
2222
IMAGE_HEADER_SIZE?=256
2323
PKA?=1
24-
WOLFBOOT_PARTITION_SIZE?=0x3A000
25-
WOLFBOOT_SECTOR_SIZE?=0x1000
26-
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0xA000
27-
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x44000
28-
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x7f000
24+
WOLFBOOT_PARTITION_SIZE?=0x38000
25+
WOLFBOOT_SECTOR_SIZE?=0x8000
26+
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x8000
27+
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x40000
28+
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x78000

hal/lpc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ int RAMFUNCTION hal_flash_write(uint32_t address, const uint8_t *data, int len)
113113
uint32_t offset;
114114
int size;
115115
while (idx < len) {
116-
page_address = (address + idx) / FLASH_PAGE_SIZE;
116+
page_address = ((address + idx) / FLASH_PAGE_SIZE) * FLASH_PAGE_SIZE;
117117
offset = address - page_address;
118118
size = FLASH_PAGE_SIZE - offset;
119119
if (size > (len - idx))

0 commit comments

Comments
 (0)