Skip to content

Commit fe9eac7

Browse files
author
Alexander Zilberkant
committed
Update PSA tools Readme
1 parent 9150518 commit fe9eac7

File tree

1 file changed

+24
-19
lines changed

1 file changed

+24
-19
lines changed

tools/psa/README.md

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,40 @@
11
# PSA tools
22

3-
This document describes the following scripts:
3+
## Code generation script
44

5-
* \_\_init\_\_.py
6-
* generate_partition_code.py
7-
* mbed_spm_tfm_common.py
8-
* release.py
5+
Mbed-OS contains two implementations of PSA Firmware Framework:
96

10-
## \_\_init\_\_.py
11-
12-
This file holds common functions dedicated to help SiP with their post-build logic.
7+
* Mbed-SPM - Implementation for dual-core v7 targets.
8+
* TF-M - Implementation for v8 targets.
139

14-
* find_secure_image - Scans a Resource object to find the correct binary of the secure image to merge with the non-secure build.
10+
Both PSA Firmware Framework implementation impose the following requirements:
1511

16-
## Code generation scripts
12+
* PSA manifests must be valid according to the JSON schema file provided by PSA FF spec.
13+
* There are no conflicts between various PSA manifests (duplicate SIDs and PIDs, dependencies, etc.)
14+
* Secure partition initialization code to be present at mbed-os core compile time.
1715

18-
Mbed OS holds two implementations of PSA:
16+
To satisfy the requirement listed above, Mbed-OS build system invokes `generate_partition_code.py` script
17+
during the build process for PSA targets.
1918

20-
* MBED_SPM - Implementation for dual-core v7 targets.
21-
* TF-M - Implementation for v8 targets.
19+
PSA code generation step has the following effects:
20+
* Scan the whole source tree for PSA manifest files, including application (in case invoked from application directory) and all the `TESTS` directories.
21+
* All found PSA manifest files get parsed and validated.
22+
* Source and header files for initializing SPM are generated. Test related partitions and SIDs are disabled by default by `#ifndef` guards.
23+
To enable them following defines must be passed to build command (typically done automatically via [release.py](#secure-image-generation)):
24+
* `-DUSE_PSA_TEST_PARTITIONS`
25+
* `-DUSE_<name>` where `<name>` corresponds to the name in PSA manifest file (`"name"` property).
2226

23-
Each implementation requires a set of auto-generated files describing the secure partitions:
27+
## Secure image generation
2428

25-
* `generate_partition_code.py` - Generate files for both implementations.
26-
* `mbed_spm_tfm_common.py` - Holds common functions for both.
29+
`release.py` is the script assigned with compiling the default secure images.
2730

28-
## Secure image generation
31+
For an application with custom secure portions, the secure image should be generated by invoking `mbed-cli` directly.
2932

30-
`release.py` is the script assigned with compiling the secure images:
33+
> **Note**: when building targets utilizing TF-M PSA implementations, add the following arguments to a build command for the secure image:
34+
`--app-config <mbed-os-root>/tools/psa/tfm/mbed_app.json`
3135
32-
```
36+
### Usage
37+
```text
3338
usage: release.py [-h] [-m MCU] [-d] [-q] [-l] [--commit] [--skip-tests]
3439
[-x ...]
3540

0 commit comments

Comments
 (0)