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.

TM4C129 Ethernet Bootloader documentation and code

Other Parts Discussed in Thread: TM4C1294KCPDT, LM3S6965, EK-TM4C1294XL, EK-TM4C129EXL

Hi all,


I am using a custom board with a TM4C1294KCPDT and try to implement the Ethernet bootloader.

I've done that on a LM3S6965 and LM3S9B92 already, so I have some experience with it.

Now, after searching a while in documentation, code and forum posts, I finally got rid of the confusion caused by the documentation.

Just to let off some steam, my comments on some issues.

1. in the Bootloader guide, it is said about FLASH_PAGE_SIZE

The size of a single, erasable page in the flash. This must be
a power of 2. The default value of 1024 bytes represents the
page size for the internal flash on TM4C123 MCUs and this
value should only be overridden if configuring a boot loader
to access external flash devices with a page size different
from this or changed to 16384 for TM4C129 MCUs.
This value must be defined.
 
In the bl_config.h file of the bootloader shipped with the TivaWare (2.1.3.156) for the 1294XL(!) evaluation board
 
// The size of a single, erasable page in the flash.  This must be a power
// of 2.  The default value of 1KB represents the page size for the internal
// flash on all Tiva MCUs and this value should only be overridden if
// configuring a boot loader to access external flash devices with a page size
// different from this.

Same for the start address of vtable and app.
 
2. ROM function defines in bl_emac.c about GPIOPadConfigSet
 
#include "driverlib/rom.h"
//
// Define ROM_SysCtlClockFreqSet() for snowflake RA0. Even though this function
// is deprecated in RA0 ROM, the function operates correctly when 
// SYSCTL_MOSCCTL register is configured correctly prior to calling this
// function.
//
#if defined(TARGET_IS_TM4C129_RA0)
#define ROM_SysCtlClockFreqSet                                                \
        ((uint32_t (*)(uint32_t ui32Config,                                   \
                       uint32_t ui32SysClock))ROM_SYSCTLTABLE[48])
#endif

//
// Define MAP_GPIOPadConfigSet() for the Boot Loader for Snowflake.
// This function fails in Snowflake for higher drive strengths, it will work
// properly for the instances where it is used here in the boot loader.
// 
#if defined(TARGET_IS_TM4C129_RA0) ||                                         \
    defined(TARGET_IS_TM4C129_RA1)
#define ROM_GPIOPadConfigSet                                                  \
        ((void (*)(uint32_t ui32Port,                                         \
                   uint8_t ui8Pins,                                           \
                   uint32_t ui32Strength,                                     \
                   uint32_t ui32PadType))ROM_GPIOTABLE[5])
#endif

//
// Define ROM_EMACInit for the bootloader of Snowflake RA0.  This function is
// deprecated in RA0 ROM, as it does not disable some interrupts that are not
// cleared by ***_EMACIntClear().  But that is not a problem for the bootloader
// as we are not enabling any interrupts.
//
#if defined(TARGET_IS_TM4C129_RA0)
#define ROM_EMACInit                                                          \
        ((void (*)(uint32_t ui32Base,                                         \
                   uint32_t ui32SysClk,                                       \
                   uint32_t ui32BusConfig,                                    \
                   uint32_t ui32RxBurst,                                      \
                   uint32_t ui32TxBurst,                                      \
                   uint32_t ui32DescSkipSize))ROM_EMACTABLE[8])
#endif

So, there seem to be errors in the ROM code that don't matter for the bootloader application. Fine.

But what about TM4C129_RA2? Did somebody forget to add the define for it or was this issue fixed in ROM of revision A2?

Same holds for ROM_SysCtlClockFreqSet is not defined for any revision, so it should be defined for RA0, RA1, RA2, right?
 
So, these missing defines / wrong statements messy docs result in compiler or linker errors which are hard to track down for unexperienced users.
 
3. After reading lots of posts, I found out that there is a boot_demo_emac_flash and a boot_emac_flash in the full TivaWare package.
Why isn't that present in the TivaWare packet for the 1294XL board?
 
 
 
 
 
  • Hello Rainer

    #1: Point taken. We shall fix the same for TivaWare 2.1.4
    #2: ROM_SysCtlClockFreqSet has been deprecated due to Errata #22 and #23 in TivaWare 2.1.3.156
    #3: We have already added the same for TivaWare 2.1.4

    Now the question is when TivaWare 2.1.4 is going to be released. We are planning for end of 4Q'16-1Q'17 as the time frame for release.
  • Thanks Amit.


    But there are still questions open, so let me ask very specific to get specific answers:

    1. ROM_SysCtlFreqSet is being used in the bootloader for revision RA0 despite being deprecated. The comment above says it works provided the SYSCTL_MOSCCTL register has been set correctly. Is this only valid for RA0 or also for RA1 and RA2? If so, the code needs to be modified for RA1 and RA2
    2. ROM_GPIOPadConfigSet is being used exactly the same way since it seems to work under the specific circumstances in the bootloader. This is explicitely defined for RA0 and RA1. Does this also hold for RA2?
    3. same question for ROM_EMACInit

    These questions are referring to the bootloader code in the TivaWare 2.1.3.156 (the general version for no specific hardware)

    Regards,

    Rainer

  • Update:

    I made an objdump of the bootloader provided by TI.

    1. SysCtlClockFreqSet is not contained in the axf, so it is being used from ROM

    2. EMACInit is not contained, so it is being used from ROM. I noted meanwhile that ROM_EMACInit is "allowed" for RA1 and RA2 in rom.h

    3. GPIOPadConfigSet is not contained, so it's being used from ROM.

    From the makefile in boot_emac_flash (and all others in TivaWare), I can see that TARGET_IS_TM4C129_RA0.

    So, all examples are compiled for RA0. I guess that's on purpose to provide all customers with a working example, right?

    Regards,

    Rainer

  • Hello Rainer

    Yes. That is to provide with customers an example for boot loader. The DK-TM4C129X is based of RA0 silicon. The next SW release will have the examples for EK-TM4C1294XL and EK-TM4C129EXL which have RA1 and RA2 silicon.

    I will check the examples once again for SysCtlClockFreqSet API call from ROM and see to it that it is corrected.
  • Hi Amit,

    just a short remark for anyone interested in this:
    I edited the bootloader such that all 3 functions are used from ROM on the T4MC1294KCPDT and it is working.

    Regards,

    Rainer
  • Hello Rainer

    There is the errata SysCtl #22 and #23 for which the SysCtlClockFreqSet must be taken from the Flash and not ROM.
  • Hi Amit,

    I know. But have a look at your own code:


    // // Define ROM_SysCtlClockFreqSet() for snowflake RA0. Even though this function // is deprecated in RA0 ROM, the function operates correctly when // SYSCTL_MOSCCTL register is configured correctly prior to calling this // function. //

    This stems from TI! You explicitely use SysCtlClockFreqSet() from ROM despite being deprecated!

    And this works for RA2 as well.

    Best regards,

    Rainer

  • Hello Rainer

    I agree. It will work, as long as the failure issue does not come along. The comment and the code usage will get changed in the next TivaWare release.