Skip to content

Commit

Permalink
[Silabs] DIC Changes (#28857)
Browse files Browse the repository at this point in the history
* AWS OTA Changes for SOC

* Added missing mbedtls defines and files for dic

* Restyled by gn

* Removed not required macros

---------

Co-authored-by: thirupathi <[email protected]>
Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
3 people authored and pull[bot] committed Feb 7, 2024
1 parent 9a2d904 commit 1725988
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lwip/silabs/lwipopts-rs911x.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,12 @@
#ifdef DIC_ENABLE
#define LWIP_DNS 1
#define DNS_RAND_TXID() ((u32_t) rand())
#define TCP_MSS (4 * 1152)
#define TCPIP_THREAD_PRIO (3)
#else
#define LWIP_DNS 0
#define TCP_MSS (1152)
#define TCPIP_THREAD_PRIO (2)
#endif /* DIC_ENABLE */

#define LWIP_FREERTOS_USE_STATIC_TCPIP_TASK 1
Expand Down Expand Up @@ -130,7 +134,6 @@
#define PBUF_CUSTOM_POOL_IDX_START (MEMP_PBUF_POOL_SMALL)
#define PBUF_CUSTOM_POOL_IDX_END (MEMP_PBUF_POOL_LARGE)

#define TCP_MSS (1152)
#define TCP_SND_BUF (2 * TCP_MSS)
#define TCP_LISTEN_BACKLOG (1)

Expand All @@ -140,8 +143,6 @@

#define TCPIP_THREAD_STACKSIZE (2048)

#define TCPIP_THREAD_PRIO (2)

#define NETIF_MAX_HWADDR_LEN 8U

#define LWIP_IPV6_NUM_ADDRESSES 5
Expand Down
20 changes: 20 additions & 0 deletions src/platform/silabs/efr32/efr32-chip-mbedtls-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,26 @@
#define MBEDTLS_SSL_OUT_CONTENT_LEN 1560
#define MBEDTLS_PSA_BUILTIN_ALG_TLS12_PRF
#define MBEDTLS_MPI_MAX_SIZE 512
#define MBEDTLS_CTR_DRBG_C
#define MBEDTLS_NO_PLATFORM_ENTROPY
#define MBEDTLS_ENTROPY_HARDWARE_ALT
#define MBEDTLS_SSL_TLS_C
#define MBEDTLS_SSL_CLI_C
#define MBEDTLS_SSL_PROTO_TLS1_2
#define MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
#define MBEDTLS_SSL_PROTO_DTLS
#define MBEDTLS_CIPHER_MODE_CBC
#define MBEDTLS_CCM_C
#define MBEDTLS_ECJPAKE_C
#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
#define MBEDTLS_SSL_MAX_CONTENT_LEN 768

/**
* Enable H Crypto and Entropy modules
*/
#define MBEDTLS_ECDH_C
#define MBEDTLS_ENTROPY_C

#endif // DIC_ENABLE

// Configurations necessary for ot coap cert libs
Expand Down
4 changes: 4 additions & 0 deletions third_party/silabs/SiWx917_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ template("siwx917_sdk") {
defines += [ "DIC_ENABLE=1" ]
}

if (aws_sdk_ota) {
defines += [ "ENABLE_AWS_OTA_FEAT=1" ]
}

libs += [ "${sdk_support_root}/platform/emdrv/nvm3/lib/libnvm3_CM4_gcc.a" ]

cflags = []
Expand Down
4 changes: 4 additions & 0 deletions third_party/silabs/efr32_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,10 @@ template("efr32_sdk") {
if (enable_dic) {
sources += [
"${chip_root}/third_party/silabs/mqtt/stack/mqtt.c",
"${efr32_sdk_root}/util/third_party/mbedtls/library/ctr_drbg.c",
"${efr32_sdk_root}/util/third_party/mbedtls/library/entropy.c",
"${efr32_sdk_root}/util/third_party/mbedtls/library/entropy_poll.c",
"${efr32_sdk_root}/util/third_party/mbedtls/library/rsa.c",
"${efr32_sdk_root}/util/third_party/mbedtls/library/rsa_alt_helpers.c",
]
}
Expand Down

0 comments on commit 1725988

Please sign in to comment.