summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorTobias Badertscher <python@baerospace.ch>2016-03-27 11:58:19 +0200
committerDamien George <damien.p.george@gmail.com>2016-05-05 15:19:33 +0100
commit7441ba7749508ef1731493892a32bf3d821e8cb2 (patch)
tree8101d06b765087acb181a86a12322a1f2a12ac89
parentadaaf439b06a5ccf47ef8eeea41790e2da13d33a (diff)
downloadmicropython-7441ba7749508ef1731493892a32bf3d821e8cb2.tar.gz
micropython-7441ba7749508ef1731493892a32bf3d821e8cb2.zip
stmhal: L4: Make CCM/DTCM RAM start-up conditional on MCU type.
-rw-r--r--stmhal/main.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/stmhal/main.c b/stmhal/main.c
index 329109cd3d..30dddaf989 100644
--- a/stmhal/main.c
+++ b/stmhal/main.c
@@ -367,13 +367,15 @@ int main(void) {
__GPIOC_CLK_ENABLE();
__GPIOD_CLK_ENABLE();
- #if defined(__HAL_RCC_DTCMRAMEN_CLK_ENABLE)
- // The STM32F746 doesn't really have CCM memory, but it does have DTCM,
- // which behaves more or less like normal SRAM.
- __HAL_RCC_DTCMRAMEN_CLK_ENABLE();
- #else
- // enable the CCM RAM
- __CCMDATARAMEN_CLK_ENABLE();
+ #if defined(MCU_SERIES_F4) || defined(MCU_SERIES_F7)
+ #if defined(__HAL_RCC_DTCMRAMEN_CLK_ENABLE)
+ // The STM32F746 doesn't really have CCM memory, but it does have DTCM,
+ // which behaves more or less like normal SRAM.
+ __HAL_RCC_DTCMRAMEN_CLK_ENABLE();
+ #else
+ // enable the CCM RAM
+ __CCMDATARAMEN_CLK_ENABLE();
+ #endif
#endif
#if defined(MICROPY_BOARD_EARLY_INIT)