MCU Secure Offline Programmer User Guide
MCU Secure Offline Programmer User Guide
Document information
Information Content
Keywords Secure Offline Programmer (SPGR), OTP (eFuse), secure JTAG
Abstract This document describes the Secure Offline Programmer (SPGR) features, project framework,
quick start, and various software settings. It describes the hand-on in detail, including image
programming, OTP (eFuse) programming, secure JTAG re-opening, and so on.
NXP Semiconductors
MCUSOPUG
MCU Secure Offline Programmer User Guide
1 Introduction
This document describes the Secure Offline Programmer (SPGR) features, project framework, quick start,
and various software settings. It describes the hand-on in detail, including image programming, OTP (eFuse)
programming, secure JTAG re-opening, and so on. Based on SoC secure features and suitable tools, the
product obtains a whole security in its lifecycle. Secure Offline Programmer (SPGR) is a terminal to assist the
OEM to build a secure injection/provisioning when manufacturing and a secure debug when repairing. Other
necessary information are in the document for convenient understanding and developing.
This product is mainly composed of two distinct elements:
• SPGR Main Programmer (SPGR-MP)
• SPGR USB Dongle (SPGR-UD)
MCUSOPUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
MCU SPGR (red circle) is a whole reference with hardware and software to extend the common-programmer
and security support when manufacturing product with security features in factory. It is consist of the main
programmer ( in Figure 1) for processing all kinds of operations and the USB dongle ( in Figure 1) for
storing sensitive keys/settings according to support functions. MCU SPGR is targeted for middle customers with
a trusted factory and a simple secure mechanism. No plain keys are available for users. Private keys are only
available for the administrator, low cost, ease of use, and portability.
1.3 Features
SPGR-MP:
• Support to program NXP MCU platforms (Table 2 lists the platforms by now) with uniform operations for all
platforms
• Complete key injection/provisioning used by the SoC secure engine for signature, encryption, and secure
JTAG mode
• Communication with programmed NXP MCU platforms via JTAG/SWD
• Complete security configurations for lock bits / lifecycle conversion
• Re-opening secure debug via the challenge-response mechanism
• Complete secure debugger via the SWD/JTAG protocol (optional, in future)
• Communication with the LPC55S69 EVK board (smartcard HSM) via USB CCID
• Support to configure the programmer via a JSON file
• Support to download the target image and configuration file via USB storage or Micro-SD
• Support for multiple toolchains and developing environments:
– Windows host: IAR, MDK, and MCUXpresso IDE
SPGR-UD:
MCUSOPUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
• Complete key management (how to download, install, use, and revoke user keys securely), such as BEE’s
KEK and JTAG_RESP
• Support for product counter and customized requirements
• Support for the UICC APDU protocol via USB CCID
MCUSOPUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
2 Quick start
This chapter introduces the quick start for the SPGR project.
MCUSOPUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
MCUSOPUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
MCUSOPUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
MCUSOPUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
MCUSOPUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
MCUSOPUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
"processor": "RT1170",
"imgs" : [
{
"image_path": "hello_world.bin",
"load_address": 805307392
}
],
Using the below command, you can see the generated "c_blob.c" file. It is the final file we use.
You can rename the "c_blob.c" file and integrate it into a project, as shown in Section 3.3. You may change the
RAM base address to something other than the default value of "0x20000000". By default, the memory buffer
location (blob_start + 0xA00) is in the "c_blob.c" file. You may also have to update it.
MCUSOPUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
#include "target_board.h"
#include "target_family.h"
#include "flash_algorithm/mimxrt1170_spi_flash_blob.c" //rename c_blob.c
Insert the "g_board_mimxrt1170" structure into the board list in the "target_devices.c" file, as follows:
MCUSOPUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
MCUSOPUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
5.4 Fusemap
The fusemap collects some fuses that are implemented to write to a target in the SPGR-MP project. The
structure of a fusemap is as follows:
If the "progVal" is 0, the SPGR-MP tries to get the fuse value from the SPGR-UD. If the item is in the "efuse"
map and it is not controlled by a configuration file, that "efuse" is provisioning.
Put the definition of the "efusemap" to the structure of the target device information.
6 Manual programming
This section shows how to program the Flash/OTP and unlock a secure JTAG.
MCUSOPUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
MCUSOPUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Note: Do not power on the target EVK board with the USB port which connects to the DAP-Link debugger.
MCUSOPUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
9. Select the "Fuse" menu using the SW4 and SW5 buttons and press the SW3 button to enter it.
Note: Connect pin 19 of J7 on the programmer board to the JTAG_MOD pin on the target EVK board to put the
chip into the secure JTAG mode.
{
"processor": "RT1170",
"sjc_en": false,
"imgs" : [
{
MCUSOPUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
"image_path": "image1.bin",
"load_address": 805307392
},
{
"image_path": "image2.bin",
"load_address": 806354944
}
],
"ocotp" : [
{
"srkh":
"00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff"
},
{
"img_keys": true
},
{
"hab_mode": true
},
{
"sjc_resp": true
},
{
"img_keys_lock": true
},
{
"sjc_resp_lock": true
}
]
}
{
"processor": "RT1060",
"imgs" : [
{
"image_path": "image1.bin",
"load_address": 1610612736
},
{
MCUSOPUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
"image_path": "image2.bin",
"load_address": 1611661312
}
],
"ocotp" : [
{
"srkh":
"00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff"
},
{
"img_keys": true
},
{
"hab_mode": true
},
{
"sjc_resp": true
},
{
"img_keys_lock": true
},
{
"sjc_resp_lock": true
}
]
}
{
"processor": "RT1010",
"imgs" : [
{
"image_path": "image1.bin",
"load_address": 1610613760
},
{
"image_path": "image2.bin",
"load_address": 1611661312
}
],
"ocotp" : [
{
MCUSOPUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
"srkh":
"00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff"
},
{
"img_keys": true
},
{
"hab_mode": true
},
{
"sjc_resp": true
},
{
"img_keys_lock": true
},
{
"sjc_resp_lock": true
},
{
"otfad_key_scramble": false
},
{
"otfad_cfg": false
}
]
}
MCUSOPUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
9 Revision history
Table 4. Revision history
Revision number Release date Description
1 15 November 2023 Initial external release
MCUSOPUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Legal information
Definitions Limiting values — Stress above one or more limiting values (as defined in
the Absolute Maximum Ratings System of IEC 60134) will cause permanent
damage to the device. Limiting values are stress ratings only and (proper)
Draft — A draft status on a document indicates that the content is still operation of the device at these or any other conditions above those
under internal review and subject to formal approval, which may result given in the Recommended operating conditions section (if present) or the
in modifications or additions. NXP Semiconductors does not give any Characteristics sections of this document is not warranted. Constant or
representations or warranties as to the accuracy or completeness of repeated exposure to limiting values will permanently and irreversibly affect
information included in a draft version of a document and shall have no the quality and reliability of the device.
liability for the consequences of use of such information.
Terms and conditions of commercial sale — NXP Semiconductors
products are sold subject to the general terms and conditions of commercial
Disclaimers sale, as published at https://www.nxp.com/profile/terms, unless otherwise
agreed in a valid written individual agreement. In case an individual
agreement is concluded only the terms and conditions of the respective
Limited warranty and liability — Information in this document is believed
agreement shall apply. NXP Semiconductors hereby expressly objects to
to be accurate and reliable. However, NXP Semiconductors does not give
applying the customer’s general terms and conditions with regard to the
any representations or warranties, expressed or implied, as to the accuracy
purchase of NXP Semiconductors products by customer.
or completeness of such information and shall have no liability for the
consequences of use of such information. NXP Semiconductors takes no
responsibility for the content in this document if provided by an information No offer to sell or license — Nothing in this document may be interpreted
source outside of NXP Semiconductors. or construed as an offer to sell products that is open for acceptance or
the grant, conveyance or implication of any license under any copyrights,
In no event shall NXP Semiconductors be liable for any indirect, incidental,
patents or other industrial or intellectual property rights.
punitive, special or consequential damages (including - without limitation -
lost profits, lost savings, business interruption, costs related to the removal
Quick reference data — The Quick reference data is an extract of the
or replacement of any products or rework charges) whether or not such
product data given in the Limiting values and Characteristics sections of this
damages are based on tort (including negligence), warranty, breach of
document, and as such is not complete, exhaustive or legally binding.
contract or any other legal theory.
Notwithstanding any damages that customer might incur for any reason
Export control — This document as well as the item(s) described herein
whatsoever, NXP Semiconductors’ aggregate and cumulative liability
may be subject to export control regulations. Export might require a prior
towards customer for the products described herein shall be limited in
authorization from competent authorities.
accordance with the Terms and conditions of commercial sale of NXP
Semiconductors.
Suitability for use in non-automotive qualified products — Unless
this document expressly states that this specific NXP Semiconductors
Right to make changes — NXP Semiconductors reserves the right to
product is automotive qualified, the product is not suitable for automotive
make changes to information published in this document, including without
use. It is neither qualified nor tested in accordance with automotive testing
limitation specifications and product descriptions, at any time and without
or application requirements. NXP Semiconductors accepts no liability for
notice. This document supersedes and replaces all information supplied prior
inclusion and/or use of non-automotive qualified products in automotive
to the publication hereof.
equipment or applications.
In the event that customer uses the product for design-in and use in
Suitability for use — NXP Semiconductors products are not designed,
automotive applications to automotive specifications and standards,
authorized or warranted to be suitable for use in life support, life-critical or
customer (a) shall use the product without NXP Semiconductors’ warranty
safety-critical systems or equipment, nor in applications where failure or
of the product for such automotive applications, use and specifications, and
malfunction of an NXP Semiconductors product can reasonably be expected
(b) whenever customer uses the product for automotive applications beyond
to result in personal injury, death or severe property or environmental
NXP Semiconductors’ specifications such use shall be solely at customer’s
damage. NXP Semiconductors and its suppliers accept no liability for
own risk, and (c) customer fully indemnifies NXP Semiconductors for any
inclusion and/or use of NXP Semiconductors products in such equipment or
liability, damages or failed product claims resulting from customer design and
applications and therefore such inclusion and/or use is at the customer’s own
use of the product for automotive applications beyond NXP Semiconductors’
risk.
standard warranty and NXP Semiconductors’ product specifications.
Applications — Applications that are described herein for any of these
Translations — A non-English (translated) version of a document, including
products are for illustrative purposes only. NXP Semiconductors makes no
the legal information in that document, is for reference only. The English
representation or warranty that such applications will be suitable for the
version shall prevail in case of any discrepancy between the translated and
specified use without further testing or modification.
English versions.
Customers are responsible for the design and operation of their
applications and products using NXP Semiconductors products, and NXP
Security — Customer understands that all NXP products may be subject to
Semiconductors accepts no liability for any assistance with applications or
unidentified vulnerabilities or may support established security standards or
customer product design. It is customer’s sole responsibility to determine
specifications with known limitations. Customer is responsible for the design
whether the NXP Semiconductors product is suitable and fit for the
and operation of its applications and products throughout their lifecycles
customer’s applications and products planned, as well as for the planned
to reduce the effect of these vulnerabilities on customer’s applications
application and use of customer’s third party customer(s). Customers should
and products. Customer’s responsibility also extends to other open and/or
provide appropriate design and operating safeguards to minimize the risks
proprietary technologies supported by NXP products for use in customer’s
associated with their applications and products.
applications. NXP accepts no liability for any vulnerability. Customer should
NXP Semiconductors does not accept any liability related to any default, regularly check security updates from NXP and follow up appropriately.
damage, costs or problem which is based on any weakness or default
Customer shall select products with security features that best meet rules,
in the customer’s applications or products, or the application or use by
regulations, and standards of the intended application and make the
customer’s third party customer(s). Customer is responsible for doing all
ultimate design decisions regarding its products and is solely responsible
necessary testing for the customer’s applications and products using NXP
for compliance with all legal, regulatory, and security related requirements
Semiconductors products in order to avoid a default of the applications
concerning its products, regardless of any information or support that may be
and the products or of the application or use by customer’s third party
provided by NXP.
customer(s). NXP does not accept any liability in this respect.
NXP has a Product Security Incident Response Team (PSIRT) (reachable
at PSIRT@nxp.com) that manages the investigation, reporting, and solution
release to security vulnerabilities of NXP products.
MCUSOPUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
MCUSOPUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Contents
1 Introduction ...................................................... 2
1.1 Acronyms and abbreviations ............................. 2
1.2 About MCU SPGR .............................................3
1.3 Features .............................................................3
1.4 Supported MCU boards as target ......................4
1.5 SPGR directory organization ............................. 4
1.6 Host system requirements .................................5
2 Quick start ........................................................5
2.1 Getting familiar with the board ...........................5
2.2 Connecting the board ........................................ 6
2.3 Building and running on Windows ..................... 6
2.3.1 IAR IDE ..............................................................6
2.3.2 MDK IDE ............................................................7
2.3.3 MCUXpresso IDE .............................................. 7
3 MCU flash program ....................................... 11
3.1 Selecting programmer target ........................... 12
3.2 Flash algorithm ................................................ 12
3.3 Integrating flash algorithm blob ....................... 13
3.4 Image storage ..................................................13
4 SPGR USB dongle ......................................... 13
5 MCU fuse provisioning ................................. 14
5.1 Selecting a fuse ...............................................14
5.2 Fuse-provisioning algorithm .............................14
5.3 Integrating OCOTP algorithm blob .................. 14
5.4 Fusemap .......................................................... 15
6 Manual programming .................................... 15
6.1 QSPI program ..................................................15
6.2 OTP program ...................................................17
6.3 Debug unlocking .............................................. 18
7 JSON configuration files ...............................19
7.1 Example configuration file for RT1170 ............. 19
7.2 Example configuration file for
RT1060/50/20 .................................................. 20
7.3 Example configuration file for RT1010 .............21
8 Note about the source code in the
document ........................................................22
9 Revision history .............................................23
Legal information ...........................................24
Please be aware that important notices concerning this document and the product(s)
described herein, have been included in section 'Legal information'.