This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nrf51822 QFAB R7 programming issue from nrf51 DK

Hi, I developed an application based on s110 using the nrf51 DK and it works fine. The DK is based on a nrf51422 QFAC which is the biggest one in terms of memory sizes. Now, I want to flash the same application on a custom board having a nrf51822 QFAB R7 which has 128K flash and 16K ram. I'm developing in gcc environment and I created the following linker script that works for the DK:

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

MEMORY { FLASH (rx) : ORIGIN = 0x00018000, LENGTH = 0x8000 RAM (rwx) : ORIGIN = 0x20002000, LENGTH = 0x2000 }

INCLUDE "gcc_nrf51_common.ld"

I can use many other values for flash and ram and all of them work but some values don't. Anyway, I flashed the nrf51822 and it doesn't work. I tried to change those values but I obtained the application output pin fixed at high level at most. Any suggestions? Thanks.

  • Hi,

    The linker settings looks correct for your chip variant. But does your board have a external crystal for the LF clock? If not you need to make sure to use the internal RC oscillator in your code. Clock source is set in the BLE stack init routine.

  • Hi, the schematic is the same of the DK, there is an external 16MHz crystal. I have the hex file of another software previously developed for that board and it seems it works fine. This means that the board is ok. Could it be anything else? Thanks.

  • Just to be sure, can you confirm that you have the 32Khz crystal as well? This and the linker settings are the two most common mistakes when porting code from the DK to a custom board in my experience.

    Have you set up GDB or similar so you can debug the FW on your board? Then you could see where the program may be stuck or maybe asserting.

  • Hi, do you mean an external 32KHz crystal? I can not see any in the schematics. I haven't tried to debug yet but thanks for suggesting, I'll try it.

  • Yes. the softdevice will wait indefinitely for the crystal to start up if configured to use a non-existent LF crystal. Please try to change the following line in ble_stack_init():

    SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, NULL);

    to:

    SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_RC_250_PPM_TEMP_4000MS_CALIBRATION, NULL);

    This configures the softdevice to use the internal RC oscillator instead of the crystal.

Related