mirror of https://github.com/ARMmbed/mbed-os.git
commit
6f403217c6
|
@ -8121,7 +8121,7 @@
|
|||
"public-ram-start": "0x08047600",
|
||||
"public-ram-size": "0x200"
|
||||
},
|
||||
"device_name": "CY8C6247BZI-D54",
|
||||
"sectors": [[268435456, 512]],
|
||||
"bootloader_supported": true
|
||||
},
|
||||
"CY8CMOD_062_4343W": {
|
||||
|
@ -8153,7 +8153,7 @@
|
|||
"post_binary_hook": {
|
||||
"function": "PSOC6Code.complete"
|
||||
},
|
||||
"device_name": "CY8C6347BZI-BLD53",
|
||||
"sectors": [[268443648, 512]],
|
||||
"bootloader_supported": true
|
||||
},
|
||||
"CY8CKIT_062_4343W": {
|
||||
|
|
|
@ -462778,56 +462778,5 @@
|
|||
],
|
||||
"vendor": "Nordic Semiconductor:54"
|
||||
},
|
||||
"CY8C6347BZI-BLD53": {
|
||||
"core": "Cortex-M4",
|
||||
"vendor": "Cypress",
|
||||
"sectors": [
|
||||
[
|
||||
268435456,
|
||||
512
|
||||
]
|
||||
],
|
||||
"memories": {
|
||||
"IROM1": {
|
||||
"access": {
|
||||
"execute": true,
|
||||
"non_secure": true,
|
||||
"non_secure_callable": false,
|
||||
"peripheral": false,
|
||||
"read": true,
|
||||
"secure": false,
|
||||
"write": true
|
||||
},
|
||||
"default": true,
|
||||
"start": "0x10002000",
|
||||
"size": "0x000FE000"
|
||||
}
|
||||
}
|
||||
},
|
||||
"CY8C6247BZI-D54": {
|
||||
"core": "Cortex-M4",
|
||||
"vendor": "Cypress",
|
||||
"sectors": [
|
||||
[
|
||||
268435456,
|
||||
512
|
||||
]
|
||||
],
|
||||
"memories": {
|
||||
"IROM1": {
|
||||
"access": {
|
||||
"execute": true,
|
||||
"non_secure": true,
|
||||
"non_secure_callable": false,
|
||||
"peripheral": false,
|
||||
"read": true,
|
||||
"secure": false,
|
||||
"write": true
|
||||
},
|
||||
"start": "0x10040000",
|
||||
"size": "0xB8000"
|
||||
}
|
||||
}
|
||||
},
|
||||
"version": "0.2.0"
|
||||
}
|
||||
|
|
|
@ -649,16 +649,21 @@ class Config(object):
|
|||
@property
|
||||
def sectors(self):
|
||||
"""Return a list of tuples of sector start,size"""
|
||||
cache = Cache(False, False)
|
||||
if self.target.device_name not in cache.index:
|
||||
raise ConfigException("Bootloader not supported on this target: "
|
||||
"targets.json `device_name` not found in "
|
||||
"arm_pack_manager index.")
|
||||
cmsis_part = cache.index[self.target.device_name]
|
||||
sectors = cmsis_part['sectors']
|
||||
if sectors:
|
||||
return sectors
|
||||
raise ConfigException("No sector info available")
|
||||
try:
|
||||
return self.target.sectors
|
||||
except AttributeError:
|
||||
cache = Cache(False, False)
|
||||
if self.target.device_name not in cache.index:
|
||||
raise ConfigException(
|
||||
"Bootloader not supported on this target: "
|
||||
"targets.json `device_name` not found in "
|
||||
"arm_pack_manager index."
|
||||
)
|
||||
cmsis_part = cache.index[self.target.device_name]
|
||||
sectors = cmsis_part['sectors']
|
||||
if sectors:
|
||||
return sectors
|
||||
raise ConfigException("No sector info available")
|
||||
|
||||
def _get_cmsis_part(self):
|
||||
if not hasattr(self.target, "device_name"):
|
||||
|
@ -745,6 +750,48 @@ class Config(object):
|
|||
|
||||
try:
|
||||
cmsis_part = self._get_cmsis_part()
|
||||
present_memories = set(cmsis_part['memories'].keys())
|
||||
valid_memories = set(memory_list).intersection(present_memories)
|
||||
|
||||
memories = self._get_mem_specs(
|
||||
["read", "write" if active_memory == "RAM" else "execute"],
|
||||
cmsis_part
|
||||
)
|
||||
for memory in valid_memories:
|
||||
mem_start = memories[memory]["start"]
|
||||
mem_size = memories[memory]["size"]
|
||||
if memory in ['IROM1', 'PROGRAM_FLASH']:
|
||||
start, size = self._get_primary_memory_override("rom")
|
||||
if start:
|
||||
mem_start = start
|
||||
if size:
|
||||
mem_size = size
|
||||
memory = 'ROM'
|
||||
elif memory in ['IRAM1', 'SRAM_OC', 'SRAM_UPPER', 'SRAM']:
|
||||
if (self.has_ram_regions):
|
||||
continue
|
||||
start, size = self._get_primary_memory_override("ram")
|
||||
if start:
|
||||
mem_start = start
|
||||
if size:
|
||||
mem_size = size
|
||||
memory = 'RAM'
|
||||
else:
|
||||
active_memory_counter += 1
|
||||
memory = active_memory + str(active_memory_counter)
|
||||
|
||||
if not isinstance(mem_start, int):
|
||||
mem_start = int(mem_start, 0)
|
||||
if not isinstance(mem_size, int):
|
||||
mem_size = int(mem_size, 0)
|
||||
available_memories[memory] = [mem_start, mem_size]
|
||||
|
||||
if not available_memories:
|
||||
raise ConfigException(
|
||||
"Bootloader not supported on this target. "
|
||||
"No memories found."
|
||||
)
|
||||
return available_memories
|
||||
except ConfigException:
|
||||
""" If the target doesn't exits in cmsis, but present in targets.json
|
||||
with ram and rom start/size defined"""
|
||||
|
@ -764,43 +811,6 @@ class Config(object):
|
|||
available_memories[active_memory] = [start, size]
|
||||
return available_memories
|
||||
|
||||
present_memories = set(cmsis_part['memories'].keys())
|
||||
valid_memories = set(memory_list).intersection(present_memories)
|
||||
|
||||
memories = self._get_mem_specs(
|
||||
["read", "write" if active_memory == "RAM" else "execute"],
|
||||
cmsis_part
|
||||
)
|
||||
for memory in valid_memories:
|
||||
mem_start = memories[memory]["start"]
|
||||
mem_size = memories[memory]["size"]
|
||||
if memory in ['IROM1', 'PROGRAM_FLASH']:
|
||||
start, size = self._get_primary_memory_override("rom")
|
||||
if start:
|
||||
mem_start = start
|
||||
if size:
|
||||
mem_size = size
|
||||
memory = 'ROM'
|
||||
elif memory in ['IRAM1', 'SRAM_OC', 'SRAM_UPPER', 'SRAM']:
|
||||
if (self.has_ram_regions):
|
||||
continue
|
||||
start, size = self._get_primary_memory_override("ram")
|
||||
if start:
|
||||
mem_start = start
|
||||
if size:
|
||||
mem_size = size
|
||||
memory = 'RAM'
|
||||
else:
|
||||
active_memory_counter += 1
|
||||
memory = active_memory + str(active_memory_counter)
|
||||
|
||||
if not isinstance(mem_start, int):
|
||||
mem_start = int(mem_start, 0)
|
||||
if not isinstance(mem_size, int):
|
||||
mem_size = int(mem_size, 0)
|
||||
available_memories[memory] = [mem_start, mem_size]
|
||||
|
||||
return available_memories
|
||||
|
||||
@property
|
||||
def ram_regions(self):
|
||||
|
|
Loading…
Reference in New Issue