File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed
trustzone/hello_trustzone Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -31,3 +31,42 @@ pico_set_security_ram_split(hello_trustzone_s hello_trustzone_ns SIMPLE 64k 2k)
3131
3232# Create combined UF2 (ns first)
3333pico_concatenate_uf2_outputs(hello_trustzone hello_trustzone_ns hello_trustzone_s)
34+
35+
36+
37+ # no_flash example
38+ # Add secure executable
39+ add_executable (hello_trustzone_no_flash_s secure.c)
40+ target_link_libraries (hello_trustzone_no_flash_s
41+ pico_stdlib
42+ hardware_watchdog
43+ pico_secure
44+ )
45+
46+ pico_set_binary_type(hello_trustzone_no_flash_s no_flash)
47+ pico_add_extra_outputs(hello_trustzone_no_flash_s)
48+
49+ # Add non-secure executable
50+ add_executable (hello_trustzone_no_flash_ns nonsecure.c)
51+ pico_set_uf2_family(hello_trustzone_no_flash_ns "rp2350-arm-ns" )
52+ target_link_libraries (hello_trustzone_no_flash_ns
53+ pico_stdlib
54+ )
55+ pico_enable_stdio_uart(hello_trustzone_no_flash_ns 0)
56+ pico_enable_stdio_usb(hello_trustzone_no_flash_ns 1)
57+
58+ pico_set_binary_type(hello_trustzone_no_flash_ns no_flash)
59+ pico_add_extra_outputs(hello_trustzone_no_flash_ns)
60+
61+ # Set security options
62+ pico_set_security_options(hello_trustzone_no_flash_s hello_trustzone_no_flash_ns
63+ USER_IRQ USB
64+ NONSECURE_TIMER 1
65+ )
66+
67+ # Set security ram split (with NO_FLASH)
68+ pico_set_security_ram_split(hello_trustzone_no_flash_s hello_trustzone_no_flash_ns SIMPLE 64k 2k NO_FLASH)
69+
70+ # Create combined CMake target
71+ add_custom_target (hello_trustzone_no_flash ALL
72+ DEPENDS hello_trustzone_no_flash_s hello_trustzone_no_flash_ns)
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ int main()
5454 // Create user callback
5555 rom_secure_call_add_user_callback (secure_call_user_callback , SECURE_CALL_CALLBACKS_MASK );
5656
57+ #if !PICO_SECURITY_SPLIT_NO_FLASH
5758 // Get boot partition
5859 boot_info_t info ;
5960 rom_get_boot_info (& info );
@@ -64,6 +65,7 @@ int main()
6465 printf ("Matching Non-Secure partition: %d\n" , ns_partition );
6566 int rc = rom_roll_qmi_to_partition (ns_partition );
6667 printf ("Rolled QMI to Non-Secure partition, rc=%d\n" , rc );
68+ #endif
6769
6870 // Configure SAU regions
6971 secure_sau_configure_split ();
You can’t perform that action at this time.
0 commit comments