<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>How to implement a custom service using a SPI interface on TF-M</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/79388/how-to-implement-a-custom-service-using-a-spi-interface-on-tf-m</link><description>Hi Sir/Madam, 
 
 Our project needs to use TEE on nRF5340 which seems to be implemented by TF-M for now and future. After investigating the implementation, I didn&amp;#39;t find a service sample that uses a peripheral from the secure world. Specifically, our</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 15 Sep 2021 14:55:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/79388/how-to-implement-a-custom-service-using-a-spi-interface-on-tf-m" /><item><title>RE: How to implement a custom service using a SPI interface on TF-M</title><link>https://devzone.nordicsemi.com/thread/329661?ContentTypeID=1</link><pubDate>Wed, 15 Sep 2021 14:55:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f686dd7-7ccb-47a1-9422-9a3471fbd251</guid><dc:creator>jli157@intel</dc:creator><description>&lt;p&gt;Understood. we can expose the SPI API&amp;nbsp;as a platform service like what you have done on exposing memory access on ioctl.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve already found an out-of-tree partition solution from &amp;nbsp;one of ARM&amp;#39;s TF-M pull requests:&amp;nbsp;&lt;a href="https://review.trustedfirmware.org/c/TF-M/trusted-firmware-m/+/10562" rel="nofollow"&gt;https://review.trustedfirmware.org/c/TF-M/trusted-firmware-m/+/10562&lt;/a&gt;&amp;nbsp;which is much useful.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you, Einar!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to implement a custom service using a SPI interface on TF-M</title><link>https://devzone.nordicsemi.com/thread/329563?ContentTypeID=1</link><pubDate>Wed, 15 Sep 2021 09:26:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cbea5c71-ae2f-4367-a59f-95f92909e18e</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="bleintel"]I read the ioctl&amp;#39;s implementation and thought it is just for reading memory block from somewhere.[/quote]
&lt;p&gt;Yes, that is how it is provided in the SDK, but you can modify it to your needs, adding more/arbitrary features in the same partition.&lt;/p&gt;
[quote user="bleintel"]How can I use it to control a SPI device?[/quote]
&lt;p&gt;You can expand it with whatever you need of functionality. If you need to control a SPI device, you can include nrfx SPI driver implementation file in the build and use that to control the SPI peripheral.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;(There is ongoing work to make it possible to add new partitions out of tree so this can be done in a cleaner way at some point in the future)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to implement a custom service using a SPI interface on TF-M</title><link>https://devzone.nordicsemi.com/thread/329531?ContentTypeID=1</link><pubDate>Wed, 15 Sep 2021 06:55:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4794b93-116f-46fe-aef1-ed30f263459f</guid><dc:creator>jli157@intel</dc:creator><description>&lt;p&gt;Hi Einar,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I read the ioctl&amp;#39;s implementation and thought it is just for reading memory block from somewhere. How can I use it to control a SPI device? I guess our application RoT could directly access the spi master driver from nordic SDK?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to implement a custom service using a SPI interface on TF-M</title><link>https://devzone.nordicsemi.com/thread/329324?ContentTypeID=1</link><pubDate>Tue, 14 Sep 2021 07:24:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f09484e-0126-49aa-8577-d2f5bd433ab8</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Jun,&lt;/p&gt;
&lt;p&gt;You do not need a separate partition. The ioctl partition is rather generic so I suggest you try to re-use the existing partition.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to implement a custom service using a SPI interface on TF-M</title><link>https://devzone.nordicsemi.com/thread/329126?ContentTypeID=1</link><pubDate>Mon, 13 Sep 2021 05:34:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6a8369a-571b-4c68-a278-a7b7faa1610a</guid><dc:creator>jli157@intel</dc:creator><description>&lt;p&gt;Hi Einar,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for the suggestions!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;One more question: our&amp;nbsp;application RoT will use the SPI master which doesn&amp;#39;t have an implementation in the HAL layer. To enable the application RoT to use the SPI driver, should a PSA RoT partition for the SPI driver be added as well, like ioctl partition which is implemented already?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Jun&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to implement a custom service using a SPI interface on TF-M</title><link>https://devzone.nordicsemi.com/thread/328779?ContentTypeID=1</link><pubDate>Thu, 09 Sep 2021 11:13:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6137d9b-d0c8-4f0d-9eed-f215688c31ec</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Jun,&lt;/p&gt;
&lt;p&gt;CryptoCell is integrated with TF-M, via the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/nrf_security/README.html"&gt;nrf_security module&lt;/a&gt;. Here mbed TLS is used as a frontend, and CryptoCell is used for operations that are supported by it. TF-M again sits on top of this.&lt;/p&gt;
&lt;p&gt;You can see this with some SDK examples. If you run&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/samples_crypto.html"&gt;Cryptography samples&lt;/a&gt; on a device with CryptoCell, that will be used. And if you also build for non-secure on the nRF9160 or nRF5340, TF-M will be used.&lt;/p&gt;
&lt;p&gt;(Note TF-M support in general is experimental in nRF Connect SDK 1.6.x.)&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to implement a custom service using a SPI interface on TF-M</title><link>https://devzone.nordicsemi.com/thread/328695?ContentTypeID=1</link><pubDate>Thu, 09 Sep 2021 05:33:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d846410b-1804-449f-9629-ac339e47ed62</guid><dc:creator>jli157@intel</dc:creator><description>&lt;p&gt;Hi Einar,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks agin for the help! The implication seems a nice example for me to get started.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;A further question: how is the status of integrating CryptoCell with TF-M? Is it fully functional for supporting the mbedTLS on the non-secure world, such as working as a backend for mbedTLS?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Jun&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to implement a custom service using a SPI interface on TF-M</title><link>https://devzone.nordicsemi.com/thread/328646?ContentTypeID=1</link><pubDate>Wed, 08 Sep 2021 14:27:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ed1db514-9540-4f8c-a3ff-aad8b4180030</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Li,&lt;/p&gt;
&lt;p&gt;You can refer to the &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/master/modules/tfm/tfm/boards/CMakeLists.txt#L64"&gt;implementation of the custom service to read memory to see how custom services are added to TF-M&lt;/a&gt;. You can add more services here using the same approach to add more services to the existing partition.&lt;/p&gt;
&lt;p&gt;Regarding SPIM you can use that from TF-M if it is configured for secure domain. If you for instance use the nrfx SPIM driver it makes sense to add the source files and include folder to the CMakeList.txt for linked to above.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>