Skip to content

Commit bd2e2b9

Browse files
STYoannZamaronrestyled-commitsandy31415
authored
[STM32] update stm32 platform with xcubematter v1.0.3 (project-chip#33240)
* update stm32 submodule to v1.18.0 * update stm32 files from xcubev1.0.3 * update matter version * convert dostounix files * Restyled by whitespace * Restyled by clang-format * Restyled by gn * add recursive for stm32 submodule * remove flash-driver * typo fix and add back shutdown features and remove unused define with lp * Restyled by clang-format --------- Co-authored-by: Restyled.io <commits@restyled.io> Co-authored-by: Andrei Litvin <andy314@gmail.com>
1 parent 70dc5a8 commit bd2e2b9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+4967
-1644
lines changed

.github/workflows/examples-stm32.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
uses: ./.github/actions/checkout-submodules-and-bootstrap
5151
with:
5252
platform: stm32
53-
53+
extra-submodule-parameters: --recursive
5454
- name: Set up environment for size reports
5555
uses: ./.github/actions/setup-size-reports
5656
if: ${{ !env.ACT }}

.gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@
313313
[submodule "third_party/st/STM32CubeWB"]
314314
path = third_party/st/STM32CubeWB
315315
url = https://github.com/STMicroelectronics/STM32CubeWB.git
316-
branch = v1.17.0
316+
branch = v1.18.0
317317
platforms = stm32
318318
[submodule "p6/lwip-network-interface-integration"]
319319
path = third_party/infineon/psoc6/psoc6_sdk/libs/lwip-network-interface-integration

examples/lighting-app/stm32/BUILD.gn

+19-17
Original file line numberDiff line numberDiff line change
@@ -54,24 +54,22 @@ if (stm32_board == "STM32WB5MM-DK") {
5454
}
5555

5656
stm32_sdk("sdk") {
57-
if (stm32_board == "STM32WB5MM-DK") {
58-
sources = [
59-
"${examples_plat_dir}/config_files/STM32WB5/FreeRTOSConfig.h",
60-
"${examples_plat_dir}/config_files/STM32WB5/matter_config.h",
61-
"${stm32_project_dir}/include/STM32WB5/CHIPProjectConfig.h",
62-
]
63-
}
64-
6557
include_dirs = [
6658
"${chip_root}/src/platform/stm32",
6759
"${examples_plat_dir}",
60+
"${stm32_project_dir}/include/STM32WB5",
6861
"${chip_root}/src/lib",
6962
]
7063

7164
if (stm32_board == "STM32WB5MM-DK") {
65+
sources = [
66+
"${examples_plat_dir}/config_files/STM32WB5/FreeRTOSConfig.h",
67+
"${examples_plat_dir}/config_files/STM32WB5/matter_config.h",
68+
"${stm32_project_dir}/include/STM32WB5/CHIPProjectConfig.h",
69+
]
70+
7271
include_dirs += [
7372
"${stm32_project_dir}/include/STM32WB5",
74-
"${examples_plat_dir}/config_files/STM32WB5",
7573
"${chip_root}/src/include",
7674
]
7775
}
@@ -100,25 +98,29 @@ stm32_executable("lighting_app") {
10098
"${stm32_board_src}/STM32_WPAN/App/app_matter.c",
10199
"${stm32_board_src}/STM32_WPAN/App/app_thread.c",
102100
"${stm32_board_src}/STM32_WPAN/App/custom_stm.c",
101+
102+
#"${stm32_board_src}/STM32_WPAN/Target/hw_ipcc.c",
103103
"${stm32_board_src}/Src/app_entry.cpp",
104104
"${stm32_board_src}/Src/main.cpp",
105+
"${stm32_board_src}/Src/ota.cpp",
105106
"src/STM32WB5/AppTask.cpp",
107+
"src/STM32WB5/IdentifierEffect.cpp",
106108
"src/STM32WB5/LightingManager.cpp",
107109
"src/STM32WB5/ZclCallbacks.cpp",
108110
]
111+
112+
deps = [
113+
":sdk",
114+
"${chip_root}/examples/lighting-app/lighting-common",
115+
"${chip_root}/examples/providers:device_info_provider",
116+
"${chip_root}/src/lib",
117+
"${chip_root}/src/setup_payload",
118+
]
109119
}
110120

111121
# Add the startup file to the target
112122
sources += [ "${examples_plat_dir}/startup_files/startup_${stm32_mcu}.s" ]
113123

114-
deps = [
115-
":sdk",
116-
"${chip_root}/examples/lighting-app/lighting-common",
117-
"${chip_root}/examples/providers:device_info_provider",
118-
"${chip_root}/src/lib",
119-
"${chip_root}/src/setup_payload",
120-
]
121-
122124
defines += [
123125
"DEBUG",
124126
"USE_HAL_DRIVER",

examples/lighting-app/stm32/include/STM32WB5/AppTask.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "LightingManager.h"
2727
#include "app_entry.h"
2828

29+
#include <DeviceInfoProviderImpl.h>
2930
#include <platform/CHIPDeviceLayer.h>
3031
#include <platform/stm32/FactoryDataProvider.h>
3132
#define APP_NAME "Lighting-app"
@@ -55,9 +56,10 @@ class AppTask
5556
static void FunctionHandler(AppEvent * aEvent);
5657
static void LightingActionEventHandler(AppEvent * aEvent);
5758
static void TimerEventHandler(TimerHandle_t xTimer);
58-
static void DelayNvmHandler(TimerHandle_t xTimer);
5959
static void MatterEventHandler(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg);
60+
#if (OTA_SUPPORT == 0)
6061
static void UpdateLCD(void);
62+
#endif
6163
static void UpdateNvmEventHandler(AppEvent * aEvent);
6264

6365
enum Function_t

examples/lighting-app/stm32/include/STM32WB5/CHIPProjectConfig.h

+40-2
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,26 @@
2323
*/
2424
#ifndef CHIPPROJECTCONFIG_H
2525
#define CHIPPROJECTCONFIG_H
26+
#include "app_conf.h"
2627

2728
// Use a default pairing code if one hasn't been provisioned in flash.
28-
#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE
2929
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021
30-
#endif
3130

3231
#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR
3332
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00
3433
#endif
3534

35+
// Use a default pairing code if one hasn't been provisioned in flash.
36+
#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS"
37+
38+
// For convenience, Chip Security Test Mode can be enabled and the
39+
// requirement for authentication in various protocols can be disabled.
40+
//
41+
// WARNING: These options make it possible to circumvent basic Chip security functionality,
42+
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
43+
//
44+
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
45+
3646
/**
3747
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
3848
*
@@ -73,6 +83,25 @@
7383
*/
7484
#define CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC 0
7585

86+
/**
87+
* CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY
88+
*
89+
* Enables the use of a hard-coded default Chip device id and credentials if no device id
90+
* is found in Chip NV storage.
91+
*
92+
* This option is for testing only and should be disabled in production releases.
93+
*/
94+
#define CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY 34
95+
96+
// For convenience, enable Chip Security Test Mode and disable the requirement for
97+
// authentication in various protocols.
98+
//
99+
// WARNING: These options make it possible to circumvent basic Chip security functionality,
100+
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
101+
//
102+
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
103+
#define CHIP_CONFIG_REQUIRE_AUTH 1
104+
76105
/**
77106
* CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING
78107
*
@@ -84,6 +113,15 @@
84113
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "1.1"
85114
#endif
86115

116+
/**
117+
* CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION
118+
*
119+
* A monothonic number identifying the software version running on the device.
120+
*/
121+
#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION
122+
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION 1
123+
#endif
124+
87125
/**
88126
* CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION
89127
*

examples/lighting-app/stm32/include/STM32WB5/FreeRTOSConfig.h

+8-7
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ extern uint32_t SystemCoreClock;
7676
#define configUSE_RECURSIVE_MUTEXES 1
7777
#define configUSE_COUNTING_SEMAPHORES 1
7878
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
79-
#define configUSE_TICKLESS_IDLE 0
79+
#define configUSE_TICKLESS_IDLE 2
8080
/* USER CODE BEGIN MESSAGE_BUFFER_LENGTH_TYPE */
8181
/* Defaults to size_t for backward compatibility, but can be changed
8282
if lengths will always be less than the number of bytes in a size_t. */
@@ -172,19 +172,20 @@ standard names. */
172172
/* USER CODE BEGIN Defines */
173173
/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */
174174
// #define configOVERRIDE_DEFAULT_TICK_CONFIGURATION 1 /* required only for Keil but does not hurt otherwise */
175-
#define configGENERATE_RUN_TIME_STATS 1
175+
/*#define configGENERATE_RUN_TIME_STATS 1
176176
177-
#if (configGENERATE_RUN_TIME_STATS == 1)
177+
#if( configGENERATE_RUN_TIME_STATS == 1 )
178178
179-
extern void RTOS_AppConfigureTimerForRuntimeStats();
179+
extern void RTOS_AppConfigureTimerForRuntimeStats();
180180
181-
extern uint32_t RTOS_AppGetRuntimeCounterValueFromISR();
181+
extern uint32_t RTOS_AppGetRuntimeCounterValueFromISR();
182182
183-
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() RTOS_AppConfigureTimerForRuntimeStats()
183+
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() RTOS_AppConfigureTimerForRuntimeStats()
184184
185-
#define portGET_RUN_TIME_COUNTER_VALUE() RTOS_AppGetRuntimeCounterValueFromISR()
185+
#define portGET_RUN_TIME_COUNTER_VALUE() RTOS_AppGetRuntimeCounterValueFromISR()
186186
187187
#endif
188+
*/
188189

189190
/* USER CODE END Defines */
190191

0 commit comments

Comments
 (0)