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

Expadning HID reports beyond the 40h barrier

GDay to Tsuneo and all

This post is somewhat an extension to Gareth's post under http://www.keil.com/forum/17770/

The given circumstances are:

- if possible, no admin or installation on host side
- under no circumstances PC driver development -> (these 2 lead us quickly to HID, at least imo)
- Full speed is available (ARM 1768)
- a transfer rate of say 30 kByte/sec is acceptable (50 kB would be better:) but 25-30 would do)
- the data chunks to be transferred range from about 256 to say 5000 Byte

In order to get this done, we chose HID and implemented a small extra layer in between to de- and reconstruct the large messages into reports and to assure proper deliverance.

so, for example to transfer 100 Byte from PC to HID, the sequence is

WriteFile(58 Byte) First part, excluding header info
ReadFile to get ACK

WriteFile(42 Byte) remaining data
ReadFile to get ACK

All In/Out reports are always 0x40 in size, the layer in between handles the data arrangement as already said.

So in general, it works, but FAR too slow, at rates of about 1 kB/s.
And, regarding the code, I am quite sure I did not forget the parking brake somewhere.
(It works at full 64 kB/s if I omit the handshake part)

so are there any ideas out to transfer the data much faster but still safely?

Is there a way to define much larger reports and transfer them with OS help in one go?
I quickly reread Axelson, but got no idea there.

kind regards
and many thanks in advance
Ulrich

  • An <EDIT Post> function for the forum would be really cool, I really do aqpologize for the typo in the header.

    To expand the above example, an entire transaction (100 Byte in, 200 Byte out) would be

    WriteFile(58 Byte) First part, excluding header info
    ReadFile to get ACK

    WriteFile(42 Byte) remaining data
    ReadFile to get ACK

    <target processes msg>
    PC may issue "get state" reports
    if target indicates "ready"

    WriteFile(ask for Block 1) PC calls for first telegram, containing size
    ReadFile(Chunk 1)

    WriteFile(ask for Block 2)
    ReadFile(Chunk 2)

    WriteFile(ask for Block 3)
    ReadFile(Chunk 3)

    WriteFile(ask for Block 4)
    ReadFile(Chunk 4)

    As this is really sort of transaction-orientated, it is always the host that starts a conversation, sends a command and waits for a reply.

  • just to push the topic up - Tsuneo seems to be offline ....
    (hope he has some nice holidays ;)))
    ub