This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

USBD_HID_GetReportTrigger problem: works only once

I am writing USB HID Device driver for ARM M0+ and got a problem with sending data from device to host. The device can send data only on the first call of USBD_HID_GetReportTrigger(). The all others calls of USBD_HID_GetReportTrigger() does nothing, it does not call back ARM_USBD_EndpointTransfer(). If I directly call ARM_USBD_EndpointTransfer(0x81, &but, 1) from main() then device can send data to host as many times as requested, no problem. I can see in memory two bits of difference in MDK usbd_config_0.o module (one is in usbd0_data->endpoint_active[17] and another looks like in usbd_driver_semaphore_cb_mem). If clear those two bits in MDK memory after USBD_HID_GetReportTrigger() got stuck then USBD_HID_GetReportTrigger() can call ARM_USBD_EndpointTransfer() again.

Parents
  • Hi Milorad,

    Here are details:
    MDK-ARM Plus Version:5.23
    MDK-Middleware 7.4.0
    Board: SVT31W74
    Microcontroller: S1C31W74

    USB driver full speed.

    Today I made a hack in ARM_USBD_EndpointTransfer() that makes USBD_HID_GetReportTrigger() working again.

    #include "rl_usbd_lib.h"

    extern usbd_data_t usbd0_data;
    int32_t ARM_USBD_EndpointTransfer(uint8_t ep_addr, uint8_t *data, uint32_t num) {

    ...

    usbd0_data.endpoint_active[17] = 0;

    return ARM_DRIVER_OK;
    }

    I do not think this is an appropriate solution and am looking for a real fix.

    Regards,
    Val

Reply
  • Hi Milorad,

    Here are details:
    MDK-ARM Plus Version:5.23
    MDK-Middleware 7.4.0
    Board: SVT31W74
    Microcontroller: S1C31W74

    USB driver full speed.

    Today I made a hack in ARM_USBD_EndpointTransfer() that makes USBD_HID_GetReportTrigger() working again.

    #include "rl_usbd_lib.h"

    extern usbd_data_t usbd0_data;
    int32_t ARM_USBD_EndpointTransfer(uint8_t ep_addr, uint8_t *data, uint32_t num) {

    ...

    usbd0_data.endpoint_active[17] = 0;

    return ARM_DRIVER_OK;
    }

    I do not think this is an appropriate solution and am looking for a real fix.

    Regards,
    Val

Children