Skip to content

Commit

Permalink
[STM32] update stm32 platform with xcubematter v1.0.3 (#33240)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
3 people authored and pull[bot] committed Dec 3, 2024
1 parent 80ead2e commit 1274968
Show file tree
Hide file tree
Showing 70 changed files with 4,967 additions and 1,644 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/examples-stm32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
uses: ./.github/actions/checkout-submodules-and-bootstrap
with:
platform: stm32

extra-submodule-parameters: --recursive
- name: Set up environment for size reports
uses: ./.github/actions/setup-size-reports
if: ${{ !env.ACT }}
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@
[submodule "third_party/st/STM32CubeWB"]
path = third_party/st/STM32CubeWB
url = https://github.com/STMicroelectronics/STM32CubeWB.git
branch = v1.17.0
branch = v1.18.0
platforms = stm32
[submodule "p6/lwip-network-interface-integration"]
path = third_party/infineon/psoc6/psoc6_sdk/libs/lwip-network-interface-integration
Expand Down
36 changes: 19 additions & 17 deletions examples/lighting-app/stm32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,22 @@ if (stm32_board == "STM32WB5MM-DK") {
}

stm32_sdk("sdk") {
if (stm32_board == "STM32WB5MM-DK") {
sources = [
"${examples_plat_dir}/config_files/STM32WB5/FreeRTOSConfig.h",
"${examples_plat_dir}/config_files/STM32WB5/matter_config.h",
"${stm32_project_dir}/include/STM32WB5/CHIPProjectConfig.h",
]
}

include_dirs = [
"${chip_root}/src/platform/stm32",
"${examples_plat_dir}",
"${stm32_project_dir}/include/STM32WB5",
"${chip_root}/src/lib",
]

if (stm32_board == "STM32WB5MM-DK") {
sources = [
"${examples_plat_dir}/config_files/STM32WB5/FreeRTOSConfig.h",
"${examples_plat_dir}/config_files/STM32WB5/matter_config.h",
"${stm32_project_dir}/include/STM32WB5/CHIPProjectConfig.h",
]

include_dirs += [
"${stm32_project_dir}/include/STM32WB5",
"${examples_plat_dir}/config_files/STM32WB5",
"${chip_root}/src/include",
]
}
Expand Down Expand Up @@ -100,25 +98,29 @@ stm32_executable("lighting_app") {
"${stm32_board_src}/STM32_WPAN/App/app_matter.c",
"${stm32_board_src}/STM32_WPAN/App/app_thread.c",
"${stm32_board_src}/STM32_WPAN/App/custom_stm.c",

#"${stm32_board_src}/STM32_WPAN/Target/hw_ipcc.c",
"${stm32_board_src}/Src/app_entry.cpp",
"${stm32_board_src}/Src/main.cpp",
"${stm32_board_src}/Src/ota.cpp",
"src/STM32WB5/AppTask.cpp",
"src/STM32WB5/IdentifierEffect.cpp",
"src/STM32WB5/LightingManager.cpp",
"src/STM32WB5/ZclCallbacks.cpp",
]

deps = [
":sdk",
"${chip_root}/examples/lighting-app/lighting-common",
"${chip_root}/examples/providers:device_info_provider",
"${chip_root}/src/lib",
"${chip_root}/src/setup_payload",
]
}

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

deps = [
":sdk",
"${chip_root}/examples/lighting-app/lighting-common",
"${chip_root}/examples/providers:device_info_provider",
"${chip_root}/src/lib",
"${chip_root}/src/setup_payload",
]

defines += [
"DEBUG",
"USE_HAL_DRIVER",
Expand Down
4 changes: 3 additions & 1 deletion examples/lighting-app/stm32/include/STM32WB5/AppTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "LightingManager.h"
#include "app_entry.h"

#include <DeviceInfoProviderImpl.h>
#include <platform/CHIPDeviceLayer.h>
#include <platform/stm32/FactoryDataProvider.h>
#define APP_NAME "Lighting-app"
Expand Down Expand Up @@ -55,9 +56,10 @@ class AppTask
static void FunctionHandler(AppEvent * aEvent);
static void LightingActionEventHandler(AppEvent * aEvent);
static void TimerEventHandler(TimerHandle_t xTimer);
static void DelayNvmHandler(TimerHandle_t xTimer);
static void MatterEventHandler(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg);
#if (OTA_SUPPORT == 0)
static void UpdateLCD(void);
#endif
static void UpdateNvmEventHandler(AppEvent * aEvent);

enum Function_t
Expand Down
42 changes: 40 additions & 2 deletions examples/lighting-app/stm32/include/STM32WB5/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,26 @@
*/
#ifndef CHIPPROJECTCONFIG_H
#define CHIPPROJECTCONFIG_H
#include "app_conf.h"

// Use a default pairing code if one hasn't been provisioned in flash.
#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021
#endif

#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00
#endif

// Use a default pairing code if one hasn't been provisioned in flash.
#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS"

// For convenience, Chip Security Test Mode can be enabled and the
// requirement for authentication in various protocols can be disabled.
//
// WARNING: These options make it possible to circumvent basic Chip security functionality,
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
*
Expand Down Expand Up @@ -73,6 +83,25 @@
*/
#define CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC 0

/**
* CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY
*
* Enables the use of a hard-coded default Chip device id and credentials if no device id
* is found in Chip NV storage.
*
* This option is for testing only and should be disabled in production releases.
*/
#define CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY 34

// For convenience, enable Chip Security Test Mode and disable the requirement for
// authentication in various protocols.
//
// WARNING: These options make it possible to circumvent basic Chip security functionality,
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING
*
Expand All @@ -84,6 +113,15 @@
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "1.1"
#endif

/**
* CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION
*
* A monothonic number identifying the software version running on the device.
*/
#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION 1
#endif

/**
* CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION
*
Expand Down
15 changes: 8 additions & 7 deletions examples/lighting-app/stm32/include/STM32WB5/FreeRTOSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ extern uint32_t SystemCoreClock;
#define configUSE_RECURSIVE_MUTEXES 1
#define configUSE_COUNTING_SEMAPHORES 1
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
#define configUSE_TICKLESS_IDLE 0
#define configUSE_TICKLESS_IDLE 2
/* USER CODE BEGIN MESSAGE_BUFFER_LENGTH_TYPE */
/* Defaults to size_t for backward compatibility, but can be changed
if lengths will always be less than the number of bytes in a size_t. */
Expand Down Expand Up @@ -172,19 +172,20 @@ standard names. */
/* USER CODE BEGIN Defines */
/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */
// #define configOVERRIDE_DEFAULT_TICK_CONFIGURATION 1 /* required only for Keil but does not hurt otherwise */
#define configGENERATE_RUN_TIME_STATS 1
/*#define configGENERATE_RUN_TIME_STATS 1
#if (configGENERATE_RUN_TIME_STATS == 1)
#if( configGENERATE_RUN_TIME_STATS == 1 )
extern void RTOS_AppConfigureTimerForRuntimeStats();
extern void RTOS_AppConfigureTimerForRuntimeStats();
extern uint32_t RTOS_AppGetRuntimeCounterValueFromISR();
extern uint32_t RTOS_AppGetRuntimeCounterValueFromISR();
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() RTOS_AppConfigureTimerForRuntimeStats()
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() RTOS_AppConfigureTimerForRuntimeStats()
#define portGET_RUN_TIME_COUNTER_VALUE() RTOS_AppGetRuntimeCounterValueFromISR()
#define portGET_RUN_TIME_COUNTER_VALUE() RTOS_AppGetRuntimeCounterValueFromISR()
#endif
*/

/* USER CODE END Defines */

Expand Down
Loading

0 comments on commit 1274968

Please sign in to comment.