Skip to content

Commit

Permalink
[Telink] Chnages to test Apple OTA
Browse files Browse the repository at this point in the history
  • Loading branch information
s07641069 committed Jun 15, 2023
1 parent 2520f47 commit 75fb31b
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 53 deletions.
6 changes: 3 additions & 3 deletions config/telink/chip-module/generate_factory_data.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ if(CONFIG_CHIP_FACTORY_DATA_USE_DEFAULT_CERTS)
string(APPEND script_args "--pai\n")
else()
# generate PAI and DAC certs
string(APPEND script_args "--cert \"${CHIP_ROOT}/credentials/test/attestation/Chip-Test-PAA-NoVID-Cert.pem\"\n")
string(APPEND script_args "--key \"${CHIP_ROOT}/credentials/test/attestation/Chip-Test-PAA-NoVID-Key.pem\"\n")
string(APPEND script_args "-cd \"${CHIP_ROOT}/credentials/development/cd-certs/Chip-Test-CD-Cert.der\"\n")
string(APPEND script_args "--cert \"${CHIP_ROOT}/credentials/production/paa-root-certs/Telink-Matter-Development-PAA-01-Cert.pem\"\n")
string(APPEND script_args "--key \"${CHIP_ROOT}/credentials/production/paa-root-certs/Telink-Matter-Development-PAA-01-Key.pem\"\n")
string(APPEND script_args "-cd \"${CHIP_ROOT}/credentials/production/paa-root-certs/Telink-Matter-Development-CD-Cert.der\"\n")
string(APPEND script_args "--paa\n")
endif()

Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-----BEGIN CERTIFICATE-----
MIIB3zCCAYSgAwIBAgIIFGPiTAVNxycwCgYIKoZIzj0EAwIwQTEpMCcGA1UEAwwg
VGVsaW5rIE1hdHRlciBEZXZlbG9wbWVudCBQQUEgMDExFDASBgorBgEEAYKifAIB
DAQxMTQxMB4XDTIyMTExMTAwMTEyMloXDTQyMTExMTAwMTEyMVowQTEpMCcGA1UE
AwwgVGVsaW5rIE1hdHRlciBEZXZlbG9wbWVudCBQQUEgMDExFDASBgorBgEEAYKi
fAIBDAQxMTQxMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEOO5hm5qgrjD2i0pF
bhHATvoezhm28q2H3eQNDZ5T2ItyUjv9LKLyUx/NTF9T6Q5i/1UWEug2Mm2Twus6
M+1dR6NmMGQwEgYDVR0TAQH/BAgwBgEB/wIBATAOBgNVHQ8BAf8EBAMCAQYwHQYD
VR0OBBYEFG7w/adj8GRbuK/eq4lSjSYjDl6BMB8GA1UdIwQYMBaAFG7w/adj8GRb
uK/eq4lSjSYjDl6BMAoGCCqGSM49BAMCA0kAMEYCIQC8V4yKaylCPOonDBQW7I+M
xhE/q1SoHiTvvp8upgaX9gIhAJup5L3Uvn0qxxhifSqNJydbVXPru2dYlHNr/vn/
MUPm
-----END CERTIFICATE-----
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIDj8+2imyoJopYib0Px7h8Tj9b0l71hEzrL74wtfsTdFoAoGCCqGSM49
AwEHoUQDQgAEOO5hm5qgrjD2i0pFbhHATvoezhm28q2H3eQNDZ5T2ItyUjv9LKLy
Ux/NTF9T6Q5i/1UWEug2Mm2Twus6M+1dRw==
-----END EC PRIVATE KEY-----
19 changes: 11 additions & 8 deletions examples/lighting-app/telink/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,21 @@ CONFIG_OPENTHREAD_NETWORK_NAME="OpenThreadDemo"
CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22"

# Disable Matter OTA DFU
CONFIG_CHIP_OTA_REQUESTOR=n
CONFIG_CHIP_OTA_REQUESTOR=y

# CHIP configuration
CONFIG_CHIP_PROJECT_CONFIG="include/CHIPProjectConfig.h"
CONFIG_CHIP_OPENTHREAD_CONFIG="../../platform/telink/project_include/OpenThreadConfig.h"

CONFIG_CHIP_DEVICE_VENDOR_ID=65521
# 4417 == 0x1141 (telink vendor ID)
CONFIG_CHIP_DEVICE_VENDOR_ID=4417
# 32773 == 0x8005 (example lighting-app)
CONFIG_CHIP_DEVICE_PRODUCT_ID=32773
CONFIG_CHIP_DEVICE_TYPE=65535
# 256 == 0x0100 (example lighting-app)
CONFIG_CHIP_DEVICE_TYPE=256

CONFIG_CHIP_DEVICE_SOFTWARE_VERSION=1
CONFIG_CHIP_DEVICE_SOFTWARE_VERSION_STRING="2022"
CONFIG_CHIP_DEVICE_SOFTWARE_VERSION=6
CONFIG_CHIP_DEVICE_SOFTWARE_VERSION_STRING="2023.6-6"

# Enable CHIP pairing automatically on application start.
CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART=y
Expand All @@ -57,9 +59,10 @@ CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART=y
CONFIG_CHIP_LIB_SHELL=n

# Disable factory data support.
CONFIG_CHIP_FACTORY_DATA=n
CONFIG_CHIP_FACTORY_DATA_BUILD=n
CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE=n
CONFIG_CHIP_FACTORY_DATA=y
CONFIG_CHIP_FACTORY_DATA_BUILD=y
CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE=y
CONFIG_CHIP_FACTORY_DATA_USE_DEFAULT_CERTS=n
CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE=n

# Enable Power Management
Expand Down
2 changes: 1 addition & 1 deletion integrations/docker/images/chip-build-telink/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ RUN set -x \
&& : # last line

# Setup Zephyr
ARG ZEPHYR_REVISION=873afebff10dc02ec881e2432a885e54c9f67b10
ARG ZEPHYR_REVISION=a628da3013530e75a97b83fb2cd96dc2377497c6
WORKDIR /opt/telink/zephyrproject
RUN set -x \
&& python3 -m pip install -U --no-cache-dir \
Expand Down
67 changes: 26 additions & 41 deletions src/platform/telink/CHIPDevicePlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,53 +130,38 @@

#ifndef CHIP_DEVICE_CONFIG_CERTIFICATION_DECLARATION
//-> format_version = 1
//-> vendor_id = 0xFFF1
//-> product_id_array = [ 0x8000, 0x8001, 0x8002, 0x8003, 0x8004, 0x8005, 0x8006, 0x8007, 0x8008, 0x8009, 0x800A, 0x800B,
// 0x800C, 0x800D, 0x800E, 0x800F, 0x8010, 0x8011, 0x8012, 0x8013, 0x8014, 0x8015, 0x8016, 0x8017, 0x8018, 0x8019, 0x801A,
// 0x801B, 0x801C, 0x801D, 0x801E, 0x801F, 0x8020, 0x8021, 0x8022, 0x8023, 0x8024, 0x8025, 0x8026, 0x8027, 0x8028, 0x8029,
// 0x802A, 0x802B, 0x802C, 0x802D, 0x802E, 0x802F, 0x8030, 0x8031, 0x8032, 0x8033, 0x8034, 0x8035, 0x8036, 0x8037, 0x8038,
// 0x8039, 0x803A, 0x803B, 0x803C, 0x803D, 0x803E, 0x803F, 0x8040, 0x8041, 0x8042, 0x8043, 0x8044, 0x8045, 0x8046, 0x8047,
// 0x8048, 0x8049, 0x804A, 0x804B, 0x804C, 0x804D, 0x804E, 0x804F, 0x8050, 0x8051, 0x8052, 0x8053, 0x8054, 0x8055, 0x8056,
// 0x8057, 0x8058, 0x8059, 0x805A, 0x805B, 0x805C, 0x805D, 0x805E, 0x805F, 0x8060, 0x8061, 0x8062, 0x8063 ]
//-> device_type_id = 0x0016
//-> certificate_id = "ZIG20142ZB330003-24"
//-> vendor_id = 0x1141
//-> product_id = 0x8005
//-> device_type_id = 0x0100
//-> certificate_id = "ZIG20141ZB330001-24"
//-> security_level = 0
//-> security_information = 0
//-> version_number = 0x2694
//-> certification_type = 0
//-> dac_origin_vendor_id is not present
//-> dac_origin_product_id is not present
#define CHIP_DEVICE_CONFIG_CERTIFICATION_DECLARATION \
{ \
0x30, 0x82, 0x02, 0x19, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x82, 0x02, 0x0a, 0x30, \
0x82, 0x02, 0x06, 0x02, 0x01, 0x03, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, \
0x02, 0x01, 0x30, 0x82, 0x01, 0x71, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x82, \
0x01, 0x62, 0x04, 0x82, 0x01, 0x5e, 0x15, 0x24, 0x00, 0x01, 0x25, 0x01, 0xf1, 0xff, 0x36, 0x02, 0x05, 0x00, 0x80, \
0x05, 0x01, 0x80, 0x05, 0x02, 0x80, 0x05, 0x03, 0x80, 0x05, 0x04, 0x80, 0x05, 0x05, 0x80, 0x05, 0x06, 0x80, 0x05, \
0x07, 0x80, 0x05, 0x08, 0x80, 0x05, 0x09, 0x80, 0x05, 0x0a, 0x80, 0x05, 0x0b, 0x80, 0x05, 0x0c, 0x80, 0x05, 0x0d, \
0x80, 0x05, 0x0e, 0x80, 0x05, 0x0f, 0x80, 0x05, 0x10, 0x80, 0x05, 0x11, 0x80, 0x05, 0x12, 0x80, 0x05, 0x13, 0x80, \
0x05, 0x14, 0x80, 0x05, 0x15, 0x80, 0x05, 0x16, 0x80, 0x05, 0x17, 0x80, 0x05, 0x18, 0x80, 0x05, 0x19, 0x80, 0x05, \
0x1a, 0x80, 0x05, 0x1b, 0x80, 0x05, 0x1c, 0x80, 0x05, 0x1d, 0x80, 0x05, 0x1e, 0x80, 0x05, 0x1f, 0x80, 0x05, 0x20, \
0x80, 0x05, 0x21, 0x80, 0x05, 0x22, 0x80, 0x05, 0x23, 0x80, 0x05, 0x24, 0x80, 0x05, 0x25, 0x80, 0x05, 0x26, 0x80, \
0x05, 0x27, 0x80, 0x05, 0x28, 0x80, 0x05, 0x29, 0x80, 0x05, 0x2a, 0x80, 0x05, 0x2b, 0x80, 0x05, 0x2c, 0x80, 0x05, \
0x2d, 0x80, 0x05, 0x2e, 0x80, 0x05, 0x2f, 0x80, 0x05, 0x30, 0x80, 0x05, 0x31, 0x80, 0x05, 0x32, 0x80, 0x05, 0x33, \
0x80, 0x05, 0x34, 0x80, 0x05, 0x35, 0x80, 0x05, 0x36, 0x80, 0x05, 0x37, 0x80, 0x05, 0x38, 0x80, 0x05, 0x39, 0x80, \
0x05, 0x3a, 0x80, 0x05, 0x3b, 0x80, 0x05, 0x3c, 0x80, 0x05, 0x3d, 0x80, 0x05, 0x3e, 0x80, 0x05, 0x3f, 0x80, 0x05, \
0x40, 0x80, 0x05, 0x41, 0x80, 0x05, 0x42, 0x80, 0x05, 0x43, 0x80, 0x05, 0x44, 0x80, 0x05, 0x45, 0x80, 0x05, 0x46, \
0x80, 0x05, 0x47, 0x80, 0x05, 0x48, 0x80, 0x05, 0x49, 0x80, 0x05, 0x4a, 0x80, 0x05, 0x4b, 0x80, 0x05, 0x4c, 0x80, \
0x05, 0x4d, 0x80, 0x05, 0x4e, 0x80, 0x05, 0x4f, 0x80, 0x05, 0x50, 0x80, 0x05, 0x51, 0x80, 0x05, 0x52, 0x80, 0x05, \
0x53, 0x80, 0x05, 0x54, 0x80, 0x05, 0x55, 0x80, 0x05, 0x56, 0x80, 0x05, 0x57, 0x80, 0x05, 0x58, 0x80, 0x05, 0x59, \
0x80, 0x05, 0x5a, 0x80, 0x05, 0x5b, 0x80, 0x05, 0x5c, 0x80, 0x05, 0x5d, 0x80, 0x05, 0x5e, 0x80, 0x05, 0x5f, 0x80, \
0x05, 0x60, 0x80, 0x05, 0x61, 0x80, 0x05, 0x62, 0x80, 0x05, 0x63, 0x80, 0x18, 0x24, 0x03, 0x16, 0x2c, 0x04, 0x13, \
0x5a, 0x49, 0x47, 0x32, 0x30, 0x31, 0x34, 0x32, 0x5a, 0x42, 0x33, 0x33, 0x30, 0x30, 0x30, 0x33, 0x2d, 0x32, 0x34, \
0x24, 0x05, 0x00, 0x24, 0x06, 0x00, 0x25, 0x07, 0x94, 0x26, 0x24, 0x08, 0x00, 0x18, 0x31, 0x7d, 0x30, 0x7b, 0x02, \
0x01, 0x03, 0x80, 0x14, 0x62, 0xfa, 0x82, 0x33, 0x59, 0xac, 0xfa, 0xa9, 0x96, 0x3e, 0x1c, 0xfa, 0x14, 0x0a, 0xdd, \
0xf5, 0x04, 0xf3, 0x71, 0x60, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, \
0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x04, 0x47, 0x30, 0x45, 0x02, 0x20, 0x24, 0xe5, \
0xd1, 0xf4, 0x7a, 0x7d, 0x7b, 0x0d, 0x20, 0x6a, 0x26, 0xef, 0x69, 0x9b, 0x7c, 0x97, 0x57, 0xb7, 0x2d, 0x46, 0x90, \
0x89, 0xde, 0x31, 0x92, 0xe6, 0x78, 0xc7, 0x45, 0xe7, 0xf6, 0x0c, 0x02, 0x21, 0x00, 0xf8, 0xaa, 0x2f, 0xa7, 0x11, \
0xfc, 0xb7, 0x9b, 0x97, 0xe3, 0x97, 0xce, 0xda, 0x66, 0x7b, 0xae, 0x46, 0x4e, 0x2b, 0xd3, 0xff, 0xdf, 0xc3, 0xcc, \
0xed, 0x7a, 0xa8, 0xca, 0x5f, 0x4c, 0x1a, 0x7c \
#define CHIP_DEVICE_CONFIG_CERTIFICATION_DECLARATION \
{ \
0x30, 0x81, 0xe9, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, \
0x07, 0x02, 0xa0, 0x81, 0xdb, 0x30, 0x81, 0xd8, 0x02, 0x01, 0x03, 0x31, \
0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, \
0x02, 0x01, 0x30, 0x45, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, \
0x01, 0x07, 0x01, 0xa0, 0x38, 0x04, 0x36, 0x15, 0x24, 0x00, 0x01, 0x25, \
0x01, 0x41, 0x11, 0x36, 0x02, 0x05, 0x05, 0x80, 0x18, 0x25, 0x03, 0x00, \
0x01, 0x2c, 0x04, 0x13, 0x5a, 0x49, 0x47, 0x32, 0x30, 0x31, 0x34, 0x31, \
0x5a, 0x42, 0x33, 0x33, 0x30, 0x30, 0x30, 0x31, 0x2d, 0x32, 0x34, 0x24, \
0x05, 0x00, 0x24, 0x06, 0x00, 0x25, 0x07, 0x76, 0x98, 0x24, 0x08, 0x00, \
0x18, 0x31, 0x7d, 0x30, 0x7b, 0x02, 0x01, 0x03, 0x80, 0x14, 0x6e, 0xf0, \
0xfd, 0xa7, 0x63, 0xf0, 0x64, 0x5b, 0xb8, 0xaf, 0xde, 0xab, 0x89, 0x52, \
0x8d, 0x26, 0x23, 0x0e, 0x5e, 0x81, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, \
0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, 0x0a, 0x06, 0x08, 0x2a, \
0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x04, 0x47, 0x30, 0x45, 0x02, \
0x20, 0x72, 0x4a, 0x80, 0x7b, 0xeb, 0x8a, 0x1c, 0x61, 0x6a, 0x32, 0x3a, \
0x98, 0x27, 0x46, 0x94, 0xdf, 0x12, 0x01, 0xb9, 0x82, 0x09, 0x9a, 0xb7, \
0x17, 0x52, 0x4e, 0xf5, 0x3a, 0x65, 0xec, 0x97, 0x1f, 0x02, 0x21, 0x00, \
0x93, 0x63, 0xd5, 0x9f, 0x83, 0x48, 0xc6, 0xc8, 0x35, 0xec, 0x51, 0x92, \
0xf8, 0xd3, 0x2b, 0x04, 0x69, 0xbe, 0xdb, 0x0e, 0x91, 0xe0, 0x26, 0x49, \
0x46, 0x2c, 0xa3, 0x53, 0x68, 0x98, 0xf9, 0x6f \
}
#endif

Expand Down

0 comments on commit 75fb31b

Please sign in to comment.