@@ -279,6 +279,10 @@ if (CONFIG_CHIP_PW_RPC)
279
279
chip_gn_arg_bool ("chip_build_pw_rpc_lighting_proto" CONFIG_CHIP_PW_RPC_LIGHTING_PROTO)
280
280
chip_gn_arg_bool ("chip_build_pw_rpc_locking_proto" CONFIG_CHIP_PW_RPC_LOCKING_PROTO)
281
281
endif (CONFIG_CHIP_PW_RPC)
282
+ if (CONFIG_CHIP_OTA_REQUESTOR)
283
+ chip_gn_arg_bool ("chip_enable_ota_requestor" CONFIG_CHIP_OTA_REQUESTOR)
284
+ endif (CONFIG_CHIP_OTA_REQUESTOR)
285
+
282
286
283
287
file (GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR} /args.gn CONTENT ${CHIP_GN_ARGS} )
284
288
@@ -325,6 +329,12 @@ list(APPEND CHIP_INCLUDES)
325
329
# CHIP defines
326
330
list (APPEND CHIP_DEFINES)
327
331
332
+ # Target specific configuration
333
+ if ("capsense" IN_LIST MBED_TARGET_LABELS)
334
+ add_subdirectory (${CHIP_ROOT} /third_party/mbed-os-cypress-capsense-button/repo ${CMAKE_BINARY_DIR} /capsense_build)
335
+ target_link_libraries (${APP_TARGET} capsense)
336
+ endif ()
337
+
328
338
list (APPEND CHIP_INCLUDES
329
339
${CHIP_ROOT} /config/mbed/mbedtls
330
340
)
@@ -442,6 +452,67 @@ endif(CONFIG_CHIP_PW_RPC_LOCKING_PROTO)
442
452
443
453
endif (CONFIG_CHIP_PW_RPC)
444
454
455
+ if (CONFIG_CHIP_OTA_REQUESTOR)
456
+ target_include_directories (${APP_TARGET} PRIVATE
457
+ ${CHIP_ROOT} /zzz_generated/ota-requestor-app
458
+ ${CHIP_ROOT} /src/app/clusters/ota-requestor
459
+ ${CHIP_ROOT} /src/platform
460
+ ${CHIP_ROOT} /src/platform/mbed
461
+ ${CHIP_ROOT} /src/include /platform
462
+ )
463
+
464
+ target_sources (${APP_TARGET} PRIVATE
465
+ ${CHIP_ROOT} /zzz_generated/ota-requestor-app/zap-generated /callback-stub.cpp
466
+ ${CHIP_ROOT} /zzz_generated/ota-requestor-app/zap-generated /CHIPClusters.cpp
467
+ ${CHIP_ROOT} /zzz_generated/ota-requestor-app/zap-generated /IMClusterCommandHandler.cpp
468
+
469
+ ${CHIP_ROOT} /src/app/clusters/ota-requestor/OTARequestor.cpp
470
+ ${CHIP_ROOT} /src/app/clusters/ota-requestor/BDXDownloader.cpp
471
+ ${CHIP_ROOT} /src/app/clusters/ota-requestor/ota-requestor-server.cpp
472
+
473
+ ${CHIP_ROOT} /src/platform/mbed/OTAImageProcessorImpl.cpp
474
+ )
475
+
476
+ list (APPEND CHIP_DEFINES
477
+ CHIP_OTA_REQUESTOR=1
478
+ )
479
+ endif (CONFIG_CHIP_OTA_REQUESTOR)
480
+
481
+ if (BOOT_ENABLED)
482
+ add_subdirectory (${MCUBOOT_PATH} /boot/bootutil/ ${CMAKE_BINARY_DIR} /mbed_mcu_boot_util_build)
483
+ add_subdirectory (${MCUBOOT_PATH} /boot/mbed/ ${CMAKE_BINARY_DIR} /mbed_mcu_boot_build)
484
+
485
+ target_include_directories (${APP_TARGET} PRIVATE
486
+ ${MCUBOOT_PATH} /boot/mbed/include
487
+ )
488
+
489
+ target_sources (${APP_TARGET} PRIVATE
490
+ ${CHIP_ROOT} /examples/platform/mbed/bootloader/default_bd.cpp
491
+ )
492
+
493
+ target_include_directories (bootutil PUBLIC
494
+ ${CHIP_ROOT} /config/mbed/mbedtls
495
+ )
496
+
497
+ target_link_libraries (${APP_TARGET} mbed-mcuboot bootutil)
498
+
499
+ file (READ ${APP_PATH} /mbed_app.json mbedAppJson)
500
+ string (JSON PRIMARY_SLOT_ADDRESS GET "${mbedAppJson} " target_overrides ${MBED_TARGET} mcuboot.primary-slot-address)
501
+ string (JSON HEADER_SIZE GET "${mbedAppJson} " target_overrides ${MBED_TARGET} mcuboot.header-size)
502
+ string (JSON SLOT_SIZE GET "${mbedAppJson} " target_overrides ${MBED_TARGET} mcuboot.slot-size)
503
+ math (EXPR APP_START "${PRIMARY_SLOT_ADDRESS} + ${HEADER_SIZE} " OUTPUT_FORMAT HEXADECIMAL)
504
+ math (EXPR APP_SIZE "${SLOT_SIZE} - 2 * ${HEADER_SIZE} " OUTPUT_FORMAT HEXADECIMAL)
505
+ target_compile_definitions (mbed-core
506
+ INTERFACE
507
+ "-DMBED_APP_START=${APP_START} "
508
+ "-DMBED_APP_SIZE=${APP_SIZE} "
509
+ )
510
+
511
+ list (APPEND CHIP_DEFINES
512
+ BOOT_ENABLED=1
513
+ )
514
+ endif ()
515
+
445
516
446
517
target_include_directories (${APP_TARGET} PRIVATE
447
518
${CHIP_INCLUDES}
0 commit comments