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.

TM4C129XNCZAD: DFU enumeration failure with TM4C129

Part Number: TM4C129XNCZAD

Good day,

We refer to the "USB Serial Device Firmware Upgrade" to try to build the bootloader,

/cfs-file/__key/communityserver-discussions-components-files/908/USB_5F00_Serial_5F00_DFU.pdf

except for modifying the chip type to fit our board (TM4C129), all other steps are done according to the manual instructions,

and encountered a problem with the USB device not being recognized.

We don't know where the problem is, please give me advice, thanks.

 bootloaderusb_10Jun2022.zip

Ray Yang

  • Reference the part 2 regarding the document, Build the TivaWare boot loader.

    Ray Yang

  • Hello Ray,

    The drivers referenced by that document are out dated and may not work for Windows 10.

    Please use our updated USB drivers from here: https://software-dl.ti.com/tiva-c/SW-TM4C/2.1.4.178/exports/SW-TM4C-2.1.4.178.PATCH-1.0.zip

    Alternatively if you have TivaWare 2.2.0.295 installed on your local machine, you can use the drivers located at [Install Path]\TivaWare_C_Series-2.2.0.295\windows_drivers

    Best Regards.

    Ralph Jacobi

  • Hi Ralph,

    Update the driver, and it still fails.

    Ray Yang

  • Hi,

    After each download the bootloader F/W to TM4C129,

    It will start from ResetISR, then run "step over" to ProcessorInit, and it will run to an unknown place,

    And will not move to line 263 ( if $$defined(BL_HW_INIT_FN_HOOK)) .

    Ray Yang

  • Hello Ray,

    That is expected because ProcessorInit is copying the code into SRAM and then executing within SRAM. Therefore the IDE does not have the symbols to debug further. It is possible to load these but I don't think we need to go to that step yet.

    I had time to review your project in much more detail and I see that you set USB_PRODUCT_ID to be 0xFE. Please try setting it to be 0xFF. That could impact the enumeration of the device as our USB drivers are valid only for specific Vendor and Product ID's. This is documented on Page 22 of the app note you are referencing.

    Best Regards,

    Ralph Jacobi

  • Hi Ralph ,

    In the past, I tried to change the USB_PRODUCT_ID to 0xff or 0xfe, but the situation did not improve.

    Best Regards,

    Ray Yang

  • Hello Ray,

    You say 'in the past' - have you tried 0xFF with the latest USB drivers I directed you to before? Because if you used 0xFF with the old drivers, then it is very likely it would not have enumerated correctly.

    Best Regards,

    Ralph Jacobi

  • Hello Ray,

    This afternoon I had the time to build and test the project you attached and re-create the issue. After a brief investigation this is due to an issue with the boot loader file provided for USB as part of the TivaWare library which is setting the wrong clock divisor.

    Please use the attached updated bl_usbfuncs.c file. With the update I am getting the proper enumeration in Windows 10:

    2046.bl_usbfuncs.c
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    //*****************************************************************************
    //
    // bl_usbfuncs.c - The subset of USB library functions required by the USB DFU
    // boot loader.
    //
    // Copyright (c) 2008-2020 Texas Instruments Incorporated. All rights reserved.
    // Software License Agreement
    //
    // Texas Instruments (TI) is supplying this software for use solely and
    // exclusively on TI's microcontroller products. The software is owned by
    // TI and/or its suppliers, and is protected under applicable copyright
    // laws. You may not combine this software with "viral" open-source
    // software in order to form a larger program.
    //
    // THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
    // NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
    // NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    // A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
    // CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Best Regards,

    Ralph Jacobi

  • Hi Ralph,

    According to the instructions you provided, already the USB device can be successfully enumerated,

    But the windows driver can not be installed.

    We use this driver "SW-TM4C-2.1.4.178.PATCH-1.0".

    Operating system: Windows 10

    Ray Yang

  • Hi Ralph,

    I found the reason, USB Product ID needs to be changed to 0xff, windows driver can be installed successfully,

    Thank you for your help, thank you very much!

    Ray Yang

  • Hi Ralph,

    I can enter the following command on the application side,
    to reset TM4C to bootloader mode, but then I encountered the USB enumeration failure again. (Port Reset Failed)

    Please provide suggestions, thanks!

        //
        // Disable all processor interrupts.  Instead of disabling them
        // one at a time, a direct write to NVIC is done to disable all
        // peripheral interrupts.
        //

        HWREG(NVIC_DIS0) = 0xffffffff;
        HWREG(NVIC_DIS1) = 0xffffffff;
        HWREG(NVIC_DIS2) = 0xffffffff;
        HWREG(NVIC_DIS3) = 0xffffffff;


        // Return control to the boot loader.  This is a call to the
        // SVC UpdateHandler in the boot loader and should never return.
        // If it does, very bad things will likely happen.

        (*((void (*)(void))(*(uint32_t *)0x2c)))();

    Ray Yang

  • Hello Ray,

    Is this happening with the boot loader built using the documentation you referenced before?

    What have you changed since getting the proper enumeration versus now? You had the flash boot loader working before, so I'm really unclear what the issue is now.

    Best Regards,

    Ralph Jacobi

  • Hi Ralph,

    I am developing based on this version of bootloaderusb_10Jun2022.zip, I can do it through TM4C by power on detection button to decide whether to enter bootloader mode, this is possible, USB enumeration is successful.

    Then I use another way to reset the TM4C by issuing a command (jumpToBootloader()) from the application side,
    into bootloader mode, the USB enumeration is failed.

    The code is as follows.

    void jumpToBootloader(void)
    {
        //
        // Disable all processor interrupts.  Instead of disabling them
        // one at a time, a direct write to NVIC is done to disable all
        // peripheral interrupts.
        //

        HWREG(NVIC_DIS0) = 0xffffffff;
        HWREG(NVIC_DIS1) = 0xffffffff;
        HWREG(NVIC_DIS2) = 0xffffffff;
        HWREG(NVIC_DIS3) = 0xffffffff;

        // Return control to the boot loader.  This is a call to the
        // SVC UpdateHandler in the boot loader and should never return.
        // If it does, very bad things will likely happen.

        (*((void (*)(void))(*(uint32_t *)0x2c)))();
    }

    Ray Yang

  • Hi Ray,

      I will suggest you debug the problem by putting breakpoints and do single-step on bl_startup_ccs.s file. After you execute  (*((void (*)(void))(*(uint32_t *)0x2c)))() the processor should jump to 0x2C for the SVC call. As you can see it will then jump to the vector at UpdateHandler.

    Fullscreen
    1
    2
    3
    .word 0 ;; Offset 28: Reserved
    .word UpdateHandler - 0x20000000 ;; Offset 2C: SVCall handler
    .word IntDefaultHandler ;; Offset 30: Debug monitor handler
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Look at UpdateHandler and it eventually should call AppUpdaterUSB.  Are you using the default AppUpdaterUSB that is in bl_usb.c or you have your custom function? You need to debug your code by starting from bl_startup_ccs.s file and then see if it jumps to AppUpdaterUSB or your custom function if you modify bl_startup_ccs.s. If you customize AppUpdaterUSB  then you need to find out why it does not enumerate again. 

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    UpdateHandler: .asmfunc
    ;;
    ;; Initialize the processor.
    ;;
    bl ProcessorInit
    ;;
    ;; Load the stack pointer from the vector table.
    ;;
    movs r0, #0x0000
    ldr sp, [r0]
    ;;
    ;; Call the user-supplied low level hardware initialization function
    ;; if provided.
    ;;
    .if $$defined(BL_HW_INIT_FN_HOOK)
    bl BL_HW_INIT_FN_HOOK
    .endif
    ;;
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hi Charles,

    Thank you for your reply,

    AppUpdaterUSB() and bl_startup_ccs.s from the bootloader example,  they are default, I didn't modify it,

    but I'll still try to find out the reason.

    Ray Yang

  • Also, I have tried to set breakpoints to debug before,
    It seems that there is no response, is this because the code is running in SRAM?

    Ray Yang

  • Hi Ray,

      After you loaded the application firmware and if you want to debug the bootloader then you need to load symbols for the bootloader program.