From 35c6903db3f9057be65ebd097cad65200d3e1955 Mon Sep 17 00:00:00 2001 From: Nicolas Stalder Date: Thu, 3 Jun 2021 18:54:10 +0200 Subject: [PATCH] Comment on change --- src/signed_binary.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/signed_binary.rs b/src/signed_binary.rs index 17419275..7cb748a6 100644 --- a/src/signed_binary.rs +++ b/src/signed_binary.rs @@ -120,8 +120,10 @@ fn modify_header(padded_image: &mut Vec, padded_certificate_length: usize) - // 0x20: total image size padded_image[0x20..][..4].copy_from_slice((total_image_size as u32).to_le_bytes().as_ref()); - // 0x24: image type "SPT" = [XIP Signed, TZ disabled, 0, 0-] + // 0x24: image type "SPT" = [XIP Signed, TZ enabled, 0, 0-] // This doesn't seem to match UM 11126, Chap. 7, Table 183 at all :) + // NOTE: Setting "TZ disabled" (0x40 in second byte) prevents use of the + // "boot to bootrom" method in lpc55-hal. padded_image[0x24..][..4].copy_from_slice(&[0x04, 0x00, 0x00, 0x00]); // "header offset", i.e. image size padded_image[0x28..][..4].copy_from_slice((image_size as u32).to_le_bytes().as_ref());