1.4.1.5.1 Bootloader Device Configuration Input

Bootloaders like UART, I2C, CAN and SPI support programming of Device Configurations (Fuse Settings) using a dedicated Device confiuration command. The respective host utilities communicating with these bootloaders use a device configuration text file to send the required fuse settings.

The Device configuration command is currently supported for all CORTEX-M based devices except CORTEX-M7.

For Non-TrustZone based CORTEX-M devices

  • Based on the device Fuse settings are placed in

    • Only USER Row memory region

    • Both User Row and BOCOR Row memory regions

  • User Row/BOCOR row Start address should be provided as part of the device configuration input text file

Syntax

  • Each configuration row needs to start with ROW_START <address>

  • Each 32-Bit Fuse bit value must be newline separated

  • ROW_END needs to be used to indicate end of Fuse bit words for the row

    • If the Fuse bit values are all 0xFFFFFFFF between the last 32-Bit Fuse and ROW_END it need not be specified as the host utilities will take care of filling the data packet with 0xFF's

  • Example text file with only User Row

ROW_START 0x00804000
0xB15088FF
0xFFFFF8BB
ROW_END
  • Example text file with both User Row and BOCOR Row

ROW_START 0x00804000
0xB08F4377
0xFFFFF0BB
0xFFFFFFFF
0xFFFFFFFF
0xFFFFFFFF
0xFFFFFFFF
0x00000000
ROW_END

ROW_START 0x0080C000
0xFFFFFFFF
0xFFE80000
ROW_END

For TrustZone based CORTEX-M devices

  • Fuse settings are placed in USER Row and BOCOR Row memory regions for these devices

  • User Row/BOCOR row Start address should be provided as part of the device configuration input text file

  • The USER Row and BOCOR Row fuses also have 32-Bit CRC’s and SHA-256 to verify the fuse configurations itself by BOOTROM at reset

    • btl_dev_cfg_gen.py host utility is provided to generate these CRC's and SHA-256 based on below syntax into a device configuration output text file to be used to send to bootloader

Syntax

  • Each configuration row needs to start with ROW_START <address>

  • Each 32-Bit Fuse bit value must be newline separated

  • CRC32_START must be used to indicate to the above utility that CRC32 has to be calculated on the Fuse words after this

  • CRC32_END must be placed at the line where generated CRC32 value will be calculated and added in output file

  • SHA-256_START must be used to indicate to the above utility that SHA-256 must be calculated on the Fuse words after this.

  • SHA-256_END must be placed at the line where generated SHA-256 value (32 Bytes = 8 words) will be calculated and added in output file

  • ROW_END needs to be used to indicate end of configuration for the row

    • If the Fuse bit values are all 0xFFFFFFFF between the last 32-Bit Fuse and ROW_END it need not be specified as the host utilities will take care of filling the data packet with 0xFF's

  • Example input text file with CRC32 and SHA-256

ROW_START 0x00804000
0xB08F4377
0xFFFFF0BB
CRC32_START
0xF0308040
0xFFFFFE80
0x00000000
0x00000002
0x00000010
0x00000000
CRC32_END
ROW_END

ROW_START 0x0080C000
SHA-256_START
CRC32_START
0xF007FFFF
0xFFE81001
CRC32_END
0xFFFFFFFF
0xFFFFFFFF
0xFFFFFFFF
...
...
...
0xFFFFFFFF
0xFFFFFFFF
SHA-256_END
ROW_END
  • Example output text file with Generated CRC32 and (32 Bytes = 8 words) SHA-256

ROW_START 0x00804000
0xB08F4377
0xFFFFF0BB
0xF0308040
0xFFFFFE80
0x00000000
0x00000002
0x00000010
0x00000000
0x4e75a269
ROW_END

ROW_START 0x0080C000
0xF007FFFF
0xFFE81001
0x64ae5ed9
0xFFFFFFFF
0xFFFFFFFF
0xFFFFFFFF
...
...
...
0xFFFFFFFF
0xFFFFFFFF
0x7ad28797
0x020201a6
0xf3412c79
0x24cbea0e
0x50bd37ba
0xa5fd23f7
0xad1c8fc1
0x1576fbf1
ROW_END