Skip to content

Commit

Permalink
Merge branch 'master' into feature/rs911x_sleepy
Browse files Browse the repository at this point in the history
  • Loading branch information
chirag-silabs authored Mar 19, 2023
2 parents 9d7467f + 3edd101 commit c675664
Show file tree
Hide file tree
Showing 264 changed files with 19,852 additions and 16,924 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/examples-telink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,21 @@ jobs:
- name: clean out build output
run: rm -rf ./out

- name: Build example Telink Lighting App with Factory Data
run: |
./scripts/checkout_submodules.py --shallow --platform linux
./scripts/build/gn_gen.sh
./scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE chip-cert chip-tool spake2p"
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-factory-data' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9518adk80d lighting-app-factory-data \
out/telink-tlsr9518adk80d-light-factory-data/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: clean out build output
run: rm -rf ./out

- name: Build example Telink Light Switch App
run: |
./scripts/run_in_build_env.sh \
Expand Down
18 changes: 11 additions & 7 deletions config/telink/chip-module/generate_factory_data.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,25 @@ else()
endif()

# find chip cert tool
find_program(chip_cert_exe NAMES chip-cert REQUIRED)
find_program(chip_cert_exe NAMES chip-cert PATHS ${CHIP_ROOT}/out/telink REQUIRED)
string(APPEND script_args "--chip-cert-path ${chip_cert_exe}\n")

# for development purpose user can use default certs instead of generating or providing them
if(CONFIG_CHIP_FACTORY_DATA_USE_DEFAULT_CERTS)
# convert decimal VID to its hexadecimal representation to find out certification files in repository
math(EXPR LOCAL_VID "${CONFIG_CHIP_DEVICE_VENDOR_ID}" OUTPUT_FORMAT HEXADECIMAL)
string(SUBSTRING ${LOCAL_VID} 2 -1 raw_vid)
string(TOUPPER ${raw_vid} raw_vid_upper)
# convert decimal PID to its hexadecimal representation to find out certification files in repository
math(EXPR LOCAL_PID "${CONFIG_CHIP_DEVICE_PRODUCT_ID}" OUTPUT_FORMAT HEXADECIMAL)
string(SUBSTRING ${LOCAL_PID} 2 -1 raw_pid)
string(TOUPPER ${raw_pid} raw_pid_upper)
# all certs are located in ${CHIP_ROOT}/credentials/development/attestation
# it can be used during development without need to generate new certifications
string(APPEND script_args "--dac-cert \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-DAC-${raw_pid_upper}-Cert.pem\"\n")
string(APPEND script_args "--dac-key \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-DAC-${raw_pid_upper}-Key.pem\"\n")
string(APPEND script_args "--cert \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-PAI-noPID-Cert.pem\"\n")
string(APPEND script_args "--key \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-PAI-noPID-Key.pem\"\n")
string(APPEND script_args "--dac-cert \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-DAC-${raw_vid_upper}-${raw_pid_upper}-Cert.pem\"\n")
string(APPEND script_args "--dac-key \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-DAC-${raw_vid_upper}-${raw_pid_upper}-Key.pem\"\n")
string(APPEND script_args "--cert \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-PAI-${raw_vid_upper}-noPID-Cert.pem\"\n")
string(APPEND script_args "--key \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-PAI-${raw_vid_upper}-noPID-Key.pem\"\n")
string(APPEND script_args "-cd \"${CHIP_ROOT}/credentials/development/cd-certs/Chip-Test-CD-Cert.der\"\n")
string(APPEND script_args "--pai\n")
else()
Expand All @@ -95,7 +99,7 @@ else()
endif()

# find chip tool requied for generating QRCode
find_program(chip_tool_exe NAMES chip-tool REQUIRED)
find_program(chip_tool_exe NAMES chip-tool PATHS ${CHIP_ROOT}/out/telink REQUIRED)
string(APPEND script_args "--chip-tool-path ${chip_tool_exe}\n")

# add Password-Authenticated Key Exchange parameters
Expand All @@ -104,7 +108,7 @@ string(APPEND script_args "--discriminator ${CONFIG_CHIP_DEVICE_DISCRIMINATOR}\n
string(APPEND script_args "--passcode ${CONFIG_CHIP_DEVICE_SPAKE2_PASSCODE}\n")

# request spake2p to generate a new spake2_verifier
find_program(spake_exe NAMES spake2p REQUIRED)
find_program(spake_exe NAMES spake2p PATHS ${CHIP_ROOT}/out/telink REQUIRED)
string(APPEND script_args "--spake2-path ${spake_exe}\n")

if(CONFIG_CHIP_DEVICE_ENABLE_KEY)
Expand Down
Loading

0 comments on commit c675664

Please sign in to comment.