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

GCC generated HEX not working (ble_app_uart)

Hi.

I am on compiling business now. Last days i tried to do GCC compiling and quite go well. But as always on last part i find an error.

My process:

  1. Wrote code on keil. Compiled on GCC with MSYS on Windows. (I have hex file now)
  2. Edited makefile with path, lib etc. (added spi_master)
  3. I turned an ST-Link V2 programmer to J-Link Programmer.
  4. Opened NRFGo Studio and programmed the Softdevice to the flash.
  5. try to burned application (.hex file) to the flash. It is okey also.

6. Nothing Works.

I think maybe something wrong with linker file and i tried my another code which dont have soft device. I edited linker file ( RAM Length 6000 --> 2000) and program it to the flash. BUM. It has worked very well. But my main program which has softdevice does not work with this linker.

So I think my problem is linker memory areas. i have nrf51822aa version on my chip i think. (Beacon module)

Can somebody help me with RAM area arrangements ? (ble_app_uart examples which i am using)

Linker File

/* Linker script to configure memory regions. */

SEARCH_DIR(.)
GROUP(-lgcc -lc -lnosys)

MEMORY
{
  FLASH (rx) : ORIGIN = 0x1c000, LENGTH = 0x24000
  RAM (rwx) :  ORIGIN = 0x20002800, LENGTH = 0x5800
}

INCLUDE "gcc_nrf51_common.ld"

UPDATE : Correct Adress Map for S130 SDK8.1 Ble_app_uart Example (in Linker File)

MEMORY
{
  FLASH (rx) : ORIGIN = 0x1c000, LENGTH = 0x24000
  RAM (rwx) :  ORIGIN = 0x20002800, LENGTH = 0x1800
}

This is worked for me. Cheers. (Thanks to Sigurd)

Parents
  • Hi,

    What SoftDevice version are you using? S130 or S110?

    The nRF51 QF AA variant only have 16kB RAM, so you need to decrease the RAM LENGTH to 0x1800 when using ORIGIN 0x20002800.

    If you are using S130, try this linker configuration:

    MEMORY
    {
      FLASH (rx) : ORIGIN = 0x1c000, LENGTH = 0x24000
      RAM (rwx) :  ORIGIN = 0x20002800, LENGTH = 0x1800
    }
    
  • The RAM is shared between the Softdevice(S130) and your application. The S130 v.1.0 which is used in SDK 8.1 needs a minimum of ~8kB(0x200022D8) RAM, (the RAM starts at address 0x20000000) , but when you add services, characteristics, etc (configures the SoftDeice), the SoftDevice will require more RAM. The default RAM requirement is 0x20002800. This value is listed in page 41 in the S130 SoftDevice Specification v1.0.

    Then you have the RAM length value. This value tells your application how much RAM it have available. Since you have a 16 kB(0x4000 in hex) RAM chip, you can then subtract the RAM used by the SoftDevice to get the available RAM for your application. 0x4000 - 0x2800 = 0x1800.

    For how much RAM and Flash the different chip variants have, take a look at this infocenter page.

    Also take a look at the ROM and RAM Management tutorial.

Reply
  • The RAM is shared between the Softdevice(S130) and your application. The S130 v.1.0 which is used in SDK 8.1 needs a minimum of ~8kB(0x200022D8) RAM, (the RAM starts at address 0x20000000) , but when you add services, characteristics, etc (configures the SoftDeice), the SoftDevice will require more RAM. The default RAM requirement is 0x20002800. This value is listed in page 41 in the S130 SoftDevice Specification v1.0.

    Then you have the RAM length value. This value tells your application how much RAM it have available. Since you have a 16 kB(0x4000 in hex) RAM chip, you can then subtract the RAM used by the SoftDevice to get the available RAM for your application. 0x4000 - 0x2800 = 0x1800.

    For how much RAM and Flash the different chip variants have, take a look at this infocenter page.

    Also take a look at the ROM and RAM Management tutorial.

Children
No Data
Related