9 Firmware Metadata Tools
Documents the FWMDT input/output files and command-line usage.
Location
After running Step 1, the FWMDT is copied to:
~/.trustplatform/pic32cmsg_secureboot/FWmetadatatool/
Input Files
| File | Description |
|---|---|
PIC32CMSG_fwmd.xml | Image configuration: addresses and hex files for each segment |
PIC32CMSG_sfp.xml | Signing key (ECC P-256), VSS
address (0x0A004000), variable slots |
FirmwareMetadata.xsd | XML schema for FWMD |
hsmSecureFlash.xsd | XML schema for SFP/VSS |
Output Files
| File | Description |
|---|---|
PIC32CMSG_fwmd.hex | Combined image: FWMD + Boot ROM + Boot Config + ROM Config + PUF AC + Application |
PIC32CMSG_sfp.hex | VSS data consumed by the ROM Boot process |
Command Line (Manual Execution)
hsmsfmdgen.exe -s PIC32CMSG_sfp.xml \
-m PIC32CMSG_fwmd.xml \
-x hsmSecureFlash.xsd \
-y FirmwareMetadata.xsd \
-d PIC32CMSG_fwmd.hex \
-o PIC32CMSG_sfp.hex
FWMD Image Segments
| Source Address | Image Type | Default File |
|---|---|---|
0x08000000 | Host Boot Image | PIC32CMSG_bfr.hex |
0x0A002800 | Boot Configuration | BOOTCFG1.hex |
0x0A003000 | ROM Configuration | ROMCFG.hex |
0x0A003C00 | PUF Activation Code | PIC32CMSG_PUF_AC_PFM.hex |
0x0C000000 | Application | (user-selected) |
VSS XML Structure (Auto-generated by Step 3)
The PIC32CMSG_sfp.xml file is dynamically rebuilt by Step 3. The <variableSlots> section is regenerated from the key registry. Each slot produces one of these XML structures:
-
ECC P-256 (asymmetric):
<variableSlot> <header><index>N</index> <storage><apl>3</apl><hsmOnly>1</hsmOnly> <storageType>unencrypted</storageType></storage></header> <validAfter>0</validAfter> <validBefore>2147483647</validBefore> <data><asymmetricalKey><ecc><weierstrassPrime> <size>32</size><usage>true</usage><algoUsed>false</algoUsed> <publicKey><x>HEX</x><y>HEX</y></publicKey> <privateKey><key>HEX</key></privateKey> </weierstrassPrime></ecc></asymmetricalKey></data> </variableSlot> -
AES (symmetric):
<variableSlot> ... <data><symmetricalKey><aes><aesEcbKey><key> <aes128|aes256><key>HEX</key></aes128|aes256> </key></aesEcbKey></aes></symmetricalKey></data> </variableSlot> -
Raw key code (PUF-wrapped):
<variableSlot> <header><index>0x8N</index>...</header> ... <data><rawKey> <length>84</length> <data>HEX_KEY_CODE</data> </rawKey></data> </variableSlot>
