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

USBD with FreeRTOS not work

Without FreeRTOS usbd working normaly with config:

#define NRF_SDH_DISPATCH_MODEL 0
#define APP_SCHEDULER_ENABLED 1

But with FreeRTOS need use

#define NRF_SDH_DISPATCH_MODEL 2

else it has errror

Error[Li006]: duplicate definitions for "SWI2_EGU2_IRQHandler"

How to solve this problem? What methods of USB need polling for working with FreeRTOS?

I'm use SDK15 and S140 v.6.0.0 Production

  • Is it possible to attach the project to this case? we can make it private case if you think it is necessary to share the code?

  • Sure. Here: http://rgho.st/7PcBJKX2Q

    And my libraries for project: http://rgho.st/private/8mhvk2yXk/e0a5f691880aaa4ff4f71db085b0ba93

    Inside the project assembly with FreeRTOS, without FreeRTOS and bootloader.

    At the same time the question about Bootloader:

    why does not the part of the periphery work in the bootloader (BLE, USB, Timer)?

    USB - The controller restarts when the function app_usbd_event_queue_process() is called (only when cable connected).

    Timer - The controller restarts when triggered interrupt from the timer.

    BLE - When BLE stack initialization (ble_stack_init()), it gets into the svc_handler () of which there is no implementation of the handler.

    The initialization is the same as in the main program, I use the same files from my libraries nRF5x_LIB15

  • Error[Li006]: duplicate definitions for "SWI2_EGU2_IRQHandler"
    How to solve this problem? What methods of USB need polling for working with FreeRTOS?

    This is not a problem. See the description of NRF_SDH_DISPATCH_MODEL_POOLING:

    Fullscreen
    1
    2
    3
    4
    5
    6
    /**@brief SoftDevice events are polled manually using @ref nrf_sdh_evts_poll().
    *
    * @note In this mode, a user application can also implement SD_EVT_IRQHandler() to receive a
    * notification about incoming events.
    */
    #define NRF_SDH_DISPATCH_MODEL_POLLING 2
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    This is not an USB requirement - it is an SDH implementation in FreeRTOS. This configuration is required for SDH module to remove interrupt implementation. It means that after that you may use pool to check the SD status or you may implement your own interrupt implementation. This is something that is done inside nrf_sdh_freertos.c.

    We are going to provide an example with SoftDevice, together with USBD and working using FreeRTOS.

  • Do I understand correctly that I should initialize everything in the same way as in individual examples, but in the same project?
    Do I need to call the app_usbd_event_queue_process () function?
    The application falls into error when you call this function

    Can you give a piece of sample code? Only main.c file

1 2