1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-12 04:34:43 +04:00

[FL-3900] Update heap implementation (#4123)

* furi: update heap4 to latest
* debug: heap under/overflow testing app
* fix formatting
* silence pvs warnings
* Linker: symbols without type
* Infrared: fix crash in universal remotes on long back press
* Infrared: properly fix incorrect input handling behavior and crash in universal remote. Fix same issue in hid_app.
* FreeRTOSConfig: explicit cast to uint in configTOTAL_HEAP_SIZE
* Format sources
* C and C++ compatible version of stm32wb55_linker.h

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Anna Antonenko
2025-02-21 05:04:02 +04:00
committed by GitHub
parent 4e9aa3883b
commit 16d18a79a9
9 changed files with 432 additions and 279 deletions

View File

@@ -11,13 +11,16 @@
#endif /* CMSIS_device_header */
#include CMSIS_device_header
#include <stm32wb55_linker.h>
#define configENABLE_FPU 1
#define configENABLE_MPU 0
#define configUSE_PREEMPTION 1
#define configSUPPORT_STATIC_ALLOCATION 1
#define configSUPPORT_DYNAMIC_ALLOCATION 0
#define configSUPPORT_DYNAMIC_ALLOCATION 1
#define configENABLE_HEAP_PROTECTOR 1
#define configHEAP_CLEAR_MEMORY_ON_FREE 1
#define configUSE_MALLOC_FAILED_HOOK 0
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
@@ -30,7 +33,7 @@
#define configUSE_POSIX_ERRNO 1
/* Heap size determined automatically by linker */
// #define configTOTAL_HEAP_SIZE ((size_t)0)
#define configTOTAL_HEAP_SIZE ((uint32_t) & __heap_end__ - (uint32_t) & __heap_start__)
#define configMAX_TASK_NAME_LEN (32)
#define configGENERATE_RUN_TIME_STATS 1
@@ -146,7 +149,7 @@ standard names. */
/* Normal assert() semantics without relying on the provision of an assert.h
header file. */
#ifdef DEBUG
#ifdef FURI_DEBUG
#define configASSERT(x) \
if((x) == 0) { \
furi_crash("FreeRTOS Assert"); \

View File

@@ -9,25 +9,28 @@
#ifdef __cplusplus
extern "C" {
typedef const char linker_symbol_t;
#else
typedef const void linker_symbol_t;
#endif
extern const void _stack_end; /**< end of stack */
extern const void _stack_size; /**< stack size */
extern linker_symbol_t _stack_end; /**< end of stack */
extern linker_symbol_t _stack_size; /**< stack size */
extern const void _sidata; /**< data initial value start */
extern const void _sdata; /**< data start */
extern const void _edata; /**< data end */
extern linker_symbol_t _sidata; /**< data initial value start */
extern linker_symbol_t _sdata; /**< data start */
extern linker_symbol_t _edata; /**< data end */
extern const void _sbss; /**< bss start */
extern const void _ebss; /**< bss end */
extern linker_symbol_t _sbss; /**< bss start */
extern linker_symbol_t _ebss; /**< bss end */
extern const void _sMB_MEM2; /**< RAM2a start */
extern const void _eMB_MEM2; /**< RAM2a end */
extern linker_symbol_t _sMB_MEM2; /**< RAM2a start */
extern linker_symbol_t _eMB_MEM2; /**< RAM2a end */
extern const void __heap_start__; /**< RAM1 Heap start */
extern const void __heap_end__; /**< RAM1 Heap end */
extern linker_symbol_t __heap_start__; /**< RAM1 Heap start */
extern linker_symbol_t __heap_end__; /**< RAM1 Heap end */
extern const void __free_flash_start__; /**< Free Flash space start */
extern linker_symbol_t __free_flash_start__; /**< Free Flash space start */
#ifdef __cplusplus
}