Skip to content
Snippets Groups Projects
Commit 92667dc2 authored by Damien George's avatar Damien George
Browse files

tools/pydfu.py: Add support for multiple memory segments.

Segments are separated by / and begin with the memory address.  This
follows how the ST DFU tool works.
parent ec7982ec
No related branches found
No related tags found
No related merge requests found
...@@ -394,10 +394,11 @@ def get_memory_layout(device): ...@@ -394,10 +394,11 @@ def get_memory_layout(device):
intf = cfg[(0, 0)] intf = cfg[(0, 0)]
mem_layout_str = get_string(device, intf.iInterface) mem_layout_str = get_string(device, intf.iInterface)
mem_layout = mem_layout_str.split('/') mem_layout = mem_layout_str.split('/')
addr = int(mem_layout[1], 0)
segments = mem_layout[2].split(',')
seg_re = re.compile(r'(\d+)\*(\d+)(.)(.)')
result = [] result = []
for mem_layout_index in range(1, len(mem_layout), 2):
addr = int(mem_layout[mem_layout_index], 0)
segments = mem_layout[mem_layout_index + 1].split(',')
seg_re = re.compile(r'(\d+)\*(\d+)(.)(.)')
for segment in segments: for segment in segments:
seg_match = seg_re.match(segment) seg_match = seg_re.match(segment)
num_pages = int(seg_match.groups()[0], 10) num_pages = int(seg_match.groups()[0], 10)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment