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

How to find error causing code witch is caugt by app_error_weak.c

I have built a custom chip with nrf52840 on it.

I use Ses as development tool.

I took as startingpoint for software SDK15.3 with Softdevice 140

I took the ble_template from the SDK and copied my code init.

I can compile the code without any error, but when I flash it on the device it does not start to advertise.

In debugger mode it starts up well, but then runs into app_error_weak.c

now the function gives error code and stuff, but I don't know, how to find the code witch caused the error

that is what i got from ses and the error handler

I'm not sure if its relevant but in call stack ar two functions in it

the first is in app_error_weak.c

the secound is in app_error_handler_gcc.c

and shows those parameters 

because error_code in one handler and id in the other ar the same i guess, that 1 error is thrown and chaugt by both handlers, or

one handler calls the other.

But I don't know now how to solve this. And how to search for the code whitch caused the error.

thanks for any help

Parents Reply Children
  • Can you please attach your project so that i can do a quick smoke test on nRF52840DK?

  • Yes I can, Sould I Give you the SDK with all code in it that i had to modiefy?

    But I have to warn you... I had to do lots of workarounds, because it's an 2017 Project, that I have portet from eclipse neon to SES

    and because nordic updatet SDK 15.3 files and I wasn't able to get an original 2017 SDK 15.3 I had to exchange some files from actual SDK 15.3 with the old version ones out of the actual Project, because I don't wanted to change the Running code of the old Project.

    The code is maybe not for all eyes... 

    Path to ses : 

    nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_template\pca10056\s140\ses\V2_ble_app_template_pca100056_s140.emProject

  • I flashed your code into the nRF52840KD and there were no errors. The device is stable, advertising, connected and manually disconnected normally

    <info> app: Template example started.
    <info> app: Fast advertising.
    <info> app: Connected.
    <info> app: Fast advertising.
    <info> app: Disconnected.

  • hmm strange...

    how do you check the advertising? 

    is that safe to flash my code on the DK? 

    someone once told me it's no good idea to put my code on DK because of other hardware it could lead to destroy some parts of DK?

    Could there be some issues with debugging conection ? Would be strange, because the kit seamed to notice my board, when I flash it looks like the image goes on the custom board not on DK.

    I have on my custom board Vcc , SWDIO, SWCLK and GND

    I connected it with the P20 debug output on the DK like

    Vcc -> VTG

    SWDIO -> SWDIO

    SWCLK -> SWDCLK

    GND -> GND Detect

    Vcc is 3 V

    the chip version on custom board is N52840-QIAAD0-1943CX

    on the DK N52840-QIAAD0-1938(maybe B)C

  • The common difference between a custom board and nRF52 DK are the clock source, and selecting the wrong clock source (NRF_SDH_CLOCK_LF_SRC) which does not match the clock on your custom board can cause sd_softdevice_enable to configure the softdevice with incorrect accuracy. Please check if the clock source you selected and its accuracy matches the one you have on your board.

Related