WIP: Support for non-secure (NS) binaries #2753
No reviewers
Labels
No labels
bazel
bluetooth
board settings
boot_stage2
bug
build
c++
can't reproduce
clang
clib-interface
cmsis
code cleanliness
code size
compiler version issues
cyw43_driver
debug
discussion
documentation
duplicate
dynamic_clock
elf2uf2
enhancement
errata
filesystem
flash layout
floating point
FreeRTOS
hardware_adc
hardware_claim
hardware_clocks
hardware_dma
hardware_exception
hardware_flash
hardware_gpio
hardware_i2c
hardware_irq
hardware_pio
hardware_pwm
hardware_rcp
hardware_rtc
hardware_spi
hardware_sync
hardware_uart
hardware_vreg
hardware_watchdog
hardware_xosc
help wanted
host
IAR
installation
invalid
linker scripts
lto
lwip
mbedtls
missing API
needs reporter detail
networking
newlib
newlib-multicore
non-c
non-cmake
non-gcc
openocd
orphan PR
OS integration
pico_async_context
pico_base
pico_binary_info
pico_flash
picolibc
pico_lwip
pico_malloc
pico_multicore
pico_printf
pico_runtime
pico_stdio
pico_stdio_usb
pico_sync
pico_time
pico_util
pioasm
port
question
review
review2
rtos interop
runtime init
static library
svd
test
tinyusb
vscode
wifi integration
wontfix
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-raspberrypi/pico-sdk!2753
Loading…
Reference in a new issue
No description provided.
Delete branch "ns-alpha"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR is alpha level, and APIs/build process are subject to change:
See the corresponding examples branch: https://github.com/raspberrypi/pico-examples/tree/ns-alpha
This PR allows the user to build separate binaries for the Secure and NonSecure sides of RP2350, and have one call the other. It provides secure call APIs for the NonSecure side to call code on the Secure side, along with CMake functions to configure both binaries to have the same functionality.
This allows for simple use of the Secure/NonSecure split, for example to keep secrets on the Secure side, while running a WiFi/USB stack on the NonSecure side.
The
hello_trustzoneexample is a minimal example showing how to create a Secure/NonSecure binary. It has NonSecure doingstdio_usb, and both sides using their respective timers. It also demonstrates a user secure call, allowing user NonSecure code to talk to Secure code. This produces a single hello_trustzone.uf2 file, which can be loaded onto any device with the trustzone_pt.json programmed. So steps are:picotool partition create trustzone_pt.json pt.uf2picotool load pt.uf2picotool reboot -udrag & drop hello_trustzone.uf2 onto the device
In addition there is a
hello_trustzone_no_flashexample for those not using flash - this doesn't require a partition table to load, either load in two parts with picotool:picotool load hello_trustzone_no_flash_ns.uf2picotool load hello_trustzone_no_flash_s.uf2 -xor create a combined UF2 using the code in the new branch (https://github.com/raspberrypi/picotool/tree/uf2-combine), which can just be dragged & dropped (or loaded with picotool as a single UF2):
picotool uf2 combine hello_trustzone_no_flash_s.uf2 hello_trustzone_no_flash_ns.uf2 hello_trustzone_no_flash.uf2drag & drop hello_trustzone_no_flash.uf2 onto the device
Please do not submit against
master, usedevelopinsteadView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.