This tutorial is based on SiSDK2024.12.x The full project is located here
You can also get a .sls file of the project here and a executable for BRD4186C here
This example is considered to be EXPERIMENTAL QUALITY which implies that the code provided in the guide has not been formally tested and is provided as-is
The PSA User Maximum Open Keys Count value of Platform->Security->PSA Crypto->Configuration component should be increased to 8:
Two files located under protocol/openthread/platform-abstraction/efr32/ needs to be modified. The two modified files and the associated diff file can be found there:
The following files in the openthread SDK needs to be modified. At the time being these modifications are either already merged or under merging in the OpenThread official repository.
Add the otInstanceGetIdx() function:
Fix index computation in multi-instances context:
Modifies key storage method in order to store different security contexts:
The diff file of all these above modifications can be accessed here
The Matter application uses a first Thread instance. The proprietary application is running COAP on top of a second thread instance. This is how the two Thread instances are declared:
/* otInstanceInitSingle is used by the Matter framework to declare the first
* Thread instance. However when OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE is
* defined, this function is not defined anymore and we provide here an
* alternate definition.
*/
otInstance *otInstanceInitSingle(void)
{
return otInstanceInitMultiple(0);
}
void ProprietaryThreadTaskMain(void * pvParameter)
{
OT_UNUSED_VARIABLE(pvParameter);
const TickType_t xDelay = 50;
myOtInstance = otInstanceInitMultiple(1);
OT_ASSERT(myOtInstance!= NULL);
/* Move CLI to Proprietary Thread instance */
otAppCliInit(myOtInstance);
while (!otSysPseudoResetWasRequested())
{
// Acquire mutex for stack access
sl_ot_rtos_acquire_stack_mutex();
// Process callbacks and tasklets
otSysProcessDrivers(myOtInstance);
otTaskletsProcess(myOtInstance);
// Release the stack mutex
sl_ot_rtos_release_stack_mutex();
vTaskDelay( xDelay );
}
}
The second Thread instance can receive and send COAP message as described in the following COAP example. The whole application file is located here
In this example the COAP ressource has been linked to the Matter OnOff attribute. In that way, both Matter and COAP interfaces can drive the light of the example. This implies some modifications to the basic Matter Light example like the creation of an additionnal event tied to COAP interface that can trigger the light. The two modified files are and the associated diff files are provided here:
At this point you can compile the example and flash it to the BRD4186C. Don't forget to add a bootloader in addition to this application.