1 /**
2   ******************************************************************************
3   * @file    boot_hal_cfg.h
4   * @author  MCD Application Team
5   * @brief   File fixing configuration flag specific for STM32U5xx platform
6   *
7   ******************************************************************************
8   * @attention
9   *
10   * <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.
11   * All rights reserved.</center></h2>
12   *
13   * This software component is licensed by ST under BSD 3-Clause license,
14   * the "License"; You may not use this file except in compliance with the
15   * License. You may obtain a copy of the License at:
16   *                        opensource.org/licenses/BSD-3-Clause
17   *
18   ******************************************************************************
19   */
20 
21 
22 /* Define to prevent recursive inclusion -------------------------------------*/
23 #ifndef BOOT_HAL_CFG_H
24 #define BOOT_HAL_CFG_H
25 
26 /* Includes ------------------------------------------------------------------*/
27 #include "stm32u5xx_hal.h"
28 
29 /* RTC clock */
30 #define  RTC_CLOCK_SOURCE_LSI
31 #ifdef RTC_CLOCK_SOURCE_LSI
32 #define RTC_ASYNCH_PREDIV  0x7F
33 #define RTC_SYNCH_PREDIV   0x00F9
34 #endif
35 #ifdef RTC_CLOCK_SOURCE_LSE
36 #define RTC_ASYNCH_PREDIV  0x7F
37 #define RTC_SYNCH_PREDIV   0x00FF
38 #endif
39 
40 /* ICache */
41 #define TFM_ICACHE_ENABLE /*!< Instruction cache enable */
42 
43 /* Static protections */
44 #define TFM_WRP_PROTECT_ENABLE  /*!< Write Protection  */
45 #define TFM_HDP_PROTECT_ENABLE /*!< HDP protection   */
46 #define TFM_SECURE_USER_SRAM2_ERASE_AT_RESET /*!< SRAM2 clear at Reset  */
47 
48 
49 #define TFM_OB_RDP_LEVEL_VALUE OB_RDP_LEVEL_0 /*!< RDP level */
50 
51 
52 #define NO_TAMPER            (0)                /*!< No tamper activated */
53 #define INTERNAL_TAMPER_ONLY (1)                /*!< Only Internal tamper activated */
54 #define ALL_TAMPER           (2)                /*!< Internal and External tamper activated */
55 #define TFM_TAMPER_ENABLE NO_TAMPER            /*!< TAMPER configuration flag  */
56 
57 
58 #define TFM_OB_BOOT_LOCK 0 /*!< BOOT Lock expected value  */
59 #define TFM_ENABLE_SET_OB /*!< Option bytes are set by TFM_SBSFU_Boot when not correctly set  */
60 #define TFM_ERROR_HANDLER_NON_SECURE /*!< Error handler is in Non Secure , this allows regression without jumping   */
61 
62 /* Run time protections */
63 #define TFM_FLASH_PRIVONLY_ENABLE  /*!< Flash Command in Privileged only  */
64 #define TFM_BOOT_MPU_PROTECTION    /*!< TFM_SBSFU_Boot uses MPU to prevent execution outside of TFM_SBSFU_Boot code  */
65 
66 /* Exported types ------------------------------------------------------------*/
67 typedef enum
68 {
69   TFM_SUCCESS = 0U,
70   TFM_FAILED
71 } TFM_ErrorStatus;
72 
73 /* Exported constants --------------------------------------------------------*/
74 /* Exported macro ------------------------------------------------------------*/
75 /* Exported functions ------------------------------------------------------- */
76 void Error_Handler(void);
77 #ifndef TFM_ERROR_HANDLER_NON_SECURE
78 void Error_Handler_rdp(void);
79 #else
80 #define Error_Handler_rdp Error_Handler
81 #endif
82 #endif /* GENERATOR_RDP_PASSWORD_AVAILABLE */
83 
84 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
85