Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Is it possible to send raw packets out of the usb interface

  1. #1
    Junior Member
    Join Date
    Dec 2013
    Posts
    3

    Is it possible to send raw packets out of the usb interface

    I want to send raw data out of the usb interface in the mk20dx128 that does not necessarily correspond to any usb message; just raw bytes for testing. Is that possible, in anyones experience here? If so, does anyone have simple code examples of doing so?

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    28,474
    That's simply not how USB works. Here is the USB 2.0 spec.

    http://www.pjrc.com/teensy/beta/usb20.pdf

    Please take a look at chapter 4 (key concepts) and the first half of chapter 5 (data flow model), and maybe chapter 8 (protocol). This may not answer all your questions, but it should at least give you a good idea of the actual protocol used. The info in chapter 4 and the first bit of chapter 5 will give you the most important concepts and terminology, which are needed to talk meaningfully about doing custom USB stuff.

  3. #3
    Junior Member
    Join Date
    Dec 2013
    Posts
    3
    Thanks Paul, totally understand that the upper protocol layers will not allow that to happen with regard to properly communication with anything. What I was asking (poorly) was if there was a possible way to simply cause transmission of a packet out of the transceiver without expectation of proper link-layer, protocol behaviour. I guess an analogous question would be, could I set up ethernet registers to send data without having the full tcp-ip stack working for this particular chip? I may be wrong, but it would seem like a bad hardware design to not be able to test the phy layer independent of the higher-level stack. It seems like I should be able to configure the proper clocks, set up a buffer and BDT, and hand it over to the DMA engine in the USB module. At the lowest level, how could the hardware possibly know anything other than an address, how much data to send, and who has ownership of the descriptor?

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    28,474
    Did you read those parts I recommended from the USB spec?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •