This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How much free memory (RAM) left for app beside S110 stack?

I'm trying to make a simple BLE app based on LED button demo (BLE_LBS.C) that probably don't use much resources. I added FIFO UART communication routines and when I tried to allocate about 480B of global data for buffers I got RAM overflow error.

arm-none-eabi-ld.exe: region RAM overflowed with stack collect2.exe: error: ld returned 1 exit status make: *** [_build/ble_pokus_gcc_s110_xxaa.out] Error 1

This indicate there left only a few memory for application. Can you give me idea how much RAM does BLE stack take? A RAM layout diagram? Can I tune max. stack size?

This are the modules I link from my makefile: C_SOURCE_FILES += $(SDK_PATH)Source/sd_common/softdevice_handler.c C_SOURCE_FILES += $(SDK_PATH)Source/ble/ble_advdata.c C_SOURCE_FILES += $(SDK_PATH)Source/ble/ble_conn_params.c C_SOURCE_FILES += $(SDK_PATH)Source/ble/ble_debug_assert_handler.c C_SOURCE_FILES += $(SDK_PATH)Source/app_common/app_button.c C_SOURCE_FILES += $(SDK_PATH)Source/app_common/app_gpiote.c C_SOURCE_FILES += $(SDK_PATH)Source/app_common/app_scheduler.c C_SOURCE_FILES += $(SDK_PATH)Source/app_common/app_timer.c C_SOURCE_FILES += $(SDK_PATH)Source/app_common/app_fifo.c C_SOURCE_FILES += $(SDK_PATH)Source/app_common/app_uart_fifo.c

I also remember that I had to remove some debug module (maybe ble_debug_assert_handler.c) to be able to compile the example as it was. Maybe new SDK 5.1.0 takes more RAM than 4.x.x

Related