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.

CCS/TM4C1230H6PM: LM Flash Programmer does NOT appear to work using the DFU mode!

Part Number: TM4C1230H6PM
Other Parts Discussed in Thread: CODECOMPOSER, EK-TM4C123GXL, TM4C123GH6PM

Tool/software: Code Composer Studio

I'm able to use both codecomposer and the LM Flash Programmer to load and run my application.  I would like to be able to upgrade the firmware using just the USB DFU interface (i.e. I'd rather not have to use a JTAG programmer to update the firmware).  I'm able to use the USB DFU mode to load my application (only) if the part has been erased previously using the JTAG interface.  When I do so the board instantiates as a"Stellaris Virtual Serial Port"; I'm assuming this is because the ROM based Bootloader is being called due to no program present.  If load my application with a USB Bootloader code (which is using a I/O Port Pin to select the USB Configuration, and USBUpdate()), the port instantiates the "Counterwound Labs Updater" interface (which the LM Flash Programmer see and connects to in the configuration page). I then select my application .bin and Program the part, which it look like it is doing and says is complete and verified, however this doesn't appear to be the case (i.e. Have have two applications that blink different colored LEDS to tell them apart from each other).  If I try and erase the part using the USB DFU mode, it also appears to be working however, when I disconnect and recount, the original program is still in Flash (i.e. it doesn't appear to erase the flash); also, I'd expect the "Stellaris Virtual Serial Port" to be instantiated if it really erase the entire Flash (like it does when I use the JTAG interface). Does anyone have a simple CCS example program that demonstrates the USB DFU bootloader.  I've been through pretty much everything I found in a web-search.... 

  • Hello John,

    The Stellaris Virtual Serial Port is the debugging circuit that comes on all LaunchPad and would not be used for boot loader operation.

    You need to plug a second USB cable into the left port of the LaunchPad to use USB DFU.

    We do have a USB boot loader example for the EK-TM4C123GXL that has been developed, I will share it here.

    Make sure to place the project folder in the ek-tm4c123gxl folder for your TivaWare install. You will want the ORIGINAL_PROJECT_ROOT in the Linked Resources list to match: C:\ti\TivaWare_C_Series-2.1.4.178\examples\boards\ek-tm4c123gxl\boot_usb\ccs

    Project: 5270.boot_usb.zip

    Hopefully this will help resolve your issues with the boot loader for the device.

  • Hi Ralph,

    Ralph Jacobi said:
    You need to plug a second USB cable into the left port of the LaunchPad to use USB DFU.

    Staff notes that poster employs, "TM4C1230H6PM" - which to our knowledge is "Not supported by a LaunchPad."   (Perhaps this noting saves (both) you & poster time/effort ... that's our hope.)

  • Ralph,

    Yes, I know that, that is when the device instantiates the "Counterwound Labs Updater".  LM FLASH Programmer see the DFU USB in the configuration window and it appears to work (i.e. it says that it is programming the device) however, the program is not written into flash, because when I discount the power and reapply the power the old program is still there...
    John
  • Ralph,

    The project folder " C:\ti\TivaWare_C_Series-2.1.4.178\examples\boards\ek-tm4c123gxl\boot_usb" does not contain a boot_usb project?

    regards,

    John

  • Hello John,

    You need to take the project I sent you on E2E and place that in that location.

    Regarding the issue with seeing the program not updating, do you have the right start address set for the program?

  • Hi Ralph,

    I'm not having much success adding the project you sent me, when I place it in the directory it does not show up in the examples.  I tell TI Resource Explorer to discover examples, but that didn't do anything...  I also can't import the project, I get an error message... 
    See details below.  Error: Import failed for project 'boot_usb' because its compiler definition is not available. Please install the ARMv18.12 compiler before importing this project - click 'View > CCS App Center' to check if compiler updates are available, or install the compiler manually and register it with CCS through 'Preferences > CCS > Build > Compilers'.
    So I tried to update CCS compiler, but I get the same error...
    When I look at the CCS Installed software it shows two ARM Compiler Tools Version 19.6.0 and 5.2.2
    regards,
    John
  • Hi Ralph,

    Also,  I'm not sure about the starting address? The tm4c123gh6pm.cmd looks like the following:

    MEMORY
    {
    FLASH (RX) : origin = 0x00000000, length = 0x00040000
    SRAM (RWX) : origin = 0x20000000, length = 0x00008000
    }

    SECTIONS
    {
    .intvecs: > 0x00000000
    .text : > FLASH
    .const : > FLASH
    .cinit : > FLASH
    .pinit : > FLASH
    .init_array : > FLASH

    .vtable : > 0x20000000
    .data : > SRAM
    .bss : > SRAM
    .sysmem : > SRAM
    .stack : > SRAM
    }

  • Hello John,

    That project was made in CCS V9.1, so if you are using an older CCS that might be the issue.

    The ccs\Debug folder as a binary and .out file if you just want to flash it. You can see the app start address and other info in the bl_config.h file.

  • Hello John,

    Okay there is an issue.

    You need to set the start address based on your bl_config settings so the boot loader exists at location 0x0000 and your application starts at a higher point. For our TivaWare example, the address is set like this for boot loader applications:

    #define APP_BASE 0x00002800
    #define RAM_BASE 0x20000000
    
    /* System memory map */
    
    MEMORY
    {
        /* Application stored in and executes from internal flash */
        FLASH (RX) : origin = APP_BASE, length = 0x0003d800
        /* Application uses internal RAM for data */
        SRAM (RWX) : origin = 0x20000000, length = 0x00008000
    }

    And in bl_config.h the start address is set to be 0x2800 as well:

    //*****************************************************************************
    //
    // The starting address of the application.  This must be a multiple of 1024
    // bytes (making it aligned to a page boundary).  A vector table is expected at
    // this location, and the perceived validity of the vector table (stack located
    // in SRAM, reset vector located in flash) is used as an indication of the
    // validity of the application image.
    //
    // The flash image of the boot loader must not be larger than this value.
    //
    // Depends on: None
    // Exclusive of: None
    // Requires: None
    //
    //*****************************************************************************
    #define APP_START_ADDRESS       0x2800

  • Hi Ralph,

    I still can not load the usb_boot project you sent... error says: See details below. 

      Error: Import failed for project 'boot_usb' because its compiler definition is not available. Please install the ARMv18.12 compiler before importing this project - click 'View > CCS App Center' to check if compiler updates are available, or install the compiler manually and register it with CCS through 'Preferences > CCS > Build > Compilers'.

    I tried to load the new ARM compiler but it is at version 19.6.0
    The good news is I was able to download the usb_boot.bin to the TIVA launchpad and it appeared to work fine; It loads the "Stellaris Device Firmware Update" for the USB DFU. Now I just need to be able to load this project, or create a new project, or striaghten out the CCS compiler issue...please advise.
    Thank you,
    John
  • Hi Ralph,

    I still can not load the usb_boot project you sent... error says: See details below. 

      Error: Import failed for project 'boot_usb' because its compiler definition is not available. Please install the ARMv18.12 compiler before importing this project - click 'View > CCS App Center' to check if compiler updates are available, or install the compiler manually and register it with CCS through 'Preferences > CCS > Build > Compilers'.

    I tried to load the new ARM compiler but it is at version 19.6.0
    The good news is I was able to download the usb_boot.bin to the TIVA launchpad and it appeared to work fine; It loads the "Stellaris Device Firmware Update" for the USB DFU. Now I just need to be able to load this project, or create a new project, or straighten out the CCS compiler issue...please advise.
    Thank you,
    John
  • Hello John,

    Which version of CCS are you using?

  • Hi Ralph,

    Version: 6.1.0.00104

    John

  • Hello John,

    That version is too old for the project I shared - the project files for CCS won't be compatible with it. I don't believe installing the compiler or a newer one will help because my understanding is that CCS v6 cannot support the project files for import for CCS V9.1.

    Is it possible for you to upgrade? CCS does not require license fees so you shouldn't need to stay with such an old version. I haven't used V6 in years and I am very slow to use newer versions myself :)

  • Hi Ralph,

    I'll try installing the latest version of CCS and get back to you.

    Thank you,

    John

  • Hi Ralph,

    I was able to load version 9.3.0.0012 on my system, and import the usb_boot program.  I looked through the code and saw where to configure it to look for an I/O pin that is held low at POR (ENABLE_UPDATE_CHECK,  FORCED_UPDATE_PERIPH, FORCED_UPDATE_PORT, FORCED_UPDATE_PIN, FORCED_UPDATE_POLARITY, FORCED_UPDATE_WPU, FORCED_UPDATE_KEY so the it will call the  CheckGPIOForceUpdate()).  It looks to be working, as it configures the Device USB Port to "Stellaris Device Firmware Upgrade" in the Windows Device Manager, and the LM Flash Programmer app sees it as "0-Device Firmware Upgrade" in the manual configuration (USB DFU) when I hold the push button down at program start.  What I don't see is how to attach my application (i.e. my main.c) so that it will start execution if the push-button is not pressed at POR.

    Thank you,

    John

  • Hello John,

    So the way this works is that the boot loader resides at 0x0000, and then you add an application that starts at a specific start address. That addresses is set in the bl_config file by changing the APP_START_ADDRESS value.

    Then for your application, you adjust the starting address in the .cmd file. For example, your file may look something like this instead for the start address:

    #define APP_BASE 0x00002800
    #define RAM_BASE 0x20000000
    
    /* System memory map */
    
    MEMORY
    {
        /* Application stored in and executes from internal flash */
        FLASH (RX) : origin = APP_BASE, length = 0x0003d800
        /* Application uses internal RAM for data */
        SRAM (RWX) : origin = 0x20000000, length = 0x00008000
    }

    Once you have these two pieces configured, you also flash your application onto the device. The flash programmer will place it at the given start address without touching the boot loader. Then when you power on your device, the boot loader will load your application which in turn can invoke the boot loader when desired.

  • Hello John,

    You rejected my prior answer but offered no details as to why so I am unclear about what other information to provide.

  • Ralph,

    I was able to get the bootloader to work finally! Thank you for your patience and guidance!  Works just like it is suppose to! 

    Thanks again,

    John