This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Tiva TM4C1236H6PM not entering DFU USB mode properly

Hi All

I'm running composite USB in my application with DFU-rt and Bulk device. I'm also using the boot_usb project for boot loader code, which works fine in its first run, as does the bulk device part in the application code. The main change I've made to the boot loader code is that our board runs off a 8 MHz clock, this has been changed in bl_config.h

When I use dfuprog to switch from run-time to DFU mode the code gets stuck waiting for a USB response in the boot loader section (while(g_ui32CommandFlags == 0) in UpdaterUSB()). It appears the interrupt isn't working. To enter the bl, the g_bUpdateSignalled flag is polled in a timer function and USBDDFUUpdateBegin() is called when it gets set, this part seems to work fine.

Is all the code required to reset the USB device already there in USBDDFUUpdateBegin()? When I probe the USB signal, only NAKS are sent from the Tiva once DFU mode is entered.

  • Kieran,

      I suspect the problem here is that you are running the system clock too slowly. The USB peripheral requires that SysClock be configured to run at at least 30MHz. Did you modify bl_config.h such that you are using the PLL and an 8MHz crystal then dividing down to 30MHz or higher, or are you just configuring the system as a whole to run at 8MHz (which won't work)?

  • Ah yes sorry, I meant the crystal used is a 8MHz one instead of the 16MHz in the example.

    I believe the system clock is set to 50Mhz where the following code is used:


    And the code makes no further direct calls to any clock setting functions. From here, both Bulk and DFU-rt modes run and show up in Windows device manager until dfuprog is used to switch to DFU mode which is done using the suggested DFUDetachCallback() method. The flag is polled form a timer interrupt - and now looking at the NVIC registers I notice it's still active after entering the bl - so I guess the USBDDFUUpdateBegin() function can't be called from an interrupt?

  • Yup, moved the polling of g_bUpdateSignalled somewhere else and it works!

  • I'm glad you got this working. I was about to apologize and run off to update the documentation for USBDFUpdateBegin() to note that it can't be called from interrupt but, on looking at it, I see that that note is already there ;-)