|
| 1 | +# Matter CYW30739 Thermostat Example |
| 2 | + |
| 3 | +An example showing the use of Matter on the Infineon CYW30739 platform. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## Table of Contents |
| 8 | + |
| 9 | +- [Matter CYW30739 Thermostat Example](#matter-cyw30739-thermostat-example) |
| 10 | + - [Table of Contents](#table-of-contents) |
| 11 | + - [Introduction](#introduction) |
| 12 | + - [Installing ModusToolbox™ Software](#installing-modustoolbox-software) |
| 13 | + - [ModusToolbox™ tools package](#modustoolbox-tools-package) |
| 14 | + - [Note for WSL (Windows Subsystem for Linux)](#note-for-wsl-windows-subsystem-for-linux) |
| 15 | + - [Checkout Submodules](#checkout-submodules) |
| 16 | + - [Building](#building) |
| 17 | + - [Factory Data](#factory-data) |
| 18 | + - [Commissionable Data](#commissionable-data) |
| 19 | + - [Device Information](#device-information) |
| 20 | + - [DAC / DAC Key / PAI Certificate / Certificate Declaration](#dac--dac-key--pai-certificate--certificate-declaration) |
| 21 | + - [Flashing the Application](#flashing-the-application) |
| 22 | + - [Enter Recovery Mode](#enter-recovery-mode) |
| 23 | + - [Run Flash Script](#run-flash-script) |
| 24 | + - [Running the Complete Example](#running-the-complete-example) |
| 25 | + |
| 26 | +--- |
| 27 | + |
| 28 | +## Introduction |
| 29 | + |
| 30 | +The CYW30739 thermostat example provides a baseline demonstration of a |
| 31 | +thermostat device, built using Matter and the Infineon Modustoolbox SDK. It can |
| 32 | +be controlled by a Matter controller over Openthread network. |
| 33 | + |
| 34 | +The CYW30739 device can be commissioned over Bluetooth Low Energy where the |
| 35 | +device and the Matter controller will exchange security information with the |
| 36 | +Rendez-vous procedure. Target Thread Network information including the active |
| 37 | +dataset and CASE credentials are then provided. |
| 38 | + |
| 39 | +## Installing [ModusToolbox™ Software](https://www.infineon.com/cms/en/design-support/tools/sdk/modustoolbox-software) |
| 40 | + |
| 41 | +Follow the |
| 42 | +[Installation Guide](https://www.infineon.com/ModusToolboxInstallguide) to |
| 43 | +download and install the ModusToolbox™ Software. |
| 44 | + |
| 45 | +### ModusToolbox™ tools package |
| 46 | + |
| 47 | +ModusToolbox™ tools package should be automatically installed in the default |
| 48 | +location if you followed the |
| 49 | +[Installation Guide](https://www.infineon.com/ModusToolboxInstallguide). Please |
| 50 | +refer to the Installation Guide for the default location for different operating |
| 51 | +systems. |
| 52 | + |
| 53 | +If you need to install the ModusToolbox™ tools package in a custom location, you |
| 54 | +must set the environment variable `CY_TOOLS_PATHS` to the |
| 55 | +`/path/to/ModusToolbox/tools_x.x` to specify the location of tools. |
| 56 | + |
| 57 | +```bash |
| 58 | +export CY_TOOLS_PATHS="/path/to/ModusToolbox/tools_x.x" |
| 59 | +``` |
| 60 | + |
| 61 | +#### Note for WSL (Windows Subsystem for Linux) |
| 62 | + |
| 63 | +If you are using WSL, please ensure you have installed the ModusToolbox™ |
| 64 | +Software for Linux. Running Windows tools directly from the WSL command line |
| 65 | +would cause path resolution failure in the build process. |
| 66 | + |
| 67 | +### Checkout Submodules |
| 68 | + |
| 69 | +Before building the example, check out the Matter repository and sync submodules |
| 70 | +using the following command: |
| 71 | + |
| 72 | +```bash |
| 73 | +$ cd ~/connectedhomeip |
| 74 | +$ scripts/checkout_submodules.py --platform infineon |
| 75 | +``` |
| 76 | + |
| 77 | +## Building |
| 78 | + |
| 79 | +- Build the example application: |
| 80 | + |
| 81 | + ```bash |
| 82 | + $ cd ~/connectedhomeip |
| 83 | + $ scripts/examples/gn_build_example.sh examples/thermostat/infineon/cyw30739 out/cyw30739-thermostat |
| 84 | + ``` |
| 85 | + |
| 86 | +- OR use GN/Ninja directly |
| 87 | + |
| 88 | + ```bash |
| 89 | + $ cd ~/connectedhomeip |
| 90 | + $ source scripts/activate.sh |
| 91 | + $ gn gen --root=examples/thermostat/infineon/cyw30739 out/cyw30739-thermostat |
| 92 | + $ ninja -C out/cyw30739-thermostat [thermostat-BOARD_NAME] |
| 93 | + ``` |
| 94 | + |
| 95 | +- To delete generated executable, libraries and object files use: |
| 96 | + |
| 97 | + ```bash |
| 98 | + $ cd ~/connectedhomeip |
| 99 | + $ rm -rf out/cyw30739-thermostat |
| 100 | + ``` |
| 101 | + |
| 102 | +## Factory Data |
| 103 | + |
| 104 | +### Commissionable Data |
| 105 | + |
| 106 | +Infineon CYW30739 examples use test passcode, discriminator and PAKE parameters |
| 107 | +by default. For a production build, manufacturers should override commissionable |
| 108 | +data by the following arguments: |
| 109 | + |
| 110 | +- `matter_passcode`, `matter_discriminator`, `matter_pake_iteration_count`, |
| 111 | + `matter_pake_salt` |
| 112 | + |
| 113 | + ```bash |
| 114 | + $ cd ~/connectedhomeip |
| 115 | + $ scripts/examples/gn_build_example.sh examples/thermostat/infineon/cyw30739 out/cyw30739-thermostat \ |
| 116 | + 'matter_passcode=20202021' \ |
| 117 | + 'matter_discriminator=3840' \ |
| 118 | + 'matter_pake_iteration_count=1000' \ |
| 119 | + 'matter_pake_salt="U1BBS0UyUCBLZXkgU2FsdA=="' |
| 120 | + ``` |
| 121 | + |
| 122 | +### Device Information |
| 123 | + |
| 124 | +Infineon CYW30739 examples support overriding the default device information by |
| 125 | +the following arguments: |
| 126 | + |
| 127 | +- matter_vendor_name |
| 128 | +- matter_vendor_id |
| 129 | +- matter_product_name |
| 130 | +- matter_product_id |
| 131 | +- matter_serial_number |
| 132 | +- matter_hardware_version |
| 133 | +- matter_hardware_version_string |
| 134 | + |
| 135 | +To override the default device information, pass the desired values to the |
| 136 | +`gn_build_example.sh` script as arguments. |
| 137 | + |
| 138 | + ```bash |
| 139 | + $ cd ~/connectedhomeip |
| 140 | + $ scripts/examples/gn_build_example.sh examples/thermostat/infineon/cyw30739 out/cyw30739-thermostat \ |
| 141 | + 'matter_vendor_name="Infineon"' \ |
| 142 | + 'matter_vendor_id="0x1388"' \ |
| 143 | + 'matter_product_name="TEST_PRODUCT"' \ |
| 144 | + 'matter_product_id="0x0001"' \ |
| 145 | + 'matter_serial_number="TEST_SN"' \ |
| 146 | + 'matter_hardware_version=30739' \ |
| 147 | + 'matter_hardware_version_string="30739"' |
| 148 | + ``` |
| 149 | + |
| 150 | +### DAC / DAC Key / PAI Certificate / Certificate Declaration |
| 151 | + |
| 152 | +Infineon CYW30739 examples use development certifications, keys, and CD by |
| 153 | +default. For a production build, manufacturers can provision certifications, |
| 154 | +keys, and CD by the following arguments: |
| 155 | + |
| 156 | +- `matter_att_cert`, `matter_att_cert_password`, `matter_cd` |
| 157 | + |
| 158 | + ```bash |
| 159 | + $ cd ~/connectedhomeip |
| 160 | + $ scripts/examples/gn_build_example.sh examples/thermostat/infineon/cyw30739 out/cyw30739-thermostat \ |
| 161 | + 'matter_att_cert="/path/to/att_cert.p12"' \ |
| 162 | + 'matter_att_cert_password="password"' \ |
| 163 | + 'matter_cd="/path/to/cd.der"' |
| 164 | + ``` |
| 165 | + |
| 166 | +## Flashing the Application |
| 167 | + |
| 168 | +### Enter Recovery Mode |
| 169 | + |
| 170 | +Put the CYW30739 in to the recovery mode before running the flash script. |
| 171 | + |
| 172 | +1. Press and hold the `RECOVERY` button on the board. |
| 173 | +2. Press and hold the `RESET` button on the board. |
| 174 | +3. Release the `RESET` button. |
| 175 | +4. After one second, release the `RECOVERY` button. |
| 176 | + |
| 177 | +### Run Flash Script |
| 178 | + |
| 179 | +- On the command line: |
| 180 | + |
| 181 | + ```bash |
| 182 | + $ cd ~/connectedhomeip |
| 183 | + $ out/cyw30739-thermostat/thermostat-BOARD_NAME.flash.py --port <port> |
| 184 | + ``` |
| 185 | + |
| 186 | +## Running the Complete Example |
| 187 | + |
| 188 | +- It is assumed here that you already have an OpenThread border router |
| 189 | + configured and running. If not see the following guide |
| 190 | + [Openthread_border_router](https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/openthread_border_router_pi.md) |
| 191 | + for more information on how to setup a border router on a raspberryPi. |
| 192 | + |
| 193 | +- For this example to work, it is necessary to have a second CYW30739 device |
| 194 | + running the thermostat example commissioned on the same OpenThread network |
0 commit comments