This use case shows how to sign both non-contiguous segments. The first one is located in the internal memory, and the second one in the external memory. The signing result may be a very large file because the data are converted to a binary format. Following JSON shows how to split the segments, sign each of them, and then combine back to a single file.

{
"schema-version": 1.0,
"content": [
{
"name" : "Signed Internal and External Flash Applications",
"description": "Use case 2: Signing two images located in the internal flash and in the external flash",
"enabled": true,
"commands": [
{ "command": "hex-segment",
"inputs": [
{ "description": "Extract Internal Flash segment",
"file": "app-path/ble_app_psoc64.hex",
"address" : "0x10000000"
}
],
"outputs" : [
{ "description": "Save Flash segment",
"format" : "ihex",
"file" : "out-path/internal.hex"
}
]
},
{
"command": "hex-segment",
"inputs": [
{ "description": "Extract External Flash segment",
"file": "app-path/ble_app_psoc64.hex",
"address" : "0x18000000"
}
],
"outputs" : [
{ "description": "Save EEPROM segment",
"format" : "ihex",
"file" : "out-path/external.hex"
}
]
}, {
"command": "sign",
"inputs": [
{ "description": "Signs Internal Flash Application",
"file": "out-path/internal.hex"
}
],
"outputs" : [
{ "description": "Signed Internal Flash Application",
"signer-key" : "/key-path/signing_private_key.pem",
"format" : "ihex",
"file" : "out-path/internal_signed.hex"
}
]
},
{
"command": "sign",
"inputs": [
{ "description": "Signs External Flash Application",
"file": "out-path/external.hex"
}
],
"outputs" : [
{ "description": "Signed External Flash Application",
"signer-key" : "/key-path/signing_private_key.pem",
"format" : "ihex",
"file" : "out-path/external_signed.hex"
}
]
},
{
"command": "merge",
"inputs": [
{ "description": "Signed Internal Flash Application",
"file": "out-path/internal_signed.hex"
},
{ "description": "Signed External Flash Application",
"file": "out-path/external_signed.hex"
}
],
"outputs" : [
{ "description": "Combine signed Internal & External Flash Apps",
"format" : "ihex",
"file" : "out-path/ble_app_psoc64_signed.hex"
}
]
}
]
}
]
}