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

Parents
  • I readed both documents about newlib-nano and I think that limitations (mostly on printf) will not limit me. I don't plan to use malloc (for printing to uart I use only vsnprintf) so maybe I could safely set heap to 0. I tried it and program run without change.

    I already created Makefiles for BLE examples based on other makefile from standard example. Maybe someone else would use it so I attach them. That's a pitty you cannot have more influence on SDK, I think gcc on arm is very popular, both win32 and linux hosts...

    gcc-makes.zip

Reply
  • I readed both documents about newlib-nano and I think that limitations (mostly on printf) will not limit me. I don't plan to use malloc (for printing to uart I use only vsnprintf) so maybe I could safely set heap to 0. I tried it and program run without change.

    I already created Makefiles for BLE examples based on other makefile from standard example. Maybe someone else would use it so I attach them. That's a pitty you cannot have more influence on SDK, I think gcc on arm is very popular, both win32 and linux hosts...

    gcc-makes.zip

Children
No Data
Related