Skip to content

Commit 7441ba7

Browse files
Tobias Badertscherdpgeorge
authored andcommitted
stmhal: L4: Make CCM/DTCM RAM start-up conditional on MCU type.
1 parent adaaf43 commit 7441ba7

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

stmhal/main.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -367,13 +367,15 @@ int main(void) {
367367
__GPIOC_CLK_ENABLE();
368368
__GPIOD_CLK_ENABLE();
369369

370-
#if defined(__HAL_RCC_DTCMRAMEN_CLK_ENABLE)
371-
// The STM32F746 doesn't really have CCM memory, but it does have DTCM,
372-
// which behaves more or less like normal SRAM.
373-
__HAL_RCC_DTCMRAMEN_CLK_ENABLE();
374-
#else
375-
// enable the CCM RAM
376-
__CCMDATARAMEN_CLK_ENABLE();
370+
#if defined(MCU_SERIES_F4) || defined(MCU_SERIES_F7)
371+
#if defined(__HAL_RCC_DTCMRAMEN_CLK_ENABLE)
372+
// The STM32F746 doesn't really have CCM memory, but it does have DTCM,
373+
// which behaves more or less like normal SRAM.
374+
__HAL_RCC_DTCMRAMEN_CLK_ENABLE();
375+
#else
376+
// enable the CCM RAM
377+
__CCMDATARAMEN_CLK_ENABLE();
378+
#endif
377379
#endif
378380

379381
#if defined(MICROPY_BOARD_EARLY_INIT)

0 commit comments

Comments
 (0)