zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.81k stars 6.59k forks source link

Nucleo L552ZEQ TFM-IPC HardFault #77847

Open faintdono opened 2 months ago

faintdono commented 2 months ago

Describe the bug when flash the STM board with TFM IPC samples I got hardfault

[INF] Starting bootloader
[INF] Beginning BL2 provisioning
[WRN] TFM_DUMMY_PROVISIONING is not suitable for production! This device is NOT SECURE
[INF] PSA Crypto init done, sig_type: EC-P256
[INF] Image index: 1, Swap type: none
[INF] Image index: 0, Swap type: none
[INF] Bootloader chainload address offset: 0x14000
[INF] Jumping to the first image slot
Booting TF-M v2.1.0
[INF] Beginning TF-M provisioning
[WRN] TFM_DUMMY_PROVISIONING is not suitable for production! This device is NOT SECURE
[WRN] This device was provisioned with dummy keys. This device is NOT SECURE
[Sec Thread] Secure image initializing!
Creating an empty ITS flash layout.
Creating an empty PS flash layout.
[INF][PS] Encryption alg: 0x5500200
[INF][Crypto] Init HW accelerator...
[INF][Crypto] Init HW accelerator... complete.
FATAL ERROR: HardFault

To Reproduce Steps to reproduce the behavior:

  1. west build -b nucleo_l552ze_q/stm32l552xx/ns samples/tfm_integration/tfm_ipc/
  2. ./build/tfm/api_ns/regression.sh
  3. west flash

Environment (please complete the following information):

github-actions[bot] commented 2 months ago

Hi @faintdono! We appreciate you submitting your first issue for our open-source project. 🌟

Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙

erwango commented 1 month ago

Some info on this issue (mostly for myslelf)

FATAL ERROR happens in TF-M binary as a seg fault. Error not reproduced in TF-M only environment (tfm tests). Issue doesn't happen in step by step debugging (set break point on backend_abi_leaving_spm; ignore next 93 crossings of breakpoint...) Git bisect won't work as for some reason flashing could not work reliably across various git commits. (Also I've not been able to find a last good version .... which is suspicious).

faintdono commented 1 month ago

I think may be there's problem in my hardware side (STM32 board). So do you mind to provide me your Option Bytes Settings ?