Skip to content

Commit

Permalink
feat: optimize memory layout
Browse files Browse the repository at this point in the history
  • Loading branch information
LynnL4 committed Nov 6, 2024
1 parent ce5dce7 commit 902b373
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
18 changes: 9 additions & 9 deletions EPII_CM55M_APP_S/app/scenario_app/sscma/sscma.ld
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ MEMORY
/* Define each memory region */
CM55M_S_APP_ROM (rx) : ORIGIN = 0x10000000, LENGTH = 0x10040000 - 0x10000000 // 256 KB
CM55M_S_APP_DATA (rwx) : ORIGIN = 0x30000000, LENGTH = 0x30040000 - 0x30000000 // 256 KB
CM55M_S_SRAM (rwx) : ORIGIN = 0x34000000, LENGTH = 0x34079800 - 0x34000000 // 486 KB, please remember to check configTOTAL_HEAP_SIZE
CM55M_S_EL_ALLOC (rw) : ORIGIN = 0x34079800, LENGTH = 0x3418F800 - 0x34079800 // 1112 KB
// CM55M_S_EL_FBUF (rw) : ORIGIN = 0x3418F800, LENGTH = 0x34200000 - 0x3418F800 // 450 KB
CM55M_S_SRAM (rwx) : ORIGIN = 0x34000000, LENGTH = 0x34054000 - 0x34000000 // 336 KB, please remember to check configTOTAL_HEAP_SIZE
CM55M_S_EL_ALLOC (rw) : ORIGIN = 0x34054000, LENGTH = 0x3416A000 - 0x34054000 // 1112 KB
// CM55M_S_EL_FBUF (rw) : ORIGIN = 0x3418F800, LENGTH = 0x34200000 - 0x3416A000 // 600 KB
// CM55S_S_EL_HWENC (rw) : ORIGIN = 0x36000000, LENGTH = 0x36060000 - 0x36000000
}

Expand Down Expand Up @@ -60,7 +60,7 @@ SECTIONS
.ext_text :
{
. = ALIGN(4);
*libdriver.*:*(.text* .rodata*)
*libfatfs.*:*(.text* .rodata*)

. = ALIGN(4);
*lib_i2c_comm.*:*(.text* .rodata*)
Expand All @@ -82,7 +82,7 @@ SECTIONS

. = ALIGN(4);
*libsscma_micro.*:*(.text* .rodata*)

. = ALIGN(4);
*libtflmtag2209_u55tag2205_gnu.*:*(.text* .rodata*)

Expand Down Expand Up @@ -286,10 +286,10 @@ SECTIONS
__HeapLimit = .;
PROVIDE(__HeapLimit = .);

} > CM55M_S_SRAM
} > CM55M_S_APP_DATA

/* Locate actual Stack in memory map */
.stack (ORIGIN(CM55M_S_SRAM) + LENGTH(CM55M_S_SRAM) - __STACK_SIZE - 32) (COPY) :
.stack (ORIGIN(CM55M_S_APP_DATA) + LENGTH(CM55M_S_APP_DATA) - __STACK_SIZE - 32) (COPY) :
{
. = ALIGN(8);
__StackLimit = .;
Expand All @@ -302,7 +302,7 @@ SECTIONS
__StackTop = .;
PROVIDE(__StackTop = .);

} > CM55M_S_SRAM
} > CM55M_S_APP_DATA

PROVIDE(__stack = __StackTop);

Expand All @@ -312,4 +312,4 @@ SECTIONS
_image_start = LOADADDR(.text);
_image_end = LOADADDR(.data) + SIZEOF(.data);
_image_size = _image_end - _image_start;
}
}
3 changes: 0 additions & 3 deletions EPII_CM55M_APP_S/app/scenario_app/sscma/sscma.mk
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,6 @@ $(info LIB_SSCMA_MICRO_CXXSRCS - $(LIB_SSCMA_MICRO_CXXSRCS))
# get dependency files
LIB_SSCMA_MICRO_DEPS = $(call get_deps, $(LIB_SSCMA_MICRO_OBJS))

# extra macros to be defined
LIB_SSCMA_MICRO_DEFINES = -DLIB_SSCMA_MICRO -DCONFIG_EL_TARGET_HIMAX -DCONFIG_EL_BOARD_GROVE_VISION_AI_WE2

# genearte library
ifeq ($(C_LIB_FORCE_PREBUILT), y)
override LIB_SSCMA_MICRO_OBJS:=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,6 @@ $(info LIB_SSCMA_MICRO_CXXSRCS - $(LIB_SSCMA_MICRO_CXXSRCS))

# get dependency files
LIB_SSCMA_MICRO_DEPS = $(call get_deps, $(LIB_SSCMA_MICRO_OBJS))

# extra macros to be defined
LIB_SSCMA_MICRO_DEFINES = -DLIB_SSCMA_MICRO -DCONFIG_EL_TARGET_HIMAX -DCONFIG_EL_BOARD_GROVE_VISION_AI_WE2

# genearte library
ifeq ($(C_LIB_FORCE_PREBUILT), y)
override LIB_SSCMA_MICRO_OBJS:=
Expand Down
9 changes: 8 additions & 1 deletion EPII_CM55M_APP_S/library/library.mk
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,14 @@ $(info LIB_SSCMA_MICRO_CXXSRCS - $(LIB_SSCMA_MICRO_CXXSRCS))
LIB_SSCMA_MICRO_DEPS = $(call get_deps, $(LIB_SSCMA_MICRO_OBJS))

# extra macros to be defined
LIB_SSCMA_MICRO_DEFINES = -DLIB_SSCMA_MICRO -DCONFIG_EL_TARGET_HIMAX -DCONFIG_EL_BOARD_GROVE_VISION_AI_WE2
TARGET ?= GROVE_VISION_AI_V2
LIB_SSCMA_MICRO_DEFINES = -DLIB_SSCMA_MICRO -DCONFIG_EL_TARGET_HIMAX
ifeq ($(TARGET), SENSECAP_WATCHER)
LIB_SSCMA_MICRO_DEFINES += -DCONFIG_EL_BOARD_SENSECAP_WATCHER
else
LIB_SSCMA_MICRO_DEFINES += -DCONFIG_EL_BOARD_GROVE_VISION_AI_V2
endif


# genearte library
ifeq ($(C_LIB_FORCE_PREBUILT), y)
Expand Down
2 changes: 1 addition & 1 deletion EPII_CM55M_APP_S/library/sscma_micro
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ extern uint32_t SystemCoreClock;
/* Constants that describe the hardware and memory usage. */
#define configCPU_CLOCK_HZ (SystemCoreClock)
#define configTICK_RATE_HZ ((TickType_t)1000)
#define configTOTAL_HEAP_SIZE ((size_t)(450 * 1024))//((size_t)4096)
#define configTOTAL_HEAP_SIZE ((size_t)(336 * 1024))//((size_t)4096)
#define configMINIMAL_STACK_SIZE ((uint16_t)256)
#define configSUPPORT_DYNAMIC_ALLOCATION 1
#if defined(FREERTOS_OSHAL)
Expand Down

0 comments on commit 902b373

Please sign in to comment.