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.

TM4C1294XL bootloader trigger on GPIO PIN

Other Parts Discussed in Thread: TM4C1294NCPDT

At the beginning hi to all forum users:)

I have question about TI bootloader. In previous job I was working with STM32 uC. It has embedded bootloader in ROM memory similar way

that TI TM4C1294 has. The only difference is that STM32 by default has specified BOOT pin to enable bootloader during power up by applying

low or high signal to that pin. TI uC has the same function disabled by default, to enable it I need to update BOOTCFG register.

I found in documentation that i need to make a "commit" operation to it. I do everything as described in datasheet but it not working:/

Can anyone with bigger experience take a fast look to attached code and tell me where I made a mistake?

void InitBootloader(void)
{
// Registers for bootloader selection
uint32_t reg;

uint32_t* fmaReg;
uint32_t* fmdReg;
uint32_t* fmcReg;
uint32_t* bootcfgReg;

fmaReg = (uint32_t*)FLASH_FMA;
fmdReg = (uint32_t*)FLASH_FMD;
fmcReg = (uint32_t*)FLASH_FMC;
bootcfgReg = (uint32_t*)FLASH_BOOTCFG;

//Read BOOTCFG value
reg = *bootcfgReg;
//Clear boot GPIO trigger settings
reg &= 0xFFFF00FF;
//Set new settings:
//PORTF = 0x5
//PIN2 = 0x2
//POL = 0
//EN = 0
reg |= 0xA8 << 8;

*fmaReg = 0x75100000;
*fmdReg = reg;
*fmcReg = 0xA442;

UARTprintf("Old BOOTCFG: %x\n", *bootcfgReg);
UARTprintf("New BOOTCFG: %x\n", reg);
}

If I understand datasheet correct the commit operation has 3 steeps:

1) Setup address in FMA register

2) Setup value in FMD register

3) Trigger operation by passing special key value to FMC register

After power up the register value not changes and I do not know why. It is possible I made simple mistake by choosing wrong key value

or something similar. I just need someone fresh look to that code.

  • Hello Pawel,

    The issue is that the FMC register write requires the KEY and Commit bit set. That would be a write of 0xA4420008 to the FMC register

    Regards
    Amit
  • Thanks, it helps and now everything is working fine:)
  • @Pawel,

    Glad you're (now) up/running.

    That said - you appear very detailed/experienced. We're curious as to, "How & why" you (appear) to have "missed" the requirements for "Key & Commit bits."

    Does the MCU manual - or bootloader manual - (or both) require better clarity and/or emphasis? A number of our clients will (shortly) follow in your footsteps - would be helpful to many to learn of your experience. (perhaps you were just "rushed or too eager...")

    Thanks your time/attention...

  • Hmm, after short thinking I have some suggestions about TM4C1294NCPDT datasheet.

    Overall documentation is clear but I found it little confusing. For example when I follow chapter about BOOTCFG register on page 669 I have to jump to page 609 with description of non volatile registers programming. Next I have to follow description of FMA, FMC and FMD registers to see what is what. In my opinion first thing is missing overall schematic with simple workflow for all non volatile registers. Also jumping from chapter to chapter not helps to figure out what is what:) Chapter 8.2.3.12 itself simply put to much information in one place like "if that do that, otherwise if that then do something else, but only if etc."

    Other think is that maybe I am blind but there are some errors in table 8-3 "FMA Value" column:
    FMPPE8 0x0000.00011 FMPPE8
    FMPPE9 0x0000.00013 FMPPE9
    FMPPE10 0x0000.00015 FMPPE10
    FMPPE11 0x0000.00017 FMPPE11
    FMPPE12 0x0000.00019 FMPPE12
    FMPPE13 0x0000.0001B FMPPE13
    FMPPE14 0x0000.0001D FMPPE14
    FMPPE15 0x0000.0001F FMPPE15

    Those values should be 32bit. Also I do not know the reason of "dot" there in HEX addresses.

    Next thing I am missing is overall processor summary description on one of first page of datasheet similar to Atmel
    ATmega processors datasheet (example: www.atmel.com/.../Atmel-8271-8-bit-AVR-Microcontroller-ATmega48A-48PA-88A-88PA-168A-168PA-328-328P_datasheet_Complete.pdf)
    Fast look into it and you know what device has on board.

    Also I prefer registers description similar to the Atmel ones. Don't understand me wrong - I really like TI datasheet style but in my opinion register description with all the fancy page formatting makes it harder to fast find information you are looking for.
    Simple example is page 670 of TM4C1294NCPDT datasheet with description of BOOTCFG register bits meaning. Part with information about PORT and PIN field covers almost all page just because formatting. Also without any frames or tables those information looks little messy on page and You have to focus to understand it.

    Those are my personal thoughts, other peoples may not agree with me and have other opinion. In short TI documentation is OK in my opinion but always could be better:)
  • @Pawel,

    May I commend you for a well-thought, caring and complete analysis?   Very well done - thank  you very much.

    In a past life - I wrote such documentation (for another giant semi-firm) and "too often" those "too close" fail to identify with the skill level & focus of their readers!

    Vendor's rep here had fast/furious "fix" for you - to me that indicates that "your exact issue" trips many - should have been better highlighted!  (single, fleeting sentence "buried in the murk" (if that's the case) may not prove best...)

    From my (outsider) perspective - the "Bootloader" Manual would be the proper place to highlight all of these details.  It's unclear how much of your understanding (if any) resulted from a seriour read/review of the Bootloader manual...

    Again - thank you - hopefully this will aid many.

    Documentation is always a challenge - very hard to fully/properly anticipate - lack of (highlight) by this vendor does not serve user's interest - imho...