Skip to content

Commit 4e73ebe

Browse files
committed
LPC55xx: correct sector size of flash regions.
The flash algos use an erase sector size of 32 kB even though the hardware flash controller can erase individual 512 byte pages.
1 parent b0425eb commit 4e73ebe

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

pyocd/target/builtin/target_LPC55S28Jxxxxx.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from ...core.memory_map import (FlashRegion, RamRegion, RomRegion, MemoryMap)
1919
from ...debug.svd.loader import SVDFile
2020

21+
# Note: the DFP has both S and NS flash algos, but they are exactly the same except for the address range.
2122
FLASH_ALGO = {
2223
'load_address' : 0x20000000,
2324

@@ -107,15 +108,17 @@ class LPC55S28(LPC5500Family):
107108

108109
MEMORY_MAP = MemoryMap(
109110
FlashRegion(name='nsflash', start=0x00000000, length=0x00080000, access='rx',
110-
blocksize=0x200,
111+
page_size=0x200,
112+
sector_size=0x8000,
111113
is_boot_memory=True,
112114
are_erased_sectors_readable=False,
113115
algo=FLASH_ALGO),
114116
RomRegion( name='nsrom', start=0x03000000, length=0x00020000, access='rx'),
115117
RamRegion( name='nscoderam', start=0x04000000, length=0x00008000, access='rwx',
116118
default=False),
117119
FlashRegion(name='sflash', start=0x10000000, length=0x00080000, access='rx',
118-
blocksize=0x200,
120+
page_size=0x200,
121+
sector_size=0x8000,
119122
is_boot_memory=True,
120123
are_erased_sectors_readable=False,
121124
algo=FLASH_ALGO,

pyocd/target/builtin/target_LPC55S69Jxxxxx.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from ...core.memory_map import (FlashRegion, RamRegion, RomRegion, MemoryMap)
1919
from ...debug.svd.loader import SVDFile
2020

21+
# Note: the DFP has both S and NS flash algos, but they are exactly the same except for the address range.
2122
FLASH_ALGO = {
2223
'load_address' : 0x20000000,
2324

@@ -107,15 +108,17 @@ class LPC55S69(LPC5500Family):
107108

108109
MEMORY_MAP = MemoryMap(
109110
FlashRegion(name='nsflash', start=0x00000000, length=0x00098000, access='rx',
110-
blocksize=0x200,
111+
page_size=0x200,
112+
sector_size=0x8000,
111113
is_boot_memory=True,
112114
are_erased_sectors_readable=False,
113115
algo=FLASH_ALGO),
114116
RomRegion( name='nsrom', start=0x03000000, length=0x00020000, access='rx'),
115117
RamRegion( name='nscoderam', start=0x04000000, length=0x00008000, access='rwx',
116118
default=False),
117119
FlashRegion(name='sflash', start=0x10000000, length=0x00098000, access='rx',
118-
blocksize=0x200,
120+
page_size=0x200,
121+
sector_size=0x8000,
119122
is_boot_memory=True,
120123
are_erased_sectors_readable=False,
121124
algo=FLASH_ALGO,

0 commit comments

Comments
 (0)