mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-14 20:10:18 +03:00
F3 - Add support for code in CCM RAM.
This commit is contained in:
parent
376d4c5294
commit
376441f89f
3 changed files with 29 additions and 0 deletions
|
@ -53,6 +53,19 @@ SECTIONS
|
||||||
_etext = .; /* define a global symbols at end of code */
|
_etext = .; /* define a global symbols at end of code */
|
||||||
} >FLASH
|
} >FLASH
|
||||||
|
|
||||||
|
/* Critical program code goes into CCM RAM */
|
||||||
|
/* Copy specific fast-executing code to CCM RAM */
|
||||||
|
ccm_code = LOADADDR(.ccm_code);
|
||||||
|
.ccm_code :
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
ccm_code_start = .;
|
||||||
|
*(.ccm_code)
|
||||||
|
*(.ccm_code*)
|
||||||
|
. = ALIGN(4);
|
||||||
|
ccm_code_end = .;
|
||||||
|
} >CCM AT >FLASH
|
||||||
|
|
||||||
|
|
||||||
.ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
|
.ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
|
||||||
.ARM : {
|
.ARM : {
|
||||||
|
|
|
@ -253,6 +253,14 @@ void initialiseMemorySections(void)
|
||||||
memcpy(&tcm_code_start, &tcm_code, (size_t) (&tcm_code_end - &tcm_code_start));
|
memcpy(&tcm_code_start, &tcm_code, (size_t) (&tcm_code_end - &tcm_code_start));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_CCM_CODE
|
||||||
|
/* Load functions into RAM */
|
||||||
|
extern uint8_t ccm_code_start;
|
||||||
|
extern uint8_t ccm_code_end;
|
||||||
|
extern uint8_t ccm_code;
|
||||||
|
memcpy(&ccm_code_start, &ccm_code, (size_t) (&ccm_code_end - &ccm_code_start));
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef USE_FAST_RAM
|
#ifdef USE_FAST_RAM
|
||||||
/* Load FAST_RAM variable intializers into DTCM RAM */
|
/* Load FAST_RAM variable intializers into DTCM RAM */
|
||||||
extern uint8_t _sfastram_data;
|
extern uint8_t _sfastram_data;
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
#define MINIMAL_CLI
|
#define MINIMAL_CLI
|
||||||
#define USE_DSHOT
|
#define USE_DSHOT
|
||||||
#define USE_GYRO_DATA_ANALYSE
|
#define USE_GYRO_DATA_ANALYSE
|
||||||
|
#define USE_CCM_CODE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef STM32F4
|
#ifdef STM32F4
|
||||||
|
@ -133,6 +134,7 @@
|
||||||
#define DEFAULT_AUX_CHANNEL_COUNT 6
|
#define DEFAULT_AUX_CHANNEL_COUNT 6
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef USE_ITCM_RAM
|
#ifdef USE_ITCM_RAM
|
||||||
#define FAST_CODE __attribute__((section(".tcm_code")))
|
#define FAST_CODE __attribute__((section(".tcm_code")))
|
||||||
#define FAST_CODE_NOINLINE NOINLINE
|
#define FAST_CODE_NOINLINE NOINLINE
|
||||||
|
@ -141,6 +143,12 @@
|
||||||
#define FAST_CODE_NOINLINE
|
#define FAST_CODE_NOINLINE
|
||||||
#endif // USE_ITCM_RAM
|
#endif // USE_ITCM_RAM
|
||||||
|
|
||||||
|
#ifdef USE_CCM_CODE
|
||||||
|
#define CCM_CODE __attribute__((section(".ccm_code")))
|
||||||
|
#else
|
||||||
|
#define CCM_CODE
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef USE_FAST_RAM
|
#ifdef USE_FAST_RAM
|
||||||
#define FAST_RAM_ZERO_INIT __attribute__ ((section(".fastram_bss"), aligned(4)))
|
#define FAST_RAM_ZERO_INIT __attribute__ ((section(".fastram_bss"), aligned(4)))
|
||||||
#define FAST_RAM __attribute__ ((section(".fastram_data"), aligned(4)))
|
#define FAST_RAM __attribute__ ((section(".fastram_data"), aligned(4)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue