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.

TM4C123GH6PM: Code not running after update BOOTCFG

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

I am running a modified version of the TivaWare 2.1.3.156 blinky example on the EK-TM4C123GXL LaunchPad trying to get the ROM bootloader working.

I have added the following as the first lines of main():

if(HWREG(FLASH_BOOTCFG) & FLASH_BOOTCFG_NW)
{
    // not committed yet
    HWREG(FLASH_FMD) = (HWREG(FLASH_BOOTCFG) & 0x7fff00ec) | (FLASH_BOOTCFG_PORT_F | FLASH_BOOTCFG_PIN_4 | FLASH_BOOTCFG_KEY | FLASH_BOOTCFG_DBG1);
    HWREG(FLASH_FMA) = 0x75100000;
    HWREG(FLASH_FMC) = FLASH_FMC_WRKEY | FLASH_FMC_COMT;
    while(HWREG(FLASH_FMC) & FLASH_FMC_COMT)
    {}
}

With a debugger I can verify that the value 0x7fffb0fe is written to BOOTCFG when the program is run for the first time. When power cycling the LaunchPad the change to BOOTCFG is committed but the LED no longer flashes. (I have a jumper to connect PF4 to +3.3V; there is no pull-up on the LaunchPad).

I have no idea why the main program does not execute. The strange thing is that if I change the code to use pin PB1, everything works as expected. PF4 is not a protected pin and this should thus not be affected by errata MEM#19. I am out of ideas why.

  • Hi Andrew,
    Perhaps I'm not clear with your question. Which pin are you using as the GPIO to toggle the LED? You configure PF4 as the boot pin. Are you trying to use PF4 as the LED pin?
  • Hi Charles,

    I am using PF3 for the LED.

    For completeness; I have modified the following example file found in TivaWare: examples/boards/ek-tm4c123gxl/blinky/blinky.c

    Full diff is given as (including line numbers and includes):

    27d26
    < #include "inc/hw_flash.h"
    29d27
    < #include "inc/hw_types.h"
    53,62d50
    <     if(HWREG(FLASH_BOOTCFG) & FLASH_BOOTCFG_NW)
    <     {
    <         // not committed yet
    <         HWREG(FLASH_FMD) = (HWREG(FLASH_BOOTCFG) & 0x7fff00ec) | (FLASH_BOOTCFG_PORT_F | FLASH_BOOTCFG_PIN_4 | FLASH_BOOTCFG_KEY | FLASH_BOOTCFG_DBG1);
    <         HWREG(FLASH_FMA) = 0x75100000;
    <         HWREG(FLASH_FMC) = FLASH_FMC_WRKEY | FLASH_FMC_COMT;
    <         while(HWREG(FLASH_FMC) & FLASH_FMC_COMT)
    <         {}
    <     }
    < 

  • Hi Andrew,
    Can you please measure the voltage on PF4? i wonder if you are in ROM bootloader mode. Looking at your code you will be in ROM bootloader mode when PF4 is low but you tie the PF4 to 3.3V.
  • Hi Charles,

    Today I found some time to further diagnose the issue. Turns out that it is a defect in this particular launchpad board. PF4 always reads as a 0, no matter what it is connected to. The code runs fine on another launchpad.

    Thanks for your help.
  • Glad you identified the root cause. The question is how the PF4 becomes defective. Was it working at one point of time?