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

softdevice enable +usbd -> deadbeef error

Hi,

I'm working on a project using BLE via s140, everything was working fine until I wanted to implement usb.

I created a blank project in order to validate the usbd then once validated, I implemented it to my BLE project.

when the code enable the softdevice, I'm redirected to app_error_fault_handler. You can see below id's error and p_info who tell me that err_code equal to 0xdeadbeef

Sometime I get 0x165 for the line_num.

It's noted that I'm using freeRTOS for my program and here is the memory mapping:
I also oversized freeRTOS heap's size to rule out any related problem.
thanks for your support
  • This is inside your application and if you see your .map file, you should be able to atleast tell the context of which the assert happened. What is at this memory address 0x37c7d in your map file?

  • nrf_usb_ble__deadbeef.zip

    Hi Nuguru,

    In order to avoid any side effects, I created a project with only the uwbd and softdevice.

    So here is the deadbeef error i'm getting:

    As you advised, I went to look in my .map file at "pc" address. But I didn't find anything conclusive

    I have at the same time look in memory but apart from the address 0x000324A7 where <e can observe DEADBEEF (maybe this is only coincidence), I do not see what could help me.

    Normally my project is attached to this answer. I used the pca10056 board for this project.

    Thanks for your support

  • Pegazee, really sorry for late response, . I will look into your project today.

  • This is an SDK error

    And looking at the p_info structure, it gives the file name and line number

    looking at nrf_drv_power.c line 0x165 which is deciman 357

    It looks to me that this function is called without the nrf_drv_power being initialized. Setting a breakpoint here and running again shows the call stack

    The nrf_drv_power_init is called in app_usbd_init which is called in your usbd_thread. But this thread does not start until the scheduler starts later on. 

    Cleaner way would be just call this below before ble_stack_init

    #if APP_USBD_CONFIG_POWER_EVENTS_PROCESS
        uint32_t ret = nrf_drv_power_init(NULL);
        if ((ret != NRF_SUCCESS) && (ret != NRF_ERROR_MODULE_ALREADY_INITIALIZED))
        {
            /* This should never happen */
            APP_ERROR_HANDLER(ret);
        }
    #endif

    I see that later you ble_advertising_init is failing with a wrong data size but that is a different error and seems like the data you are trying to fit into your advertising packet does not fit the legacy adv packet.

  • Thanks for your feedback !

    I feel a little silly not to have thought of this.. The deadbeef error has probably disturbed me.

    I fixed the error concerning the advertising packet and all works correctly on the pca10056 board.

    Thanks again for your support !

    I'm faced with an "error" when I try to run the code on my board.

    The code reaches into the function:

    ret_code = sd_softdevice_enable(&clock_lf_cfg, app_error_fault_handler);

    but never leaves it.

    No error is caught despite the fact that I waited 5-10min.

Related