Skip to content

Commit deeaa79

Browse files
committed
CMake: Add post build operation support
A CMake custom target, mbed-post-build, is added as a dependency of the application CMake target if a Mbed target adds a CMake custom target named mbed-post-build-bin. mbed-post-build-bin is added as a dependency of mbed-post-build. mbed-post-build-bin depends on the application binary. This is done so a CMake custom command that executes post-build can be added. The Python scripts that implement the operations have been modified to add CLI entry points so they can be called from CMake. Dependency on the old tool has been removed on those scripts by passing them exactly what they require instead of passing old tool Python objects. A consequence of that was to slightly amend how the old tool calls some of those Python modules. Support has only been added for Mbed targets that currently have a requirement for post build operations. This includes: LPC1114, LPC1768, ARCH_PRO, LPC54114, LPC546XX, FF_LPC546XX, CY8CKIT064B0S2_4343W, CYTFM_064B0S2_4343W, CYSBSYSKIT_01 The following targets are not supported as TFM support is not yet included: ARM_MUSCA_B1, ARM_MUSCA_B1_NS, ARM_MUSCA_S1, ARM_MUSCA_S1_NS.
1 parent 0460a85 commit deeaa79

File tree

15 files changed

+618
-0
lines changed

15 files changed

+618
-0
lines changed

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,14 @@ function(mbed_generate_bin_hex target)
194194
"executable:"
195195
VERBATIM
196196
)
197+
198+
if(TARGET mbed-post-build-bin)
199+
add_custom_target(mbed-post-build
200+
ALL
201+
DEPENDS
202+
mbed-post-build-bin
203+
)
204+
endif()
197205
endfunction()
198206

199207
#

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT064B0S2_4343W/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Copyright (c) 2020 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4+
include(${MBED_PATH}/targets/TARGET_Cypress/scripts/mbed_set_post_build_cypress.cmake)
5+
46
if("BSP_DESIGN_MODUS" IN_LIST MBED_TARGET_LABELS)
57
target_include_directories(mbed-core
68
INTERFACE
@@ -58,3 +60,13 @@ target_sources(mbed-core
5860
${SYSTEM_SOURCE}
5961
${STARTUP_FILE}
6062
)
63+
64+
mbed_post_build_psoc6_sign_image(
65+
"psoc6_02_cm0p_secure.hex"
66+
"CY8CKIT064B0S2_4343W"
67+
"policy_single_CM0_CM4.json"
68+
"single_image"
69+
"1"
70+
"16"
71+
"${MBED_PATH}/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT064B0S2_4343W/device/COMPONENT_CM4/hex/psoc6_02_cm0p_secure.hex"
72+
)

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYSBSYSKIT_01/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Copyright (c) 2020 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4+
include(${MBED_PATH}/targets/TARGET_Cypress/scripts/mbed_set_post_build_cypress.cmake)
5+
46
if("BSP_DESIGN_MODUS" IN_LIST MBED_TARGET_LABELS)
57
target_include_directories(mbed-core
68
INTERFACE
@@ -47,3 +49,5 @@ target_sources(mbed-core
4749
${SYSTEM_SOURCE}
4850
${STARTUP_FILE}
4951
)
52+
53+
mbed_post_build_psoc6_merge_hex()

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYTFM_064B0S2_4343W/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Copyright (c) 2020 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4+
include(${MBED_PATH}/targets/TARGET_Cypress/scripts/mbed_set_post_build_cypress.cmake)
5+
46
if("BSP_DESIGN_MODUS" IN_LIST MBED_TARGET_LABELS)
57
target_include_directories(mbed-core
68
INTERFACE
@@ -62,3 +64,13 @@ target_sources(mbed-core
6264
${SYSTEM_SOURCE}
6365
${STARTUP_FILE}
6466
)
67+
68+
mbed_post_build_psoc6_sign_image(
69+
"tfm_s.hex"
70+
"CYTFM_064B0S2_4343W"
71+
"policy_multi_CM0_CM4_tfm.json"
72+
"multi_image"
73+
"1"
74+
"16"
75+
${MBED_PATH}/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYTFM_064B0S2_4343W/COMPONENT_TFM_S_FW/tfm_s.hex
76+
)

0 commit comments

Comments
 (0)