Skip to content

Commit 1ad42b2

Browse files
jmartinez-silabsrcasallas-silabsrosahay-silabsmkardous-silabsbhmanda-silabs
authored
[CSA-CP]Bring GN support for sisdk2024.12.0 wifisdk 3.4.0 (#212)
Co-authored-by: Ricardo Casallas <77841255+rcasallas-silabs@users.noreply.github.com> Co-authored-by: Rohan Sahay <103027015+rosahay-silabs@users.noreply.github.com> Co-authored-by: Mathieu Kardous <84793247+mkardous-silabs@users.noreply.github.com> Co-authored-by: bhmanda-silabs <107180296+bhmanda-silabs@users.noreply.github.com>
1 parent a2845d9 commit 1ad42b2

File tree

18 files changed

+223
-86
lines changed

18 files changed

+223
-86
lines changed

.github/workflows/examples-efr32.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
if: github.actor != 'restyled-io[bot]'
4242

4343
container:
44-
image: ghcr.io/project-chip/chip-build-efr32:89
44+
image: ghcr.io/project-chip/chip-build-efr32:95
4545
volumes:
4646
- "/tmp/bloat_reports:/tmp/bloat_reports"
4747
steps:

examples/platform/silabs/efr32/BUILD.gn

+4-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,10 @@ config("efr32-common-config") {
141141
defines += [ "CHIP_DEVICE_CONFIG_ENABLE_MULTI_OTA_REQUESTOR=1" ]
142142
}
143143

144-
ldflags = [ "-Wl,--no-warn-rwx-segment" ]
144+
ldflags = [
145+
"-Wl,--no-warn-rwx-segment",
146+
"-fno-lto",
147+
]
145148
}
146149

147150
source_set("efr32-common") {

examples/platform/silabs/ldscripts/efr32mg24.ld

+29-11
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
MEMORY
3131
{
3232
FLASH (rx) : ORIGIN = 0x8006000, LENGTH = 0x178000
33-
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x40000
33+
RAM (rwx) : ORIGIN = 0x20000004, LENGTH = 0x3fffc
34+
BOOTLOADER_RESET_REGION (rwx) : ORIGIN = 0x20000000, LENGTH = 0x4
3435
}
3536

3637
ENTRY(Reset_Handler)
@@ -48,6 +49,13 @@ SECTIONS
4849
__Vectors_Size = __Vectors_End - __Vectors;
4950
__lma_ramfuncs_start__ = .;
5051
} > FLASH
52+
.bootloader_reset_section (NOLOAD):
53+
{
54+
__ResetReasonStart__ = .;
55+
. = . + 4;
56+
. = ALIGN(4);
57+
__ResetReasonEnd__ = .;
58+
} > BOOTLOADER_RESET_REGION
5159

5260
.stack (NOLOAD):
5361
{
@@ -59,31 +67,33 @@ SECTIONS
5967
PROVIDE(__stack = __StackTop);
6068
} > RAM
6169

62-
63-
.noinit (NOLOAD):
64-
{
65-
*(.noinit*);
66-
} > RAM
67-
6870
.bss :
6971
{
7072
. = ALIGN(4);
7173
__bss_start__ = .;
7274
*(SORT_BY_ALIGNMENT(.bss*))
7375
*(COMMON)
74-
. = ALIGN(4);
76+
. = ALIGN(32);
7577
__bss_end__ = .;
7678
} > RAM
7779

80+
81+
.noinit (NOLOAD):
82+
{
83+
*(.noinit*);
84+
. = ALIGN(32);
85+
} > RAM
86+
87+
7888
text_application_ram :
7989
{
80-
. = ALIGN(4);
90+
. = ALIGN(32);
8191
__vma_ramfuncs_start__ = .;
8292
__text_application_ram_start__ = .;
8393

8494
*(text_application_ram)
8595

86-
. = ALIGN(4);
96+
. = ALIGN(32);
8797
__vma_ramfuncs_end__ = .;
8898
__text_application_ram_end__ = .;
8999
} > RAM AT > FLASH
@@ -196,16 +206,24 @@ SECTIONS
196206
KEEP(*(SORT(.fini_array.*)))
197207
KEEP(*(.fini_array))
198208
PROVIDE_HIDDEN (__fini_array_end = .);
209+
. = ALIGN(4);
210+
*(SEGGER_RTT)
199211

200212
. = ALIGN(4);
201213
/* All data end */
202214
__data_end__ = .;
203215

204216
} > RAM AT > FLASH
217+
218+
219+
/* Calculate heap size based on RAM limits. */
220+
heap_limit = ORIGIN(RAM) + LENGTH(RAM); /* End of RAM */
221+
heap_size = heap_limit - __HeapBase;
205222
.memory_manager_heap (NOLOAD):
206223
{
207224
. = ALIGN(8);
208225
__HeapBase = .;
226+
. += heap_size;
209227
__end__ = .;
210228
end = __end__;
211229
_end = __end__;
@@ -214,7 +232,7 @@ SECTIONS
214232
} > RAM
215233

216234
__heap_size = __HeapLimit - __HeapBase;
217-
__ram_end__ = 0x20000000 + 0x40000;
235+
__ram_end__ = 0x20000004 + 0x3fffc;
218236
__main_flash_end__ = 0x8006000 + 0x178000;
219237

220238
/* This is where we handle flash storage blocks. We use dummy sections for finding the configured

examples/platform/silabs/ldscripts/efr32mg26.ld

+29-11
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
MEMORY
3131
{
3232
FLASH (rx) : ORIGIN = 0x8006000, LENGTH = 0x318000
33-
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x80000
33+
RAM (rwx) : ORIGIN = 0x20000004, LENGTH = 0x7fffc
34+
BOOTLOADER_RESET_REGION (rwx) : ORIGIN = 0x20000000, LENGTH = 0x4
3435
}
3536

3637
ENTRY(Reset_Handler)
@@ -48,6 +49,13 @@ SECTIONS
4849
__Vectors_Size = __Vectors_End - __Vectors;
4950
__lma_ramfuncs_start__ = .;
5051
} > FLASH
52+
.bootloader_reset_section (NOLOAD):
53+
{
54+
__ResetReasonStart__ = .;
55+
. = . + 4;
56+
. = ALIGN(4);
57+
__ResetReasonEnd__ = .;
58+
} > BOOTLOADER_RESET_REGION
5159

5260
.stack (NOLOAD):
5361
{
@@ -59,31 +67,33 @@ SECTIONS
5967
PROVIDE(__stack = __StackTop);
6068
} > RAM
6169

62-
63-
.noinit (NOLOAD):
64-
{
65-
*(.noinit*);
66-
} > RAM
67-
6870
.bss :
6971
{
7072
. = ALIGN(4);
7173
__bss_start__ = .;
7274
*(SORT_BY_ALIGNMENT(.bss*))
7375
*(COMMON)
74-
. = ALIGN(4);
76+
. = ALIGN(32);
7577
__bss_end__ = .;
7678
} > RAM
7779

80+
81+
.noinit (NOLOAD):
82+
{
83+
*(.noinit*);
84+
. = ALIGN(32);
85+
} > RAM
86+
87+
7888
text_application_ram :
7989
{
80-
. = ALIGN(4);
90+
. = ALIGN(32);
8191
__vma_ramfuncs_start__ = .;
8292
__text_application_ram_start__ = .;
8393

8494
*(text_application_ram)
8595

86-
. = ALIGN(4);
96+
. = ALIGN(32);
8797
__vma_ramfuncs_end__ = .;
8898
__text_application_ram_end__ = .;
8999
} > RAM AT > FLASH
@@ -196,16 +206,24 @@ SECTIONS
196206
KEEP(*(SORT(.fini_array.*)))
197207
KEEP(*(.fini_array))
198208
PROVIDE_HIDDEN (__fini_array_end = .);
209+
. = ALIGN(4);
210+
*(SEGGER_RTT)
199211

200212
. = ALIGN(4);
201213
/* All data end */
202214
__data_end__ = .;
203215

204216
} > RAM AT > FLASH
217+
218+
219+
/* Calculate heap size based on RAM limits. */
220+
heap_limit = ORIGIN(RAM) + LENGTH(RAM); /* End of RAM */
221+
heap_size = heap_limit - __HeapBase;
205222
.memory_manager_heap (NOLOAD):
206223
{
207224
. = ALIGN(8);
208225
__HeapBase = .;
226+
. += heap_size;
209227
__end__ = .;
210228
end = __end__;
211229
_end = __end__;
@@ -214,7 +232,7 @@ SECTIONS
214232
} > RAM
215233

216234
__heap_size = __HeapLimit - __HeapBase;
217-
__ram_end__ = 0x20000000 + 0x80000;
235+
__ram_end__ = 0x20000004 + 0x7fffc;
218236
__main_flash_end__ = 0x8006000 + 0x318000;
219237

220238
/* This is where we handle flash storage blocks. We use dummy sections for finding the configured

examples/platform/silabs/ldscripts/mgm24.ld

+29-11
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
MEMORY
3131
{
3232
FLASH (rx) : ORIGIN = 0x8006000, LENGTH = 0x178000
33-
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x40000
33+
RAM (rwx) : ORIGIN = 0x20000004, LENGTH = 0x3fffc
34+
BOOTLOADER_RESET_REGION (rwx) : ORIGIN = 0x20000000, LENGTH = 0x4
3435
}
3536

3637
ENTRY(Reset_Handler)
@@ -48,6 +49,13 @@ SECTIONS
4849
__Vectors_Size = __Vectors_End - __Vectors;
4950
__lma_ramfuncs_start__ = .;
5051
} > FLASH
52+
.bootloader_reset_section (NOLOAD):
53+
{
54+
__ResetReasonStart__ = .;
55+
. = . + 4;
56+
. = ALIGN(4);
57+
__ResetReasonEnd__ = .;
58+
} > BOOTLOADER_RESET_REGION
5159

5260
.stack (NOLOAD):
5361
{
@@ -59,31 +67,33 @@ SECTIONS
5967
PROVIDE(__stack = __StackTop);
6068
} > RAM
6169

62-
63-
.noinit (NOLOAD):
64-
{
65-
*(.noinit*);
66-
} > RAM
67-
6870
.bss :
6971
{
7072
. = ALIGN(4);
7173
__bss_start__ = .;
7274
*(SORT_BY_ALIGNMENT(.bss*))
7375
*(COMMON)
74-
. = ALIGN(4);
76+
. = ALIGN(32);
7577
__bss_end__ = .;
7678
} > RAM
7779

80+
81+
.noinit (NOLOAD):
82+
{
83+
*(.noinit*);
84+
. = ALIGN(32);
85+
} > RAM
86+
87+
7888
text_application_ram :
7989
{
80-
. = ALIGN(4);
90+
. = ALIGN(32);
8191
__vma_ramfuncs_start__ = .;
8292
__text_application_ram_start__ = .;
8393

8494
*(text_application_ram)
8595

86-
. = ALIGN(4);
96+
. = ALIGN(32);
8797
__vma_ramfuncs_end__ = .;
8898
__text_application_ram_end__ = .;
8999
} > RAM AT > FLASH
@@ -196,16 +206,24 @@ SECTIONS
196206
KEEP(*(SORT(.fini_array.*)))
197207
KEEP(*(.fini_array))
198208
PROVIDE_HIDDEN (__fini_array_end = .);
209+
. = ALIGN(4);
210+
*(SEGGER_RTT)
199211

200212
. = ALIGN(4);
201213
/* All data end */
202214
__data_end__ = .;
203215

204216
} > RAM AT > FLASH
217+
218+
219+
/* Calculate heap size based on RAM limits. */
220+
heap_limit = ORIGIN(RAM) + LENGTH(RAM); /* End of RAM */
221+
heap_size = heap_limit - __HeapBase;
205222
.memory_manager_heap (NOLOAD):
206223
{
207224
. = ALIGN(8);
208225
__HeapBase = .;
226+
. += heap_size;
209227
__end__ = .;
210228
end = __end__;
211229
_end = __end__;
@@ -214,7 +232,7 @@ SECTIONS
214232
} > RAM
215233

216234
__heap_size = __HeapLimit - __HeapBase;
217-
__ram_end__ = 0x20000000 + 0x40000;
235+
__ram_end__ = 0x20000004 + 0x3fffc;
218236
__main_flash_end__ = 0x8006000 + 0x178000;
219237

220238
/* This is where we handle flash storage blocks. We use dummy sections for finding the configured

examples/platform/silabs/matter-platform.slcp

-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ component:
7373
- {id: mbedtls_base64}
7474
- {id: ot_psa_crypto}
7575
- {id: ot_platform_abstraction}
76-
- {id: ot_rtos_wrappers_real}
7776
- {id: sl_ot_custom_cli}
7877
# Necessary componenets for ot coap cert lib
7978
# - {id: mbedtls_dtls} # Requried by COAP lib

examples/platform/silabs/provision/ProvisionStorageCustom.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
#include <ProvisionStorage.h>
1817
#include <algorithm>
1918
#include <lib/support/CodeUtils.h>
19+
#include <platform/silabs/provision/ProvisionStorage.h>
2020
#include <string.h>
2121

2222
namespace chip {

src/platform/silabs/efr32/efr32-chip-mbedtls-config.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,12 @@
8181
#define MBEDTLS_CIPHER_MODE_CBC
8282
#define MBEDTLS_CCM_C
8383
#define MBEDTLS_ECJPAKE_C
84+
#define MBEDTLS_X509_CRT_PARSE_C
8485
#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
8586
#define MBEDTLS_PK_HAVE_CURVE_SECP256R1
8687
#define MBEDTLS_PK_HAVE_JPAKE
87-
#define PSA_WANT_ALG_SOME_PAKE
88+
#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
89+
#define MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED
8890
#endif // SL_USE_COAP_CONFIG
8991

9092
#if SL_MATTER_PROVISION_FLASH

src/platform/silabs/efr32/efr32-psa-crypto-config.h

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
// Configurations necessary for ot coap cert libs
2929
#if SL_USE_COAP_CONFIG
3030
#define PSA_WANT_ALG_CBC_NO_PADDING
31+
#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC
32+
#define PSA_WANT_ALG_JPAKE
33+
#define PSA_WANT_ECC_SECP_R1_256
3134
#endif // SL_USE_COAP_CONFIG
3235

3336
// Multi-chip OTA encryption processing

src/platform/silabs/wifi/rs911x/rs9117.gni

+3-2
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ rs9117_src_sapi = [
3737
# sl_si91x_wireless component
3838
"${wifi_sdk_root}/components/device/silabs/si91x/wireless/src/sl_si91x_driver.c",
3939
"${wifi_sdk_root}/components/device/silabs/si91x/wireless/src/sl_rsi_utility.c",
40-
"${wifi_sdk_root}/components/device/silabs/si91x/wireless/src/sl_si91x_callback_framework.c",
4140
"${wifi_sdk_root}/components/device/silabs/si91x/wireless/threading/sli_si91x_multithreaded.c",
4241
"${wifi_sdk_root}/components/device/silabs/si91x/wireless/sl_net/src/sl_net_rsi_utility.c",
42+
"${wifi_sdk_root}/components/device/silabs/si91x/wireless/sl_net/src/sl_net_si91x_callback_framework.c",
4343
"${wifi_sdk_root}/components/device/silabs/si91x/wireless/sl_net/src/sl_net_si91x_integration_handler.c",
4444
"${wifi_sdk_root}/components/device/silabs/si91x/wireless/sl_net/src/sl_si91x_net_credentials.c",
4545
"${wifi_sdk_root}/components/device/silabs/si91x/wireless/ncp_interface/spi/sl_si91x_spi.c",
@@ -49,11 +49,12 @@ rs9117_src_sapi = [
4949
"${sdk_support_root}/components/service/network_manager/src/sl_net_for_lwip.c",
5050

5151
# wifi component
52+
"${wifi_sdk_root}/components/protocol/wifi/src/sl_wifi_basic_credentials.c",
5253
"${wifi_sdk_root}/components/protocol/wifi/src/sl_wifi_callback_framework.c",
5354
"${wifi_sdk_root}/components/protocol/wifi/si91x/sl_wifi.c",
5455

5556
# basic_network_manager component
56-
"${wifi_sdk_root}/components/service/network_manager/src/sl_net_basic_credentials.c",
57+
"${wifi_sdk_root}/components/service/network_manager/src/sl_net_credentials.c",
5758
"${wifi_sdk_root}/components/service/network_manager/src/sl_net_basic_profiles.c",
5859

5960
# si91x_basic_buffers component

0 commit comments

Comments
 (0)