Skip to content

Commit

Permalink
Merge branch 'update_kotlin_struct_library' of github.com:joonhaengHe…
Browse files Browse the repository at this point in the history
…o/connectedhomeip into update_kotlin_struct_library
  • Loading branch information
joonhaengHeo committed Sep 21, 2023
2 parents 75b23ed + 4fe25cb commit 8d27dd5
Show file tree
Hide file tree
Showing 41 changed files with 1,651 additions and 1,088 deletions.
20 changes: 0 additions & 20 deletions config/telink/chip-module/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -188,26 +188,6 @@ config SHELL_BACKEND_SERIAL_RX_RING_BUFFER_SIZE
int
default 255 if SHELL_BACKEND_SERIAL

config CHIP_ICD_SUBSCRIPTION_HANDLING
bool "Enables platform specific handling of ICD subscriptions"
default PM
help
Enables platform specific implementation that handles ICD subscription requests
and selects subscription report interval value considering maximum interval preferred
by the publisher.

config CHIP_MAX_PREFERRED_SUBSCRIPTION_REPORT_INTERVAL
int "Maximum preferred interval of sending subscription reports (s)"
default 60
help
Provides maximum preferred interval to be used by a publisher for negotiation
of the final maximum subscription report interval, after receiving a subscription
request from the initiator. This value should be selected as a compromise between
keeping the power consumption low due to not sending reports too often, and allowing
the initiator device to detect the publisher absence reasonably fast due to not sending
the reports too rarely. The current algorithm is to select bigger value from the one
requested by the initiator and the one preferred by the publisher.

config CHIP_ENABLE_POWER_ON_FACTORY_RESET
bool "Enable power on factory reset sequence"
default n
Expand Down
233 changes: 124 additions & 109 deletions docs/guides/ti/matter_cc2674_migration.md
Original file line number Diff line number Diff line change
@@ -1,109 +1,124 @@
# Running Matter Examples on the TI SimpleLink CC2674P10 and CC2674R10

The existing Matter project examples are based on LP_EM_CC1354P10_6. If using
the CC2674P10, the following migration steps are required. Developers are
strongly encouraged to start with a `cc13x4_26x4` example and migrate the
project accordingly. Example projects can be found in the following location:
`matter/examples/[application]/cc13x4_26x4`

## Dependencies

The following must be installed on your system before proceeding:

- [SysConfig](https://www.ti.com/tool/SYSCONFIG) v1.16.2 or later
- [SIMPLELINK-LOWPOWER-F2-SDK](https://www.ti.com/tool/SIMPLELINK-LOWPOWER-SDK)
v7.10.01.24

## Matter source code changes

The following are changes to the Matter source code files which should be
applied to convert a `matter/examples/[application]/cc13x4_26x4` project to the
CC2674P10 device

- `examples/[application]/cc13x4_26x4/args.gni`, modify/add the following
defines for the CC2674
- `ti_simplelink_board = CC2674`
- `ti_simplelink_device = CC2674P10RGZ`
- `third_party/ti_simplelink_sdk/repo_cc13xx_cc26xx`, replace this folder
contents with the 7.10.01.24 version from
[TI's downloads page](https://www.ti.com/tool/download/SIMPLELINK-LOWPOWER-F2-SDK/7.10.01.24)
which is required to add support SDK for the CC2674P10 device.

## Configuring `chip.syscfg` in the SysConfig GUI

1. To open `matter/examples/[application]/cc13x4_26x4/chip.syscfg` in the GUI,
add the following line to the top of the file:

```
// @cliArgs --product <path to SDK>/.metadata/product.json --board /ti/boards/LP_EM_CC1354P10_6 --rtos freertos
```

2. Open the `syscfg` file using the standalone Sysconfig GUI
(`sysconfig_gui.sh`) from the SysConfig installation folder.
3. Click on _Show Device View_ and then click _Switch_.
4. Select _Board_ as _None_ and _Device_ as _`CC2674P10RGZ`_, Unselect
_`Lock PinMux`_, and click _Confirm_.
5. To fix errors, make the following module changes:
- _RF Design_ and _RF Stacks -> BLE -> Radio_: click on _accepting the
current value_, which should be _`LP_CC2674P10_RGZ`_ in the drop down menu
for _Based On RF Design_
- _TI DEVICES -> Device Configuration_: Clear
_`XOSC Cap Array Modification`_
- _TI DRIVERS -> RF_: Set _Global Event Mask_ as _None_ and _No. of Antenna
Switch Control Pins_ as _0_
- _TI DRIVERS -> UART2 -> `PinMux`_: Set _UART Peripheral_ to _UART0_, _TX
Pin_ to _`DIO_13/19`_, and _RX Pin_ to _`DIO_12/18`_
- _TI DRIVERS APPS -> Button_: Set _`PinMux`_ of _CONFIG_BTN_LEFT_ to
_`DIO_15`_ and _CONFIG_BTN_RIGHT_ to _`DIO_14`_
- _TI DRIVERS APPS -> LED_: Set _`PinMux`_ of _CONFIG_LED_RED_ to _`DIO_6`_
and _CONFIG_LED_RIGHT_ to _`DIO_7`_
6. Save the SysConfig file (click on _Save As_) and ensure the file name matches
the reference from `BUILD.gn` (default project name is `chip.syscfg`).
7. Open the new SysConfig file with a text editor and remove the generated
arguments.
```
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --device "CC2674P10RGZ" --package "RGZ" --part "Default" --rtos "freertos" --product "simplelink_cc13xx_cc26xx_sdk@7.10.01.24"
* @versions {"tool":"1.18.0+3130"}
*/
```
8. Move the `*.syscfg` file into the
`matter/examples/[application]/cc13x4_26x4/` folder. Make sure that the
`args.gni` parameters are aligned for the `CC2674P10RGZ` as detailed above,
and build the example using the `README.md` instructions.

## Modifications required for the CC2674R10

After applying all items in the "Configuring `chip.syscfg` in the SysConfig GUI"
section, additional steps must also be applied to generate Matter project for
the CC2674R10.

- `examples/[application]/cc13x4_26x4/args.gni` should have
`ti_simplelink_board` as `CC2674` and `ti_simplelink_device = CC2674R10RGZ`.
- `examples/[application]/cc13x4_26x4/chip.syscfg` opened with a Text Editor
should change `ble.radioConfig.codeExportConfig.$name` to
`ti_devices_radioconfig_code_export_param2` and `ble.rfDesign` to
`LP_EM_CC1354P10_1`

Furthermore, the subsequent changes apply specifically for the CC2674R10 and
should be addressed from a SysConfig Editor.

1. Pins will need to be reconfigured as such:

| SysConfig pin name | R10 `PinMux` |
| ------------------ | ------------ |
| UART_RX | `DIO_2` |
| UART_TX | `DIO_3` |
| CONFIG_BTN_LEFT | `DIO_13` |
| CONFIG_BTN_RIGHT | `DIO_14` |
| CONFIG_LED_RED | `DIO_6` |
| CONFIG_LED_GREEN | `DIO_7` |

2. _Custom -> IEEE 802.15.4-2006, `250 kbps`, `OQPSK`, `DSSS = 1:8` -> Code
Export Configuration_, acknowledge and dismiss the PA radio setup error
3. _Custom -> IEEE 802.15.4-2006, `250 kbps`, `OQPSK`, `DSSS = 1:8` -> RF
Command Symbols_, change `CMD_RADIO_SETUP` from `RF_cmdRadioSetup` to
`RF_cmdIeeeRadioSetup` and add the following functions from the drop-down:
`CMD_TX_TEST`,`CMD_IEEE_ED_SCAN`, `CMD_IEEE_CSMA`, and `CMD_IEEE_RX_ACK`.
# Running Matter Examples on the TI SimpleLink CC2674P10 and CC2674R10

The existing Matter project examples are based on LP_EM_CC1354P10_6. If using
the CC2674P10, the following migration steps are required. Developers are
strongly encouraged to start with a `cc13x4_26x4` example and migrate the
project accordingly. Example projects can be found in the following location:
`matter/examples/[application]/cc13x4_26x4`

## Dependencies

The following must be installed on your system before proceeding:

- [SysConfig](https://www.ti.com/tool/SYSCONFIG) v1.16.2 or later
- [SIMPLELINK-LOWPOWER-F2-SDK](https://www.ti.com/tool/SIMPLELINK-LOWPOWER-SDK)
v7.10.01.24

## Matter source code changes

The following are changes to the Matter source code files which should be
applied to convert a `matter/examples/[application]/cc13x4_26x4` project to the
CC2674P10 device

- `examples/[application]/cc13x4_26x4/args.gni`, modify/add the following
defines for the CC2674
- `ti_simplelink_board = CC2674`
- `ti_simplelink_device = CC2674P10RGZ`
- `third_party/ti_simplelink_sdk/repo_cc13xx_cc26xx`, replace this folder
contents with the 7.10.01.24 version from
[TI's downloads page](https://www.ti.com/tool/download/SIMPLELINK-LOWPOWER-F2-SDK/7.10.01.24)
which is required to add support SDK for the CC2674P10 device.

## Configuring `chip.syscfg` in the SysConfig GUI

1. To open `matter/examples/[application]/cc13x4_26x4/chip.syscfg` in the GUI,
add the following line to the top of the file:

```
// @cliArgs --product <path to SDK>/.metadata/product.json --board /ti/boards/LP_EM_CC1354P10_6 --rtos freertos
```

2. Open the `syscfg` file using the standalone Sysconfig GUI
(`sysconfig_gui.sh`) from the SysConfig installation folder.
3. Click on _Show Device View_ and then click _Switch_.
4. Select _Board_ as _None_ and _Device_ as _`CC2674P10RGZ`_, Unselect
_`Lock PinMux`_, and click _Confirm_.
5. To fix errors, make the following module changes:
- _RF Design_ and _RF Stacks -> BLE -> Radio_: click on _accepting the
current value_, which should be _`LP_CC2674P10_RGZ`_ in the drop down menu
for _Based On RF Design_
- _TI DEVICES -> Device Configuration_: Clear
_`XOSC Cap Array Modification`_
- _TI DRIVERS -> RF_: Set _Global Event Mask_ as _None_ and _No. of Antenna
Switch Control Pins_ as _0_
- _TI DRIVERS -> UART2 -> `PinMux`_: Set _UART Peripheral_ to _UART0_, _TX
Pin_ to _`DIO_13/19`_, and _RX Pin_ to _`DIO_12/18`_
- _TI DRIVERS APPS -> Button_: Set _`PinMux`_ of _CONFIG_BTN_LEFT_ to
_`DIO_15`_ and _CONFIG_BTN_RIGHT_ to _`DIO_14`_
- _TI DRIVERS APPS -> LED_: Set _`PinMux`_ of _CONFIG_LED_RED_ to _`DIO_6`_
and _CONFIG_LED_RIGHT_ to _`DIO_7`_
6. Save the SysConfig file (click on _Save As_) and ensure the file name matches
the reference from `BUILD.gn` (default project name is `chip.syscfg`).
7. Open the new SysConfig file with a text editor and remove the generated
arguments.
```
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --device "CC2674P10RGZ" --package "RGZ" --part "Default" --rtos "freertos" --product "simplelink_cc13xx_cc26xx_sdk@7.10.01.24"
* @versions {"tool":"1.18.0+3130"}
*/
```
8. Move the `*.syscfg` file into the
`matter/examples/[application]/cc13x4_26x4/` folder. Make sure that the
`args.gni` parameters are aligned for the `CC2674P10RGZ` as detailed above,
and build the example using the `README.md` instructions.

## Modifications required for the CC2674R10

After applying all items in the "Configuring `chip.syscfg` in the SysConfig GUI"
section, additional steps must also be applied to generate Matter project for
the CC2674R10.

- `examples/[application]/cc13x4_26x4/args.gni` should have
`ti_simplelink_board` as `CC2674` and `ti_simplelink_device = CC2674R10RGZ`.
- `examples/[application]/cc13x4_26x4/chip.syscfg` opened with a Text Editor
should change `ble.radioConfig.codeExportConfig.$name` to
`ti_devices_radioconfig_code_export_param2` and `ble.rfDesign` to
`LP_EM_CC1354P10_1`

Furthermore, the subsequent changes apply specifically for the CC2674R10 and
should be addressed from a SysConfig Editor.

1. Pins will need to be reconfigured as such:

| SysConfig pin name | R10 `PinMux` |
| ------------------ | ------------ |
| UART_RX | `DIO_2` |
| UART_TX | `DIO_3` |
| CONFIG_BTN_LEFT | `DIO_13` |
| CONFIG_BTN_RIGHT | `DIO_14` |
| CONFIG_LED_RED | `DIO_6` |
| CONFIG_LED_GREEN | `DIO_7` |

2. _Custom -> IEEE 802.15.4-2006, `250 kbps`, `OQPSK`, `DSSS = 1:8` -> Code
Export Configuration_, acknowledge and dismiss the PA radio setup error
3. _Custom -> IEEE 802.15.4-2006, `250 kbps`, `OQPSK`, `DSSS = 1:8` -> RF
Command Symbols_, change `CMD_RADIO_SETUP` from `RF_cmdRadioSetup` to
`RF_cmdIeeeRadioSetup` and add the following functions from the drop-down:
`CMD_TX_TEST`,`CMD_IEEE_ED_SCAN`, `CMD_IEEE_CSMA`, and `CMD_IEEE_RX_ACK`.

## Building examples for the CC1354P10-1

To migrate the CC1354P10-6 examples to the CC1354P10-1 platform, there are only
two steps:

1. `examples/[application]/cc13x4_26x4/args.gni` should have
`ti_simplelink_board` as `CC1354P10-1`
2. `examples/[application]/cc13x4_26x4/chip.syscfg` opened with a Text Editor
should change `ble.radioConfig.codeExportConfig.$name` to
`ti_devices_radioconfig_code_export_param2` and `ble.rfDesign` to
`LP_EM_CC1354P10_1`

After this, the example's `README.md` instructions can be followed to produce
the executable needed.
Original file line number Diff line number Diff line change
Expand Up @@ -7204,9 +7204,9 @@ endpoint 1 {
}

server cluster FlowMeasurement {
ram attribute measuredValue;
ram attribute minMeasuredValue;
ram attribute maxMeasuredValue;
ram attribute measuredValue default = 5;
ram attribute minMeasuredValue default = 0;
ram attribute maxMeasuredValue default = 100;
ram attribute tolerance default = 0;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23526,7 +23526,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": "5",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand All @@ -23542,7 +23542,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": "0",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand All @@ -23558,7 +23558,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": "100",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand Down Expand Up @@ -35392,5 +35392,6 @@
"endpointId": 65534,
"networkId": 0
}
]
],
"log": []
}
2 changes: 1 addition & 1 deletion examples/java-matter-controller/Manifest.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Main-Class: com.matter.controller.MainKt
Class-Path: ../lib/third_party/connectedhomeip/src/controller/java/CHIPController.jar ../lib/third_party/connectedhomeip/src/setup_payload/java/OnboardingPayload.jar ../lib/third_party/connectedhomeip/third_party/java_deps/stub_src/Android.jar ../lib/third_party/connectedhomeip/third_party/java_deps/json-20220924.jar ../lib/third_party/connectedhomeip/third_party/java_deps/jsr305-3.0.2.jar ../lib/third_party/connectedhomeip/third_party/java_deps/kotlin-stdlib-1.8.10.jar
Class-Path: ../lib/third_party/connectedhomeip/src/controller/java/CHIPController.jar ../lib/third_party/connectedhomeip/src/setup_payload/java/OnboardingPayload.jar ../lib/third_party/connectedhomeip/third_party/java_deps/stub_src/Android.jar ../lib/third_party/connectedhomeip/third_party/java_deps/json-20220924.jar ../lib/third_party/connectedhomeip/third_party/java_deps/jsr305-3.0.2.jar ../lib/third_party/connectedhomeip/third_party/java_deps/kotlin-stdlib-1.8.20.jar

12 changes: 12 additions & 0 deletions examples/platform/silabs/display/lcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
#include "dmd.h"
#include "glib.h"

#if (SIWX_917)
#include "rsi_chip.h"
#endif

#ifdef QR_CODE_ENABLED
#include "qrcodegen.h"
#endif // QR_CODE_ENABLED
Expand All @@ -38,6 +42,7 @@
#define QR_CODE_VERSION 4
#define QR_CODE_MODULE_SIZE 3
#define QR_CODE_BORDER_SIZE 0
#define SL_BOARD_ENABLE_DISPLAY_PIN 0

#ifdef QR_CODE_ENABLED
static uint8_t qrCode[qrcodegen_BUFFER_LEN_FOR_VERSION(QR_CODE_VERSION)];
Expand All @@ -64,12 +69,19 @@ CHIP_ERROR SilabsLCD::Init(uint8_t * name, bool initialState)
}

/* Enable the memory lcd */
#if (SIWX_917)
RSI_NPSSGPIO_InputBufferEn(SL_BOARD_ENABLE_DISPLAY_PIN, 1U);
RSI_NPSSGPIO_SetPinMux(SL_BOARD_ENABLE_DISPLAY_PIN, 0);
RSI_NPSSGPIO_SetDir(SL_BOARD_ENABLE_DISPLAY_PIN, 0);
RSI_NPSSGPIO_SetPin(SL_BOARD_ENABLE_DISPLAY_PIN, 1U);
#else
status = sl_board_enable_display();
if (status != SL_STATUS_OK)
{
SILABS_LOG("Board Display enable fail %d", status);
err = CHIP_ERROR_INTERNAL;
}
#endif

/* Initialize the DMD module for the DISPLAY device driver. */
status = DMD_init(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,22 @@ typedef struct
(sl_pin_t) { .port = gpioPort##port_id, .pin = pin_id }

#define PACKET_PENDING_INT_PRI 3

#if defined(EFR32MG24_BRD4186C) || defined(BRD4186C)
#if defined(EFR32MG12_BRD4161A) || defined(BRD4161A) || defined(EFR32MG12_BRD4162A) || defined(BRD4162A) || \
defined(EFR32MG12_BRD4163A) || defined(BRD4163A) || defined(EFR32MG12_BRD4164A) || defined(BRD4164A) || \
defined(EFR32MG12_BRD4170A) || defined(BRD4170A)
// BRD4161-63-64 are pin to pin compatible for SPI
#include "brd4161a.h"
#elif defined(EFR32MG24_BRD4186C) || defined(BRD4186C)
#include "brd4186c.h"
#elif defined(EFR32MG24_BRD4187C) || defined(BRD4187C)
#include "brd4187c.h"
#else
#error "Need SPI Pins"
#endif /* EFR32MG12_BRD4161A */
#if EXP_BOARD && (defined(EFR32MG24_BRD4187C) || defined(BRD4187C) || defined(EFR32MG24_BRD4186C) || defined(BRD4186C))
#endif
#if EXP_BOARD
#define RESET_PIN PIN(A, 6)
#define INTERRUPT_PIN PIN(A, 7)
#define SLEEP_CONFIRM_PIN PIN(A, 5) /* Exp hdr 7 */
#define SL_WFX_HOST_PINOUT_SPI_IRQ 5
#endif

#define NETWORK_INTERFACE_VALID(x) (x == SL_NET_DEFAULT_WIFI_CLIENT_INTERFACE) || (x == SL_NET_DEFAULT_WIFI_AP_INTERFACE)
Expand Down
Loading

0 comments on commit 8d27dd5

Please sign in to comment.