Blog Sturntech

MAX3421E USB HOST Debugging: HRSLT = hrJERR (0x0D)

with 4 comments

The MAX3421E (link) is a USB Peripheral/Host Controller with SPI Interface. It contains the digital logic and analog circuitry necessary to implement a full-speed USB peripheral or a full-/low-speed host compliant to USB specification rev 2.0.

When developing with the MAX3421E, routinely checking the HRSLT codes after each USB operation is important for confirming that a given operation reached a successful completion. The MAX3421E provides the HRSL register for this purpose; specifically the HRSLT field. The following is a summary of the error codes, taken from AN3785: Max3421E Programming Guide  (link).

HRSLT codes for the MAX3421E from AN3785

Information on the exact cause of the various error codes is scarce. I recently spent several hours trying to track down why a design was encountering the 0x0D (hrJERR) code.  Several forums have postings from developers confounded by this error, with no successful resolutions discovered. It seemed important to me to share what I learned.

In my design, the MAX3421E was fully responsive via SPI and had been configured into HOST mode. I was successfully retrieving my USB test peripheral’s Device Descriptor, Configuration Descriptors, and Endpoint Descriptors. I could execute Set_Address CONTROL messages with success and everything looked fine. My DATA0/DATA1 toggles were synced properly and my transactional NAKs were at a minimum.

Then I tried to initiate a BULK_OUT transfer and encountered the hrJERR error code. Long debugging story short, I had forgotten to execute a Set_Configuration CONTROL message to the peripheral in order to actually enable the functionality of the USB peripheral. Since my firmware was attempting to drive the MAX3421E Host (and subsequently the USB peripheral) without informing the USB peripheral what to expect, the JERR error resulted from the unexpected J-State change on the D+/D- lines.

Written by sturnfie

November 23rd, 2010 at 6:38 pm

Posted in C,Design,Tip,USB

4 Responses to 'MAX3421E USB HOST Debugging: HRSLT = hrJERR (0x0D)'

Subscribe to comments with RSS or TrackBack to 'MAX3421E USB HOST Debugging: HRSLT = hrJERR (0x0D)'.

  1. Lucas,

    I’m curled up in the same situation “hrJerr”.
    Could you provide more details of your solution.

    João Gomes

    21 Feb 11 at 8:09 AM

  2. My solution was understanding why a D+/D- transition was occurring out-of-sequence. This is what triggers the hrJerr code. My particular problem was due to the peripheral expecting a different line-assertion than what was sent by the MAX3421E. Specifically a J-state of the D+/D- lines was seen instead of a response bit pattern. The J and K states are defined based on the USB configuration (opposite D+/D- for Full- versus Low- speed USB).


    18 Mar 11 at 10:48 PM

  3. Hi,I had the J error coming up on bulk out transfer, but I was setting the Configuration, only problem was I was setting it to 0 instead of 1. Your post made me look at that part of my code which helped me find my problem. Thanks


    31 Aug 13 at 1:59 AM

  4. Hey, thanks! I had exactly that problem and calling setConfiguration was the solution.

    I should have googled earlier. Would have saved me some time.

    Thanks again!

    Master Of Grizmo

    21 Mar 14 at 5:11 AM

Leave a Reply