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

  • I steped slowly trouhg the program to search where the error is happening...

    the function sd_ble_enable() returns 0x4 as I found in an other forum entry this means no or not enough memory...

    should i now try to change RAM start or RAM size? 

  • So I tryed to change RAM_START, and  RAM_SIZE

    New RAM_START  : 0x20001ff8

    New RAM_SIZE : 0x2008

    Now sd_bleenabe() returns 0x0 what mean success...

    sd_ble_event_get() returns 0x5 this means that no ble_event is in stack, thats ok then

    but it did still not advertise

  • sd_ble_evt_get returning NRF_ERROR_NOT_FOUND is a normal scenario where softdevice tells that there are no more events to be pulled out.

     

    bom4 said:
    but it did still not advertise

    If your application has called sd_ble_gap_adv_start without any errors, then I do not understand why the device is not advertising. Please make sure that your application starts in debug mode and put a breakpoint inside app_error_fault_handler to find out if any APP_ERROR_CHECK failures.

  • at the moment I'm debugging

    the function sd_advertising_start() returns 8 invalid state

    in this funciton it is a call to 

    ble_advdata_set() returns 7 invalid parameter

    in this function is a call to

    sd_ble_uuid_encode() returns also 7

    after sd_ble_uuid_encode() returns error code the function hangs up in a infinity loop

    were it always enters sd_advertiseing_start() and always returns 8 

    but never ever passes the breakpoint by ble_advdata_set() or 

    sd_ble_uuid_encode()

    but in the infocenter i can not find clear informations about this function,

    All information I found about this is ...

    I don't have a clue what this minimalistic information should give me... 

  • Could it be, that SES whant's to load all on RAM in debugging? 

    The chip has 1MB Flash and 256 kB RAM...

    in SES it says : 

    that gives a total of 273.8 kB what is more then we have in RAM only

    I 'm looking for a needle in a haystack pleas show me the needle

Related