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

Build problem with pca10001 ble_app_proximity project

Hello,

I am trying to build the nrf51822/Board/pca10001/s110/ble_app_proximity project, with gcc ... I have created a makefile based on the button_radio_example makefile (which works well!). It is the first time I use the s110 softdevice.

I have a problem at the link level: RAM overflowed with stack Here is the command line generated by the makefile: "gcc-arm-none-eabi-4_8-2013q4/bin/arm-none-eabi-gcc" -L"gcc-arm-none-eabi-4_8-2013q4/arm-none-eabi/lib/armv6-m" -L"gcc-arm-none-eabi-4_8-2013q4/lib/gcc/arm-none-eabi//armv6-m" -Xlinker -Map=_build/ble_app_proximity_gcc_s110_xxaa.map -mcpu=cortex-m0 -mthumb -mabi=aapcs -L ../../../../..//Source//templates/gcc/ -Tgcc_nrf51_s110_xxaa.ld _build/main.o _build/ble_tps.o _build/ble_ias.o _build/ble_lls.o _build/ble_bas.o _build/ble_ias_c.o _build/ble_advdata.o _build/ble_srv_common.o _build/ble_conn_params.o _build/app_timer.o _build/softdevice_handler.o _build/ble_bondmngr.o _build/pstorage.o _build/crc16.o _build/app_button.o _build/app_gpiote.o _build/ble_error_log.o _build/ble_debug_assert_handler.o _build/system_nrf51.o _build/gcc_startup_nrf51.o -o _build/ble_app_proximity_gcc_s110_xxaa.out gcc-arm-none-eabi-4_8-2013q4/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld: region RAM overflowed with stack collect2: error: ld returned 1 exit status

I have attached the map file. Any ideas are welcome !

Thanks,

Olivier

ble_app_proximity_gcc_s110_xxaa.txt

  • You will get this error if your application consumes too much RAM. You should try reducing the heap size to make it compile.

    I've also attached a Makefile and startup file that does this, and which works with the official setup.

    You may also have use in taking a look at my private GCC setup here.

  • Thanks Ole ! And thanks for your makefiles. I will try them to morrow.

    I have reduced heap size from 2048 to 1024. And link is ok now !! Cool !!!

    I am using the Segger JLinkExe to flash, but nothing happen ... Here is my load file: r device nrf51822 speed 1000

    w4 4001e504 2 w4 4001e50c 1 w4 4001e514 1 r w4 4001e504 1

    loadbin ../../../../../SoftDevices/s110/v_5.2.1/s110_nrf51822_5.2.1_softdevice.hex 0

    loadbin _build/ble_app_proximity_gcc_s110_xxaa.bin 0x00014000

    r g exit

    I am sure there are errors in my commands, but I don't know where ...

  • You can obviously not do loadbin with a hex file. Take a look at the Makefiles in the repository I pointed you at, which handles flashing a softdevice correctly, including splitting the binary.

  • Hi Ole,

    Sorry for my late reply ....

    I have switched to your makefiles ! At the end of the compilation, I have: ../main.c: In function 'ble_stack_init': ../main.c:1097:5: warning: implicit declaration of function 'softdevice_ble_evt_handler_set' [-Wimplicit-function-declaration] APP_ERROR_CHECK(err_code); ^ Should I define BLE_STACK_SUPPORT_REQD somewhere ?

    Thanks,

    Olivier

    Here is my makefile:

    List all source files the application uses.

    APPLICATION_SRCS = $(notdir $(wildcard ../*.c)) main.c

    Use shell to find name of root folder. Possible but horrible to do in make.

    PROJECT_NAME = $(shell basename "$(realpath ../)")

    DEVICE = NRF51 BOARD = BOARD_PCA10001 #SEGGER_SERIAL =

    USE_SOFTDEVICE = S110

    SDK_PATH = $(HOME)/projects/meb/nrf51/nrf51822/ TEMPLATE_PATH = $(HOME)/projects/meb/nrf51/nrf51-pure-gcc-setup/template/

    LIBRARY_PATHS += $(SDK_PATH)Include/s110 LIBRARY_PATHS += $(SDK_PATH)Include/sd_common

    CFLAGS = -Os

    GDB_PORT_NUMBER = 2331

    include $(TEMPLATE_PATH)Makefile

  • Yes, you should. I have unfortunately not gotten around to update my Makefiles for 5.1.0 yet, but for now you can just add '-DBLE_STACK_SUPPORT_REQD' to CFLAGS in the project Makefile.

Related