Hi Bohdan,

 

Regarding Musca-B1 specific implementation, @Mark Horvath may help give the details.

 

Regarding the duplicated reset() in tfm_core_panic(), your understanding is correct.

I will add the missing comment. Thanks a lot for pointing it out.

 

Best regards,

Hu Ziji

 

From: Bohdan.Hunko--- via TF-M <tf-m@lists.trustedfirmware.org>
Sent: Friday, January 28, 2022 10:08 PM
To: tf-m@lists.trustedfirmware.org
Cc: Roman.Mazurak@infineon.com; Nazar.Chornenkyy@infineon.com
Subject: [TF-M] Custom implementation of of tfm_hal_system_reset

 

Hi everyone,

 

I have a few questions related to TF-M code:

  1. Default implementation of tfm_hal_system_reset(void) from platform/ext/common/tfm_platform.c just calls NVIC_SystemReset(), but some ARM platform, take musca_b1 for example, reimplement it (platform/ext/target/arm/musca_b1/sse_200/tfm_hal_platform.c ).

Custom implementations tend to also disable and clean IRQ and call mpc_revert_non_secure_to_secure_cfg();

Is there any benefits of doing that??? If so then what those benefits are?

  1. tfm_core_panic() (secure_fw/spm/ffm/utilities.c) when TFM_FIH_PROFILE_ON is defined calls fih_delay() and tfm_hal_system_reset() twice. Is this done to ensure that tfm_hal_system_reset() will be called (even if first one was skipped there is second one)? And if so, can a comment be added there to highlight that intention?

 

Regards,

Bohdan Hunko

 

Cypress Semiconductor Ukraine

Engineer

CSUKR CSS ICW SW FW

Mobile: +38099 50 19 714
Bohdan.Hunko@infineon.com