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

Keil Usb example / flow control

Is it possible to overwrite data to the In Endpoint, that is, overwrite data in the buffer before the host has a chance to read it? In my device I am sending a series of responses to a request from the host. Each of these responses are less than 64 bytes. I know the IN is double buffered, is it possible that the 3rd write can overwrite a buffer if the first 2 have not been read yet? Or is all that prevented by hardware? I am looking at a Keil example of writing data to an endpoint and it just writes to the tranmit data register without any type of checking?

Parents
  • "Is it possible to overwrite data to the In Endpoint"

    Which USB MCU are you working on?
    It's device specific.

    But at least I know, there is no USB MCU whose datasheet clearly describes about the result of overwrite to full endpoint buffer. It isn't expected.

    Instead, some USB MCU has a command to flash the endpoint buffer, though not all of USB MCU have.



    "I am looking at a Keil example of writing data to an endpoint and it just writes to the tranmit data register without any type of checking?

    KEIL examples are interrupt driven as for the IN endpoint handling. The interrupt for the IN endpoint is triggered when the endpoint buffer goes empty. Then, no check is required.

    Tsuneo

Reply
  • "Is it possible to overwrite data to the In Endpoint"

    Which USB MCU are you working on?
    It's device specific.

    But at least I know, there is no USB MCU whose datasheet clearly describes about the result of overwrite to full endpoint buffer. It isn't expected.

    Instead, some USB MCU has a command to flash the endpoint buffer, though not all of USB MCU have.



    "I am looking at a Keil example of writing data to an endpoint and it just writes to the tranmit data register without any type of checking?

    KEIL examples are interrupt driven as for the IN endpoint handling. The interrupt for the IN endpoint is triggered when the endpoint buffer goes empty. Then, no check is required.

    Tsuneo

Children