Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

heap-management: Use C memory management APIs #57

Merged
merged 2 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ test-applications:
--credentials-path "applications/${APP_UNDERSCORED}/configs/aws_configs" \
--merged-elf-name "${APP}_merged.elf" \
--signed-update-bin-name "${APP}-update_signed.bin" \
--timeout-seconds 1800 \
--timeout-seconds 2700 \
--pass-output-file "applications/${APP_UNDERSCORED}/tests/pass_output.log" \
--fail-output-file "applications/${APP_UNDERSCORED}/tests/fail_output.log" \
--pythonhome-path "/opt/python/3.9.18"
Expand All @@ -171,7 +171,7 @@ test-applications:
--credentials-path "applications/${APP_UNDERSCORED}/configs/aws_configs" \
--merged-elf-name "${APP}_merged.elf" \
--signed-update-bin-name "${APP}-update_signed.bin" \
--timeout-seconds 1800 \
--timeout-seconds 2700 \
--pass-output-file "applications/${APP_UNDERSCORED}/tests/pass_output.log" \
--fail-output-file "applications/${APP_UNDERSCORED}/tests/fail_output.log"
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ extern uint32_t SystemCoreClock;
/* Memory allocation related definitions. */
#define configSUPPORT_STATIC_ALLOCATION 1
#define configSUPPORT_DYNAMIC_ALLOCATION 1
#define configTOTAL_HEAP_SIZE 720896
#define configTOTAL_HEAP_SIZE 0
#define configAPPLICATION_ALLOCATED_HEAP 0

#define configENABLE_MVE 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ extern uint32_t SystemCoreClock;
/* Memory allocation related definitions. */
#define configSUPPORT_STATIC_ALLOCATION 1
#define configSUPPORT_DYNAMIC_ALLOCATION 1
#define configTOTAL_HEAP_SIZE 720896
#define configTOTAL_HEAP_SIZE 0
#define configAPPLICATION_ALLOCATED_HEAP 0

#define configENABLE_MVE 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ extern uint32_t SystemCoreClock;
/* Memory allocation related definitions. */
#define configSUPPORT_STATIC_ALLOCATION 1
#define configSUPPORT_DYNAMIC_ALLOCATION 1
#define configTOTAL_HEAP_SIZE 720896
#define configTOTAL_HEAP_SIZE 0
#define configAPPLICATION_ALLOCATED_HEAP 0

#define configENABLE_MVE 0
Expand Down
2 changes: 1 addition & 1 deletion bsp/corstone300/an552_ns.ld
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ __RAM_SIZE = (0x00200000 - PROVISIONING_SIZE);
</h>
-----------------------------------------------------------------------------*/
__STACK_SIZE = 0x00001000;
__HEAP_SIZE = 0x000B0000;
__HEAP_SIZE = 0x000C0000;

/*
*-------------------- <<< end of configuration section >>> -------------------
Expand Down
2 changes: 1 addition & 1 deletion bsp/corstone300/an552_ns.sct
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ LR_CODE (0x28000000 + ((((0) + (0x40000)) + (0x400)))) {

ARM_LIB_STACK +0 ALIGN 32 EMPTY (0x0001000) {
}
ARM_LIB_HEAP +0 ALIGN 8 EMPTY (0x00b0000) {
ARM_LIB_HEAP +0 ALIGN 8 EMPTY (0x00C0000) {
}

;-----------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion bsp/corstone310/an555_ns.ld
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ __RAM_SIZE = (ISRAM1_SIZE - PROVISIONING_SIZE);
</h>
-----------------------------------------------------------------------------*/
__STACK_SIZE = 0x00001000;
__HEAP_SIZE = 0x000B0000;
__HEAP_SIZE = 0x000C0000;

/*
*-------------------- <<< end of configuration section >>> -------------------
Expand Down
2 changes: 1 addition & 1 deletion bsp/corstone310/an555_ns.sct
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#define ISRAM1_SIZE 0x00200000
#define PROVISIONING_SIZE 0x1000
#define STACK_SIZE 0x00001000
#define HEAP_SIZE 0x000B0000
#define HEAP_SIZE 0x000C0000

LR_CODE (ROM_START + ((((0) + (FLASH_S_PARTITION_SIZE)) + BL2_HEADER_SIZE))) {
ER_CODE (ROM_START + ((((0) + (FLASH_S_PARTITION_SIZE)) + BL2_HEADER_SIZE))) (((FLASH_NS_PARTITION_SIZE) - BL2_HEADER_SIZE - BL2_TRAILER_SIZE)) {
Expand Down
2 changes: 1 addition & 1 deletion components/freertos_kernel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set(freertos_kernel_SOURCE_DIR
"Path to FreeRTOS-Kernel source code"
)

set(FREERTOS_HEAP "4" CACHE STRING "" FORCE)
set(FREERTOS_HEAP "${CMAKE_CURRENT_LIST_DIR}/integration/src/heap_management.c" CACHE STRING "" FORCE)

if(ARM_CORSTONE_BSP_TARGET_PLATFORM STREQUAL "corstone300")
set(FREERTOS_PORT GCC_ARM_CM55_TFM)
Expand Down
37 changes: 37 additions & 0 deletions components/freertos_kernel/integration/src/heap_management.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/* Copyright 2024 Arm Limited and/or its affiliates
* <[email protected]>
* SPDX-License-Identifier: MIT
*/

#include <stdlib.h>

void * pvPortMalloc( size_t xWantedSize )
{
return malloc( xWantedSize );
}

void vPortFree( void * pv )
{
free( pv );
}

void * pvPortCalloc( size_t xNum,
size_t xSize )
{
return calloc( xNum, xSize );
}

/* These are dummy implementations as C standard library does not provide
* functions to get the statistics of heap memory. These dummy implementation are needed
* as these APIs are used as part of FreeRTOS Plus TCP code which is unused in the FRI code (removed by the linker)
* but ARMClang linker requires all the compiled symbols to be defined.
*/
size_t xPortGetFreeHeapSize( void )
{
return 0;
}

size_t xPortGetMinimumEverFreeHeapSize( void )
{
return 0;
}
1 change: 1 addition & 0 deletions release_changes/202402261352.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
heap-management: Use C memory management APIs.
Loading