Skip to content

Commit a82bc7e

Browse files
committed
[NXP][examples][rw61x] Adding support to build applications with cmake (this method is using wrappers which call the gn build command)
* Adding configs for build & pre/post-build processes Signed-off-by: Dina Benamar <dina.benamarelmaaroufi@nxp.com>
1 parent 3a4d8c2 commit a82bc7e

File tree

3 files changed

+186
-0
lines changed

3 files changed

+186
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#
2+
# Copyright (c) 2024 Project CHIP Authors
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
cmake_minimum_required(VERSION 3.13.1)
18+
19+
project(chip-rw61x-all-cluster-example)
20+
21+
if (NOT CHIP_ROOT)
22+
get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_LIST_DIR}/../../../../.. REALPATH)
23+
endif()
24+
25+
# Define the GN root target for the application
26+
get_filename_component(GN_ROOT_TARGET ${CMAKE_CURRENT_LIST_DIR} REALPATH)
27+
28+
# Include platform specific configs / variables
29+
include(${CHIP_ROOT}/examples/platform/nxp/rt/rw61x/platform_config.cmake)
30+
31+
add_subdirectory(${CHIP_ROOT}/config/nxp/chip-cmake-freertos ./chip)
32+
33+
#**************************************************************************************
34+
# Build example application
35+
#**************************************************************************************
36+
if(CONFIG_CHIP_BUILD_APP_WITH_GN)
37+
nxp_build_app_with_gn()
38+
endif()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
2+
#
3+
# Copyright (c) 2024 Project CHIP Authors
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
#
19+
# @file
20+
# CMake file that defines cmake variables specific to this platform
21+
#
22+
23+
# Board configs
24+
set(CONFIG_CORE_FOLDER "")
25+
26+
if (CONFIG_BOARD_VARIANT STREQUAL "frdm")
27+
set(CONFIG_BOARD_NAME "frdmrw612")
28+
else()
29+
set(CONFIG_BOARD_NAME "rdrw612bga")
30+
endif()
31+
32+
# MCUBoot OTA configs
33+
set(CONFIG_MCUBOOT_BUILD_TYPE "flash_release")
34+
set(CONFIG_CHIP_MCUBOOT_SLOT_SIZE 0x440000)
35+
set(CONFIG_CHIP_MCUBOOT_MAX_SECTORS 1088)
36+
set(CONFIG_CHIP_MCUBOOT_HEADER_SIZE 0x1000)
37+
38+
# CHIP configs
39+
set(CONFIG_CHIP_DEVICE_VENDOR_ID 4151)
40+
set(CONFIG_CHIP_DEVICE_PRODUCT_ID 41510)
41+
42+
set(CONFIG_CHIP_DEVICE_VENDOR_NAME "NXP Semiconductors")
43+
if (NOT CONFIG_CHIP_DEVICE_PRODUCT_NAME)
44+
set(CONFIG_CHIP_DEVICE_PRODUCT_NAME "Thermostat")
45+
endif()
46+
if (NOT CONFIG_CHIP_DEVICE_TYPE)
47+
set(CONFIG_CHIP_DEVICE_TYPE 769)
48+
endif()
49+
set(CONFIG_CHIP_DEVICE_SPAKE2_IT 10000)
50+
set(CONFIG_CHIP_DEVICE_SPAKE2_SALT "UXKLzwHdN3DZZLBaL2iVGhQi/OoQwIwJRQV4rpEalbA=")
51+
if (NOT CONFIG_CHIP_DEVICE_DISCRIMINATOR)
52+
set(CONFIG_CHIP_DEVICE_DISCRIMINATOR 2560)
53+
endif()
54+
if (NOT CONFIG_CHIP_DEVICE_SPAKE2_PASSCODE)
55+
set(CONFIG_CHIP_DEVICE_SPAKE2_PASSCODE 14014)
56+
endif()
57+
set(CONFIG_CHIP_DEVICE_HARDWARE_VERSION 1)
58+
set(CONFIG_CHIP_DEVICE_HARDWARE_VERSION_STRING "1.0")
59+
set(CONFIG_CHIP_DEVICE_SERIAL_NUMBER "12345678")
60+
set(CONFIG_CHIP_DEVICE_MANUFACTURING_DATE "2024-01-01")
61+
set(CONFIG_CHIP_DEVICE_ROTATING_DEVICE_UID "00112233445566778899aabbccddeeff")
62+
set(CONFIG_CHIP_DEVICE_PRODUCT_FINISH "Matte")
63+
set(CONFIG_CHIP_DEVICE_PRODUCT_COLOR "Green")
64+
set(CONFIG_CHIP_DEVICE_PRODUCT_URL "https://www.nxp.com/products/wireless/wi-fi-plus-bluetooth-plus-802-15-4/wireless-mcu-with-integrated-tri-radiobr1x1-wi-fi-6-plus-bluetooth-low-energy-5-3-802-15-4:RW612")
65+
set(CONFIG_CHIP_DEVICE_PRODUCT_LABEL "RW612")
66+
set(CONFIG_CHIP_DEVICE_PART_NUMBER "RW612")
67+
set(CONFIG_CHIP_ENCRYPTED_FACTORY_DATA_AES128_KEY "2B7E151628AED2A6ABF7158809CF4F3C")
68+
set(CONFIG_CHIP_FACTORY_DATA_CERT_SOURCE_GENERATED true)
69+
set(CONFIG_CHIP_FACTORY_DATA_GENERATE_SPAKE2_VERIFIER true)
70+
set(CONFIG_CHIP_ENCRYPTED_FACTORY_DATA true)
71+
72+
# build configs
73+
set(CONFIG_CHIP_NVM_COMPONENT "nvs")
74+
set(CONFIG_CHIP_RT_PLATFORM "rw61x")
75+
set(CONFIG_CHIP_NXP_PLATFORM "rt/${CONFIG_CHIP_RT_PLATFORM}")
76+
set(CONFIG_CHIP_FACTORY_DATA 1)
77+
set(CONFIG_CHIP_SECURE_DAC_PRIVATE_KEY_STORAGE false)
78+
set(CONFIG_CHIP_ENABLE_SECURE_WHOLE_FACTORY_DATA false)
79+
set(CONFIG_CHIP_BUILD_APP_WITH_GN true)
80+
set(CONFIG_LOG true)
81+
set(CONFIG_MATTER_LOG_LEVEL 4) # detail logs
82+
83+
# BLE is enabled by default
84+
if (NOT DEFINED CONFIG_BT)
85+
set(CONFIG_BT true)
86+
endif()
87+
88+
if (NOT DEFINED CONFIG_CHIP_IPV4)
89+
set(CONFIG_CHIP_IPV4 true)
90+
endif()
91+
92+
if (NOT DEFINED CONFIG_CHIP_DEVICE_SOFTWARE_VERSION)
93+
set(CONFIG_CHIP_DEVICE_SOFTWARE_VERSION 1)
94+
endif()
95+
96+
if (NOT DEFINED CONFIG_CHIP_DEVICE_SOFTWARE_VERSION_STRING)
97+
set(CONFIG_CHIP_DEVICE_SOFTWARE_VERSION_STRING "1.0")
98+
endif()
99+
100+
if(NOT DEFINED CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART)
101+
set(CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART true)
102+
endif()
103+
104+
105+
# define sections to remove from the binary when converting the elf to bin with objcopy
106+
if (CONFIG_CHIP_OTA_REQUESTOR)
107+
set(CONFIG_REMOVE_SECTIONS_FROM_BIN -R .flash_config -R .NVM)
108+
else()
109+
set(CONFIG_REMOVE_SECTIONS_FROM_BIN -R .NVM)
110+
endif()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#
2+
# Copyright (c) 2024 Project CHIP Authors
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
cmake_minimum_required(VERSION 3.13.1)
18+
19+
project(chip-rw61x-thermostat-example)
20+
21+
if (NOT CHIP_ROOT)
22+
get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_LIST_DIR}/../../../../.. REALPATH)
23+
endif()
24+
25+
# Define the GN root target for the application
26+
get_filename_component(GN_ROOT_TARGET ${CMAKE_CURRENT_LIST_DIR} REALPATH)
27+
28+
# Include platform specific configs / variables
29+
include(${CHIP_ROOT}/examples/platform/nxp/rt/rw61x/platform_config.cmake)
30+
31+
add_subdirectory(${CHIP_ROOT}/config/nxp/chip-cmake-freertos ./chip)
32+
33+
#**************************************************************************************
34+
# Build example application
35+
#**************************************************************************************
36+
if(CONFIG_CHIP_BUILD_APP_WITH_GN)
37+
nxp_build_app_with_gn()
38+
endif()

0 commit comments

Comments
 (0)