mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
This reverts commit 9850749afa
.
This commit is contained in:
parent
7b2d114c51
commit
d27bea9ca6
6 changed files with 4 additions and 81 deletions
|
@ -98,21 +98,6 @@ SECTIONS
|
||||||
PROVIDE_HIDDEN (__pg_resetdata_end = .);
|
PROVIDE_HIDDEN (__pg_resetdata_end = .);
|
||||||
} >MAIN
|
} >MAIN
|
||||||
|
|
||||||
/* Storage for the address for the configuration section so we can grab it out of the hex file */
|
|
||||||
.custom_defaults :
|
|
||||||
{
|
|
||||||
. = ALIGN(4);
|
|
||||||
KEEP (*(.custom_defaults_start_address))
|
|
||||||
. = ALIGN(4);
|
|
||||||
KEEP (*(.custom_defaults_end_address))
|
|
||||||
. = ALIGN(4);
|
|
||||||
__custom_defaults_internal_start = .;
|
|
||||||
*(.custom_defaults);
|
|
||||||
} >CUSTOM_DEFAULTS
|
|
||||||
|
|
||||||
PROVIDE_HIDDEN (__custom_defaults_start = __custom_defaults_internal_start);
|
|
||||||
PROVIDE_HIDDEN (__custom_defaults_end = ORIGIN(CUSTOM_DEFAULTS) + LENGTH(CUSTOM_DEFAULTS));
|
|
||||||
|
|
||||||
/* used by the startup to initialize data */
|
/* used by the startup to initialize data */
|
||||||
_sidata = LOADADDR(.data);
|
_sidata = LOADADDR(.data);
|
||||||
|
|
||||||
|
|
|
@ -82,21 +82,6 @@ SECTIONS
|
||||||
PROVIDE_HIDDEN (__pg_resetdata_end = .);
|
PROVIDE_HIDDEN (__pg_resetdata_end = .);
|
||||||
} >MAIN
|
} >MAIN
|
||||||
|
|
||||||
/* Storage for the address for the configuration section so we can grab it out of the hex file */
|
|
||||||
.custom_defaults :
|
|
||||||
{
|
|
||||||
. = ALIGN(4);
|
|
||||||
KEEP (*(.custom_defaults_start_address))
|
|
||||||
. = ALIGN(4);
|
|
||||||
KEEP (*(.custom_defaults_end_address))
|
|
||||||
. = ALIGN(4);
|
|
||||||
__custom_defaults_internal_start = .;
|
|
||||||
*(.custom_defaults);
|
|
||||||
} >CUSTOM_DEFAULTS
|
|
||||||
|
|
||||||
PROVIDE_HIDDEN (__custom_defaults_start = __custom_defaults_internal_start);
|
|
||||||
PROVIDE_HIDDEN (__custom_defaults_end = ORIGIN(CUSTOM_DEFAULTS) + LENGTH(CUSTOM_DEFAULTS));
|
|
||||||
|
|
||||||
/* used by the startup to initialize data */
|
/* used by the startup to initialize data */
|
||||||
_sidata = LOADADDR(.data);
|
_sidata = LOADADDR(.data);
|
||||||
|
|
||||||
|
|
|
@ -46,24 +46,6 @@ The initial CODE_RAM is sized at 1MB.
|
||||||
/* see .exst section below */
|
/* see .exst section below */
|
||||||
_exst_hash_size = 64;
|
_exst_hash_size = 64;
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
A section for custom defaults needs to exist for unified targets, however it is a hideous waste of precious RAM.
|
|
||||||
Using RAM will suffice until an alternative location for it can be made workable.
|
|
||||||
|
|
||||||
It would be much better to store the custom defaults on some spare flash pages on the external flash and have some
|
|
||||||
code to read them from external flash instead of a copy of them stored in precious RAM.
|
|
||||||
There are usually spare flash pages after the config page on the external flash, however current EXST bootloaders are
|
|
||||||
not 'custom defaults' aware. they only know about firmware partitions and config partitions. Using the spare sectors
|
|
||||||
in the config partition for custom defaults would work, but if users use the bootloader menus to erase their config
|
|
||||||
then the custom defaults would also be erased...
|
|
||||||
Also, it would need a change the packaging a distribution method of BF as there would be 2 non-contiguous files to
|
|
||||||
flash if they were separated, i.e. load firmware at flash address 'x' and load custom defaults at flash address 'y'.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
_custom_defaults_size = 8K;
|
|
||||||
|
|
||||||
/* Specify the memory areas */
|
/* Specify the memory areas */
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
|
@ -80,9 +62,8 @@ MEMORY
|
||||||
|
|
||||||
OCTOSPI2 (rx) : ORIGIN = 0x70000000, LENGTH = 256M
|
OCTOSPI2 (rx) : ORIGIN = 0x70000000, LENGTH = 256M
|
||||||
OCTOSPI1 (rx) : ORIGIN = 0x90000000, LENGTH = 256M
|
OCTOSPI1 (rx) : ORIGIN = 0x90000000, LENGTH = 256M
|
||||||
OCTOSPI1_CODE (rx): ORIGIN = ORIGIN(OCTOSPI1) + 1M, LENGTH = 1M - _custom_defaults_size - _exst_hash_size /* hard coded start address, as required by SPRACINGH7 boot loader, don't change! */
|
OCTOSPI1_CODE (rx): ORIGIN = ORIGIN(OCTOSPI1) + 1M, LENGTH = 1M - _exst_hash_size /* hard coded start address, as required by SPRACINGH7 boot loader, don't change! */
|
||||||
CUSTOM_DEFAULTS (r) : ORIGIN = ORIGIN(OCTOSPI1_CODE) + LENGTH(OCTOSPI1_CODE), LENGTH = _custom_defaults_size
|
EXST_HASH (rx) : ORIGIN = ORIGIN(OCTOSPI1_CODE) + LENGTH(OCTOSPI1_CODE), LENGTH = _exst_hash_size
|
||||||
EXST_HASH (rx) : ORIGIN = ORIGIN(OCTOSPI1_CODE) + LENGTH(CUSTOM_DEFAULTS) + LENGTH(OCTOSPI1_CODE), LENGTH = _exst_hash_size
|
|
||||||
}
|
}
|
||||||
|
|
||||||
REGION_ALIAS("STACKRAM", DTCM_RAM)
|
REGION_ALIAS("STACKRAM", DTCM_RAM)
|
||||||
|
|
|
@ -54,34 +54,14 @@ possible.
|
||||||
/* see .exst section below */
|
/* see .exst section below */
|
||||||
_exst_hash_size = 64;
|
_exst_hash_size = 64;
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
A section for custom defaults needs to exist for unified targets, however it is a hideous waste of precious RAM.
|
|
||||||
Using RAM will suffice until an alternative location for it can be made workable.
|
|
||||||
|
|
||||||
It would be much better to store the custom defaults on some spare flash pages on the external flash and have some
|
|
||||||
code to read them from external flash instead of a copy of them stored in precious RAM.
|
|
||||||
There are usually spare flash pages after the config page on the external flash, however current EXST bootloaders are
|
|
||||||
not 'custom defaults' aware. they only know about firmware partitions and config partitions. Using the spare sectors
|
|
||||||
in the config partition for custom defaults would work, but if users use the bootloader menus to erase their config
|
|
||||||
then the custom defaults would also be erased...
|
|
||||||
Also, it would need a change the packaging a distribution method of BF as there would be 2 non-contiguous files to
|
|
||||||
flash if they were separated, i.e. load firmware at flash address 'x' and load custom defaults at flash address 'y'.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
_custom_defaults_size = 8K;
|
|
||||||
|
|
||||||
/* Specify the memory areas */
|
/* Specify the memory areas */
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K
|
ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K
|
||||||
DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
|
DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
|
||||||
RAM (rwx) : ORIGIN = 0x24000000, LENGTH = 64K
|
RAM (rwx) : ORIGIN = 0x24000000, LENGTH = 64K
|
||||||
CODE_RAM (rx) : ORIGIN = 0x24010000, LENGTH = 448K - _custom_defaults_size - _exst_hash_size /* hard coded start address, as required by SPRACINGH7 boot loader, don't change! */
|
CODE_RAM (rx) : ORIGIN = 0x24010000, LENGTH = 448K - _exst_hash_size /* hard coded start address, as required by SPRACINGH7 boot loader, don't change! */
|
||||||
CUSTOM_DEFAULTS (r) : ORIGIN = ORIGIN(CODE_RAM) + LENGTH(CODE_RAM), LENGTH = _custom_defaults_size
|
EXST_HASH (rx) : ORIGIN = 0x24010000 + LENGTH(CODE_RAM), LENGTH = _exst_hash_size
|
||||||
|
|
||||||
EXST_HASH (rx) : ORIGIN = 0x24010000 + LENGTH(CODE_RAM) + LENGTH(CUSTOM_DEFAULTS), LENGTH = _exst_hash_size
|
|
||||||
|
|
||||||
D2_RAM (rwx) : ORIGIN = 0x30000000, LENGTH = 256K /* SRAM1 + SRAM2 */
|
D2_RAM (rwx) : ORIGIN = 0x30000000, LENGTH = 256K /* SRAM1 + SRAM2 */
|
||||||
|
|
||||||
|
|
|
@ -110,8 +110,4 @@
|
||||||
#define CONFIG_IN_RAM
|
#define CONFIG_IN_RAM
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_EXST
|
|
||||||
#define USE_CUSTOM_DEFAULTS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define USE_EXTI
|
#define USE_EXTI
|
||||||
|
|
|
@ -105,8 +105,4 @@
|
||||||
#define CONFIG_IN_RAM
|
#define CONFIG_IN_RAM
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_EXST
|
|
||||||
#define USE_CUSTOM_DEFAULTS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define USE_EXTI
|
#define USE_EXTI
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue