diff --git a/boards.txt b/boards.txt index 65eaf59dbd..d95899abad 100644 --- a/boards.txt +++ b/boards.txt @@ -37,7 +37,7 @@ Nucleo_144.menu.pnum.NUCLEO_F207ZG.build.cmsis_lib_gcc=arm_cortexM3l_math Nucleo_144.menu.pnum.NUCLEO_F429ZI=Nucleo F429ZI Nucleo_144.menu.pnum.NUCLEO_F429ZI.node=NODE_F429ZI Nucleo_144.menu.pnum.NUCLEO_F429ZI.upload.maximum_size=2097152 -Nucleo_144.menu.pnum.NUCLEO_F429ZI.upload.maximum_data_size=262144 +Nucleo_144.menu.pnum.NUCLEO_F429ZI.upload.maximum_data_size=196608 Nucleo_144.menu.pnum.NUCLEO_F429ZI.build.mcu=cortex-m4 Nucleo_144.menu.pnum.NUCLEO_F429ZI.build.flags.fp=-mfpu=fpv4-sp-d16 -mfloat-abi=hard Nucleo_144.menu.pnum.NUCLEO_F429ZI.build.board=NUCLEO_F429ZI @@ -398,7 +398,7 @@ Nucleo_64.menu.pnum.NUCLEO_L476RG.build.cmsis_lib_gcc=arm_cortexM4lf_math # PNUCLEO_WB55RG board Nucleo_64.menu.pnum.PNUCLEO_WB55RG=P-Nucleo WB55RG -Nucleo_64.menu.pnum.PNUCLEO_WB55RG.node=NODE_WB55RG +Nucleo_64.menu.pnum.PNUCLEO_WB55RG.node="NODE_WB55RG,NOD_WB55RG" Nucleo_64.menu.pnum.PNUCLEO_WB55RG.upload.maximum_size=524288 Nucleo_64.menu.pnum.PNUCLEO_WB55RG.upload.maximum_data_size=196604 Nucleo_64.menu.pnum.PNUCLEO_WB55RG.build.mcu=cortex-m4 @@ -571,7 +571,7 @@ Disco.menu.pnum.DISCO_F100RB.build.cmsis_lib_gcc=arm_cortexM3l_math Disco.menu.pnum.DISCO_F407VG=STM32F407G-DISC1 Disco.menu.pnum.DISCO_F407VG.node=DIS_F407VG Disco.menu.pnum.DISCO_F407VG.upload.maximum_size=1048576 -Disco.menu.pnum.DISCO_F407VG.upload.maximum_data_size=196608 +Disco.menu.pnum.DISCO_F407VG.upload.maximum_data_size=131072 Disco.menu.pnum.DISCO_F407VG.build.mcu=cortex-m4 Disco.menu.pnum.DISCO_F407VG.build.flags.fp=-mfpu=fpv4-sp-d16 -mfloat-abi=hard Disco.menu.pnum.DISCO_F407VG.build.board=DISCO_F407VG @@ -1137,7 +1137,7 @@ GenF4.menu.pnum.Generic_F423CH.build.variant=Generic_F4x3Cx # Generic F417VG GenF4.menu.pnum.Generic_F417VG=Generic F417VG GenF4.menu.pnum.Generic_F417VG.upload.maximum_size=1048576 -GenF4.menu.pnum.Generic_F417VG.upload.maximum_data_size=196608 +GenF4.menu.pnum.Generic_F417VG.upload.maximum_data_size=131072 GenF4.menu.pnum.Generic_F417VG.build.board=GENERIC_F417VG GenF4.menu.pnum.Generic_F417VG.build.product_line=STM32F417xx GenF4.menu.pnum.Generic_F417VG.build.variant=Generic_F4x7Vx @@ -1145,7 +1145,7 @@ GenF4.menu.pnum.Generic_F417VG.build.variant=Generic_F4x7Vx # Generic F417VE GenF4.menu.pnum.Generic_F417VE=Generic F417VE GenF4.menu.pnum.Generic_F417VE.upload.maximum_size=524288 -GenF4.menu.pnum.Generic_F417VE.upload.maximum_data_size=196608 +GenF4.menu.pnum.Generic_F417VE.upload.maximum_data_size=131072 GenF4.menu.pnum.Generic_F417VE.build.board=GENERIC_F417VE GenF4.menu.pnum.Generic_F417VE.build.product_line=STM32F417xx GenF4.menu.pnum.Generic_F417VE.build.variant=Generic_F4x7Vx @@ -1153,7 +1153,7 @@ GenF4.menu.pnum.Generic_F417VE.build.variant=Generic_F4x7Vx # Generic F415RG GenF4.menu.pnum.Generic_F415RG=Generic F415RG GenF4.menu.pnum.Generic_F415RG.upload.maximum_size=1048576 -GenF4.menu.pnum.Generic_F415RG.upload.maximum_data_size=196608 +GenF4.menu.pnum.Generic_F415RG.upload.maximum_data_size=131072 GenF4.menu.pnum.Generic_F415RG.build.board=GENERIC_F415RG GenF4.menu.pnum.Generic_F415RG.build.product_line=STM32F415xx GenF4.menu.pnum.Generic_F415RG.build.variant=Generic_F4x5RG @@ -1180,7 +1180,7 @@ GenF4.menu.pnum.Generic_F413CH.upload.maximum_size=1572864 GenF4.menu.pnum.Generic_F413CH.upload.maximum_data_size=327680 GenF4.menu.pnum.Generic_F413CH.build.board=GENERIC_F413CH GenF4.menu.pnum.Generic_F413CH.build.product_line=STM32F413xx -GenF4.menu.pnum.Generic_F413CH.build.variant=Generic_F4x3Rx +GenF4.menu.pnum.Generic_F413CH.build.variant=Generic_F4x3Cx # Generic F413CG GenF4.menu.pnum.Generic_F413CG=Generic F413CG @@ -1289,7 +1289,7 @@ GenF4.menu.pnum.Generic_F410C8.build.variant=Generic_F410Cx # Generic F407VG GenF4.menu.pnum.Generic_F407VG=Generic F407VG GenF4.menu.pnum.Generic_F407VG.upload.maximum_size=1048576 -GenF4.menu.pnum.Generic_F407VG.upload.maximum_data_size=196608 +GenF4.menu.pnum.Generic_F407VG.upload.maximum_data_size=131072 GenF4.menu.pnum.Generic_F407VG.build.board=GENERIC_F407VG GenF4.menu.pnum.Generic_F407VG.build.product_line=STM32F407xx GenF4.menu.pnum.Generic_F407VG.build.variant=Generic_F4x7Vx @@ -1297,7 +1297,7 @@ GenF4.menu.pnum.Generic_F407VG.build.variant=Generic_F4x7Vx # Generic F407VE GenF4.menu.pnum.Generic_F407VE=Generic F407VE GenF4.menu.pnum.Generic_F407VE.upload.maximum_size=524288 -GenF4.menu.pnum.Generic_F407VE.upload.maximum_data_size=196608 +GenF4.menu.pnum.Generic_F407VE.upload.maximum_data_size=131072 GenF4.menu.pnum.Generic_F407VE.build.board=GENERIC_F407VE GenF4.menu.pnum.Generic_F407VE.build.product_line=STM32F407xx GenF4.menu.pnum.Generic_F407VE.build.variant=Generic_F4x7Vx @@ -1305,7 +1305,7 @@ GenF4.menu.pnum.Generic_F407VE.build.variant=Generic_F4x7Vx # Generic F405RG GenF4.menu.pnum.Generic_F405RG=Generic F405RG GenF4.menu.pnum.Generic_F405RG.upload.maximum_size=1048576 -GenF4.menu.pnum.Generic_F405RG.upload.maximum_data_size=196608 +GenF4.menu.pnum.Generic_F405RG.upload.maximum_data_size=131072 GenF4.menu.pnum.Generic_F405RG.build.board=GENERIC_F405RG GenF4.menu.pnum.Generic_F405RG.build.product_line=STM32F405xx GenF4.menu.pnum.Generic_F405RG.build.variant=Generic_F4x5RG @@ -1613,7 +1613,7 @@ LoRa.menu.upload_method.dfuMethod.upload.tool=stm32CubeProg # PRNTR_F407_V1 board 3dprinter.menu.pnum.PRNTR_F407_V1=PRNTR F407 v1 3dprinter.menu.pnum.PRNTR_F407_V1.upload.maximum_size=524288 -3dprinter.menu.pnum.PRNTR_F407_V1.upload.maximum_data_size=196608 +3dprinter.menu.pnum.PRNTR_F407_V1.upload.maximum_data_size=131072 3dprinter.menu.pnum.PRNTR_F407_V1.build.mcu=cortex-m4 3dprinter.menu.pnum.PRNTR_F407_V1.build.flags.fp=-mfpu=fpv4-sp-d16 -mfloat-abi=hard 3dprinter.menu.pnum.PRNTR_F407_V1.build.board=PRNTR_F407_V1 @@ -1625,7 +1625,7 @@ LoRa.menu.upload_method.dfuMethod.upload.tool=stm32CubeProg # PRNTR_V2 board 3dprinter.menu.pnum.PRNTR_V2=PRNTR v2 3dprinter.menu.pnum.PRNTR_V2.upload.maximum_size=524288 -3dprinter.menu.pnum.PRNTR_V2.upload.maximum_data_size=196608 +3dprinter.menu.pnum.PRNTR_V2.upload.maximum_data_size=131072 3dprinter.menu.pnum.PRNTR_V2.build.mcu=cortex-m4 3dprinter.menu.pnum.PRNTR_V2.build.flags.fp=-mfpu=fpv4-sp-d16 -mfloat-abi=hard 3dprinter.menu.pnum.PRNTR_V2.build.board=PRNTR_V2 diff --git a/variants/BLACK_F407XX/variant.cpp b/variants/BLACK_F407XX/variant.cpp index 8094995148..83e71da379 100644 --- a/variants/BLACK_F407XX/variant.cpp +++ b/variants/BLACK_F407XX/variant.cpp @@ -222,6 +222,10 @@ WEAK void SystemClock_Config(void) if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); } + + /* Ensure CCM RAM clock is enabled */ + __HAL_RCC_CCMDATARAMEN_CLK_ENABLE(); + } #ifdef __cplusplus diff --git a/variants/BLUE_F407VE_Mini/variant.cpp b/variants/BLUE_F407VE_Mini/variant.cpp index ecbf711bcb..f05506428c 100644 --- a/variants/BLUE_F407VE_Mini/variant.cpp +++ b/variants/BLUE_F407VE_Mini/variant.cpp @@ -205,6 +205,10 @@ WEAK void SystemClock_Config(void) if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); } + + /* Ensure CCM RAM clock is enabled */ + __HAL_RCC_CCMDATARAMEN_CLK_ENABLE(); + } #ifdef __cplusplus diff --git a/variants/DISCO_F407VG/ldscript.ld b/variants/DISCO_F407VG/ldscript.ld index 712ddeb836..d5ac4c137f 100644 --- a/variants/DISCO_F407VG/ldscript.ld +++ b/variants/DISCO_F407VG/ldscript.ld @@ -14,14 +14,13 @@ ** ** Target : STMicroelectronics STM32 ** -** -** Distribution: The file is distributed as is, without any warranty +** Distribution: The file is distributed “as is,” without any warranty ** of any kind. ** ***************************************************************************** ** @attention ** -**

© COPYRIGHT(c) 2014 Ac6

+**

© COPYRIGHT(c) 2019 STMicroelectronics

** ** Redistribution and use in source and binary forms, with or without modification, ** are permitted provided that the following conditions are met: @@ -30,7 +29,7 @@ ** 2. Redistributions in binary form must reproduce the above copyright notice, ** this list of conditions and the following disclaimer in the documentation ** and/or other materials provided with the distribution. -** 3. Neither the name of Ac6 nor the names of its contributors +** 3. Neither the name of STMicroelectronics nor the names of its contributors ** may be used to endorse or promote products derived from this software ** without specific prior written permission. ** @@ -54,15 +53,15 @@ ENTRY(Reset_Handler) /* Highest address of the user mode stack */ _estack = 0x20020000; /* end of RAM */ /* Generate a link error if heap and stack don't fit into RAM */ -_Min_Heap_Size = 0x200;; /* required amount of heap */ -_Min_Stack_Size = 0x400;; /* required amount of stack */ +_Min_Heap_Size = 0x200; /* required amount of heap */ +_Min_Stack_Size = 0x400; /* required amount of stack */ /* Specify the memory areas */ MEMORY { -FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K +FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K } /* Define output sections */ @@ -77,7 +76,7 @@ SECTIONS } >FLASH /* The program code and other data goes into FLASH */ - .text ALIGN(4): + .text : { . = ALIGN(4); *(.text) /* .text sections (code) */ @@ -94,7 +93,7 @@ SECTIONS } >FLASH /* Constant data goes into FLASH */ - .rodata ALIGN(4): + .rodata : { . = ALIGN(4); *(.rodata) /* .rodata sections (constants, strings, etc.) */ @@ -184,12 +183,12 @@ SECTIONS /* User_heap_stack section, used to check that there is enough RAM left */ ._user_heap_stack : { - . = ALIGN(4); + . = ALIGN(8); PROVIDE ( end = . ); PROVIDE ( _end = . ); . = . + _Min_Heap_Size; . = . + _Min_Stack_Size; - . = ALIGN(4); + . = ALIGN(8); } >RAM diff --git a/variants/DISCO_F407VG/variant.cpp b/variants/DISCO_F407VG/variant.cpp index 3aa10927ea..530f438123 100644 --- a/variants/DISCO_F407VG/variant.cpp +++ b/variants/DISCO_F407VG/variant.cpp @@ -190,6 +190,10 @@ WEAK void SystemClock_Config(void) /* Enable the Flash prefetch */ __HAL_FLASH_PREFETCH_BUFFER_ENABLE(); } + + /* Ensure CCM RAM clock is enabled */ + __HAL_RCC_CCMDATARAMEN_CLK_ENABLE(); + } #ifdef __cplusplus diff --git a/variants/DIYMORE_F407VGT/variant.cpp b/variants/DIYMORE_F407VGT/variant.cpp index 98e8945738..b316d665d0 100644 --- a/variants/DIYMORE_F407VGT/variant.cpp +++ b/variants/DIYMORE_F407VGT/variant.cpp @@ -206,6 +206,10 @@ WEAK void SystemClock_Config(void) if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); } + + /* Ensure CCM RAM clock is enabled */ + __HAL_RCC_CCMDATARAMEN_CLK_ENABLE(); + } #ifdef __cplusplus diff --git a/variants/FEATHER_F405/variant.cpp b/variants/FEATHER_F405/variant.cpp index 0a615bcbca..86cfdc37bf 100644 --- a/variants/FEATHER_F405/variant.cpp +++ b/variants/FEATHER_F405/variant.cpp @@ -132,6 +132,10 @@ WEAK void SystemClock_Config(void) if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); } + + /* Ensure CCM RAM clock is enabled */ + __HAL_RCC_CCMDATARAMEN_CLK_ENABLE(); + } #ifdef __cplusplus diff --git a/variants/FK407M1/variant.cpp b/variants/FK407M1/variant.cpp index 813d9dbbad..01064d284a 100644 --- a/variants/FK407M1/variant.cpp +++ b/variants/FK407M1/variant.cpp @@ -153,6 +153,10 @@ WEAK void SystemClock_Config(void) if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); } + + /* Ensure CCM RAM clock is enabled */ + __HAL_RCC_CCMDATARAMEN_CLK_ENABLE(); + } #ifdef __cplusplus diff --git a/variants/Generic_F412Cx/ldscript.ld b/variants/Generic_F412Cx/ldscript.ld index 432ea552f4..001bfc3ddb 100644 --- a/variants/Generic_F412Cx/ldscript.ld +++ b/variants/Generic_F412Cx/ldscript.ld @@ -61,7 +61,6 @@ _Min_Stack_Size = 0x400; /* required amount of stack */ MEMORY { RAM (xrw) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE -CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET } @@ -77,7 +76,7 @@ SECTIONS } >FLASH /* The program code and other data goes into FLASH */ - .text ALIGN(8): + .text : { . = ALIGN(4); *(.text) /* .text sections (code) */ @@ -94,7 +93,7 @@ SECTIONS } >FLASH /* Constant data goes into FLASH */ - .rodata ALIGN(4): + .rodata : { . = ALIGN(4); *(.rodata) /* .rodata sections (constants, strings, etc.) */ @@ -145,25 +144,6 @@ SECTIONS _edata = .; /* define a global symbol at data end */ } >RAM AT> FLASH - _siccmram = LOADADDR(.ccmram); - - /* CCM-RAM section - * - * IMPORTANT NOTE! - * If initialized variables will be placed in this section, - * the startup code needs to be modified to copy the init-values. - */ - .ccmram : - { - . = ALIGN(4); - _sccmram = .; /* create a global symbol at ccmram start */ - *(.ccmram) - *(.ccmram*) - - . = ALIGN(4); - _eccmram = .; /* create a global symbol at ccmram end */ - } >CCMRAM AT> FLASH - /* Uninitialized data section */ . = ALIGN(4); diff --git a/variants/Generic_F412Rx/ldscript.ld b/variants/Generic_F412Rx/ldscript.ld index bbd62a8723..961faf59b7 100644 --- a/variants/Generic_F412Rx/ldscript.ld +++ b/variants/Generic_F412Rx/ldscript.ld @@ -4,6 +4,7 @@ ** File : LinkerScript.ld ** +** Author : Auto-generated by System Workbench for STM32 ** ** Abstract : Linker script for STM32F412Rx series ** 512/1024Kbytes FLASH and 256Kbytes RAM @@ -61,7 +62,6 @@ _Min_Stack_Size = 0x400; /* required amount of stack */ MEMORY { RAM (xrw) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE -CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET } @@ -77,7 +77,7 @@ SECTIONS } >FLASH /* The program code and other data goes into FLASH */ - .text ALIGN(8): + .text : { . = ALIGN(4); *(.text) /* .text sections (code) */ @@ -94,7 +94,7 @@ SECTIONS } >FLASH /* Constant data goes into FLASH */ - .rodata ALIGN(4): + .rodata : { . = ALIGN(4); *(.rodata) /* .rodata sections (constants, strings, etc.) */ @@ -145,25 +145,6 @@ SECTIONS _edata = .; /* define a global symbol at data end */ } >RAM AT> FLASH - _siccmram = LOADADDR(.ccmram); - - /* CCM-RAM section - * - * IMPORTANT NOTE! - * If initialized variables will be placed in this section, - * the startup code needs to be modified to copy the init-values. - */ - .ccmram : - { - . = ALIGN(4); - _sccmram = .; /* create a global symbol at ccmram start */ - *(.ccmram) - *(.ccmram*) - - . = ALIGN(4); - _eccmram = .; /* create a global symbol at ccmram end */ - } >CCMRAM AT> FLASH - /* Uninitialized data section */ . = ALIGN(4); diff --git a/variants/Generic_F4x3Cx/ldscript.ld b/variants/Generic_F4x3Cx/ldscript.ld index 5287205220..3956e1ca33 100644 --- a/variants/Generic_F4x3Cx/ldscript.ld +++ b/variants/Generic_F4x3Cx/ldscript.ld @@ -61,7 +61,6 @@ _Min_Stack_Size = 0x400; /* required amount of stack */ MEMORY { RAM (xrw) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE -CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET } @@ -77,7 +76,7 @@ SECTIONS } >FLASH /* The program code and other data goes into FLASH */ - .text ALIGN(8): + .text : { . = ALIGN(4); *(.text) /* .text sections (code) */ @@ -94,7 +93,7 @@ SECTIONS } >FLASH /* Constant data goes into FLASH */ - .rodata ALIGN(4): + .rodata : { . = ALIGN(4); *(.rodata) /* .rodata sections (constants, strings, etc.) */ @@ -145,25 +144,6 @@ SECTIONS _edata = .; /* define a global symbol at data end */ } >RAM AT> FLASH - _siccmram = LOADADDR(.ccmram); - - /* CCM-RAM section - * - * IMPORTANT NOTE! - * If initialized variables will be placed in this section, - * the startup code needs to be modified to copy the init-values. - */ - .ccmram : - { - . = ALIGN(4); - _sccmram = .; /* create a global symbol at ccmram start */ - *(.ccmram) - *(.ccmram*) - - . = ALIGN(4); - _eccmram = .; /* create a global symbol at ccmram end */ - } >CCMRAM AT> FLASH - /* Uninitialized data section */ . = ALIGN(4); diff --git a/variants/Generic_F4x3Rx/ldscript.ld b/variants/Generic_F4x3Rx/ldscript.ld index 6f16566ecc..7ae2de58a9 100644 --- a/variants/Generic_F4x3Rx/ldscript.ld +++ b/variants/Generic_F4x3Rx/ldscript.ld @@ -61,7 +61,6 @@ _Min_Stack_Size = 0x400; /* required amount of stack */ MEMORY { RAM (xrw) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE -CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET } @@ -77,7 +76,7 @@ SECTIONS } >FLASH /* The program code and other data goes into FLASH */ - .text ALIGN(8): + .text : { . = ALIGN(4); *(.text) /* .text sections (code) */ @@ -94,7 +93,7 @@ SECTIONS } >FLASH /* Constant data goes into FLASH */ - .rodata ALIGN(4): + .rodata : { . = ALIGN(4); *(.rodata) /* .rodata sections (constants, strings, etc.) */ @@ -145,25 +144,6 @@ SECTIONS _edata = .; /* define a global symbol at data end */ } >RAM AT> FLASH - _siccmram = LOADADDR(.ccmram); - - /* CCM-RAM section - * - * IMPORTANT NOTE! - * If initialized variables will be placed in this section, - * the startup code needs to be modified to copy the init-values. - */ - .ccmram : - { - . = ALIGN(4); - _sccmram = .; /* create a global symbol at ccmram start */ - *(.ccmram) - *(.ccmram*) - - . = ALIGN(4); - _eccmram = .; /* create a global symbol at ccmram end */ - } >CCMRAM AT> FLASH - /* Uninitialized data section */ . = ALIGN(4); diff --git a/variants/Generic_F4x5RG/variant.cpp b/variants/Generic_F4x5RG/variant.cpp index 15c0ee26d0..6ac8661d90 100644 --- a/variants/Generic_F4x5RG/variant.cpp +++ b/variants/Generic_F4x5RG/variant.cpp @@ -230,6 +230,10 @@ WEAK void SystemClock_Config(void) } } } + + /* Ensure CCM RAM clock is enabled */ + __HAL_RCC_CCMDATARAMEN_CLK_ENABLE(); + /* Output clock on MCO2 pin(PC9) for debugging purpose */ //HAL_RCC_MCOConfig(RCC_MCO2, RCC_MCO2SOURCE_SYSCLK, RCC_MCODIV_4); } diff --git a/variants/Generic_F4x7Vx/ldscript.ld b/variants/Generic_F4x7Vx/ldscript.ld index 4f9aa8a6cc..b360f06ed6 100644 --- a/variants/Generic_F4x7Vx/ldscript.ld +++ b/variants/Generic_F4x7Vx/ldscript.ld @@ -1,5 +1,5 @@ /* -***************************************************************************** +****************************************************************************** ** ** File : LinkerScript.ld @@ -14,14 +14,13 @@ ** ** Target : STMicroelectronics STM32 ** -** -** Distribution: The file is distributed as is, without any warranty +** Distribution: The file is distributed “as is,” without any warranty ** of any kind. ** ***************************************************************************** ** @attention ** -**

© COPYRIGHT(c) 2014 Ac6

+**

© COPYRIGHT(c) 2019 STMicroelectronics

** ** Redistribution and use in source and binary forms, with or without modification, ** are permitted provided that the following conditions are met: @@ -30,7 +29,7 @@ ** 2. Redistributions in binary form must reproduce the above copyright notice, ** this list of conditions and the following disclaimer in the documentation ** and/or other materials provided with the distribution. -** 3. Neither the name of Ac6 nor the names of its contributors +** 3. Neither the name of STMicroelectronics nor the names of its contributors ** may be used to endorse or promote products derived from this software ** without specific prior written permission. ** @@ -61,6 +60,7 @@ _Min_Stack_Size = 0x400; /* required amount of stack */ MEMORY { RAM (xrw) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE +CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET } @@ -76,7 +76,7 @@ SECTIONS } >FLASH /* The program code and other data goes into FLASH */ - .text ALIGN(4): + .text : { . = ALIGN(4); *(.text) /* .text sections (code) */ @@ -133,7 +133,7 @@ SECTIONS _sidata = LOADADDR(.data); /* Initialized data sections goes into RAM, load LMA copy after code */ - .data : + .data : { . = ALIGN(4); _sdata = .; /* create a global symbol at data start */ @@ -144,7 +144,26 @@ SECTIONS _edata = .; /* define a global symbol at data end */ } >RAM AT> FLASH - + _siccmram = LOADADDR(.ccmram); + + /* CCM-RAM section + * + * IMPORTANT NOTE! + * If initialized variables will be placed in this section, + * the startup code needs to be modified to copy the init-values. + */ + .ccmram : + { + . = ALIGN(4); + _sccmram = .; /* create a global symbol at ccmram start */ + *(.ccmram) + *(.ccmram*) + + . = ALIGN(4); + _eccmram = .; /* create a global symbol at ccmram end */ + } >CCMRAM AT> FLASH + + /* Uninitialized data section */ . = ALIGN(4); .bss : @@ -172,7 +191,7 @@ SECTIONS . = ALIGN(8); } >RAM - + /* Remove information from the standard libraries */ /DISCARD/ : diff --git a/variants/Generic_F4x7Vx/variant.cpp b/variants/Generic_F4x7Vx/variant.cpp index a1864d20d1..3721d4f5b5 100644 --- a/variants/Generic_F4x7Vx/variant.cpp +++ b/variants/Generic_F4x7Vx/variant.cpp @@ -262,6 +262,10 @@ WEAK void SystemClock_Config(void) } } } + + /* Ensure CCM RAM clock is enabled */ + __HAL_RCC_CCMDATARAMEN_CLK_ENABLE(); + /* Output clock on MCO2 pin(PC9) for debugging purpose */ //HAL_RCC_MCOConfig(RCC_MCO2, RCC_MCO2SOURCE_SYSCLK, RCC_MCODIV_4); } diff --git a/variants/NUCLEO_F429ZI/variant.cpp b/variants/NUCLEO_F429ZI/variant.cpp index 76e4b4daea..15e05f8d68 100644 --- a/variants/NUCLEO_F429ZI/variant.cpp +++ b/variants/NUCLEO_F429ZI/variant.cpp @@ -203,6 +203,9 @@ WEAK void SystemClock_Config(void) RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5); + + /* Ensure CCM RAM clock is enabled */ + __HAL_RCC_CCMDATARAMEN_CLK_ENABLE(); } #ifdef __cplusplus diff --git a/variants/PRNTR_Vx/ldscript.ld b/variants/PRNTR_Vx/ldscript.ld index 80b3971280..91100a0782 100644 --- a/variants/PRNTR_Vx/ldscript.ld +++ b/variants/PRNTR_Vx/ldscript.ld @@ -14,14 +14,13 @@ ** ** Target : STMicroelectronics STM32 ** -** -** Distribution: The file is distributed as is, without any warranty +** Distribution: The file is distributed “as is,” without any warranty ** of any kind. ** ***************************************************************************** ** @attention ** -**

© COPYRIGHT(c) 2014 Ac6

+**

© COPYRIGHT(c) 2019 STMicroelectronics

** ** Redistribution and use in source and binary forms, with or without modification, ** are permitted provided that the following conditions are met: @@ -30,7 +29,7 @@ ** 2. Redistributions in binary form must reproduce the above copyright notice, ** this list of conditions and the following disclaimer in the documentation ** and/or other materials provided with the distribution. -** 3. Neither the name of Ac6 nor the names of its contributors +** 3. Neither the name of STMicroelectronics nor the names of its contributors ** may be used to endorse or promote products derived from this software ** without specific prior written permission. ** @@ -77,7 +76,7 @@ SECTIONS } >FLASH /* The program code and other data goes into FLASH */ - .text ALIGN(8): + .text : { . = ALIGN(4); *(.text) /* .text sections (code) */ @@ -94,7 +93,7 @@ SECTIONS } >FLASH /* Constant data goes into FLASH */ - .rodata ALIGN(4): + .rodata : { . = ALIGN(4); *(.rodata) /* .rodata sections (constants, strings, etc.) */ diff --git a/variants/PRNTR_Vx/variant.cpp b/variants/PRNTR_Vx/variant.cpp index 3da2aaa921..95aa3bee0f 100644 --- a/variants/PRNTR_Vx/variant.cpp +++ b/variants/PRNTR_Vx/variant.cpp @@ -191,6 +191,9 @@ WEAK void SystemClock_Config(void) if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); } + + /* Ensure CCM RAM clock is enabled */ + __HAL_RCC_CCMDATARAMEN_CLK_ENABLE(); } #ifdef __cplusplus