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.

How to build TivaWare bootloader

Other Parts Discussed in Thread: TM4C1294NCPDT, CODECOMPOSER, UNIFLASH, LMFLASHPROGRAMMER, ENERGIA, EK-TM4C1294XL

I have the TivaWare bootloader source files set up for a TM4C1294NCPDT and ethernet update, but I don't know how to build it. Do I exclude the source files of update options (CAN, UART, etc.) that I'm not using? 

Is there perhaps a CodeComposer project template that I can adapt?

  • Hello Rudolph,

    The defines for each boot loader is independent of the others. So if you include only one the others are eliminated. There is an example to do in the DK-TM4C129 example, that may be used (D:\ti\TivaWare_C_Series-2.1.0.12573\examples\boards\dk-tm4c129x\boot_emac_flash) as a reference to build the same for TM4C1294NCPDT

    Regards
    Amit
  • I've adapted that CCS project for the TM4C1294NCDPT but it won't build-- it appears to have issues with the linker memory settings. I get the following errors:

    "C:/ti/TivaWare_C_Series-2.1.0.12573/boot_loader/bl_link_ccs.cmd"  -l"libc.a" 
    <Linking>
    "C:/ti/TivaWare_C_Series-2.1.0.12573/boot_loader/bl_link_ccs.cmd", line 41: error #10263: FLASH memory range has already been specified
    "C:/ti/TivaWare_C_Series-2.1.0.12573/boot_loader/bl_link_ccs.cmd", line 41: error #10264: FLASH memory range overlaps existing memory range FLASH
    "C:/ti/TivaWare_C_Series-2.1.0.12573/boot_loader/bl_link_ccs.cmd", line 42: error #10263: SRAM memory range has already been specified
    "C:/ti/TivaWare_C_Series-2.1.0.12573/boot_loader/bl_link_ccs.cmd", line 42: error #10264: SRAM memory range overlaps existing memory range SRAM
    
    >> Compilation failure
    "C:/ti/TivaWare_C_Series-2.1.0.12573/boot_loader/bl_link_ccs.cmd", line 61: warning #10190-D: absolute symbol "__STACK_TOP" being redefined
    "C:/ti/TivaWare_C_Series-2.1.0.12573/boot_loader/bl_link_ccs.cmd", line 61: warning #10190-D: absolute symbol "__STACK_TOP" being redefined
    error #10056: symbol "ResetISR" redefined: first defined in "./tm4c1294ncpdt_startup_ccs.obj"; redefined in "./boot_loader/bl_startup_ccs.obj"
    "C:/ti/TivaWare_C_Series-2.1.0.12573/boot_loader/bl_link_ccs.cmd", line 61: warning #10190-D: absolute symbol "__STACK_TOP" being redefined
    error #10010: errors encountered during linking; "boot_emac_flash.out" not built
    gmake: *** [boot_emac_flash.out] Error 1
    gmake: Target `all' not remade because of errors.

  • Hello Rudolph

    Can you please share the CCS project? or at least attach the cmd file?

    Regards
    Amit
  • Amit, 

    I've attached the CCS project for you. boot_emac_flash.zip

  • Hello Rudolph

    The define for Crystal Frequency is incorrect

    #define CRYSTAL_FREQ 120000000

    It cannot be 120MHz. It must be less than or equal to 25MHz.

    Also please remove the tm4c1294ncpdt.cmd file as it has already been defined in the bl_link_ccs.cmd in the boot loader. if required update the bl_link_ccs.cmd file

    Similarly remove tm4c1294ncpdt_startup_ccs.c from build flow.

    Also since you are using driverlib files, you would need to add the driverlib.lib during Link Phase

    Regards
    Amit
  • Amit,

    I made those changes and it compiles. I also even managed to get the bootloader and my firmware on my device without each overwriting the other.

    Now I don't know how to use the bootloader to update the firmware. Do I have to put the device into a DFU mode? I tried the LM Flash Tool with no luck; even restarting the device while the LM Flash Tool was attempting to connect for ethernet firmware update.

    -Rudy
  • Hello Rudy

    You need to make sure that application jumps back to the boot loader. One of the boot_demo code has the Branch code to the Boot Loader. I think it is

    D:\ti\TivaWare_C_Series-2.1.0.12573\examples\boards\dk-tm4c129x\boot_demo_flash

    Regards
    Amit
  • Hi Amit, 

    Thanks for the info. I found the code you pointed me to and copied it into my firmware. When I initiate the firmware update, the device stops all other activity except for the ethernet activity LEDs, so I assume it's in the bootloader correctly. However the LM Flash Tool set for the IP address and MAC address of the target device hangs on "attempting to connect" and seems to never proceed past that point. And UniFlash 3.1 configured for "Stellaris Ethernet" with the same information filled in seems to crash when I attempt to program firmware with it. 

    I can actually confirm the device is still functioning in the bootloader, as Wireshark shows it sending ARP broadcasts from the same IP address it had previously. 

    Perhaps it's a blocked port/protocol in my firewall? Which ports do the Ethernet update utility use?

  • Hello Rudolph,

    When you mentioned that you got the boot loader and application on the device, was it with Ethernet as the boot interface or was it with JTAG?

    Regards
    Amit
  • Hi Amit,

    I used JTAG (XDS100v2) to load the firmware onto the device, but I'm using the Ethernet bootloader. I also power-cycled the device with no JTAG connected and still couldn't load firmware over ethernet, with either LM Flash or Uniflash.
  • Hello Rudolph.

    First load a standard Ethernet example from TivaWare like enet_lwip to get the IP address of the board. Then load the ethernet boot loader into the device with JTAG and use the LMFlashProgrammer with the IP Address that you got.

    Also is the MAC address configured in the device?

    Regards
    Amit
  • Hi Amit,

    The main firmware that I'm loading happens to be a fully-functional industrial lighting controller with UDP interactivity, which uses lwip (through wrapped in the Energia Ethernet library). The MAC address is loaded in user registers 0 and 1, and I am providing that MAC to the LM Flash Tool. If it matters, I've changed the MAC from the factory default TI to one in my company's block (00:22:FE).

    While the device is in the bootloader (after jumping into it from the main firmware), I've noticed it sends and receives ARP broadcasts but does not respond to ICMP pings.

    -Rudy
  • Hello Rudolph,

    OK so the MAC address is fine. The LMFlashProgrammer Tool requires the IP address as well besides the MAC address.

    Regards
    Amit
  • I have the MAC address and IP address set in LM Flash Tool, like so: 

    After I press Program in the Program tab, it hangs on "Attempting to connect", like so:

    -Rudy

  • Hello Rudy

    I would need to build the same for my EK-TM4C1294XL Connected LaunchPad and see what the issue is. This will take me some time

    Regards
    Amit
  • Amit,

    Go ahead. This isn't a pressing issue; I still have a month before we start shipping devices and having field-upgradeable firmware would be a plus but it's not a deal-breaker not having it.

    -Rudy
  • Hello Rudolph,

    Some questions as I build it on my side

    1. Does the Application Jump to the Ethernet Boot Loader on a user input like a Switch press?
    2. or does the Application Jump to the Ethernet Boot Loader based on Remote Firmware Upgrade?

    P.S: I do not have a month with me, so I have to wrap it up in the coming week.

    Regards
    Amit
  • Amit,

    The application jumps to the bootloader on a user input, with the input being a particular UDP packet that the firmware parses and understands.

    -Rudy
  • Perhaps he forgot to REM the Snow Flake clock fix top of (bl_emac.c)? That patch kills the EMAC clock.

    //
    // 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
    

     

  • I commented out that define and I got an undefined symbol error in linking. I presume I need to replace it with something? Problem is I'd have to hunt through all the files to see where it's used. 

  • No it is not required but only for snowflake silicon RA0 MPU.

    Did U first clean the project prior to compile? If so what is the error symbol?

    U can check DIDO register in debug for silicon revision or check if MPU number end in (I3) is latest revision.
  • I did clean the project, the error still occurs. The error is as follows: 

    <Linking>
    
     undefined          first referenced         
      symbol                in file              
     ---------          ----------------         
     SysCtlClockFreqSet ./boot_loader/bl_emac.obj

    The second line on our chips is "4NCPDTT3", where the T I think indicates that it's a high-temperature version of the chip. That's the only version Mouser had in stock. 

  • TI3 suffix is version 3 Si-metal - latest & greatest. Not sure why compiler it is posting error after U first (clean) the project prior to recompile?

    Assuming the MPU clock is also configured in the main function of the application that invokes Boot Loader?

    Check the project CCS build dependencies tab has (driverlib-Tiva-12573) active, if not add it then check under Project Reference in tree will then show library.

     
  • Forgot to mention the crystal frequency must be set in (bl_config.h) order code in (bl_main.c) shown below is invoked.

    #ifdef CRYSTAL_FREQ
        //
        // Since the crystal frequency was specified, enable the main oscillator
        // and clock the processor from it.
        //
        HWREG(SYSCTL_RCC) &= ~(SYSCTL_RCC_MOSCDIS);
        Delay(524288);
        HWREG(SYSCTL_RCC) = ((HWREG(SYSCTL_RCC) & ~(SYSCTL_RCC_OSCSRC_M)) |
                             SYSCTL_RCC_OSCSRC_MAIN);
    #endif

  • In the main function of the firmware I manually set the system clock to 120 MHz with

    ROM_SysCtlClockFreqSet(SYSCTL_USE_OSC | SYSCTL_CFG_VCO_320, 120000000);

    In bl_emac.h I have CRYSTAL_FREQ set to 25000000 (25MHz). The board also has a 25MHz crystal oscillator. 

    I've added a dependency for driverlib and the bootloader still doesn't build with that define commented out. 

  • I take firmware to imply to be your main application. BTW I changed that typo above to be (bl_main.c) for the BL clock setting. We have always relied on (bl_config.h) setting clock and other defines, never modified the (bl_emach.h) in the way you mention.

    The compiler believes there is still a reference to the snowflake RA0 clock code, no one has reported that happening after commenting it out. Perhaps remove RA0 code completely, clean the project and rebuilding the index may help after first checking for any unresolved includes. Leaving RA0 clock code active kills the BL clock, that evidence from my find and others having same issue.
  • BTW: Make sure your application module or where ever setting the clock manually has;

    #include "driverlib/sysctl.h"
  • Hi Rudolph,

    Some helpful tips:

    The Boot Loader soft resets the MPU after it copies the application from flash into SRAM. MPU then uses the applications clock source and interrupt vector table copied to SRAM.

    Important topic absence any answer to what is (firmware clock?)

    If my suggestions have helped your plight please be sure to check question answered!

    Thanks :)
  • I meant to say that I set CRYSTAL_FREQ in bl_config.h. 

    My main firmware uses driverlib for other things, so it already had sysctl.h included. 

    On a plus side, I found where the undefined symbol was: lower down in bl_emac.c, there was a call to MAP_SysCtlClockFreqSet, which was a macro alias for SysCtlClockFreqSet, which led me to believe that driverlib still wasn't being included. So I manually added a link option for driverlib.lib and now the bootloader compiles with the RA0 code removed. 

    However, it still doesn't work. 

    I saw another question about the TM4C1294 bootloader for ethernet not working, and the solution there had to do with ".vtable" being linked into flash rather than RAM for the main firmware. My main firmware is compiled with GCC using the Energia linker file, which I have attached. I can see a "vtable" section in .data, which is sure enough, loaded into REGION_RAM. I'll try putting my whole .data into flash and see what happens. 

    /**
     *
     * lm4fcpp.ld - Linker configuration file for Energia c++ programs.
     *
     */ 
    
    MEMORY 
    {
        flash (rx) : ORIGIN = 0x00004000, LENGTH = 0x00100000 
        ram  (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00040000 
    }
    
    /* STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : 0x800 ; */
    
    REGION_ALIAS("REGION_TEXT", flash);
    REGION_ALIAS("REGION_RAM", ram);
    
    SECTIONS 
    {
        .text :
        {
            . = ALIGN(4);
            _text = .;
            KEEP(*(.isr_vector))
            *(.text .text* .gnu.linkonce.t.*)
            *(.glue_7t) *(.glue_7)
            *(.rodata .rodata* .gnu.linkonce.r.*)
            *(.ARM.extab* .gnu.linkonce.armextab.*)
            
    
            . = ALIGN(4);
            KEEP(*(.init))
            . = ALIGN(4);
            __preinit_array_start = .;
            KEEP (*(SORT(.preinit_array*)))
            KEEP (*(.preinit_array))
            __preinit_array_end = .;
    
            . = ALIGN(4);
            __init_array_start = .;
            KEEP (*(SORT(.init_array.*)))
            KEEP (*(.init_array))
            __init_array_end = .;
    
            . = ALIGN(4);
            KEEP(*(.fini))
    
            . = ALIGN(4);
            __fini_array_start = .;
            KEEP (*(.fini_array))
            KEEP (*(SORT(.fini_array.*)))
            __fini_array_end = .;
    
            . = ALIGN(4);
            _etext = .;
        } > REGION_TEXT
    
        .data : AT(ADDR(.text) + SIZEOF(.text))
        {
            . = ALIGN(4);
            _data = .;
            *(vtable)
            *(.data .data* .gnu.linkonce.d.*)
            _edata = .;
        } > REGION_RAM
    
        .bss (NOLOAD):
        {
            . = ALIGN(4);
            _bss = .; 
            *(.bss .bss*) 
            *(COMMON)
            . = ALIGN(4); 
            _ebss = .; 
            . = ALIGN(8);
        } > REGION_RAM 
    
    /*
        .stack (NOLOAD):
        {
            . = ALIGN(8);
            _stack = .;
            . = . + STACK_SIZE;
            . = ALIGN(8);
            _estack = .;
        } > REGION_RAM
    */
    
        PROVIDE_HIDDEN (__exidx_start = .);
        .ARM.exidx :
        {
          *(.ARM.exidx* .gnu.linkonce.armexidx.*)
        } > REGION_RAM
        PROVIDE_HIDDEN (__exidx_end = .);
    
        . = ALIGN(4);
        _end = . ;
    }
    
    /* end of allocated ram is start of heap, heap grows up towards stack*/
    PROVIDE(end = _end);
    
    /* top of stack starts at end of ram, stack grows down towards heap */
    PROVIDE (_estack = ORIGIN(ram) + LENGTH(ram));
    

  • As I expected, any change I made to that linker file resulted in non-functioning firmware. Even just putting the "*(vtable)" line into the .text section.
  • Do check the application start address, vector table and reserved space all set 0x0000.4000 or higher but all set on 16kb boundary in (bl-config.h). The TFTP server was having issue with application erase boundary found a macro call had incorrectly double parentheses - Noticed yesterday CCS compiler had several warnings on (bl_main.c) half way down the module yet CCS built the module non the less only flagged the warnings in the module not the error message window.

    Once you get BL to compile suggest to first test your application at APP_BASE: 0x0000.0000 - insure it works without BL. Then LM-Flash BL offset 0x0000.0000 and change the application APP_BASE:0x0000.4000 then LM-Flash offset 0x0000.4000. That is the order of flash loading and trying to build one large application with BL included in the binary will likely crash and burn.
  • I've made progress. I edited the Energia linker file to have .vtable in its own section, right after .text in flash, and took vtable out of .data. My main firmware now works, and when I call the bootloader from it, LM Flash tool shows the error message: "**ERROR**: Problem starting the BOOTP server!" when I press "Program".

    Also, I had no warnings anywhere in my CCS project for the bootloader.
  • Good to hear the main app is now working and invoking BL. Might need to do an IntMasterDisable(), delay 1 second just before leaving main app. The BootP/tftp server host name is "stellaris" listed far down page in (lwipopts.h).
    Perhaps BootP is a broadcast IP 0.0.0.0 or 255.255.255.255?
    Getting close to success!
  • Do I exclude the source files of update options (CAN, UART, etc.) that I'm not using?

    Yes exclude those from build and rename the INT vectors you removed to (IntDefaultHandler) in (startup_ccs.c). Never delete lines from the listed order or any not being used.
  • My main app was always working and invoking the bootloader. It turns out the LM Flash error was from a conflict with VirtualBox and not dependent on the firmware app. 

    Upon further investigation I don't think the bootloader is working at all. Wireshark shows no UDP packets whatsoever leaving it, no BOOTP requests, nothing. Also, LM Flash never sends any UDP packets to it, either. 


  • You might try connect direct MPU Ethernet via TFTP client in Windows - if client stays connected for some time without immediate dropping offline then BL TFTP is up.
    I like to see link and strobe LED flash showing we have life.  Might add code (bl_emac.c) in target area to BL for such events.

    // // Initialize the MAC and set the DMA mode. // // ROM_ EMACInit(EMAC0_BASE, ui32Clock, EMAC_BCONFIG_MIXED_BURST | EMAC_BCONFIG_PRIORITY_FIXED, 4, 4, 0); // // Using the EMACMIIADDR MII register, access and configure PHY MR37 (EPHYLEDCFG) // and reconfigure TX/RX activity for LED2, Flash 20Hz (50ms) datasheet pages 1486, 1638, 1647 // MAP_EMACPHYExtendedWrite(EMAC0_BASE, EMAC_PLA_PHY, EPHY_LEDCFG, EMAC_PHY_PF0LED0LNK_PF1LED2ACTY); MAP_EMACPHYExtendedWrite(EMAC0_BASE, EMAC_PLA_PHY, EPHY_LEDCR, EPHY_LEDCR_BLINKRATE_20HZ); // // Get the MAC address from the flash user registers. If it has not been // programmed, then use the boot loader default MAC address. // ROM_FlashUserGet(&ui32User0, &ui32User1); if((ui32User0 == 0xffffffff) || (ui32User1 == 0xffffffff)) {

    (emac.h) add defines below:
    
    #define EMAC_PHY_PF0LED0LNK_PF4LED1ACTY     0x00000510
    #define EMAC_PHY_PF0LED0LNK_PF1LED2ACTY     0x00000150
    #define EMAC_PHY_PK4LED0LNK_PK5LED2ACTY     0x00000150

  • I tried adding that code to the bootloader, but "EMAC_PLA_PHY" was undefined, and I didn't know which header had it. 

    Anyway, when I branch into the bootloader from my main app, I see the ethernet LEDs get "disrupted" (turn off) for under a second before resuming blinking the orange LED. After that, only the orange LED continues blinking at its own pace regardless of activity. Now the interesting thing is this: as part of my troubleshooting other things yesterday, I accidentally triggered the branch to bootloader code in my main app when the bootloader wasn't on the board-- and it behaved the same way. Same LED disruption, no activity LED, and of course no ethernet response. 

    Also, when I did have the bootloader on the board, after I branched into it the Windows tftp client couldn't connect to the board. 

    My specific code to branch to the bootloader from my main app is a copy-paste from the example firmware: 

    //
    // Return control to the boot loader.  This is a call to the SVC
    // handler in the flash based boot loader.
    //
    (*((void(*)(void))(*(unsigned long *)0x2c)))();

    Perhaps that address isn't valid and I'm jumping to the wrong spot in memory?

  • That is the correct branch address to invoke BL. Now the orange LED flash and missing define are each interesting.

    Dealing with a custom board here? The ETH external Rbias pin 59 resistor is 4.87k on TM4c1294NCPDT?

    That define EMAC_PLA_PHY and many other EMAC defines are listed in (bl_emac.h) must be an #include at top of (bl_emac.c).

  • Yes, I'm dealing with a custom board.

    There is indeed a 4.87k resistor between RBIAS and ground.

    My TivaWare (version 2.1.0.12573) doesn't have a "bl_emac.h" in the "boot_loader" folder, and bl_emac.c doesn't include it. It does include "driverlib/emac.h", but that header doesn't define "EMAC_PLA_PHY".
  • Ok good to know those things.

    My bad - your right #include "emac.h" in (bl_emac.c). Be sure to set the correct GPIO pins you are using for EMAC0 Link/Status LEDS in (bl_emac.c), under configureEnet() they are being configured - match same LEDS you set in the two enable lines posted earlier.

    Sometimes it takes a few tries to get it all aligned even for simple link & LED blinks but then you have some idea if the code is executing that far in if/when they link & blink.
  • Look up a few posts - the defines you have to add to (emac.h) that address the PLA_PHY register are shown! Recompile the /driverlib may help. Simply /driverlib as a project in CCS5 if you must. We use F3 key to test the path of code lines in CCS5, F2 key shows macro expansions.
  • Well BL TFTP  was working very well up until revision 3 silicon, only witnessed it load the *.bin one time. Now BL  invokes, link LED on and activity LED flashes but the TFTP transfer is halted.  There is no IP address assignment for BootP and they set the broadcast address 255.255.255.255 in the code below. Make sure to delay a second after master disable all interrupts  prior to entering into BL or it will hang up. Wonder what is up here might be the ARP timer timeout?

    ROM_SysCtlDelay(g_ui32SysClock / 5);
    
                            //
                            // Also disable the SysTick interrupt.
                            //
                            SysTickIntDisable();
    
                            //
                            // Disable all processor interrupts.  Instead of disabling them
                            // one at a time (and possibly missing an interrupt if new sources
                            // are added), a direct write to NVIC is done to disable all
                            // peripheral interrupts.
                            //
                            HWREG(NVIC_DIS0) = 0xffffffff;
                            HWREG(NVIC_DIS1) = 0xffffffff;
    
                            //
                            // Clear any active interrupts.  If the boot loader uses
                            // any interrupts, they will therefore respond as expected.
                            //
                            HWREG(NVIC_APINT) = (NVIC_APINT_VECTKEY |
                                                 NVIC_APINT_VECT_CLR_ACT);
    
                            //
                            // Return control to the boot loader.  This is a call to the SVC
                            // handler in the boot loader.
                            //
                            (*((void (*)(void))(*(uint32_t *)0x2c)))();
    
    //! This function starts the Ethernet firmware update process.  The BOOTP
    //! (as defined by RFC951 at tools.ietf.org/.../rfc951) and TFTP (as
    //! defined by RFC1350 at tools.ietf.org/.../rfc1350) protocols are
    //! used to transfer the firmware image over Ethernet.
    
        // Create a UDP socket for sending requests to the BOOTP server.  After the
        // BOOTP portion of the protocol has been handled, this socket will be
        // reused to communicate with the TFTP server.
        //
        *((uint32_t *)(void *)(&sAddr)) = 0xffffffff;
        g_pConn = uip_udp_new(&sAddr, HTONS(BOOTP_SERVER_PORT));
        uip_udp_bind(g_pConn, HTONS(BOOTP_CLIENT_PORT));

  • Well it's good to know that it's not just me having this issue. Unfortunately, I have a two week deadline to have devices shipping and I have other firmware issues to attend to. It would be nice if a TI engineer could investigate. 

  • Found added predefined Symbol (TARGET_IS_TM4C129_RA0) was added to the project, changing it to one of the other TARGET_IS_TM4C129_RA1 made no difference. You can not ping a broadcast address (ffff.ffff) yet can the MAC from some switches such as Cisco. Setting predefined to RA3 created 23 symbol not defined errors around (bl_emac.c). BL- TFTP transfer was working great with RA0 device, suspect something in the ARP timer timing/registers may be slightly different.

    Are the link and activity LEDS active and link flashing at times as if waiting on a BootP reply from the TFTP client?
  • On mine the activity LED never flashes. Only the link LED.

    And wireshark shows no broadcast packets leaving it.
  • Seeing near the same thing; Sniffer finds no UDP packets on 67 or 68. Also added UART print out for the commands and a few places in Bootp thread start(). Not one message will display at the terminal window. Oddly when BL was being invoked using Boolean switch it was working hundreds of times Flashing the bin file. Saw it load a *.bin one time last night but no more after for some reason flashed the recompiled BL and it must have Kludged what was working.

    There is a wait while loop after PHY reset, waits for the EMAC to come ready. Think it may never come ready but the activity LED flashes - seemingly blows that thought out of the water.

    Has me wondering if the BL_EMAC is not responding after we recently applied memory leak patch (tiva-tm4c129.c) into the LWIP stack. The EMAC configuration in the main application is working great on TCP http 80 but not in BL.
  • I had the CCS debugger on my bootloader, and while I couldn't get debug symbols for the region of code it was in, it was definitely in a loop with several instructions inside it. So not a fault ISR, but without debug symbols I couldn't say for sure what it was doing.

    And my main firmware works absolutely fine with lwip-based UDP on port 7777. And TCP port 80 also responds to pings.
  • Did after awhile waiting (ARP timer fires every 60 seconds) start to get UDP response 255.255.255.255 (67) -->(68) but from the Wii console. Other times from machines on the network. 

    Reviewing the boot loader code in some detail discovered in more detail;

    1. Appears to only Invoke ConfigureEnet() prior to the app loading into SRAM and skips over it in other modes/times.

    2. Asserts only EnetReconfig() when BL is invoked from app using interrupt handler 0xc2 (startup_ccs.c). Below posted code initializes the MPU 1st step prior to invoking UpdateBootP() that first calls EnetReconfig(). I commented the user added stuff.

    3. Find it odd when enet_enable_update (EEU) is enabled (bl_config.h) the interrupt handler routine ignores bl_main.c - Updater() asserts only when EEU is not enabled. States Updater is for UART,SSI,USB update mode..

    4. All TFTP console commands are handled by Updater(). The BootP file transfer RFC (via UIP) appears to not use the Updater() commands since EEU is enabled -- (#ifdef top of (bl_main) excludes EEU from Updater()) or possibly code was somehow jumping into Updater to listen for client commands. Believe later is unlikely since my GUI uses the TFTP client to access upload *.bin file - soon after clicking ok the progress indicator bar starts moving when EEU is enabled. The code in bl_main.c complies with complex UIP protocol that appears to not be listening for ARP replies yet is sending UIP out since Wii console responded. Never dove this deep into TFTP before nor ever wanted to. 

     

        .thumbfunc UpdateHandler
    UpdateHandler: .asmfunc
        ;;
        ;; Initialize the processor.
        ;;
        bl      ProcessorInit
    
        ;;
        ;; Load the stack pointer from the vector table.
        ;;
        movs    r0, #0x0000
        ldr     sp, [r0]
    
        ;;
        ;; Call the user-supplied low level hardware initialization function
        ;; if provided.
        ;;
     ;;.if $$defined(BL_HW_INIT_FN_HOOK)
       ;; bl      BL_HW_INIT_FN_HOOK
     ;;.endif
    
        ;;
        ;; Call the user-supplied re-initialization function if provided.
        ;;
     ;;.if $$defined(BL_REINIT_FN_HOOK)
       ;; .ref    BL_REINIT_FN_HOOK
       ;; bl      BL_REINIT_FN_HOOK
     ;;.endif
    
        ;;
        ;; Branch to the update handler.
        ;;
     .if $$defined(ENET_ENABLE_UPDATE)
        b       UpdateBOOTP
     .elseif $$defined(CAN_ENABLE_UPDATE)
        .ref    AppUpdaterCAN
        b       AppUpdaterCAN
     .elseif $$defined(USB_ENABLE_UPDATE)
        .ref    AppUpdaterUSB
        b       AppUpdaterUSB
     .else
        b       Updater
     .endif
        .endasmfunc
    

  • LWIP (uip.c) is providing all the BootP functions, (uip.h) TCP/UIP configuration.  Back tracked several months restored folder when BL was know working. Possibly something has changed  either on my network or PC yet firewall is open on UDP 67-68 both inbound/outboud. BL loads then activity LED stays on solid no blink. Finally did get the UART code to load print debug messages in the UIP loop.  UART prints a few messages in the receive loop then quits and messages are problematic in the high speed loop.

    PacketReceive() checks  DES0_RX_CTRL_OWN flag to determine does the DMA hardware or Host have control of RXD data using descriptor bIt 31 to receive packets filtering up to application layer in SRAM.  The only way I could get instruction pointer to move past the first RXD descriptor test (MAinAppLoop) was to remove the (!) from the OWN bit test. Made it go a few rounds after changing all 3 OWN tests to DES0_RX_STAT_TS_AVAILABLE and thought that was it. In any case it proved the OWN flag is not being set by EMAC, believe DES0_RX_TS_ = Time Stamp available.

    U can add UART code to the top of UpdateBOOTP() and print your added messages to a Terminal emulator (YAT or Putty) on virtual COM3 or 4 via USB pipe loaded from TM4C1294 device driver.  Be mindful where place print messages, some loops run extremely fast, UARTprintf  often can Halt MPU if buffer gets plugged up as no RTS/CTS hand shake in the COM pipe. Hope this helps!

    #ifdef UART_PRINT_ENABLE
        //
        // Enable pin PA0 PA1 for UART0 U0RX, U0TX
        //
        ROM_GPIOPinConfigure(GPIO_PA0_U0RX);
        ROM_GPIOPinConfigure(GPIO_PA1_U0TX);
        ROM_GPIOPinTypeUART(GPIO_PORTA_AHB_BASE, GPIO_PIN_0 | GPIO_PIN_1);
    
        //
        // Enable the UART, clear the terminal for printing messages.
        // Set data rate, length, parity, and number of stop bits to 8-N-1.
        //
        UARTStdioConfig(0, UART_FIXED_BAUDRATE, 120000000);
    
        UARTprintf("<< UART print configured Enabled >>\n");
    
    #endif
  • BTW: (bl_config.h) add:

    //*****************************************************************************
    //
    // Selects the UART to print status messages on command progress.
    // Possibly bad to have enabled with UART_ENABLE_UPDATE.
    // UART_FIXED_BAUDRATE determines the data rate.
    //
    //*****************************************************************************
    #define UART_PRINT_ENABLE
    
    //*****************************************************************************
    //
    // Selects the baud rate to be used for the UART.
    //
    // Depends on: UART_ENABLE_UPDATE, CRYSTAL_FREQ
    // Exclusive of: UART_AUTOBAUD
    // Requires: None
    //
    //*****************************************************************************
    #define UART_FIXED_BAUDRATE    460800 // 115200