Hi Poppy,

 

First-Level Interrupt Handling (FLIH) should be recommended in your use case as you have latency requirements.

Here is an example:

https://git.trustedfirmware.org/TF-M/tf-m-tests.git/tree/test/secure_fw/suites/spm/irq/service/tfm_flih_test_service

 

You’ll firstly need to add an “irq” item in the manifest and “handling” it with “FLIH”:

https://git.trustedfirmware.org/TF-M/tf-m-tests.git/tree/test/secure_fw/suites/spm/irq/service/tfm_flih_test_service/tfm_flih_test_service.yaml#n33

And also add the “mmio_regions” item with the associated device (SPI) to give access permissions to the Secure Partition.

 

The IRQ handling should be in the Secure Partition:

https://git.trustedfirmware.org/TF-M/tf-m-tests.git/tree/test/secure_fw/suites/spm/irq/service/tfm_flih_test_service/tfm_flih_test_service.c#n15

Note that, no PSA APIs are allowed in the handling.

 

Best Regards,

Kevin

 

From: Edward Yang via TF-M <tf-m@lists.trustedfirmware.org>
Sent: Monday, May 16, 2022 5:38 PM
To: tf-m@lists.trustedfirmware.org
Subject: [TF-M] Enable SPI interrupt in secure partition

 


Hi experts,

Recently we're developing a demo based on TF-M, this demo involves using SPI module to drive a sensor by sending commands in a secure partition.

And we need to enable SPI receive and send interrupt in this secure partition and the latency shall be as small as possible. I am wondering how to implement this secure interrupts. Is there any example code or instrucstions?

Thanks.

Best Regards,
Poppy Wu
吴偏偏

Macronix Microelectronics (Suzhou) Co.,Ltd
旺宏微电子(苏州)有限公司
http://www.mxic.com.cn

CONFIDENTIALITY NOTE:

This e-mail and any attachments may contain confidential information and/or personal data, which is protected by applicable laws. Please be reminded that duplication, disclosure, distribution, or use of this e-mail (and/or its attachments) or any part thereof is prohibited. If you receive this e-mail in error, please notify us immediately and delete this mail as well as its attachment(s) from your system. In addition, please be informed that collection, processing, and/or use of personal data is prohibited unless expressly permitted by personal data protection laws. Thank you for your attention and cooperation.

Macronix International Co., Ltd.

=====================================================================