Skip to content

Commit 071ff0e

Browse files
[NXP][scripts] Minor updates for NXP related scripts
Add HWParams APP FactoryData support * Add proper format for HWParameters app factory data section * Put changes under new argument Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com> [nxp noup][scripts][common] Fix Crc16 attribute when using latest version Signed-off-by: marius-alex-tache <marius.tache@nxp.com> [nxp noup][scripts] Update structure k32w1 path All k32w1 folders were moved under nxp, removing the k32w parent. Signed-off-by: marius-alex-tache <marius.tache@nxp.com> [nxp noup][scripts][ota] Update paths after k32w transition Signed-off-by: marius-alex-tache <marius.tache@nxp.com> (cherry picked from commit 4963ce98725b74e94f498f959d46edf4933fa56c)
1 parent 7764f27 commit 071ff0e

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

scripts/build/builders/nxp.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def FolderName(self, os_env):
5656
if self == NxpBoard.K32W0:
5757
return 'k32w0'
5858
elif self == NxpBoard.K32W1:
59-
return 'k32w/k32w1'
59+
return 'k32w1'
6060
elif self == NxpBoard.RW61X:
6161
if os_env == NxpOsUsed.ZEPHYR:
6262
return 'zephyr'

scripts/tools/nxp/factory_data_generator/generate.py

+11
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
ProductPrimaryColor, ProductURL, Salt, SerialNum, SetupPasscode, StrArgument, UniqueId, VendorId, VendorName,
2828
Verifier)
2929
from default import InputArgument
30+
from crc import Calculator, Crc16
3031

3132
# Global variable for hash ID
3233
hash_id = "CE47BA5E"
@@ -133,6 +134,14 @@ def to_bin(self, klv, out, aes128_key):
133134

134135
size = len(fullContent)
135136

137+
if (self.args.hw_params):
138+
calculator = Calculator(Crc16.XMODEM)
139+
crc_sum = calculator.checksum(fullContent)
140+
141+
fullContent = bytearray(b"APP_FACT_DATA: ") + size.to_bytes(4,'little') + fullContent + crc_sum.to_bytes(2,'little')
142+
143+
size = len(fullContent)
144+
136145
logging.info("Size of final generated binary is: {} bytes".format(size))
137146
file.write(fullContent)
138147
else:
@@ -235,6 +244,8 @@ def main():
235244
help="[str] Visible finish of the product")
236245
optional.add_argument("--product_primary_color", type=ProductPrimaryColor, metavar=ProductPrimaryColor.VALUES,
237246
help="[str] Representative color of the visible parts of the product")
247+
optional.add_argument("--hw_params", action='store_true',
248+
help="[bool] If present, store factory data in HWParameters APP section")
238249

239250
args = parser.parse_args()
240251

scripts/tools/nxp/ota/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ thus the `OTAImageProcessorImpl` instance should take this into account.
1414
## Supported platforms
1515

1616
- K32W0 -
17-
[K32W OTA README](../../../../src/platform/nxp/k32w/common/K32W_OTA_README.md)
17+
[K32W OTA README](../../../../src/platform/nxp/common/legacy/OTA_README.md)
1818

1919
## Usage
2020

0 commit comments

Comments
 (0)