Skip to content

Commit ea592bb

Browse files
committed
core: U5: enable HAL ICACHE
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent ae2b3a0 commit ea592bb

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

cores/arduino/stm32/stm32yyxx_hal_conf.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@
6565
#undef HAL_TIM_MODULE_ENABLED
6666
#endif
6767

68+
#if !defined(HAL_ICACHE_MODULE_DISABLED)
69+
#define HAL_ICACHE_MODULE_ENABLED
70+
#else
71+
#undef HAL_ICACHE_MODULE_ENABLED
72+
#endif
73+
6874
/*
6975
* Not defined by default
7076
*/
@@ -137,7 +143,6 @@
137143
HAL_HASH_MODULE_ENABLED
138144
HAL_HCD_MODULE_ENABLED
139145
HAL_HRTIM_MODULE_ENABLED
140-
HAL_ICACHE_MODULE_ENABLED
141146
HAL_IRDA_MODULE_ENABLED
142147
HAL_IWDG_MODULE_ENABLED // IWD built-in library uses LL
143148
HAL_JPEG_MODULE_ENABLED

libraries/SrcWrapper/src/stm32/hw_config.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ void hw_config_init(void)
5353
#if defined (USBCON) && defined(USBD_USE_CDC)
5454
USBD_CDC_init();
5555
#endif
56+
57+
#if (__CORTEX_M == 33U) &&\
58+
defined(HAL_ICACHE_MODULE_ENABLED) && !defined(HAL_ICACHE_MODULE_DISABLED)
59+
if (HAL_ICACHE_ConfigAssociativityMode(ICACHE_1WAY) != HAL_OK) {
60+
Error_Handler();
61+
}
62+
if (HAL_ICACHE_Enable() != HAL_OK) {
63+
Error_Handler();
64+
}
65+
#endif
5666
}
5767
#ifdef __cplusplus
5868
}

0 commit comments

Comments
 (0)