Difference between revisions of "Firmware file format (.gdf)"

From Granite Devices Knowledge Wiki
Jump to: navigation, search
[checked revision][checked revision]
(GDF version 310 - draft)
(GDF version 400 - draft)
Line 35: Line 35:
 
         *
 
         *
 
         * 4 ASCII string = "GDFW"
 
         * 4 ASCII string = "GDFW"
         * 2 version = 400
+
         * 2 GDF version = 400
         * 2 backwards compatible version = 400
+
         * 2 GDF backwards compatible version = 400
 
         * 4 target device type ID
 
         * 4 target device type ID
 
         * 4 number of data chunks in file = N
 
         * 4 number of data chunks in file = N
Line 51: Line 51:
 
         * data chunk types
 
         * data chunk types
 
         * ----------------
 
         * ----------------
 +
        * 0=target device name, UTF8
 +
        * 1=firmware name, UTF8
 +
        * 2=firmware version string, UTF8
 +
        * 3=remarks, UTF8
 
         * 100=main MCU FW binary, S=any
 
         * 100=main MCU FW binary, S=any
 
         * 101=main MCU FW unique identifier number, S=4
 
         * 101=main MCU FW unique identifier number, S=4
 
         * 200=secondary MCU FW binary, S=any
 
         * 200=secondary MCU FW binary, S=any
 +
        *
 +
        * note: firmware may contain any many combinations of above chunks. in basic case, it contains just chunk type 100 and nothing else.
 
         *
 
         *
 
         * data chunk option bits
 
         * data chunk option bits

Revision as of 13:30, 9 October 2018

File format byte by byte

All multibyte integers are stored LSB first.

GDF version 300

Header

IDString - 4 bytes, always="GDFW"

BLFileVersion - 2 bytes, value=300

TargetDriveType - 2 bytes, Argon=4000, Ion=11000, Atomi=14000

HostFWbytes - 4 bytes, number of bytes for STM32 CPU

GCFWbytes - 4 bytes, number of bytes for GraniteCore CPU or 0xffffffff if not included

Data

Data of HostFW begins. Amount of bytes is HostFWbytes

Data of GCFW begins. Amount of bytes is GCFWbytes

File checksum

FileCksum - 4 bytes calculated from the current file. Simply sum of all unsigned bytes in file except CKSum itself


GDF version 400 - draft

Header

Version 400 described below:

        /* GDF version 400 format
         * ----------------------
         *
         * Binary file contents
         * --------------------
         *
         * bytes  meaning:
         *
         * 4	ASCII string = "GDFW"
         * 2	GDF version = 400
         * 2	GDF backwards compatible version = 400
         * 4	target device type ID
         * 4	number of data chunks in file = N
         *
         * repeat N times:
         * 4	data chunk type
         * 4	data chunk option bits
         * 4	data chunk size in bytes=S
         * S	data
         * end of repeat
         *
         * 4	file's CRC-32
         *
         * data chunk types
         * ----------------
         * 0=target device name, UTF8
         * 1=firmware name, UTF8
         * 2=firmware version string, UTF8
         * 3=remarks, UTF8
         * 100=main MCU FW binary, S=any
         * 101=main MCU FW unique identifier number, S=4
         * 200=secondary MCU FW binary, S=any
         *
         * note: firmware may contain any many combinations of above chunks. in basic case, it contains just chunk type 100 and nothing else.
         *
         * data chunk option bits
         * ----------------------
         * bit 0: if 1, GDF loading application must support/understand the chunk type to use this file
         *
         */

For practical reading software implementation, see devicedeployment.c from SimpleMotion library.