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.

EK-TM4C123GXL: TM4C123GXL / TM4C123GH6PM - Access ROM Boot Loader

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

Tool/software:

We are attempting to program the MCU using FTDI USB to serial on UART0. From the documentation https://www.ti.com/lit/ug/spmu301e/spmu301e.pdf?ts=1740617535539 for ROM Boot Loader it says to query the BOOTCF register to identify the GPIO and state to invoke the ROM boot loader. Looking at register (0x400FE1E0). Then looking at the datasheet (TivaTm C Series TM4C123GH6PM Microcontroller Data Sheet datasheet (Rev. E)) it states that bit 15:13 is the Boot GPIO Port and 12:10 is the Boot GPIO Pin. 

Q1: Am I looking at the correct bits for Boot GPIO Port and Pin?

Q2: What is the default setting of the BOOTCFG register? 

Q3: What is the default Boot GPIO Port and Pin to used to enable the ROM BootLoader?

Our goal is to put the MCU on our own designed board without using the Tiva C Series Launchpad. We are trying to validate that we can successfully upload our bin file via the FTDI via serial as opposed to using the Tiva C Series launchpad debug port. We want to use LM Flash Programmer configured using serial but up to this point have been unsuccessful. 

Any help would be greatly appreciated.

Thanks
James

  • it states that bit 15:13 is the Boot GPIO Port and 12:10 is the Boot GPIO Pin. 
    Q1: Am I looking at the correct bits for Boot GPIO Port and Pin?

    HI,

      Your understanding is correct.

    Q2: What is the default setting of the BOOTCFG register? 

    If you look at the reset value of th PORT and PIN the are all 1's for bits 15:10. For the entire register it is 0xFFFFFFFE. You can view this in CCS Register Windows. 

    Q3: What is the default Boot GPIO Port and Pin to used to enable the ROM BootLoader?

    Since the default value of BOOTCFG is 0xFFFFFFFE, this means by default Port H, Pin 7. 

    2. In the ROM Boot Loader, the status of the specified GPIO pin is compared with the specified
    polarity. If the status matches the specified polarity, the ROM is mapped to address 0x0000.0000
    and execution continues out of the ROM Boot Loader.

  • Charles,

    Thanks for the reply. On the EK-TM4C123GXL (Tiva C Series LaunchPad) Port H, Pin 7 does not exist, or at least I cannot find it on the 40 pin header. 

  • Hi James,

      That is right. Therefore, on the LaunchPad, you cannot accidently jump to the ROM bootloader since the port/pin don't even exist on the LP. You will need to program the BOOTCFG register for an available port/pin on the LaunchPad in order to use a GPIO pin to force the MCU into the bootloader state or otherwise, the device will jump to the application directly if it finds a valid SP and Reset Vector at 0x0 and 0x4. 

  • Ok that makes sense. Thank you for clarifying. 

    Would the following be correct? :

    1. Modify the BOOTCFG register Port/Pin assignment to available GPIO.

    2. Bring the assigned Port/Pin that is defined in BOOTCFG register to high/low (as defined in BOOTCFG register).

    3. Reset LP.

    4. ROM bootloader will be running.

    5. Connect with LM Flash programmer via serial.

    6. Flash LP.

    7. Remove high/low to pin.

    8. Reset LP.

    9. LP running with flashed program.

  • That is the correct sequence. 

  • Ok great! A couple more questions in regards to ROM bootloader without the LP. The bootloader guide ( TivaWareTm Bootloader for C Series User's Guide (Rev. E) page 9) states  "For UART, I2C, and SSI, the ROM boot loader is fixed for UART0, I2C0, and SSI0, respectively." 

    This then brings me to my next question...since we want to use the LM Flash programmer & ROM bootloader and ultimately we are not using the LP how do we change the BOOTCFG register and/or is Port H, Pin 7 accessible on the TM4C123GH6PM (assuming the default state of BOOTCFG is H7)?

  • Let's say you want to use GPIO E6 pin to force the device into ROM bootloader when E6 is asserted high. You will need to insert the below code into your application firmware. 

    #define FLASH_FMA 0x400FD000
    #define FLASH_FMD 0x400FD004
    #define FLASH_FMC 0x400FD008
    #define FLASH_FMC_WRKEY 0xA442
    #define FLASH_FMC_COMT 0x9

    // FMA should have this value to program BOOTCFG
    HWREG(FLASH_FMA) = 0x75100000;

    // Data to be flashed in BOOTCFG, must be stored in FMD. 0xFFFF9AFE will enable GPIO pin E6 with polarity high to enter ROM bootloader
    HWREG(FLASH_FMD) = 0xFFFF9AFE;

    // FMC should have writekey and commit bit
    HWREG(FLASH_FMC) = FLASH_FMC_WRKEY | FLASH_FMC_COMT;

    while (HWREG(FLASH_FMC) & FLASH_FMC_COMT)
    {
    }

    The first time the flash is empty, it will run the ROM-based bootloader and load your application firmware including the above code. The next time when you start the device the device already has code in it, the processor will just run the code. However, if it detects that E6 has been asserted then it will jump to the ROM bootloader again so that you can reload/update the firmware. 

  • Understood, thank you for the sample.

    Is the correct thinking...

    In order to load the application firmware onto the device the first time I will need to use J-Link or XDS110/SDS100? Then subsequent updates could be via FTDI USB to serial on UART0 after a reset with E6 asserted high?

  • In order to load the application firmware onto the device the first time I will need to use J-Link or XDS110/SDS100? Then subsequent updates could be via FTDI USB to serial on UART0 after a reset with E6 asserted high?

    You could use J-link or XDS and these are the JTAG method of loading the firmware. As I explained, you can also load your firmware through UART0 the first time if you want. Since you already have a JTAG debug probe like J-link or XDS, I will suggest you load your first program using it. You just use CCS to load the code. 

  • Thanks Charles for your continued support and answering my questions. I have two more questions...( I think the answer is yes and yes, but just want to make sure).

    #1 If we have a brand new chip on our board, the flash will be empty and it will always run the ROM bootloader? 

    #2 The first time we can use the FTDI usb to serial and load the code with CCS and/or LM Flash Programmer?

  • Hi James,

    #1 If we have a brand new chip on our board, the flash will be empty and it will always run the ROM bootloader? 

    Yes.

    #2 The first time we can use the FTDI usb to serial and load the code with CCS and/or LM Flash Programmer?

    If the device is virgin with the flash fully erased, you can use the ROM bootloader to download firmware from UART0 that is connected to your FTDI usb to serial adapter. CCS does not support serial download but only JTAG. Yes, you can use LM Flash Programmer which is GUI base. If you want to use command line, you can use C:\ti\TivaWare_C_Series-2.2.0.295_ORG\tools\bin\sflash.exe.