Docs: Add document for eRPC framework

Change-Id: I66a8d2a441042c40fb35a1a670aa57273133cf7b
Signed-off-by: Kevin Peng <kevin.peng@arm.com>
diff --git a/docs/media/erpc_test_framework.svg b/docs/media/erpc_test_framework.svg
new file mode 100755
index 0000000..cae4bec
--- /dev/null
+++ b/docs/media/erpc_test_framework.svg
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Do not edit this file with editors other than diagrams.net -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="602px" height="346px" viewBox="-0.5 -0.5 602 346" content="&lt;mxfile host=&quot;app.diagrams.net&quot; modified=&quot;2023-02-27T02:48:02.575Z&quot; agent=&quot;5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36&quot; etag=&quot;ziJBf11UqT7pjjJNRFsl&quot; version=&quot;20.8.23&quot; type=&quot;onedrive&quot;&gt;&lt;diagram name=&quot;第 1 页&quot; id=&quot;4oCPlJvOIF9VEz3LROrS&quot;&gt;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&lt;/diagram&gt;&lt;/mxfile&gt;" style="background-color: rgb(255, 255, 255);"><defs><linearGradient x1="0%" y1="0%" x2="0%" y2="100%" id="mx-gradient-ffcd28-1-ffa500-1-s-0"><stop offset="0%" style="stop-color: rgb(255, 205, 40); stop-opacity: 1;"/><stop offset="100%" style="stop-color: rgb(255, 165, 0); stop-opacity: 1;"/></linearGradient><linearGradient x1="0%" y1="0%" x2="0%" y2="100%" id="mx-gradient-f5f5f5-1-b3b3b3-1-s-0"><stop offset="0%" style="stop-color: rgb(245, 245, 245); stop-opacity: 1;"/><stop offset="100%" style="stop-color: rgb(179, 179, 179); stop-opacity: 1;"/></linearGradient><linearGradient x1="0%" y1="0%" x2="0%" y2="100%" id="mx-gradient-dae8fc-1-7ea6e0-1-s-0"><stop offset="0%" style="stop-color: rgb(218, 232, 252); stop-opacity: 1;"/><stop offset="100%" style="stop-color: rgb(126, 166, 224); stop-opacity: 1;"/></linearGradient><pattern patternUnits="userSpaceOnUse" width="11.5" height="11.5" x="0" y="0" patternTransform="rotate(45)" id="mx-pattern-dashed-1-000000-0"><line x1="0" y1="2.875" x2="0" y2="8.625" stroke="rgb(0, 0, 0)" stroke-width="1.5"/></pattern><linearGradient x1="0%" y1="0%" x2="0%" y2="100%" id="mx-gradient-d5e8d4-1-97d077-1-s-0"><stop offset="0%" style="stop-color: rgb(213, 232, 212); stop-opacity: 1;"/><stop offset="100%" style="stop-color: rgb(151, 208, 119); stop-opacity: 1;"/></linearGradient><linearGradient x1="0%" y1="0%" x2="0%" y2="100%" id="mx-gradient-f8cecc-1-ea6b66-1-s-0"><stop offset="0%" style="stop-color: rgb(248, 206, 204); stop-opacity: 1;"/><stop offset="100%" style="stop-color: rgb(234, 107, 102); stop-opacity: 1;"/></linearGradient><pattern patternUnits="userSpaceOnUse" width="11.5" height="11.5" x="0" y="0" patternTransform="rotate(45)" id="mx-pattern-dashed-1-ff0000-0"><line x1="0" y1="2.875" x2="0" y2="8.625" stroke="#ff0000" stroke-width="1.5"/></pattern></defs><g><rect x="140" y="100" width="390" height="230" fill="none" stroke="#ff9933" stroke-width="2" pointer-events="all"/><g fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px"><text x="141.5" y="324.5">TF-M eRPC Framework</text></g><rect x="0" y="50" width="120" height="40" fill="url(#mx-gradient-ffcd28-1-ffa500-1-s-0)" stroke="#d79b00" pointer-events="all"/><g fill="rgb(0, 0, 0)" font-family="Helvetica" text-anchor="middle" font-size="12px"><text x="59.5" y="74.5">Application Layer</text></g><rect x="0" y="169" width="120" height="40" fill="url(#mx-gradient-f5f5f5-1-b3b3b3-1-s-0)" stroke="#666666" pointer-events="all"/><g fill="rgb(0, 0, 0)" font-family="Helvetica" text-anchor="middle" font-size="12px"><text x="59.5" y="193.5">Generated shim code</text></g><rect x="0" y="238" width="120" height="60" fill="url(#mx-gradient-dae8fc-1-7ea6e0-1-s-0)" stroke="#6c8ebf" pointer-events="all"/><g fill="rgb(0, 0, 0)" font-family="Helvetica" text-anchor="middle" font-size="12px"><text x="59.5" y="251.5">Protocal Layer</text><text x="59.5" y="293.5">Transportation Layer</text></g><rect x="160" y="238" width="190" height="60" rx="9" ry="9" fill="url(#mx-gradient-dae8fc-1-7ea6e0-1-s-0)" stroke="#6c8ebf" pointer-events="all"/><g fill="rgb(0, 0, 0)" font-family="Helvetica" text-anchor="middle" font-size="12px"><text x="254.5" y="272.5">eRPC Framework</text></g><rect x="390" y="238" width="120" height="60" rx="9" ry="9" fill="url(#mx-gradient-dae8fc-1-7ea6e0-1-s-0)" stroke="#6c8ebf" pointer-events="all"/><g fill="rgb(0, 0, 0)" font-family="Helvetica" text-anchor="middle" font-size="12px"><text x="449.5" y="272.5">eRPC Framework</text></g><rect x="160" y="50" width="80" height="40" rx="6" ry="6" fill="url(#mx-gradient-ffcd28-1-ffa500-1-s-0)" stroke="#d79b00" pointer-events="all"/><g fill="rgb(0, 0, 0)" font-family="Helvetica" text-anchor="middle" font-size="12px"><text x="199.5" y="74.5">Host App</text></g><rect x="270" y="50" width="80" height="40" rx="6" ry="6" fill="url(#mx-gradient-ffcd28-1-ffa500-1-s-0)" stroke="#d79b00" pointer-events="all"/><g fill="rgb(0, 0, 0)" font-family="Helvetica" text-anchor="middle" font-size="12px"><text x="309.5" y="74.5">Test Suites</text></g><path d="M 246.9 71.52 L 246.9 73.59 L 240.5 70 L 246.9 66.41 L 246.9 68.48 L 263.1 68.48 L 263.1 66.41 L 269.5 70 L 263.1 73.59 L 263.1 71.52 Z" fill="#000000" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><path d="M 198.48 96.9 L 196.4 96.9 L 200 90.5 L 203.59 96.9 L 201.52 96.9 L 201.42 230.26 L 203.5 230.26 L 199.9 236.66 L 196.31 230.26 L 198.38 230.26 Z" fill="#000000" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><path d="M 282.96 96.86 L 280.89 96.86 L 284.48 90.46 L 288.07 96.86 L 286 96.86 L 286 161.66 L 288.07 161.66 L 284.48 168.06 L 280.89 161.66 L 282.96 161.66 Z" fill="#000000" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><path d="M 321.34 97.59 L 319.27 97.61 L 322.8 91.18 L 326.45 97.55 L 324.38 97.57 L 324.46 107.09 L 326.53 107.07 L 323 113.5 L 319.35 107.13 L 321.42 107.11 Z" fill="#000000" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><path d="M 356.37 268 L 383.63 268" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" stroke-dasharray="1 1" pointer-events="stroke"/><path d="M 351.12 268 L 358.12 264.5 L 356.37 268 L 358.12 271.5 Z" fill="url(#mx-pattern-dashed-1-000000-0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><path d="M 388.88 268 L 381.88 271.5 L 383.63 268 L 381.88 264.5 Z" fill="url(#mx-pattern-dashed-1-000000-0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><path d="M 321.51 150.9 L 319.44 150.91 L 323 144.5 L 326.58 150.89 L 324.51 150.9 L 324.53 160.9 L 326.6 160.89 L 323.04 167.3 L 319.46 160.91 L 321.53 160.9 Z" fill="#000000" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><rect x="296" y="114" width="54" height="30" rx="4.5" ry="4.5" fill="url(#mx-gradient-d5e8d4-1-97d077-1-s-0)" stroke="#82b366" pointer-events="all"/><g fill="rgb(0, 0, 0)" font-family="Helvetica" text-anchor="middle" font-size="12px"><text x="322.5" y="126.5">API </text><text x="322.5" y="140.5">Wrapper</text></g><rect x="270" y="169" width="80" height="40" rx="6" ry="6" fill="url(#mx-gradient-f5f5f5-1-b3b3b3-1-s-0)" stroke="#666666" pointer-events="all"/><g fill="rgb(0, 0, 0)" font-family="Helvetica" text-anchor="middle" font-size="12px"><text x="309.5" y="186.5">eRPC Client</text><text x="309.5" y="200.5">Shim</text></g><path d="M 308.48 216.9 L 306.41 216.9 L 310 210.5 L 313.59 216.9 L 311.52 216.9 L 311.52 230.1 L 313.59 230.1 L 310 236.5 L 306.41 230.1 L 308.48 230.1 Z" fill="#000000" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><path d="M 370 340 L 370 30" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><rect x="390" y="50" width="80" height="40" rx="6" ry="6" fill="url(#mx-gradient-ffcd28-1-ffa500-1-s-0)" stroke="#d79b00" pointer-events="all"/><g fill="rgb(0, 0, 0)" font-family="Helvetica" text-anchor="middle" font-size="12px"><text x="429.5" y="67.5">Target</text><text x="429.5" y="81.5">App</text></g><path d="M 414.43 97.77 L 412.36 97.76 L 416 91.38 L 419.54 97.8 L 417.47 97.79 L 416.57 229.27 L 418.64 229.28 L 415 235.66 L 411.46 229.24 L 413.53 229.25 Z" fill="#000000" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><path d="M 481.51 147.9 L 479.44 147.91 L 483 141.5 L 486.58 147.89 L 484.51 147.9 L 484.53 161.9 L 486.6 161.89 L 483.04 168.3 L 479.46 161.91 L 481.53 161.9 Z" fill="#000000" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><rect x="456" y="111" width="54" height="30" rx="4.5" ry="4.5" fill="url(#mx-gradient-d5e8d4-1-97d077-1-s-0)" stroke="#82b366" pointer-events="all"/><g fill="rgb(0, 0, 0)" font-family="Helvetica" text-anchor="middle" font-size="12px"><text x="482.5" y="123.5">API </text><text x="482.5" y="137.5">Wrapper</text></g><rect x="430" y="170" width="80" height="40" rx="6" ry="6" fill="url(#mx-gradient-f5f5f5-1-b3b3b3-1-s-0)" stroke="#666666" pointer-events="all"/><g fill="rgb(0, 0, 0)" font-family="Helvetica" text-anchor="middle" font-size="12px"><text x="469.5" y="187.5">eRPC Server</text><text x="469.5" y="201.5">Shim</text></g><path d="M 468.48 217.9 L 466.41 217.9 L 470 211.5 L 473.59 217.9 L 471.52 217.9 L 471.52 231.1 L 473.59 231.1 L 470 237.5 L 466.41 231.1 L 468.48 231.1 Z" fill="#000000" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><path d="M 540 344 L 540 34" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" stroke-dasharray="3 3" pointer-events="stroke"/><rect x="560" y="111" width="40" height="109" rx="6" ry="6" fill="url(#mx-gradient-f8cecc-1-ea6b66-1-s-0)" stroke="#b85450" pointer-events="all"/><g fill="rgb(0, 0, 0)" font-family="Helvetica" text-anchor="middle" font-size="12px"><text x="579.5" y="170">TF-M</text></g><path d="M 516.37 123.98 L 552.59 123.88" fill="none" stroke="#ff0000" stroke-miterlimit="10" stroke-dasharray="1 1" pointer-events="stroke"/><path d="M 511.12 124 L 518.11 120.48 L 516.37 123.98 L 518.13 127.48 Z" fill="url(#mx-pattern-dashed-1-ff0000-0)" stroke="#ff0000" stroke-miterlimit="10" pointer-events="all"/><path d="M 557.84 123.87 L 550.85 127.38 L 552.59 123.88 L 550.83 120.38 Z" fill="url(#mx-pattern-dashed-1-ff0000-0)" stroke="#ff0000" stroke-miterlimit="10" pointer-events="all"/><path d="M 516.37 188.8 L 552.31 188.82" fill="none" stroke="#ff0000" stroke-miterlimit="10" stroke-dasharray="1 1" pointer-events="stroke"/><path d="M 511.12 188.8 L 518.12 185.3 L 516.37 188.8 L 518.12 192.3 Z" fill="url(#mx-pattern-dashed-1-ff0000-0)" stroke="#ff0000" stroke-miterlimit="10" pointer-events="all"/><path d="M 557.56 188.83 L 550.56 192.32 L 552.31 188.82 L 550.56 185.32 Z" fill="url(#mx-pattern-dashed-1-ff0000-0)" stroke="#ff0000" stroke-miterlimit="10" pointer-events="all"/><rect x="220" y="0" width="60" height="30" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 58px; height: 1px; padding-top: 15px; margin-left: 221px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Host</div></div></div></foreignObject><text x="250" y="19" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Host</text></switch></g><rect x="470" y="0" width="60" height="30" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 58px; height: 1px; padding-top: 15px; margin-left: 471px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Device</div></div></div></foreignObject><text x="500" y="19" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Device</text></switch></g></g><switch><g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/><a transform="translate(0,-5)" xlink:href="https://www.diagrams.net/doc/faq/svg-export-text-problems" target="_blank"><text text-anchor="middle" font-size="10px" x="50%" y="100%">Text is not SVG - cannot display</text></a></switch></svg>
\ No newline at end of file
diff --git a/docs/tfm_erpc_test_framework.rst b/docs/tfm_erpc_test_framework.rst
new file mode 100644
index 0000000..5fa33ee
--- /dev/null
+++ b/docs/tfm_erpc_test_framework.rst
@@ -0,0 +1,194 @@
+############################
+The TF-M eRPC Test Framework
+############################
+
+The TF-M eRPC Test Framework is an Remote Procedure Call (RPC) framework for testing purpose.
+It's based on the `eRPC <https://github.com/EmbeddedRPC/erpc>`__ system.
+It is an additional framework to the existing one for running NS test suites.
+It enables you to run test codes on host machines as if they were running on the device.
+It has the following advantages.
+
+- Off-load test codes from device to host
+
+  Arm M-profile devices usually have limited flash storage which can only fit limited test suites.
+  With test codes running on hosts you can run far more tests than on the devices.
+
+- Less frequent image downloading for test code development.
+
+  As the test codes run on the host, you don't need to update the image on device when you update
+  test codes.
+
+- Host can get test pass or failure directly from the return codes.
+
+  This would be helpful for test automation because you don't need to parse the test logs.
+
+****************
+How Does It Work
+****************
+Originally, the NS tests are executed in the NSPE of the device.
+The NS image on the device contains the test codes, which calls into TF-M through the PSA client
+APIs.
+
+With the eRPC test framework, the NS tests code are executed on the host machine.
+The NSPE of device side does not run the test codes anymore.
+When the tests call the PSA client APIs, they call into the eRPC framework.
+The eRPC framework communicates with the NSPE on the device, which calls into TF-M through the PSA
+client APIs.
+
+The prototypes of the PSA client APIs are the same while the implementations are different.
+Refer to the following sections for more details.
+
+The Stucture
+============
+
+The following diagram shows the software structure.
+
+.. figure:: media/erpc_test_framework.svg
+
+- eRPC Framework
+
+  The eRPC framework system
+
+- eRPC Client Shim
+
+  The eRPC generated shim layer of remote APIs for clients.
+  It serializes the identifier of the API and its parameters into a stream of bytes and transports
+  to the server through a communication channel such as UART and TCP/IP.
+  The codes are generated by the `erpcgen tool <https://github.com/EmbeddedRPC/erpc/wiki/erpcgen>`_.
+
+- eRPC Server Shim
+
+  The generated shim layer of the server.
+  It registers a callback function to the eRPC framework.
+  When the framework receives any requests from the client, it calls the callback function.
+  The callback unserializes the bytes streams to determine what API to call and then invoke it with
+  the corresponding parameters from the bytes streams.
+  And then it returns the results to the client in the reverse routine.
+
+- API Wrapper
+
+  Part of the parameters of ``psa_call`` API is not supported by eRPC directly, thus an API wrapper
+  is required to transform the ``in_vec/out_vec`` structures to the eRPC supported data types.
+  The wrapper API is named as ``erpc_psa_call``.
+
+  On the client side, the wrapper implements the ``psa_call`` which calls the ``erpc_psa_call`` in
+  the client shim layer.
+  On the server side, the wrapper implements the ``erpc_psa_call`` which is called by the shim layer.
+  The ``erpc_psa_call`` then calls the ``psa_call``.
+
+- Test Suites
+
+  Can be the existing TF-M regression tests or any other tests that interact with TF-M using the
+  PSA Client APIs.
+
+- Host App
+
+  Initializes the eRPC client and starts test suites.
+
+- Target App
+
+  Initializes the eRPC server and listens for requests from the client.
+
+Supported APIs
+==============
+
+The APIs supported for doing RPC are the PSA Client APIs because they are the lowest level APIs that
+interact with TF-M. You can build lots of test suites upon them.
+You can also add your own APIs in the ``tfm.erpc`` file.
+Please refer to `IDL Reference <https://github.com/EmbeddedRPC/erpc/wiki/IDL-Reference>`_ for the
+syntax of the file.
+
+API Grouping
+************
+
+PSA client APIs are categorised into common APIs and connection-based service APIs.
+Connection-based APIs are available when there are connection-based services in the TF-M.
+So in the eRPC integration, the APIs are also split into two groups so that the shim layer of the
+APIs can be separated into different files as well.
+Then build systems can decide which source files to build based on the existence of connection-based
+services.
+
+Common APIs:
+
+- psa_framework_version()
+- psa_version()
+- psa_call()
+
+Connection-based specific:
+
+- psa_connect()
+- psa_close()
+
+Transportation
+==============
+
+On device side, only UART transportation is supported in NSPE.
+For the host side, both UART and TCP are supported.
+The TCP transportation support is basically for fast models where UART data are transferred between
+a TCP/IP socket on the host and a serial port on the target.
+See the
+`fast model reference guide <https://developer.arm.com/documentation/100966/1116/Getting-Started-with-Fixed-Virtual-Platforms/Using-a-terminal-with-a-system-model>`_
+for more details.
+
+********************
+Platform Integration
+********************
+
+First, the UART drivers of platforms shall support TX/RX control feature.
+The TF-M build system provides a ``CONFIG_ENABLE_NS_UART_TX_RX_CONTROL`` option to enable or disable
+the TX/RX control feature and it is disabled by default.
+When the eRPC test framework is enabled, the ``CONFIG_ENABLE_NS_UART_TX_RX_CONTROL`` will be enabled
+automatically.
+
+Secondly, platforms need to specify the UART port and driver for eRPC transportation config via
+``target_cfg.h``.
+
+.. code-block::
+
+  #define ERPC_UART           Driver_USART0
+
+It's recommended to use a different UART to the stdio UART.
+If the same UART is used for both, then the TF-M logs (both SPM and Secure Partitions) must be
+disabled.
+Otherwise, the eRPC transportation might fail.
+
+***********************
+Application Integration
+***********************
+
+The TF-M eRPC test framework provides two CMake libraries for integration.
+One is the ``erpc_client``, the other is the ``erpc_server``.
+Both include the eRPC framework, the shim layers, API wrappers and expose an initialization API
+for client and server respectively.
+
+The initialization does not include the initialization of the transportation layer because it is use
+case specific which kind of transportation is used.
+So it is the client and server's responsibilities to initialize the transportation layers and pass
+them to the ``erpc_client`` and ``erpc_server``.
+
+TF-M provides a ``app/erpc_app.c`` as the default server application which initializes the UART
+transportation and starts the eRPC server.
+
+A config option ``CONFIG_TFM_ERPC_TEST_FRAMEWORK`` is provided to enable the eRPC framework on
+device (server) side.
+The default server will be built and developers only need to focus on the client application
+developments.
+
+In summary, on the server side, you only need to build with the ``CONFIG_TFM_ERPC_TEST_FRAMEWORK``
+enabled.
+On the client side, you must
+
+- Initializes the transportation layer using eRPC provided APIs.
+- Call the initialization function provided by TF-M eRPC test framework with the transportation
+  instance initialized above.
+- Develop the application code
+- Building with CMake
+
+  - ``add_subdirectory`` with the ``erpc/client``
+  - link the ``erpc_client`` library
+
+There is an example at ``erpc/host_example`` for reference.
+
+--------------
+
+*Copyright (c) 2023, Arm Limited. All rights reserved.*