Skip to content

Instantly share code, notes, and snippets.

@bsmt
Last active January 7, 2022 06:18
Show Gist options
  • Save bsmt/e07167916a258ff988a0145f815f5e4a to your computer and use it in GitHub Desktop.
Save bsmt/e07167916a258ff988a0145f815f5e4a to your computer and use it in GitHub Desktop.
# Half-done definition for XGPro's ULI/UDC files.
# These let users add support for new flash chips, provided there is an
# existing "reference" chip that is similar enough.
# The XGPro software does not allow users to change the size of the chip, however.
# So, XGPro will not let you add chip that is bigger than everything else it supports.
# This is currently incomplete and cannot be used to create a definition from scratch.
meta:
id: xgpro_uli
file-extension: uli, udc
endian: le
seq:
- id: magic
contents: [0xff, 0x97, 0x68, 0xff]
- id: version
type: u4
doc: Currently always 1
- id: header_padding
type: str
size: 24
encoding: UTF-8
doc: Zero padding for header.
- id: unk1_memory_type
type: u4
doc: |
Unknown value.
Might be memory type? Need to figure out enum if so.
0x3 = flash, probably.
- id: unk2
type: u4
doc: Unknown value.
- id: unk3
type: u4
doc: Unknown value.
- id: flash_model_full
type: str
encoding: UTF-8
size: 40
doc: |
This contains the flash model and the "@ package" part.
For instance: "W25Q01JV@ SOIC16"
- id: unk4
type: u4
doc: Unknown value.
- id: flash_size
type: u4
doc: |
Size, in bytes, of the flash.
- id: unk5
type: u4
- id: unk6
type: u4
- id: unk7
type: u4
- id: unk8
type: u4
- id: unk9
type: u4
- id: unk10
type: u4
- id: unk11
type: u4
- id: unk12
type: u4
- id: device_id_1
type: u4be
doc: |
Expected device ID of the flash, big endian.
For instance: 0xef402100
For some reason this is repeated a few times.
- id: unk16
type: u4
- id: unk17
type: u4
- id: unk13
type: u4
- id: unk14
type: u4
- id: unk15
type: u4
- id: flash_reference
type: str
encoding: UTF-8
size: 40
doc: |
Name of the reference flash model.
For instance: "W25Q256JV"
"Reference" in XGPro GUI.
- id: package
type: str
encoding: UTF-8
size: 32
doc: |
Package name.
For instance: "SOIC16"
"Package" in XGPro GUI.
- id: size_str
type: str
encoding: UTF-8
size: 32
doc: |
Human-readable size. For instance: " 128 MB".
For some reason this always starts with a space.
"MemorySize" in XGPro GUI.
- id: supported_by
type: str
encoding: UTF-8
size: 32
doc: |
Model name of the XGecu programmer supported.
For instance: " XGecu T56 / TL866II Plus"
For some reason this always starts with a space.
"SupportedBy" in XGPro GUI.
- id: model
type: str
encoding: UTF-8
size: 40
doc: |
Model name of the flash.
For instance: "W25Q01JV"
"Model" in XGPro GUI
- id: manufacturer
type: str
encoding: UTF-8
size: 32
doc: |
Manufacturer name of the flash chip.
For instance: "Winbond"
"Manufacture" in XGPro GUI
- id: device_id_2
type: u4be
doc: |
Expected device ID of the flash, big endian.
For instance: 0xef402100
For some reason this is repeated a few times.
- id: device_id_3
type: u4be
doc: |
Expected device ID of the flash, packed into big endian dword.
For instance: 0xef402100
For some reason this is repeated a few times.
- id: unk18
type: u4
- id: unk19
type: u4
- id: username
type: str
encoding: UTF-8
size: 32
doc: |
User name.
"UserName" in XGPro GUI
- id: notes
type: str
encoding: UTF-8
size: 136
doc: |
Notes.
"Notes" in XGPro GUI
- id: checksum
type: u4
doc: |
Custom checksum. It is computed with data from 0x20 - 0x21b.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment