Flasher Hub - Patch data

From SEGGER Wiki
Jump to: navigation, search

The Flasher Compact modules connected to the Flasher Hub support patch files, which allows to patch the content of the data to be programmed.

Patch file support

Before starting the programming process in stand-alone mode, the Flasher Compact module will look for a file named Patches.txt being present. This file includes the patches. If this file is present, the number in Serial.txt describes the line number of the Patches.txt file that will be used for the current cycle (line counting starts at 0).

Each line in Patches.txt can hold up to 4 patches, where each patch can be up to 32 bytes in length.

Syntax
Each line begins with <NumPatches> followed by each patch <Addr>,<NumBytes>:<Data> in sequence and separated by commas. So the syntax for <NumPatches> = 4 would be as follows:

<NumPatches>,<Addr>,<NumBytes>:<Data>,<Addr>,<NumBytes>:<Data>,<Addr>,<NumBytes>:<Data>,<Addr>,<NumBytes>:<Data>

Find below a table which describes each parameter.

Parameter Description
<NumPatches> Describes the number of patches in this patch line. Max. value is 4.
<Addr> Describes the address to be patched. Value is expected in hex.
<NumBytes> Number of bytes for the current patch. Max. value is 20h (32 in decimal). Value is expected in hex.
<Data> Describes the data to be patched. <Data> is always expected as 2 hexadecimal characters per byte.


Note:
All values are expected in hexadecimal format (hex).
The <Data> section is always preceded by ":", not ",".

Example
Please find below an example sequence which clarifies the usage of patch files.

Patches.txt, which is located on the Flasher Compact(s), contains the following line:

3,100025,3:AABBCC,100063,2:DDEE,100078,1:FF

Serial.txt contains a "0", which forces the Flasher Compact to use line 0 from Patches.txt.

After starting the programming cycle, the following data will be patched:

Addr 0x100025: 3 byte 0xAA 0xBB 0xCC
Addr 0x100063: 2 byte 0xDD 0xEE
Addr 0x100078: 1 byte 0xFF

Patch via command

Alternatively, you can start a programming cycle with patch data that is only valid for this one cycle (no need for a Patches.txt file):

Send the

#AUTO PATCH <module> <NumPatches>,<Addr>,<NumBytes>:<Data>

command via the Flasher Hub ASCII terminal interface. The parameters have the same function as described in the table above.