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

Linker file in gcc/eclipse how to find RAM size for new project

Hi i want to create a new project in Eclipse. I did this my following the complete code form git hub for devzone.nordicsemi.com/.../

*Nordic has provided sample code for this tutorial using SDK 13 in post as zip file but it is only for Keil not for gcc. It is missing Makefile and linker file.

I am not sure how i can create these files. For Makefile i have managed by looking in other projects.

But the linker file seems very hard and i do not know how to do it. As this is a new project which will have code taken from other multiple projects like uart, twi, timmers, blink etc.

How should i define: MEMORY and SECTIONS?

Also what is this SECTIONS for? Memory is for rom and ram. What does SECTIONS do?

MEMORY
{
  FLASH (rx) : ORIGIN = 0x1c000, LENGTH = 0x1A000
  RAM (rwx) :  ORIGIN = 0x20001FE8, LENGTH = 0x6018

  /** Location in UICR where bootloader start address is stored. */
  UICR_BOOTLOADER (r) : ORIGIN = 0x10001014, LENGTH = 0x04
}

SECTIONS
{
  /* Write the bootloader address in UICR. */
  .uicrBootStartAddress : 
  {
    KEEP(*(.uicrBootStartAddress))
  } > UICR_BOOTLOADER

  .fs_data :
  {
    . = ALIGN(4);
    PROVIDE(__start_fs_data = .);
    KEEP(*(.fs_data))
    PROVIDE(__stop_fs_data = .);
  } > RAM  
}
Parents
  • Hi,

    For the MEMORY section:

    For the Flash part you need to make room for the SoftDevice. Assuming that you are using the nRF52832, then you for SDK 13 with the S132 v.4.0.x need to set aside 124 kB for the SoftDevice:

      FLASH (rx) : ORIGIN = 0x1f000, LENGTH = 0x61000
    

    The RAM part will depend on how you configure the SoftDevice. Adding services, support for more BLE links, etc, will make the SoftDevice require more RAM. If you turn on logging(nrf_log), the SoftDevice will tell you how much RAM it requires when you try to enable it. For the ble_app_uart example in SDK 13 for nRF52832, we have the following configuration:

    RAM (rwx) :  ORIGIN = 0x200025f8, LENGTH = 0xda08
    

    With the release of SDK 14.1, we have added support for Segger Embedded Studio (SES) IDE. SES is cross-platform, and can be used on Windows, Mac OS X, and Linux. You can use Segger Embedded Studio for commercial and non-commercial purpose with Nordic Semiconductor devices free of charge without any code limit. See this article for more information. I would therefore recommend using SES instead of Eclipse.

    You can download SDK 14.1 here.

    You can download Segger Embedded Studio from here.

Reply
  • Hi,

    For the MEMORY section:

    For the Flash part you need to make room for the SoftDevice. Assuming that you are using the nRF52832, then you for SDK 13 with the S132 v.4.0.x need to set aside 124 kB for the SoftDevice:

      FLASH (rx) : ORIGIN = 0x1f000, LENGTH = 0x61000
    

    The RAM part will depend on how you configure the SoftDevice. Adding services, support for more BLE links, etc, will make the SoftDevice require more RAM. If you turn on logging(nrf_log), the SoftDevice will tell you how much RAM it requires when you try to enable it. For the ble_app_uart example in SDK 13 for nRF52832, we have the following configuration:

    RAM (rwx) :  ORIGIN = 0x200025f8, LENGTH = 0xda08
    

    With the release of SDK 14.1, we have added support for Segger Embedded Studio (SES) IDE. SES is cross-platform, and can be used on Windows, Mac OS X, and Linux. You can use Segger Embedded Studio for commercial and non-commercial purpose with Nordic Semiconductor devices free of charge without any code limit. See this article for more information. I would therefore recommend using SES instead of Eclipse.

    You can download SDK 14.1 here.

    You can download Segger Embedded Studio from here.

Children
No Data
Related