Hi Poppy,
The setup looks good.
Have you checked the NVIC_ISPR to read the pending status? Have you also modified vector table in the startup file to make sure the interrupt handling will finally call your spi0_tx_isr()?
Best Regards, Kevin
From: Edward Yang EdwardYang@mxic.com.cn Sent: Wednesday, May 18, 2022 1:38 PM To: Kevin Peng Kevin.Peng@arm.com; tf-m@lists.trustedfirmware.org Cc: Poppy Wu poppywu@mxic.com.cn Subject: Re: [TF-M] Re: Enable SPI interrupt in secure partition
Hi Kevin,
Thanks for your instruction.
We're developing an application RoT partition which access a sensor via an SPI interface(Based on RA6M4_EK development board). After commands have been transferred to the sensor, an SPI_TX_INTERRUPT should be triggered, then calls spi_tx_isr().
Now let's put aside binding secure interrupts to each secure partition, just talk about how to enable SPI interrupts in secure world simply.
Here is my implementation:
1.Configure this SPI peripheral as secure peripheral. 2.Assign SPI tx and rx interrupts to secure state by setting NVIC->ITNS register. 3.Enable SPI tx and rx interrupts by seeting NVIC->ISER register.
But during debug, I found that spi0_tx_isr() (The ISRs are also placed under this application RoT partition's folder) has never been triggered. Is there anything that I miss?
Best Regards, Poppy Wu 吴偏偏
Macronix Microelectronics (Suzhou) Co.,Ltd 旺宏微电子(苏州)有限公司 http://www.mxic.com.cnhttp://www.mxic.com.cn/
Kevin Peng via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org>
2022/05/17 09:45 Please respond to Kevin Peng <Kevin.Peng@arm.commailto:Kevin.Peng@arm.com> To Edward Yang <EdwardYang@mxic.com.cnmailto:EdwardYang@mxic.com.cn>, "tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org" <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> cc Subject [TF-M] Re: Enable SPI interrupt in secure partition
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/suit...
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/suit... 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/suit... Note that, no PSA APIs are allowed in the handling.
Best Regards, Kevin
From: Edward Yang via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: Monday, May 16, 2022 5:38 PM To: tf-m@lists.trustedfirmware.orgmailto: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.cnhttp://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.
=====================================================================-- TF-M mailing list -- tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org To unsubscribe send an email to tf-m-leave@lists.trustedfirmware.orgmailto:tf-m-leave@lists.trustedfirmware.org
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 it attachments 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.
=====================================================================