Skip to content

Commit 790aac0

Browse files
Fixes Matter AWS connection stability issues (#567)
1 parent e0d55e2 commit 790aac0

File tree

8 files changed

+22
-8
lines changed

8 files changed

+22
-8
lines changed

examples/platform/silabs/matter_aws/matter_aws_interface/include/MatterAws.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @file
3-
* @brief Matter abstraction layer for Direct Internet Connectivity.
3+
* @brief Matter abstraction layer for AWS
44
*******************************************************************************
55
* # License
66
* <b>Copyright 2023 Silicon Laboratories Inc.

examples/platform/silabs/matter_aws/matter_aws_interface/include/MatterAwsConfig.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
#ifndef __MATTER_AWS_CONFIG_H
2222
#define __MATTER_AWS_CONFIG_H
2323

24+
#include "cmsis_os2.h"
25+
2426
/* Instance configuration */
2527

2628
#ifndef SL_MATTER_AWS_NVM_EMBED_CERT
@@ -30,7 +32,7 @@
3032
/* Task Configuration */
3133
#define MATTER_AWS_TASK_NAME "MATTER_AWS"
3234
#define MATTER_AWS_TASK_STACK_SIZE (2 * 1024) // 2k
33-
#define MATTER_AWS_TASK_PRIORITY (5)
35+
#define MATTER_AWS_TASK_PRIORITY (osPriorityAboveNormal)
3436

3537
/* Network Configuration */
3638
#define MATTER_AWS_SERVER_HOST ""

examples/platform/silabs/matter_aws/matter_aws_interface/src/MatterAws.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @file
3-
* @brief Matter abstraction layer for Direct Internet Connectivity.
3+
* @brief Matter abstraction layer for AWS.
44
*******************************************************************************
55
* # License
66
* <b>Copyright 2020 Silicon Laboratories Inc.

src/lwip/silabs/lwipopts-rs911x.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,17 @@
6767
#define TCP_QUEUE_OOSEQ 0
6868
#define ARP_QUEUEING (0)
6969
#define TCPIP_THREAD_NAME "LWIP"
70+
#define TCPIP_THREAD_PRIO osPriorityAboveNormal
7071

7172
#define LWIP_SOCKET 0
7273

7374
#ifdef SL_MATTER_ENABLE_AWS
7475
#define LWIP_DNS 1
7576
#define DNS_RAND_TXID() ((u32_t) rand())
7677
#define TCP_MSS (4 * 1152)
77-
#define TCPIP_THREAD_PRIO osPriorityRealtime7
7878
#else
7979
#define LWIP_DNS 0
8080
#define TCP_MSS (1152)
81-
#define TCPIP_THREAD_PRIO osPriorityAboveNormal
8281
#endif /* SL_MATTER_ENABLE_AWS */
8382

8483
#define LWIP_FREERTOS_USE_STATIC_TCPIP_TASK 1

src/lwip/silabs/lwipopts-wf200.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
#define TCP_QUEUE_OOSEQ 0
6868
#define ARP_QUEUEING (0)
6969
#define TCPIP_THREAD_NAME "LWIP"
70+
#define TCPIP_THREAD_PRIO osPriorityAboveNormal
7071

7172
#define LWIP_SOCKET 0
7273

@@ -76,12 +77,11 @@
7677
#define MEM_SIZE 5632
7778
#define MEMP_NUM_UDP_PCB (6)
7879
#define TCP_MSS (4 * 1152)
79-
#define TCPIP_THREAD_PRIO osPriorityHigh7
8080
#else
8181
#define LWIP_DNS 0
8282
#define MEMP_NUM_UDP_PCB (5)
8383
#define TCP_MSS (1152)
84-
#define TCPIP_THREAD_PRIO osPriorityAboveNormal
84+
8585
#endif // SL_MATTER_ENABLE_AWS
8686

8787
#define LWIP_FREERTOS_USE_STATIC_TCPIP_TASK 1

src/platform/silabs/SiWx917/siwx917-chip-mbedtls-config.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
// MATTER AWS Specific Configurations
3030
#ifdef SL_MATTER_ENABLE_AWS
3131

32+
#ifndef MBEDTLS_MPI_MAX_SIZE
3233
#define MBEDTLS_MPI_MAX_SIZE 512
34+
#endif // MBEDTLS_MPI_MAX_SIZE
3335

3436
#define MBEDTLS_CIPHER_MODE_CBC
3537
#define MBEDTLS_CIPHER_MODE_WITH_PADDING
@@ -38,9 +40,18 @@
3840
#define MBEDTLS_RSA_C
3941
#define MBEDTLS_RSA_NO_CRT
4042
#define MBEDTLS_SHA1_C
43+
44+
#ifndef MBEDTLS_SSL_IN_CONTENT_LEN
4145
#define MBEDTLS_SSL_IN_CONTENT_LEN 5120
46+
#endif // MBEDTLS_SSL_IN_CONTENT_LEN
47+
48+
#ifndef MBEDTLS_SSL_MAX_CONTENT_LEN
4249
#define MBEDTLS_SSL_MAX_CONTENT_LEN 5120
50+
#endif // MBEDTLS_SSL_MAX_CONTENT_LEN
51+
52+
#ifndef MBEDTLS_SSL_OUT_CONTENT_LEN
4353
#define MBEDTLS_SSL_OUT_CONTENT_LEN 1560
54+
#endif // MBEDTLS_SSL_OUT_CONTENT_LEN
4455

4556
#define MBEDTLS_DEBUG_C
4657
#define MBEDTLS_X509_USE_C

third_party/silabs/mqtt/mqtt_transport_interface/include/altcp_tls_mbedtls_opts.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252

5353
/** Configure debug level of this file */
5454
#ifndef ALTCP_MBEDTLS_DEBUG
55-
#define ALTCP_MBEDTLS_DEBUG 4
55+
#define ALTCP_MBEDTLS_DEBUG 0
5656
#endif
5757

5858
/** Set a session timeout in seconds for the basic session cache

third_party/silabs/mqtt/mqtt_transport_interface/src/altcp_tls_mbedtls.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,6 +1161,8 @@ static int altcp_mbedtls_bio_send(void *ctx, const unsigned char *dataptr, size_
11611161
return MBEDTLS_ERR_NET_SEND_FAILED;
11621162
}
11631163
}
1164+
// Send data immediately after write to avoid queuing
1165+
altcp_output(conn->inner_conn);
11641166
return written;
11651167
}
11661168

0 commit comments

Comments
 (0)