Updating Customer Data into BCT

Update customer data, such as skuinfo and others, using the --customer-data option provided with the create_bsp_images.sh, flash_bsp_images.sh, or bootburn.sh script.

Command Line Option

The command-line option is as follows.
Options
Description
--customer-data <json_data_file> [<json_schema_file>]
Specifies customer data, such as skuinfo.
 
<json_data_file> specifies the customer data values in a JSON file.
 
<json_schema_file> specifies the optional customer data schema files.
 
Notes:
1) When using the -x option with bootburn.sh, skuinfo cannot be specified using this option.
2) Arguments -z, -A, and --customer-data are mutually exclusive command line arguments.
 
Note:
Partial customer data updates are supported. It is not required to update all the data fields specified in the schema.
Usage
./bootburn.sh --customer-data customer_data.json -b e3550b03-t194a -B qspi
 
./create_bsp_images.sh --customer-data customer_data.json nv_customer_data_schema.json -b e3550b03-t194a -r 02 -g ./flashing_images
 
./flash_bsp_images.sh --customer-data customer_data.json -b e3550b01-t194a -P ./flashing_images/699-63550-0001-300_GD

Customer Data Schema File Format

Definitions

BCT section name: Name of the BCT section where data needs to be updated in BCT.
Supported sections at present are: "customer-data-unsigned".
allowed-offset-ranges: Array of allowed offset ranges for a section type where each range is specified as an array of [start of the range, end of the range].
Data field name: Field name for the data.
parser-metadata: Metadata used to parse the user input value and convert them into list of words represented by their schema given in "schema".
data-separator-string: Separator characters to allow separating user input data into individual words.
number-of-words: Expected number of words after data-separator-string is applied to the user input.
schema: Schema to interpret input data words and covert input data to bytes.
version: Version for the data item (defaults to 1)
Version schema object is optional and only need to be specified for the data items that requires version information.
value
List of schema objects in sequence to allow interpreting each word in user input value for the data field.
Note:
If the multiple format is supported for each word, schema for a word can be a list of schema objects.
Each schema object is of the following format
Type
Type
Interpretation
"decimal"
Used for integer formats "I", "H" and "Q"
"char"
Used for character format "c"
"string"
Used for string format "s"
format-string:
Format String
Interpretation
"I"
Four bytes unsigned integer
"H"
Two bytes unsinged short integer
"Q"
Eight bytes unsigned integer
"c"
One byte characters
"s"
Null terminated string
offset: Offset where value needs to be stored in the BCT section
Offset values must be within the allowed range specified by “allowed-offset-ranges” for each section.
min-len
Minimum required input value length
Only required for "c" and "s" format types
max-len
Maximum required input value length.
Only required for "c" and "s" format types.

Format of the Data Value File

{
"<Field Name>": "<Field Value>"
"<Field Name>": {
"version": <Version Value>,
"value": <Field Value>,
}
}
Description
Field Name: Name of the data field as specified in the schema (must match the name specified in the schema).
Field Value: Value of the data field.
version: Version value for the data field format.
value: Value of the data field (same as field value above).
Example customer data file
{
"skuNumber": "940-63550-2200-000",
"prodInfo": "940-63550-2200-000 NA",
"skuVersion": "C",
"macId0": "mac0 0x00044BAF6835",
"VIN": "ADF893F873TH76589",
"bomId": "997897989888",
"machineName": "Machine"
}
Example schema file
{
"customer-data-unsigned": {
"allowed-offset-ranges": [[0, 267]],
"data": {
"skuNumber": {
"parser-metadata" : {
"data-separator-string": "-",
"number-of-words": 4
},
"schema": {
"version": {
"type": "unsigned-char",
"format-string": "B",
"offset": 17
},
"value": [
{
"type": "decimal",
"format-string": "H",
"offset": 19
},
[
{
"type": "decimal",
"format-string": "I",
"offset": 21
},
{
"type": "char",
"format-string": "c",
"offset": 21,
"max-len": 4,
"min-len": 1
}
],
{
"type": "decimal",
"format-string": "I",
"offset": 25
},
{
"type": "decimal",
"format-string": "H",
"offset": 29
}
]
}
},
"prodInfo": {
"parser-metadata" : {
"data-separator-string": "-| ",
"number-of-words": 5
},
"schema": {
"version": {
"type": "unsigned-char",
"format-string": "B",
"offset": 41
},
"value": [
{
"type": "decimal",
"format-string": "H",
"offset": 43
},
[
{
"type": "decimal",
"format-string": "I",
"offset": 45
},
{
"type": "char",
"format-string": "c",
"offset": 45,
"max-len": 4,
"min-len": 1
}
],
{
"type": "decimal",
"format-string": "I",
"offset": 49
},
{
"type": "decimal",
"format-string": "H",
"offset": 53
},
{
"type": "char",
"format-string": "c",
"offset": 55,
"min-len": 1,
"max-len": 2
}
]
}
},
"skuVersion": {
"parser-metadata" : {
"data-separator-string": null,
"number-of-words": 1
},
"schema": {
"value": [
{
"type": "char",
"format-string": "c",
"offset": 31,
"max-len": 2,
"min-len": 1
}
]
}
},
"macId0": {
"parser-metadata" : {
"data-separator-string": " ",
"number-of-words": 2
},
"schema": {
"version": {
"type": "unsigned-char",
"format-string": "B",
"offset": 65
},
"value": [
{
"type": "string",
"format-string": "s",
"offset": 66,
"max-len": 4,
"min-len": 1
},
{
"type": "hex",
"format-string": "Q",
"offset": 71,
"max-len": 6,
"min-len": 6
}
]
}
},
"macId1": {
"parser-metadata" : {
"data-separator-string": " ",
"number-of-words": 2
},
"schema": {
"version": {
"type": "unsigned-char",
"format-string": "B",
"offset": 77
},
"value": [
{
"type": "string",
"format-string": "s",
"offset": 78,
"max-len": 4,
"min-len": 1
},
{
"type": "hex",
"format-string": "Q",
"offset": 83,
"max-len": 6,
"min-len": 6
}
]
}
},
"macId2": {
"parser-metadata" : {
"data-separator-string": " ",
"number-of-words": 2
},
"schema": {
"version": {
"type": "unsigned-char",
"format-string": "B",
"offset": 89
},
"value": [
{
"type": "string",
"format-string": "s",
"offset": 90,
"max-len": 4,
"min-len": 1
},
{
"type": "hex",
"format-string": "Q",
"offset": 95,
"max-len": 6,
"min-len": 6
}
]
}
},
"macId3": {
"parser-metadata" : {
"data-separator-string": " ",
"number-of-words": 2
},
"schema": {
"version": {
"type": "unsigned-char",
"format-string": "B",
"offset": 101
},
"value": [
{
"type": "string",
"format-string": "s",
"offset": 102,
"max-len": 4,
"min-len": 1
},
{
"type": "hex",
"format-string": "Q",
"offset": 107,
"max-len": 6,
"min-len": 6
}
]
}
},
"boardSerial": {
"parser-metadata" : {
"data-separator-string": null,
"number-of-words": 1
},
"schema": {
"version": {
"type": "unsigned-char",
"format-string": "B",
"offset": 4
},
"value": [
{
"type": "decimal",
"format-string": "Q",
"offset": 5
}
]
}
}
}
}
}