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

nRF52832 PCA10040 armgcc application .ld RAM/FLASH

I have the nRF52832 PCA10040, V1.2.1, 2017.23 development board with ble_app_blinky_gcc_nrf52.ld RAM/FLASH settings:

MEMORY
{
FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0x5a000
RAM (rwx) : ORIGIN = 0x200022b8, LENGTH = 0xdd48
}

Which is the way it was configured from the installation.  I am using the example:

nRF5_SDK_15.0.0_a53641a/examples/ble_peripheral/ble_app_blinky/pca10040/s132/armgcc 

and gcc:

/usr/local/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-gcc --version    
arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 5.4.1 20160919 (release) [ARM/embedded-5-branch re
vision 240496]

If I download the pre-built ble_app_blinky_pca10040_s132.hex to the development board it runs and communicates with the blinky app on my android phone.  When I build the app using the armgcc compiler it doesn't run at all.  I have followed the directions and downloaded the s132 soft device which must be working since the above mentioned .hex file runs and all works correctly.  Looking at the forum I think it may be the memory configuration but from the documentation it is not clear what the application ble_app_blinky_gcc_nrf52.ld memory configuration should be.  The device has 512K Flash and 64K RAM and I think the s132 is loaded in the first section of flash and ram so how do I determine where the application code should be loaded?

make output:

[charlton@saturn armgcc]$ make
Linking target: _build/nrf52832_xxaa.out
  text    data     bss     dec     hex filename
 27616     592    2348   30556    775c _build/nrf52832_xxaa.out
Preparing: _build/nrf52832_xxaa.hex
Preparing: _build/nrf52832_xxaa.bin
DONE nrf52832_xxaa
[charlton@saturn armgcc]$

I download the _build/nrf52832_xxaa.hex generated which doesn't even start as debug output isn't displayed on the attached serial port.

John

Parents
  • Hi John 

    SDK v15.0.0 uses GCC ARM Embedded 6.3 2017-q2-update, see the nRF5 SDK v15.0.0 Release Notes, so I would recommend updating your GCC toolchain. 

    All the SDK examples should compile and work "out-of-the-box" with our development kits, so you should not have to modify the linker settings to get an unaltered example to run. I fyou have modified the example in such a way that the SoftDevice require more RAM, then the SoftDevice will return the new application ram start address the first time it calls sd_ble_enable(), this new start address is printed as log output. It is also possible to examine the returned value in a debug session. 

    Have you tried debugging the application using GDB or Segger Ozone and verified that the application is not asserting before the log output is printed? Alternatively, you could use Segger Embedded Studio (both IDE and debugger) instead of GCC as you get a free perpetual license when developing with nRF5x devices. 

    Best regards

    Bjørn 

Reply
  • Hi John 

    SDK v15.0.0 uses GCC ARM Embedded 6.3 2017-q2-update, see the nRF5 SDK v15.0.0 Release Notes, so I would recommend updating your GCC toolchain. 

    All the SDK examples should compile and work "out-of-the-box" with our development kits, so you should not have to modify the linker settings to get an unaltered example to run. I fyou have modified the example in such a way that the SoftDevice require more RAM, then the SoftDevice will return the new application ram start address the first time it calls sd_ble_enable(), this new start address is printed as log output. It is also possible to examine the returned value in a debug session. 

    Have you tried debugging the application using GDB or Segger Ozone and verified that the application is not asserting before the log output is printed? Alternatively, you could use Segger Embedded Studio (both IDE and debugger) instead of GCC as you get a free perpetual license when developing with nRF5x devices. 

    Best regards

    Bjørn 

Children
  • Thank you.  I decided to take the ses option.  It worked and the ble_app_blinky works with some log output I added and changed the button and led, so the problem is not with my changes but with the armgcc configuration.  I installed the correct version of the gcc compiler (GCC ARM Embedded 6.3 2017-q2-update) but that didn't correct the problem.  I will try some other examples to see if I can get the gcc version to work.  I will use the ses IDE for now since I plan to stick with the nRF52 devices.  My understanding is I can develop a commercial product with the nRF52 with the free version of ses.

Related