2019-03-07 00:39:56 +00:00
|
|
|
# PSA tools
|
2019-03-06 16:19:57 +00:00
|
|
|
|
2019-03-07 00:39:56 +00:00
|
|
|
This document describes the following scripts:
|
2019-03-06 16:19:57 +00:00
|
|
|
|
|
|
|
* \_\_init\_\_.py
|
|
|
|
* generate_partition_code.py
|
|
|
|
* mbed_spm_tfm_common.py
|
|
|
|
* generate_mbed_spm_partition_code.py
|
|
|
|
* generate_tfm_partition_code.py
|
|
|
|
* release.py
|
|
|
|
|
|
|
|
## \_\_init\_\_.py
|
|
|
|
|
2019-03-07 00:39:56 +00:00
|
|
|
This file holds common functions dedicated to help SiP with their postbuild logic.
|
2019-03-06 16:19:57 +00:00
|
|
|
|
2019-03-07 00:39:56 +00:00
|
|
|
* find_secure_image - Scans a Resource object to find the correct binary of the secure image to merge with the nonsecure build.
|
2019-03-06 16:19:57 +00:00
|
|
|
|
|
|
|
## Code generation scripts
|
|
|
|
|
2019-03-07 00:39:56 +00:00
|
|
|
Mbed OS holds two implementations of PSA:
|
|
|
|
|
|
|
|
* MBED_SPM - Implementation for dual-core v7 targets.
|
2019-03-06 16:19:57 +00:00
|
|
|
* TF-M - Implementation for v8 targets.
|
|
|
|
|
2019-03-07 00:39:56 +00:00
|
|
|
Each implementation requires a set of autogenerated files describing the secure partitions:
|
2019-03-06 16:19:57 +00:00
|
|
|
|
|
|
|
* `generate_partition_code.py` - Generate files for both implementations.
|
2019-03-06 23:08:24 +00:00
|
|
|
* `generate_mbed_spm_partition_code.py` - Generate files for MBED_SPM.
|
2019-03-06 16:19:57 +00:00
|
|
|
* `generate_tfm_partition_code.py` - Generate files for TF-M.
|
|
|
|
* `mbed_spm_tfm_common.py` - Holds common functions for both.
|
|
|
|
|
|
|
|
## Secure image generation
|
|
|
|
|
2019-03-07 00:39:56 +00:00
|
|
|
`release.py` is the script assigned with compiling the secure images:
|
2019-03-06 16:19:57 +00:00
|
|
|
|
2019-03-06 21:21:09 +00:00
|
|
|
```
|
2019-03-20 13:10:28 +00:00
|
|
|
usage: release.py [-h] [-m MCU] [-d] [-q] [--commit] [--skip-tests]
|
2019-03-06 16:19:57 +00:00
|
|
|
|
|
|
|
optional arguments:
|
|
|
|
-h, --help show this help message and exit
|
|
|
|
-m MCU, --mcu MCU build for the given MCU
|
2019-03-08 12:17:58 +00:00
|
|
|
-d, --debug set build profile to debug
|
2019-03-20 13:10:28 +00:00
|
|
|
-q, --quiet No Build log will be printed
|
2019-03-08 14:11:27 +00:00
|
|
|
--commit create a git commit for each platform
|
2019-03-20 13:10:28 +00:00
|
|
|
--skip-tests skip the test build phase
|
2019-03-06 16:19:57 +00:00
|
|
|
```
|
|
|
|
|
2019-03-08 12:17:58 +00:00
|
|
|
* When `MCU ` is not specified, the script compiles all the images for all the targets.
|
|
|
|
* When `-d/--debug` is not specified, the script compiles the images using the release profile.
|
2019-03-08 14:11:27 +00:00
|
|
|
* When `--commit` is not specified, the script will not commit the images to git.
|
2019-03-07 00:39:56 +00:00
|
|
|
|
|
|
|
This script should be run in following scenarios:
|
2019-03-06 16:19:57 +00:00
|
|
|
|
|
|
|
* Release.
|
|
|
|
* Update to files originating in the secure side.
|
|
|
|
* Drivers update.
|
|
|
|
* PSA updates.
|