Avoid initializing storage to flash, reduce storage size by 8B and restore GCC 11 in CI

This commit is contained in:
Yaya-Cout
2025-01-25 18:00:29 +01:00
parent 7f560f8a5b
commit c1cc19d47c
4 changed files with 8 additions and 16 deletions

View File

@@ -25,7 +25,7 @@ public:
#ifdef _FXCG
constexpr static size_t k_storageSize = 65500;
#else
constexpr static size_t k_storageSize = 60000;
constexpr static size_t k_storageSize = 59992;
#endif
static_assert(UINT16_MAX >= k_storageSize, "record_size_t not big enough");

View File

@@ -145,8 +145,6 @@ void __attribute__((noinline)) __attribute__((section(".recovery_boot"))) __attr
uint32_t address = Ion::Device::BootloaderSharedData::sharedBootloaderData()->storageAddress();
uint32_t size = Ion::Device::BootloaderSharedData::sharedBootloaderData()->storageSize();
size_t storageSize = (&_static_storage_end - &_static_storage_start);
memcpy(&_static_storage_start, (void*)address, size);
size_t dataSectionLength = (&_data_section_end_ram - &_data_section_start_ram);

View File

@@ -101,17 +101,6 @@ SECTIONS {
_data_section_end_ram = .;
} >SRAM AT> FLASH
/*
* We set the .static_storage right after the .data section, even if it's a bss region, because we need to fix it in memory.
*/
.static_storage : {
. = ALIGN(4);
_bss_section_start_ram = .;
_static_storage_start = .;
KEEP (*(.static_storage))
_static_storage_end = .;
} > SRAM
.bss : {
/* The bss section contains data for all uninitialized variables
* So like the .data section, it will go in RAM, but unlike the data section
@@ -120,6 +109,10 @@ SECTIONS {
* Before execution, crt0 will erase that section of memory though, so we'll
* need pointers to the beginning and end of this section. */
. = ALIGN(4);
_bss_section_start_ram = .;
_static_storage_start = .;
KEEP (*(.static_storage))
_static_storage_end = .;
*(.bss)
*(.bss.*)
/* The compiler may choose to allocate uninitialized global variables as