Skip to content

Commit fa6eace

Browse files
praveenCYandy31415
authored andcommitted
[Infineon] Update PSoC6 assets to latest release (project-chip#34405)
Co-authored-by: Andrei Litvin <andy314@gmail.com>
1 parent cd2e4b4 commit fa6eace

File tree

131 files changed

+14959
-9703
lines changed

Some content is hidden

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

131 files changed

+14959
-9703
lines changed

.gitmodules

+24-17
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,6 @@
9797
path = third_party/infineon/psoc6/psoc6_sdk/libs/abstraction-rtos
9898
url = https://github.com/Infineon/abstraction-rtos
9999
platforms = infineon
100-
[submodule "p6/bluetooth-freertos"]
101-
path = third_party/infineon/psoc6/psoc6_sdk/libs/bluetooth-freertos
102-
url = https://github.com/Infineon/bluetooth-freertos
103-
branch = v2.X
104-
platforms = infineon
105100
[submodule "p6/btstack"]
106101
path = third_party/infineon/psoc6/psoc6_sdk/libs/btstack
107102
url = https://github.com/Infineon/btstack
@@ -134,10 +129,6 @@
134129
path = third_party/infineon/psoc6/psoc6_sdk/libs/mtb-pdl-cat1
135130
url = https://github.com/Infineon/mtb-pdl-cat1
136131
platforms = infineon
137-
[submodule "p6/psoc6cm0p"]
138-
path = third_party/infineon/psoc6/psoc6_sdk/libs/psoc6cm0p
139-
url = https://github.com/Infineon/psoc6cm0p
140-
platforms = infineon
141132
[submodule "p6/whd-bsp-integration"]
142133
path = third_party/infineon/psoc6/psoc6_sdk/libs/whd-bsp-integration
143134
url = https://github.com/Infineon/whd-bsp-integration
@@ -185,10 +176,6 @@
185176
[submodule "third_party/jsoncpp/repo"]
186177
path = third_party/jsoncpp/repo
187178
url = https://github.com/open-source-parsers/jsoncpp.git
188-
[submodule "third_party/p6/p6_sdk/libs/anycloud-ota"]
189-
path = third_party/infineon/psoc6/psoc6_sdk/libs/anycloud-ota
190-
url = https://github.com/Infineon/anycloud-ota
191-
platforms = infineon
192179
[submodule "third_party/mbed-mcu-boot/repo"]
193180
path = third_party/mbed-mcu-boot/repo
194181
url = https://github.com/ATmobica/mcuboot.git
@@ -312,10 +299,6 @@
312299
url = https://github.com/STMicroelectronics/STM32CubeWB.git
313300
branch = v1.18.0
314301
platforms = stm32
315-
[submodule "p6/lwip-network-interface-integration"]
316-
path = third_party/infineon/psoc6/psoc6_sdk/libs/lwip-network-interface-integration
317-
url = https://github.com/Infineon/lwip-network-interface-integration.git
318-
platforms = infineon
319302
[submodule "third_party/infineon/trustm/optiga-trust-m"]
320303
path = third_party/infineon/trustm/optiga-trust-m
321304
url = https://github.com/Infineon/optiga-trust-m.git
@@ -326,3 +309,27 @@
326309
url = https://github.com/NXP/nxp_matter_support.git
327310
branch = master
328311
platforms = nxp
312+
[submodule "third_party/infineon/psoc6/psoc6_sdk/libs/btstack-integration"]
313+
path = third_party/infineon/psoc6/psoc6_sdk/libs/btstack-integration
314+
url = https://github.com/Infineon/btstack-integration.git
315+
platforms = infineon
316+
[submodule "third_party/infineon/psoc6/psoc6_sdk/libs/cat1cm0p"]
317+
path = third_party/infineon/psoc6/psoc6_sdk/libs/cat1cm0p
318+
url = https://github.com/Infineon/cat1cm0p.git
319+
platforms = infineon
320+
[submodule "third_party/infineon/psoc6/psoc6_sdk/libs/cmsis"]
321+
path = third_party/infineon/psoc6/psoc6_sdk/libs/cmsis
322+
url = https://github.com/Infineon/cmsis.git
323+
platforms = infineon
324+
[submodule "third_party/infineon/psoc6/psoc6_sdk/libs/ota-bootloader-abstraction"]
325+
path = third_party/infineon/psoc6/psoc6_sdk/libs/ota-bootloader-abstraction
326+
url = https://github.com/Infineon/ota-bootloader-abstraction.git
327+
platforms = infineon
328+
[submodule "third_party/infineon/psoc6/psoc6_sdk/libs/ota-update"]
329+
path = third_party/infineon/psoc6/psoc6_sdk/libs/ota-update
330+
url = https://github.com/Infineon/ota-update.git
331+
platforms = infineon
332+
[submodule "third_party/infineon/psoc6/psoc6_sdk/libs/lwip-network-interface-integration"]
333+
path = third_party/infineon/psoc6/psoc6_sdk/libs/lwip-network-interface-integration
334+
url = https://github.com/Infineon/lwip-network-interface-integration.git
335+
platforms = infineon

docs/guides/infineon_psoc6_software_update.md

+10-3
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,30 @@ Infineon PSoC6 example applications by passing the
2525

2626
```
2727
$ scripts/build/build_examples.py --enable-flashbundle --target infineon-psoc6-lock-ota build
28-
$ third_party/infineon/psoc6/psoc6_sdk/ota/ota_base_build.sh out/infineon-psoc6-lock-ota chip-psoc6-lock-example
28+
$ third_party/infineon/psoc6/psoc6_sdk/ota/ota_base_build.sh psoc6-lock chip-psoc6-lock-example
2929
```
3030

3131
- Build the PSoC6 OTA Update application from the chip root dir and create OTA
3232
file
3333

3434
```
3535
$ scripts/build/build_examples.py --enable-flashbundle --no-log-timestamps --target infineon-psoc6-lock-ota-updateimage build
36-
$ third_party/infineon/psoc6/psoc6_sdk/ota/ota_update_build.sh out/infineon-psoc6-lock-ota-updateimage chip-psoc6-lock-example
36+
$ third_party/infineon/psoc6/psoc6_sdk/ota/ota_update_build.sh psoc6-lock chip-psoc6-lock-example
3737
```
3838

39-
* Additionally a pre-compiled bootloader must be flashed to the board using
39+
* Additionally a pre-compiled bootloader must be flashed to the board before
40+
flashing the application using
4041
[Cypress Programmer](https://softwaretools.infineon.com/tools/com.ifx.tb.tool.cypressprogrammer).
4142
This image can be found at:
4243

4344
$ ./third_party/infineon/psoc6/psoc6_sdk/ota/matter-psoc6-mcuboot-bootloader.hex
4445

46+
* Flash the application after putting the CY8CKIT-062S2-43012 board on
47+
KitProg3 CMSIS-DAP Mode by pressing the `MODE SELECT` button.
48+
49+
$ cd ~/connectedhomeip
50+
$ python3 out/infineon-psoc6-lock-ota/chip-psoc6-lock-example.flash.py
51+
4552
* In a terminal start the Provider app passing to it the path to the Matter
4653
OTA file created in the previous step:(output of ota_update_build step)
4754

examples/all-clusters-app/infineon/psoc6/BUILD.gn

+26-20
Original file line numberDiff line numberDiff line change
@@ -45,32 +45,38 @@ config("psoc6_ota_config") {
4545

4646
ldflags = [ "-T" + rebase_path(linker_script, root_build_dir) ]
4747

48-
ldflags += [ "-Wl,--defsym,MCUBOOT_HEADER_SIZE=0x400,--defsym,MCUBOOT_BOOTLOADER_SIZE=0x18000,--defsym,CY_BOOT_PRIMARY_1_SIZE=0x1C0000" ]
48+
ldflags += [ "-Wl,--undefined=uxTopUsedPriority -Wl,--defsym,MCUBOOT_HEADER_SIZE=0x400,--defsym,FLASH_AREA_IMG_1_PRIMARY_START=0x028000,--defsym,FLASH_AREA_IMG_1_PRIMARY_SIZE=0x1c0000" ]
4949

5050
defines = [
5151
"P6_OTA",
52-
"OTA_SUPPORT ",
53-
"OTA_USE_EXTERNAL_FLASH",
54-
"CY_BOOT_USE_EXTERNAL_FLASH",
55-
"MCUBOOT_HEADER_SIZE=0x400",
56-
"MCUBOOT_MAX_IMG_SECTORS=3584",
57-
"CY_BOOT_SCRATCH_SIZE=0x00004000",
58-
"MCUBOOT_BOOTLOADER_SIZE=0x00018000",
59-
"CY_BOOT_BOOTLOADER_SIZE=0x00018000",
60-
"CY_BOOT_PRIMARY_1_START=0x00018000",
61-
"CY_BOOT_PRIMARY_1_SIZE=0x1C0000",
62-
"CY_BOOT_SECONDARY_1_START=0x00000000",
63-
"CY_BOOT_SECONDARY_1_SIZE=0x001C0000",
64-
"CY_FLASH_ERASE_VALUE=0xFF",
52+
"COMPONENT_MCUBOOT",
53+
"CY_BOOTLOADER=MCUBOOT",
54+
"OTA_SUPPORT=1",
55+
"COMPONENT_OTA_PSOC_062",
56+
"PSOC_062_2M",
57+
"OTA_USE_EXTERNAL_FLASH=1",
58+
"ENABLE_OTA_LOGS",
59+
"ENABLE_OTA_BOOTLOADER_ABSTRACTION_LOGS",
6560
"MCUBOOT_IMAGE_NUMBER=1",
66-
"MCUBOOT_SLOT_SIZE=0x1C0000",
67-
"MCUBOOT_SCRATCH_SIZE=0x4000",
68-
"MCUBOOT_SECTOR_SIZE = 512",
61+
"MCUBOOT_MAX_IMG_SECTORS=3584",
62+
"FLASH_AREA_BOOTLOADER_DEV_ID='FLASH_DEVICE_INTERNAL_FLASH'",
63+
"FLASH_AREA_BOOTLOADER_SIZE=0x028000",
64+
"FLASH_AREA_BOOTLOADER_START=0x000000",
65+
"FLASH_AREA_IMAGE_SCRATCH_DEV_ID='FLASH_DEVICE_EXTERNAL_FLASH(CY_BOOT_EXTERNAL_DEVICE_INDEX)'",
66+
"FLASH_AREA_IMAGE_SCRATCH_SIZE=0x080000",
67+
"FLASH_AREA_IMAGE_SCRATCH_START=0x440000",
68+
"FLASH_AREA_IMAGE_SWAP_STATUS_DEV_ID='FLASH_DEVICE_INTERNAL_FLASH'",
69+
"FLASH_AREA_IMAGE_SWAP_STATUS_SIZE=0x006c00",
70+
"FLASH_AREA_IMAGE_SWAP_STATUS_START=0x1e8000",
71+
"FLASH_AREA_IMG_1_PRIMARY_DEV_ID='FLASH_DEVICE_INTERNAL_FLASH'",
72+
"FLASH_AREA_IMG_1_PRIMARY_SIZE=0x1c0000",
73+
"FLASH_AREA_IMG_1_PRIMARY_START=0x028000",
74+
"FLASH_AREA_IMG_1_SECONDARY_DEV_ID='FLASH_DEVICE_EXTERNAL_FLASH(CY_BOOT_EXTERNAL_DEVICE_INDEX)'",
75+
"FLASH_AREA_IMG_1_SECONDARY_SIZE=0x1c0000",
76+
"FLASH_AREA_IMG_1_SECONDARY_START=0x000200",
6977
"APP_VERSION_MAJOR=1",
7078
"APP_VERSION_MINOR=0",
7179
"APP_VERSION_BUILD=0",
72-
"MCUBOOT_OVERWRITE_ONLY",
73-
"CY_ENABLE_XIP_PROGRAM",
7480
]
7581

7682
if (build_update_image) {
@@ -87,7 +93,7 @@ psoc6_sdk_sources("all_clusters_app_sdk_sources") {
8793

8894
defines = [
8995
"BOARD_ID=${psoc6_board}",
90-
"P6_LOG_ENABLED=1",
96+
"PSOC6_LOG_ENABLED=1",
9197
"CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE=${setup_pin_code}",
9298
]
9399

examples/all-clusters-app/infineon/psoc6/include/AppConfig.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@
4848
#define THREAD_ACTIVE_POLLING_INTERVAL_MS 100
4949
#define THREAD_INACTIVE_POLLING_INTERVAL_MS 1000
5050

51-
// P6 Logging
51+
// PSOC6 Logging
5252
#ifdef __cplusplus
5353
extern "C" {
5454
#endif
5555

5656
void appError(int err);
57-
void P6Log(const char * aFormat, ...);
58-
#define P6_LOG(...) P6Log(__VA_ARGS__)
57+
void PSOC6Log(const char * aFormat, ...);
58+
#define PSOC6_LOG(...) PSOC6Log(__VA_ARGS__)
5959

6060
#ifdef __cplusplus
6161
}

examples/all-clusters-app/infineon/psoc6/include/AppTask.h

+4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
#include <ble/Ble.h>
3030
#include <platform/CHIPDeviceLayer.h>
3131

32+
extern "C" {
33+
#include "flash_map_backend.h"
34+
}
35+
3236
// Application-defined error codes in the CHIP_ERROR space.
3337
#define APP_ERROR_EVENT_QUEUE_FAILED CHIP_APPLICATION_ERROR(0x01)
3438
#define APP_ERROR_CREATE_TASK_FAILED CHIP_APPLICATION_ERROR(0x02)

examples/all-clusters-app/infineon/psoc6/include/CHIPProjectConfig.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@
4242
#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x8003
4343

4444
/* The ProductName attribute of the Basic cluster. */
45-
#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME "P6-CYW43012 All Clusters"
45+
#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME "PSOC6-CYW43012 All Clusters"
4646

4747
/* The HardwareVersionString attribute of the Basic cluster. */
48-
#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING "P6-43012"
48+
#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING "PSOC6-43012"
4949

5050
/* The HardwareVersion attribute of the Basic cluster. */
5151
#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION 43012

examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp

+19-18
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ CHIP_ERROR AppTask::StartAppTask()
148148
sAppEventQueue = xQueueCreateStatic(APP_EVENT_QUEUE_SIZE, sizeof(AppEvent), sAppEventQueueBuffer, &sAppEventQueueStruct);
149149
if (sAppEventQueue == NULL)
150150
{
151-
P6_LOG("Failed to allocate app event queue");
151+
PSOC6_LOG("Failed to allocate app event queue");
152152
appError(APP_ERROR_EVENT_QUEUE_FAILED);
153153
}
154154
// Start App task.
@@ -160,10 +160,10 @@ CHIP_ERROR AppTask::Init()
160160
{
161161
CHIP_ERROR err = CHIP_NO_ERROR;
162162
#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
163-
int rc = boot_set_confirmed();
163+
int rc = flash_area_boot_set_confirmed();
164164
if (rc != 0)
165165
{
166-
P6_LOG("boot_set_confirmed failed");
166+
PSOC6_LOG("flash_area_boot_set_confirmed failed");
167167
appError(CHIP_ERROR_UNINITIALIZED);
168168
}
169169
#endif
@@ -196,11 +196,11 @@ CHIP_ERROR AppTask::Init()
196196
);
197197
if (sFunctionTimer == NULL)
198198
{
199-
P6_LOG("funct timer create failed");
199+
PSOC6_LOG("funct timer create failed");
200200
appError(APP_ERROR_CREATE_TIMER_FAILED);
201201
}
202202
NetWorkCommissioningInstInit();
203-
P6_LOG("Current Software Version: %s", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING);
203+
PSOC6_LOG("Current Software Version: %s", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING);
204204

205205
// Initialize LEDs
206206
sStatusLED.Init(SYSTEM_STATE_LED);
@@ -221,11 +221,11 @@ void AppTask::AppTaskMain(void * pvParameter)
221221
CHIP_ERROR err = sAppTask.Init();
222222
if (err != CHIP_NO_ERROR)
223223
{
224-
P6_LOG("AppTask.Init() failed");
224+
PSOC6_LOG("AppTask.Init() failed");
225225
appError(err);
226226
}
227227

228-
P6_LOG("App Task started");
228+
PSOC6_LOG("App Task started");
229229

230230
while (true)
231231
{
@@ -301,7 +301,8 @@ void AppTask::FunctionHandler(AppEvent * event)
301301
{
302302
if (!sAppTask.mFunctionTimerActive && sAppTask.mFunction == Function::kNoneSelected)
303303
{
304-
P6_LOG("Factory Reset Triggered. Press button again within %us to cancel.", FACTORY_RESET_CANCEL_WINDOW_TIMEOUT / 1000);
304+
PSOC6_LOG("Factory Reset Triggered. Press button again within %us to cancel.",
305+
FACTORY_RESET_CANCEL_WINDOW_TIMEOUT / 1000);
305306
// Start timer for FACTORY_RESET_CANCEL_WINDOW_TIMEOUT to allow user to
306307
// cancel, if required.
307308
sAppTask.StartTimer(FACTORY_RESET_CANCEL_WINDOW_TIMEOUT);
@@ -325,7 +326,7 @@ void AppTask::FunctionHandler(AppEvent * event)
325326
// canceled.
326327
sAppTask.mFunction = Function::kNoneSelected;
327328

328-
P6_LOG("Factory Reset has been Canceled");
329+
PSOC6_LOG("Factory Reset has been Canceled");
329330
}
330331
}
331332
}
@@ -334,7 +335,7 @@ void AppTask::CancelTimer()
334335
{
335336
if (xTimerStop(sFunctionTimer, 0) == pdFAIL)
336337
{
337-
P6_LOG("app timer stop() failed");
338+
PSOC6_LOG("app timer stop() failed");
338339
appError(APP_ERROR_STOP_TIMER_FAILED);
339340
}
340341

@@ -345,7 +346,7 @@ void AppTask::StartTimer(uint32_t aTimeoutInMs)
345346
{
346347
if (xTimerIsTimerActive(sFunctionTimer))
347348
{
348-
P6_LOG("app timer already started!");
349+
PSOC6_LOG("app timer already started!");
349350
CancelTimer();
350351
}
351352

@@ -354,7 +355,7 @@ void AppTask::StartTimer(uint32_t aTimeoutInMs)
354355
// cannot immediately be sent to the timer command queue.
355356
if (xTimerChangePeriod(sFunctionTimer, aTimeoutInMs / portTICK_PERIOD_MS, 100) != pdPASS)
356357
{
357-
P6_LOG("app timer start() failed");
358+
PSOC6_LOG("app timer start() failed");
358359
appError(APP_ERROR_START_TIMER_FAILED);
359360
}
360361

@@ -385,11 +386,11 @@ void AppTask::PostEvent(const AppEvent * event)
385386
}
386387

387388
if (!status)
388-
P6_LOG("Failed to post event to app task event queue");
389+
PSOC6_LOG("Failed to post event to app task event queue");
389390
}
390391
else
391392
{
392-
P6_LOG("Event Queue is NULL should never happen");
393+
PSOC6_LOG("Event Queue is NULL should never happen");
393394
}
394395
}
395396

@@ -401,7 +402,7 @@ void AppTask::DispatchEvent(AppEvent * event)
401402
}
402403
else
403404
{
404-
P6_LOG("Event received with no handler. Dropping event.");
405+
PSOC6_LOG("Event received with no handler. Dropping event.");
405406
}
406407
}
407408

@@ -414,7 +415,7 @@ void AppTask::OnOffUpdateClusterState(intptr_t context)
414415

415416
if (status != Protocols::InteractionModel::Status::Success)
416417
{
417-
P6_LOG("ERR: updating on/off %x", to_underlying(status));
418+
PSOC6_LOG("ERR: updating on/off %x", to_underlying(status));
418419
}
419420
}
420421

@@ -435,7 +436,7 @@ void AppTask::InitOTARequestor()
435436

436437
gRequestorUser.Init(&gRequestorCore, &gImageProcessor);
437438

438-
P6_LOG("Current Software Version: %u", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION);
439-
P6_LOG("Current Software Version String: %s", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING);
439+
PSOC6_LOG("Current Software Version: %u", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION);
440+
PSOC6_LOG("Current Software Version String: %s", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING);
440441
}
441442
#endif

examples/all-clusters-app/infineon/psoc6/src/ButtonHandler.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void ButtonHandler::TimerCallback(TimerHandle_t xTimer)
102102
buttonevent = cyhal_gpio_read(APP_FUNCTION_BUTTON);
103103
break;
104104
default:
105-
P6_LOG("Unhandled TimerID: %d", timerId);
105+
PSOC6_LOG("Unhandled TimerID: %d", timerId);
106106
break;
107107
}
108108

0 commit comments

Comments
 (0)