show firmware details from image header

This commit is contained in:
Laura Klünder 2023-11-23 19:16:57 +01:00
parent 92e3c2a583
commit 6caaf17205
2 changed files with 24 additions and 3 deletions

View file

@ -190,6 +190,10 @@ class FlashSize(EnumSchemaByNameMixin, IntEnum):
SIZE_64MB = 6
SIZE_128MB = 7
@property
def pretty_name(self):
return self.name.removeprefix('SIZE_')
@unique
class FlashFrequency(EnumSchemaByNameMixin, IntEnum):
@ -198,12 +202,20 @@ class FlashFrequency(EnumSchemaByNameMixin, IntEnum):
FREQ_20MHZ = 2
FREQ_80MHZ = 0xf
@property
def pretty_name(self):
return self.name.removeprefix('FREQ_').replace('MHZ', 'Mhz')
@dataclass
class FlashSettings:
size: FlashSize
frequency: FlashFrequency
@property
def display(self):
return f"{self.size.pretty_name} ({self.frequency.pretty_name})"
@unique
class ChipType(EnumSchemaByNameMixin, IntEnum):

View file

@ -8,6 +8,7 @@
<div class="columns">
<div>
<p>
<strong>Project name:</strong> {{ build.version.project_name }}<br>
<strong>Version:</strong> <a href="{% url 'mesh.firmwares.detail' pk=build.version.pk %}">{{ build.version.version }}</a><br>
@ -15,10 +16,18 @@
<strong>Uploader:</strong> {{ build.version.uploader }}<br>
<strong>Created:</strong> {{ build.version.created }}<br>
</p>
<o>
<p>
<strong>Variant:</strong> {{ build.variant }}<br>
<strong>Chip:</strong> {{ build.get_chip_display }}<br>
</o>
<strong>Chip:</strong> {{ build.get_chip_display }}
<small>
>=rev{{ build.firmware_image.ext_header.min_chip_rev.0 }}.{{ build.firmware_image.ext_header.min_chip_rev.1 }}
<=rev{{ build.firmware_image.ext_header.max_chip_rev.0 }}.{{ build.firmware_image.ext_header.max_chip_rev.1 }}
</small>
<br>
<strong>Flash:</strong> {{ build.firmware_image.header.flash_stuff.display }}<br>
<strong>SPI Flash Mode:</strong> {{ build.firmware_image.header.spi_flash_mode.name }}<br>
<strong>App ELF SHA256:</strong> <small>{{ build.sha256_hash }}</small><br>
</p>
<h4>Compatible boards:</h4>
<ul>
{% for board in build.boards %}