-
Notifications
You must be signed in to change notification settings - Fork 180
Description
From the File format description:
blockNo
: Sequential block number; starts at 0numBlocks
: Total number of blocks in file
And the File containers section concurs in that this should be the block number and count for the entire file:
The fields
blockNo
andnumBlocks
refer to the entire UF2 file, not the current file.
But, then the Family ID description suggest that multiple UF2 can be concatenated, and each file will have a different total of numBlocks
and duplicated blockNo
values:
If the familyID doesn't match, the bootloader should disregard the entire block, including blockNo and numBlocks fields. [...] This also allows for several files with different familyID to be simply concatenated together, and the whole resulting file to be copied to the device with only one actually being written to flash.
And we also have this unmerged PR for joining UF2 files, which does change the blockNo
and numBlocks
, but it keeps a different count for each Family ID. So joining 3 UF2 files for 2 families, will end up with two different numBlocks
(the same family are merged, the other family kept separated):
- add --join option #81
- https://github.com/microsoft/uf2/pull/81/files#diff-2c62a0beb64519fa879c3e146eaaf0efbca0a2d9aca8489247e0ebe603c4ab62R64
So we seem to have to contradictory definitions, unless the definition is meant to be:
- When the file container flag is used
blockNo
andnumBlocks
refer to the entire UF2 file - Otherwise the blockNo
and
numBlocksrefer to the blocks for each individual
familyID`.