User Guide - pfr

This user’s guide describes how to use pfr application.

Command line interface

pfr

Utility for generating and parsing Protected Flash Region data (CMPA, CFPA).

pfr [OPTIONS] COMMAND [ARGS]...

Options

-v, --verbose

Print more detailed information

-vv, --debug

Display more debugging information.

--version

Show the version and exit.

--help

Show this message and exit.

devices

List supported devices.

pfr devices [OPTIONS]

generate-binary

Generate binary data.

pfr generate-binary [OPTIONS]

Options

-e, --elf2sb-config <elf2sb_config>

Specify Root Of Trust from configuration file used by elf2sb tool

-f, --secret-file <secret_file>

Secret file (certificate, public key, private key); can be defined multiple times

-c, --user-config <user_config_file>

Required YAML/JSON file with user configuration

-o, --output <output>

Required Save the output into a file instead of console

-a, --add-seal

Add seal mark digest at the end.

-i, --calc-inverse

Calculate the INVERSE values CAUTION!!! It locks the settings

-p, --password <password>

Password when using Encrypted private keys as –secret-file

get-cfg-template

Generate user configuration template file.

pfr get-cfg-template [OPTIONS]

Options

-t, --type <area>

Required Select PFR partition

Options

cmpa | cfpa

-d, --device <device>

Required Device to use

Options

lpc55s6x | lpc551x | lpc55s1x | lpc550x | lpc55s0x | lpc55s2x | lpc552x | lpc55s3x | lpc553x | nhs52sxx

-r, --revision <revision>

Chip revision; if not specified, most recent one will be used

-o, --output <output>

Save the output into a file instead of console

-f, --full

Show full config, including computed values

info

Generate HTML page with brief description of CMPA/CFPA configuration fields.

pfr info [OPTIONS]

Options

-t, --type <area>

Required Select PFR partition

Options

cmpa | cfpa

-d, --device <device>

Required Device to use

Options

lpc55s6x | lpc551x | lpc55s1x | lpc550x | lpc55s0x | lpc55s2x | lpc552x | lpc55s3x | lpc553x | nhs52sxx

-r, --revision <revision>

Chip revision; if not specified, most recent one will be used

-o, --output <output>

Required Save the output into a file instead of console

-p, --open

Open the generated description file

parse-binary

Parse binary and extract configuration.

pfr parse-binary [OPTIONS]

Options

-t, --type <area>

Required Select PFR partition

Options

cmpa | cfpa

-d, --device <device>

Required Device to use

Options

lpc55s6x | lpc551x | lpc55s1x | lpc550x | lpc55s0x | lpc55s2x | lpc552x | lpc55s3x | lpc553x | nhs52sxx

-r, --revision <revision>

Chip revision; if not specified, most recent one will be used

-o, --output <output>

Save the output into a file instead of console

-b, --binary <binary>

Required Binary to parse

-f, --show-diff

Show differences comparing to defaults

-c, --show-calc

Show also calculated fields when displaying difference to defaults (–show-diff)

read

Read PFR page from the device.

pfr read [OPTIONS]

Options

-p, --port <COM[,speed>

Serial port configuration. Default baud rate is 57600. Use ‘nxpdevscan’ utility to list devices on serial port.

-u, --usb <VID:PID|USB_PATH|DEV_NAME>

USB device identifier.

Following formats are supported: <vid>, <vid:pid> or <vid,pid>, device/instance path, device name.
<vid>: hex or dec string; e.g. 0x0AB12, 43794.
<vid/pid>: hex or dec string; e.g. 0x0AB12:0x123, 1:3451.
Use ‘nxpdevscan’ utility to list connected device names.
-l, --lpcusbsio <usb,VID:PID|USB_PATH|SER_NUM,]spi|i2c>

USB-SIO bridge interface.

Optional USB device filtering formats: [usb,vid:pid|usb_path|serial_number]

Following serial interfaces are supported:

spi[index][,port,pin,speed_kHz,polarity,phase]
- index … optional index of SPI peripheral. Example: “spi1” (default=0)
- port … bridge GPIO port used as SPI SSEL(default=0)
- pin … bridge GPIO pin used as SPI SSEL
default SSEL is set to 0.15 which works
for the LPCLink2 bridge. The MCULink OB
bridge ignores the SSEL value anyway.(default=15)
- speed_kHz … SPI clock in kHz (default 1000)
- polarity … SPI CPOL option (default=1)
- phase … SPI CPHA option (default=1)
i2c[index][,address,speed_kHz]
- index … optional index of I2C peripheral. Example: “i2c1” (default=0)
- address … I2C device address (default 0x10)
- speed_kHz … I2C clock in kHz (default 100)
-b, --buspal <spi[,speed,polarity,phase,lsb|msb] | i2c[,address,speed>

buspal settings

-t, --timeout <ms>

Sets timeout when waiting on data over a serial line. The default is 5000 milliseconds.

-t, --type <area>

Required Select PFR partition

Options

cmpa | cfpa

-d, --device <device>

Required Device to use

Options

lpc55s6x | lpc551x | lpc55s1x | lpc550x | lpc55s0x | lpc55s2x | lpc552x | lpc55s3x | lpc553x | nhs52sxx

-r, --revision <revision>

Chip revision; if not specified, most recent one will be used

-o, --output <output>

Store PFR data into a file. If not specified hexdump data into stdout.

-y, --yaml <yaml_output>

Parse data read from device into YAML config.

-f, --show-diff

(applicable for parsing) Show differences comparing to defaults

-c, --show-calc

(applicable for parsing) Show also calculated fields when displaying difference to defaults (–show-diff)

write

Write PFR page to the device.

pfr write [OPTIONS]

Options

-p, --port <COM[,speed>

Serial port configuration. Default baud rate is 57600. Use ‘nxpdevscan’ utility to list devices on serial port.

-u, --usb <VID:PID|USB_PATH|DEV_NAME>

USB device identifier.

Following formats are supported: <vid>, <vid:pid> or <vid,pid>, device/instance path, device name.
<vid>: hex or dec string; e.g. 0x0AB12, 43794.
<vid/pid>: hex or dec string; e.g. 0x0AB12:0x123, 1:3451.
Use ‘nxpdevscan’ utility to list connected device names.
-l, --lpcusbsio <usb,VID:PID|USB_PATH|SER_NUM,]spi|i2c>

USB-SIO bridge interface.

Optional USB device filtering formats: [usb,vid:pid|usb_path|serial_number]

Following serial interfaces are supported:

spi[index][,port,pin,speed_kHz,polarity,phase]
- index … optional index of SPI peripheral. Example: “spi1” (default=0)
- port … bridge GPIO port used as SPI SSEL(default=0)
- pin … bridge GPIO pin used as SPI SSEL
default SSEL is set to 0.15 which works
for the LPCLink2 bridge. The MCULink OB
bridge ignores the SSEL value anyway.(default=15)
- speed_kHz … SPI clock in kHz (default 1000)
- polarity … SPI CPOL option (default=1)
- phase … SPI CPHA option (default=1)
i2c[index][,address,speed_kHz]
- index … optional index of I2C peripheral. Example: “i2c1” (default=0)
- address … I2C device address (default 0x10)
- speed_kHz … I2C clock in kHz (default 100)
-b, --buspal <spi[,speed,polarity,phase,lsb|msb] | i2c[,address,speed>

buspal settings

-t, --timeout <ms>

Sets timeout when waiting on data over a serial line. The default is 5000 milliseconds.

-t, --type <area>

Required Select PFR partition

Options

cmpa | cfpa

-d, --device <device>

Required Device to use

Options

lpc55s6x | lpc551x | lpc55s1x | lpc550x | lpc55s0x | lpc55s2x | lpc552x | lpc55s3x | lpc553x | nhs52sxx

-r, --revision <revision>

Chip revision; if not specified, most recent one will be used

-b, --binary <binary>

Required Path to PFR data to write.