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

Thread: 'undocumented bit' 0x40 in USB0_TRC0 0x40

  1. #1
    Junior Member
    Join Date
    Nov 2012
    Posts
    2

    'undocumented bit' 0x40 in USB0_TRC0 0x40

    referencing usb_dev.c:usb_init, there is a set to a reserved bit in the
    USB0_USBTRC0 register at 0x40.

    there clearly may be other problems with my code, but if I set this bit I
    take a fault.

    is there any background as to where this bit came from?

    thanks for your time

  2. #2
    Junior Member
    Join Date
    Nov 2012
    Posts
    2
    well, the crash was caused by the erroneous use of 32 bit accesses on the trc0 register.

    i've tried removing this from a version I have based on the reference code from pjrc, and it still seems
    to move packets, so my problem is almost certainly in bdt management.

    it would be interesting to know what this guy is supposed to do

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    23,974
    I wish I knew too! I suspect it does nothing, but might do something in other Freescale chips which have basically this same USB peripheral?

    Freescale's example code sets that bit, but their code is a mess... obviously adapted from Coldfire and even HC08. They also use the bit which resets all endpoint data toggles (at least I understand it) during control transfers, which seems very odd to me. I've never gone to the trouble of setting up a working CodeWarrior installation (I mainly use Linux... and getting it to work seemed like a lot of fiddling, at least with the early versions when I developed my USB code).

    Freescale's example also only manages a fixed 2 packet buffer scheme for each endpoint, which is easier but doesn't allow enough buffering for simple Arduino-based code using Serial.print to achieve the best USB speeds when used together with libraries like LiquidCrystal or OneWire. So for Teensy 3.0, I mostly ignored Freescale's example code and mainly relied on the datasheet and a LOT of testing.

    If you do observe that bit doing anything at all, please let me know!

Posting Permissions

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