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

Working / sample programs crashing on Custom Board?

Hi, I have made my custom board using nrf51422 sample chips (Which came nrf 51422DK ), but my working / sample program which works on DK gets crashed on custom Board.

Blinking works fine, but uart and other soft device programs crashes.

Marking on my chip is: NRF51422 QFAC A1 1503AD

  • I think you need to provide more info in order to make it possible for anyone to try to understand the issue.

    • What is the difference between your hardware and the DK? Are you using a 32 kHz crystal? (the clock source is specified when the SoftDevice is initialized).
    • How does the software fail and in what situations? Have you used a debugger to investigate the details?
  • We are not using external 32khz crystal oscillator, Followed DC-DC schematic from the nrf Specs. We have configured the stack to use internal RC with 250 ppm 4 msec calibration clock.

    Even the UART sample program crashes at printf() statement. But I'm able to run blinky example perfectly.

  • It seems you are using the same chip variant as the DK, which also has a QFAC. As long as you initialize the SoftDevice with the correct settings for 32 kHz clock, I do not see what should be different. Which version of the SDK and SoftDevice do you use? Can you disable optimization and define DEBUG and use a debugger to figure out exactly where the error occurs?

  • We use gcc and gdb for debugging. This is the error we get 0x00001bac when we reach printf statement and the program crashes. We are running the uart example code with out softdevice. UART Peripheral example.

    #0  0x000004de in app_error_handler (error_code=12, line_num=42, 
       p_file_name=0x2ac8 "/home/akhil/work/code/nRF51_SDK_9/examples/peripheral/uart/main.c")
       at /home/akhil/work/code/nRF51_SDK_9/components/libraries/util/app_error.c:84
    #1  0x0000035c in uart_error_handle (p_event=0x20007f70)
       at /home/akhil/work/code/nRF51_SDK_9/examples/peripheral/uart/main.c:42
    #2  0x00000b3e in UART0_IRQHandler ()
       at /home/akhil/work/code/nRF51_SDK_9/components/drivers_nrf/uart/app_uart_fifo.c:327
    #3  <signal handler called>
    #4  0x00001bf0 in printf ()
    #5  0x00000430 in main ()
       at /home/akhil/work/code/nRF51_SDK_9/examples/peripheral/uart/main.c:125
    
  • Error code 12 is NRF_ERROR_DATA_SIZE, which normally indicate that the data size exceeds limit. You could try to increase the buffer sizes (defined near the top of main.c), but there should not be any difference from the DK to your board.

    Have you made any changes from the example? If so which? Can you upload your modified example here?

Related