Skip to content

Commit 1466456

Browse files
jmartinez-silabsrestyled-commits
authored andcommitted
[Silabs] Small miscellaneous fixes: (#24956)
* Miscellaneous fixes: exclude the tag from the build version string, move the silabs_config wich contains the version str to the silabs common source_set instead of calling it in each example. fix key mismatch in the factoryProvider script for the VendorName and Productname. Rename argument rotating_id to unique_id * Restyled by autopep8 --------- Co-authored-by: Restyled.io <[email protected]>
1 parent 9d9389c commit 1466456

File tree

11 files changed

+15
-17
lines changed

11 files changed

+15
-17
lines changed

examples/chef/efr32/BUILD.gn

-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ efr32_sdk("sdk") {
8383

8484
efr32_executable("chef_app") {
8585
output_name = "chip-efr32-chef-example.out"
86-
public_configs = [ "${efr32_sdk_build_root}:silabs_config" ]
8786
include_dirs = [ "include" ]
8887
defines = []
8988

examples/light-switch-app/silabs/efr32/BUILD.gn

-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ efr32_sdk("sdk") {
7373

7474
efr32_executable("light_switch_app") {
7575
output_name = "chip-efr32-light-switch-example.out"
76-
public_configs = [ "${efr32_sdk_build_root}:silabs_config" ]
7776
include_dirs = [ "include" ]
7877
defines = []
7978

examples/lighting-app/silabs/efr32/BUILD.gn

-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ efr32_sdk("sdk") {
7272

7373
efr32_executable("lighting_app") {
7474
output_name = "chip-efr32-lighting-example.out"
75-
public_configs = [ "${efr32_sdk_build_root}:silabs_config" ]
7675
include_dirs = [ "include" ]
7776
defines = []
7877

examples/lock-app/silabs/efr32/BUILD.gn

-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ efr32_sdk("sdk") {
7272

7373
efr32_executable("lock_app") {
7474
output_name = "chip-efr32-lock-example.out"
75-
public_configs = [ "${efr32_sdk_build_root}:silabs_config" ]
7675
include_dirs = [ "include" ]
7776
defines = []
7877

examples/platform/silabs/efr32/BUILD.gn

+4-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,10 @@ config("silabs-wifi-config") {
236236
source_set("efr32-common") {
237237
deps = []
238238
public_deps = []
239-
public_configs = [ ":efr32-common-config" ]
239+
public_configs = [
240+
":efr32-common-config",
241+
"${efr32_sdk_build_root}:silabs_config",
242+
]
240243

241244
include_dirs = [ "." ]
242245

examples/thermostat/silabs/efr32/BUILD.gn

-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ efr32_sdk("sdk") {
8989

9090
efr32_executable("thermostat_app") {
9191
output_name = "chip-efr32-thermostat-example.out"
92-
public_configs = [ "${efr32_sdk_build_root}:silabs_config" ]
9392
include_dirs = [ "include" ]
9493
defines = []
9594

examples/window-app/silabs/efr32/BUILD.gn

-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ efr32_sdk("sdk") {
5858

5959
efr32_executable("window_app") {
6060
output_name = "chip-efr32-window-example.out"
61-
public_configs = [ "${efr32_sdk_build_root}:silabs_config" ]
6261
output_dir = root_out_dir
6362
include_dirs = [
6463
"include",

scripts/build/builders/efr32.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@ def __init__(self,
201201
'use_silabs_thread_lib=true chip_openthread_target="../silabs:ot-efr32-cert" use_thread_coap_lib=true openthread_external_platform=""')
202202

203203
if not no_version:
204-
shortCommitSha = subprocess.check_output(['git', 'describe', '--always', '--dirty']).decode('ascii').strip()
204+
shortCommitSha = subprocess.check_output(
205+
['git', 'describe', '--always', '--dirty', '--exclude', '*']).decode('ascii').strip()
205206
branchName = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']).decode('ascii').strip()
206207
self.extra_gn_options.append(
207208
'sl_matter_version_str="v1.0-%s-%s"' % (branchName, shortCommitSha))

scripts/examples/gn_efr32_example.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ else
209209

210210
if [ "$USE_GIT_SHA_FOR_VERSION" == true ]; then
211211
{
212-
ShortCommitSha=$(git describe --always --dirty)
212+
ShortCommitSha=$(git describe --always --dirty --exclude '*')
213213
branchName=$(git rev-parse --abbrev-ref HEAD)
214214
optArgs+="sl_matter_version_str=\"v1.0-$branchName-$ShortCommitSha\" "
215215
} &>/dev/null

scripts/tools/silabs/FactoryDataProvider.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ class FactoryDataWriter:
4040
VERIFIER_NVM3_KEY = "0x8720A:"
4141
PRODUCT_ID_NVM3_KEY = "0x8720B:"
4242
VENDOR_ID_NVM3_KEY = "0x8720C:"
43-
PRODUCT_NAME_NVM3_KEY = "0x8720D:"
44-
VENDOR_NAME_NVM3_KEY = "0x8720E:"
43+
VENDOR_NAME_NVM3_KEY = "0x8720D:"
44+
PRODUCT_NAME_NVM3_KEY = "0x8720E:"
4545
HW_VER_STR_NVM3_KEY = "0x8720F:"
4646
UNIQUE_ID_NVM3_KEY = "0x8721F:"
4747
HW_VER_NVM3_KEY = "0x87308:"
@@ -147,8 +147,8 @@ def __init__(self, arguments) -> None:
147147

148148
self._args = arguments
149149

150-
if self._args.rotating_id:
151-
assert (len(bytearray.fromhex(self._args.rotating_id)) == kUniqueIDLength), "Provide a 16 bytes rotating id"
150+
if self._args.unique_id:
151+
assert (len(bytearray.fromhex(self._args.unique_id)) == kUniqueIDLength), "Provide a 16 bytes unique id"
152152
if self._args.product_name:
153153
assert (len(self._args.product_name) <= kMaxProductNameLength), "Product name exceeds the size limit"
154154
if self._args.vendor_name:
@@ -262,8 +262,8 @@ def create_nvm3injected_image(self):
262262
hwVersionByteArray = bytes(self._args.hw_version_str, 'utf-8').hex()
263263
cmd.extend(["--object", self.HW_VER_STR_NVM3_KEY + str(hwVersionByteArray)])
264264

265-
if self._args.rotating_id:
266-
cmd.extend(["--object", self.UNIQUE_ID_NVM3_KEY + self._args.rotating_id])
265+
if self._args.unique_id:
266+
cmd.extend(["--object", self.UNIQUE_ID_NVM3_KEY + self._args.unique_id])
267267

268268
if self._args.manufacturing_date:
269269
dateByteArray = bytes(self._args.manufacturing_date, 'utf-8').hex()
@@ -338,7 +338,7 @@ def all_int_format(i): return int(i, 0)
338338
help="[string] Provide the product label [optional]")
339339
parser.add_argument("--product_url", type=str,
340340
help="[string] Provide the product url [optional]")
341-
parser.add_argument("--rotating_id", type=str,
341+
parser.add_argument("--unique_id", type=str,
342342
help="[hex_string] A 128 bits hex string unique id (without 0x) [optional]")
343343
parser.add_argument("--serial_number", type=str,
344344
help="[string] Provide serial number of the device")

scripts/tools/silabs/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ number to ensure you are writing to the right device.
6060
| --vendor_name | optional | string | Provide the vendor name (Max 32 char). |
6161
| --hw_version | optional | dec/hex | Provide the hardware version value (Max 2 bytes). |
6262
| --hw_version_str | optional | string | Provide the hardware version string (Max 64 char). |
63-
| --rotating_id | optional | Hex string | A 128 bits hex string unique id (without 0x). |
63+
| --unique_id | optional | Hex string | A 128 bits hex string unique id (without 0x). |
6464
| --serial_number | optional | string | Provide serial number of the device (Max 32 char). |
6565
| --commissioning_flow | optional | dec/hex | Provide Commissioning Flow 0=Standard, 1=User Action, 2=Custom. |
6666
| --rendezvous_flag | optional | dec/hex | Provide Rendez-vous flag: 1=SoftAP, 2=BLE 4=OnNetwork (Can be combined). |

0 commit comments

Comments
 (0)