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

section .heap overlaps absolute placed section .stack

I would like to use nRF52 DK (nRF52832) to program Fanstel BC805M EK (nRF52805).  When I upload to code from nrf52 DK to BC805M, I got this error message. 

section .heap overlaps absolute placed section .stack

Output/Release/Obj/ble_app_uart_pca10040_s132/ses_startup_nrf_common.o: in function `InitializeUserMemorySections':

undefined reference to `SystemInit'

I know that in SES, thumb_crt0.s is actually the linker script. It contains some assembly language codes. 

Q1: How to solve this error, please? Do I have to modify the assembly language code, or is there any easier way to solve this error? 

Here is how I modified RAM and FLASH in <Section Placement Macro>. 

According to the guide, I have set #1-4. 

1) FLASH_PH_START=0x0

2) FLASH_PH_SIZE=0x30000

3) RAM_PH_START=0x20000000

4) RAM_PH_SIZE=0x6000

Because nRF52805 uses SoftDevice S112 or S113, so I used S113 version 7.2.0. And this post told me that my "minimum RAM start" and "FLASH start" are 0x20001198 and 0x1C000 respectively. 

5) FLASH_START=0x19000

6) RAM_START=0x200026a0

Then, I do the calculation to find FLASH_SIZE and RAM_SIZE. 

  • FLASH_START + FLASH_SIZE = FLASH_PH_SIZE
  • RAM_START + RAM_SIZE = (RAM_PH_START + RAM_PH_SIZE)

7) FLASH_SIZE=0x17000

8) RAM_SIZE=0x3960

Q2: Is this the correct way to set RAM and FLASH address? 

Thank you very much! 

Parents
  • Hello,

    I think I would recommend starting with one the nRF52805 (pca10040e_nrf52805) project examples Bjørn included at the end of his guide before making a new project from scratch. 

    Q1: How to solve this error, please? Do I have to modify the assembly language code, or is there any easier way to solve this error? 

     thumb_crt0.c is responsible for initializing RAM on startup and should not require any modifications. The error you are getting indicates that you may have forgotten to include 'system_nrf52805.c' in your project? This is where the SystemInit() function is supposed to be defined.

    Q2: Is this the correct way to set RAM and FLASH address? 

    The RAM requirement is calculated at runtime based on the Softdevice configuration parameter you pass to sd_ble_enable(), and ble_app_uart does not use the minimal configuration, so the actual RAM requirement is going to be more than 0x20001198. But if you enable logging you will see what the minimum RAM configuration is for your project.

    Here's an example of when the RAM layout needs to be adjusted:

    FLASH_START must be set to 0x1C000 when using s113. Remaining space in flash (FLASH_SIZE) will then be 0x30000 - 0x1C000 = 0x14000

    Best regards,

    Vidar

  • Hi Vidar Nerg, 

    Thanks for your quick help! I followed your above mentioned "nRF52805 (pca10040e_nrf52805) project examples Bjørn", and changed FLASH and RAM size accordingly. Now the error "section .heap overlaps absolute placed section .stack" is solved! However, some new errors take place. 

    I downloaded the Peripheral UART/Serial Port Emulation over BLE (ble_app_uart) example. I'm using nRF52 DK, and I need to upload the code to the Evaluation Board EV-BC805M EK (nRF52805). The error is: 

    Any idea, please? Thank you very much! 

  • Hi,

    The linker is not finding a section to place the data, hence the 'UNPLACED_SECTION' error. This is often the symptom when there is a mismatch with the name of the section segments defined in the project file (FLASH + RAM) and those that are actually used in the flash_placement.xml file.

    Please check that the names match in your case as shown in the image below. Note that the RAM section is named "RAM1" in SDK 17.0.2.

Reply
  • Hi,

    The linker is not finding a section to place the data, hence the 'UNPLACED_SECTION' error. This is often the symptom when there is a mismatch with the name of the section segments defined in the project file (FLASH + RAM) and those that are actually used in the flash_placement.xml file.

    Please check that the names match in your case as shown in the image below. Note that the RAM section is named "RAM1" in SDK 17.0.2.

Children
No Data
Related