Hi everyone, 

I am developing an App RoT for STM32L552 and testing the recent integrated FLIH interrupt feature, but I am missing something in the step of "Initializing the Interrupts" and "Integrating the Interrupt Handling Function".

As is described in Secure Interrupt Integration Guide, to enable an interrupt it is needed:
  1. Binding the interrupt to a Secure Partition.
  2. Granting the Secure Partition access permissions to the device of the interrupt.
  3. Initializing the interrupt.
  4. Integrating the interrupt handling function
Step 1 and 2,  think that is "checked":
  •  by adding this code to the partition manifest file.
"mmio_regions": [
    {
      "name": "TFM_PERIPHERAL_TIMER7",
      "permission": "READ-WRITE"
    }
  ],
  "irqs": [
    {
      "source": "TFM_TIMER7_IRQ",
      "name": "TFM_TIMER7_IRQ",
      "handling": "FLIH",
    }
 extern struct platform_data_t timer7
 #define TFM_PERIPHERAL_TIMER7 &timer7
struct platform_data_t timer7 = {
 __TIMER7_BASE,
 __TIMER7_BASE + 0x3FF,
 -1,
 -1
 };
const uintptr_t partition_named_mmio_list[] = {
 (uintptr_t)TFM_PERIPHERAL_TIMER0,
 (uintptr_t)TFM_PERIPHERAL_STD_UART,
 (uintptr_t) TFM_PERIPHERAL_TIMER7,
};
psa_flih_result_t tfm_timer7_irq_flih(void)
{
    ....
}

static void flih_test_case_1(psa_msg_t *msg) {
    psa_irq_enable(TFM_TIMER7_IRQ_SIGNAL);
    timer_start();
    .......
   timer_stop();
   psa_irq_disable(TFM_TIMER7_IRQ_SIGNAL);
    psa_reply(msg->handle, PSA_SUCCESS);
}

My problem, I think, is with the other two steps, 3 and 4. The TF-M documentation is not clear in these two steps. 

In step 3, as is said in the documentation it is needed: i) to configure the interrupt priority; ii) to ensure that the interrupt targets the Secure State. iii) and save the interrupt information. So I suppose it goes something like this:

struct irq_t {
    void                   *p_pt;
    struct irq_load_info_t *p_ildi;
} save_tfm_timer7_irq_info;

enum tfm_hal_status_t tfm_timer7_irq_init(void *p_pt, struct irq_load_info_t *p_ildi)
{
  //targetting the interrupt to S state
  NVIC_ClearTargetState(TIM7_IRQn);
  NVIC_SetPriority(TIM7_IRQn, 1);
  NVIC_EnableIRQ(TIM7_IRQn);
  //Saving the Interrupt Information
  save_tfm_timer7_irq_info.p_pt = p_pt;
  save_tfm_timer7_irq_info.p_ildi = p_ildi;
  return TFM_HAL_SUCCESS;
}

But in which file should I put this function? And where should I call this function??

And in step 4, I also do not understand how can I meet this requirement -> "Platforms should call this entry function in the interrupt handlers defined in Vector Table with the saved information for each interrupt."
Being  the function in question ->  void spm_handle_interrupt(void *p_pt, struct irq_load_info_t *p_ildi).

Which file can I do this in? And how should I do this step?

Cheers,
Cristiano Rodrigues