@@ -6,18 +6,25 @@ target_link_libraries(hello_trustzone_s
66 pico_secure
77)
88
9+ # Packaged no_flash binary
910pico_set_binary_type(hello_trustzone_s no_flash)
1011pico_package_uf2_output(hello_trustzone_s 0x10000000)
1112pico_add_extra_outputs(hello_trustzone_s)
1213
1314# Add non-secure executable
1415add_executable (hello_trustzone_ns nonsecure.c)
15- pico_set_uf2_family(hello_trustzone_ns "rp2350-arm-ns" )
1616target_link_libraries (hello_trustzone_ns
1717 pico_stdlib
1818)
19+
20+ # Set UF2 family manually
21+ pico_set_uf2_family(hello_trustzone_ns "rp2350-arm-ns" )
22+
23+ # Use stdio_usb
1924pico_enable_stdio_uart(hello_trustzone_ns 0)
2025pico_enable_stdio_usb(hello_trustzone_ns 1)
26+
27+ # Default flash binary
2128pico_add_extra_outputs(hello_trustzone_ns)
2229
2330# Set security options
@@ -29,7 +36,7 @@ pico_set_security_options(hello_trustzone_s hello_trustzone_ns
2936# Set security ram split
3037pico_set_security_ram_split(hello_trustzone_s hello_trustzone_ns SIMPLE 64k 2k)
3138
32- # Create combined UF2 (ns first)
39+ # Create combined UF2, for loading into the partition table (non-secure first)
3340pico_concatenate_uf2_outputs(hello_trustzone hello_trustzone_ns hello_trustzone_s)
3441
3542
@@ -43,18 +50,24 @@ target_link_libraries(hello_trustzone_no_flash_s
4350 pico_secure
4451)
4552
53+ # no_flash binary for secure side
4654pico_set_binary_type(hello_trustzone_no_flash_s no_flash)
4755pico_add_extra_outputs(hello_trustzone_no_flash_s)
4856
4957# Add non-secure executable
5058add_executable (hello_trustzone_no_flash_ns nonsecure.c)
51- pico_set_uf2_family(hello_trustzone_no_flash_ns "rp2350-arm-ns" )
5259target_link_libraries (hello_trustzone_no_flash_ns
5360 pico_stdlib
5461)
62+
63+ # Set UF2 family manually
64+ pico_set_uf2_family(hello_trustzone_ns "rp2350-arm-ns" )
65+
66+ # Use stdio_usb
5567pico_enable_stdio_uart(hello_trustzone_no_flash_ns 0)
5668pico_enable_stdio_usb(hello_trustzone_no_flash_ns 1)
5769
70+ # no_flash binary for non-secure side too
5871pico_set_binary_type(hello_trustzone_no_flash_ns no_flash)
5972pico_add_extra_outputs(hello_trustzone_no_flash_ns)
6073
@@ -67,6 +80,6 @@ pico_set_security_options(hello_trustzone_no_flash_s hello_trustzone_no_flash_ns
6780# Set security ram split (with NO_FLASH)
6881pico_set_security_ram_split(hello_trustzone_no_flash_s hello_trustzone_no_flash_ns SIMPLE 64k 2k NO_FLASH)
6982
70- # Create combined CMake target
83+ # Create combined CMake target, for easy building
7184add_custom_target (hello_trustzone_no_flash ALL
7285 DEPENDS hello_trustzone_no_flash_s hello_trustzone_no_flash_ns)
0 commit comments