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

Which SDK11 gcc examples work with nRF51822?

I think similar issues have been posted before and not resolved

If I flash the hex precompiled hex files for virtually any project by using the pca10028 S130 version it works fine

e.g. examples\ble_peripheral\ble_app_hrs\hex\ble_app_hrs_s130_pca10028.hex

But if I try to compile using gcc 4.9.3 the resultant binary doesn't work.

(I have the S130 SDK11 installed), I just flash the code into 0x1b000

The only example that does compile and run is

examples\ble_peripheral\ble_app_beacon\pca20006\s130\armgcc

i.e This targets the pca20006 board.

The pca20006 is a nRF51822 where as the pca10028 is a nRF51422 - so I don't know if that's the problem.

I'm now downloading keil to see if this is a gcc issue (I'm using gcc 4.9.3 as recommended here devzone.nordicsemi.com/.../ )

But the gcc toolchain must be working as the beacon for pca20006 will compile, upload and run without any problems

  • Regarding the different RAM usage by the SoftDevice for different examples, this is something that was introduced in S130 version 2. Depending on how the SoftDevice is configured, it will require different amounts of RAM. This is described in the S130 v2 release notes. If you enable logging and use a debugger, the SoftDevice will output the "correct" ram start address, as described in the release notes. If you use an example and does not modify it significantly (no more connections etc.), you should not have to change the start address.

    In what way does it not work? As long as you set aside (at least) enough RAM for the SoftDevice, you should be OK. If there is not enough RAM left for the application, you should get an error during linking.

    What is the rest of the marking on the 16 kB RAM chips you have? There are 3 generations of QFAA devices, and the latest SDK and SoftDevice are only compatible with the 3rd generation, marked "QFAAH..". See nRF51 Series IC revisions compatibility with SDK and SoftDevices for details.

  • Thanks Einar

    I was not aware that older nRF51822QFAA were incompatible with SD V2. I checked and the device I was using is QFAAH however I also have some modules by "Wiress-tag" (of china), which use the older QFAAG3 device So I will not use those with SD V2

    I think I will need to leave this question open until I have worked out why changing the HRS will run from your precompiled HEX file but will not run when I compile using armgcc (even after changing the RAM linker settings that you posted)

    Thanks

    Roger

  • I have now managed to get some examples to work on my nRF51822QFAAH0 device

    The HRS example works but the proximity will not compile as it takes more RAM than is available.

    Using the PCA10028 board as the base..

    I changed the linker file as suggested to ..

    MEMORY
    {
      FLASH (rx) : ORIGIN = 0x1b000, LENGTH = 0x25000
      RAM (rwx) :  ORIGIN = 0x20002080, LENGTH = 0x1f80
    }
    

    (I reduced the LENGTH value by 0x4000 hex)

    I am not sure why this solution didn't originally seem to work. But I retested with a clean copy of SDK11 and it is now OK

    Note. Examples that take more than 1f80 of RAM will simply not compile (link), which is understandable.

Related