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.

Using the LM Flash Programmer for automatic flash updates over ethernet

Other Parts Discussed in Thread: EK-TM4C1294XL, TM4C1294NCPDT

I am trying to set up automatic updates via Ethernet using the LM Flash Programmer utility.  The help within this utility states that if you listen on port 9 for the magic packets you can automatically kick yourself into bootloader mode and thus allow the LM Programmer tool to automatically update to your device, via ethernet. 

I was expecting the LM Flash Programmer tool to send the magic packets via UDP port 9 when you hit program (as the help states), but I never see the packets come across port 9.

My code is listening on UDP port 9.  I have gotten this to work but ONLY after I kick my application into ROM bootloader mode (I did this using a separate program that just sends a couple of UDP messages down port 9).  Once it is in bootloader mode, the LM Flash Programmer does in fact update the flash via Ethernet.

Just wondering if the LM Flash Programmer is really sending the magic packets via UDP on port 9?

I am using the EK-TM4C1294XL launchpad and the LM Flash Programmer Build is 1606.

  • I just tested this with version 1613 of LM Programmer and monitored the traffic with WireShark. I see many packets being sent to Port 9. 

    I think you might be seeing the same issue that bit me - rev A0 of the silicon does not fully support the Ethernet bootloader in ROM. It is supposed to work using Flash but I have not tried that. Check your part and see if you have A0 silicon.

    Jeff

  • Thanks for your input Jeff.

    I think there is something weird going on with LM Programmer.  I am connected to several networks at the same time and so had 2 Ethernet ports up & Wifi (plus some virtual ones).  Even if i select the Ethernet port for my private network it seems to send the UDP magic packets down my work network???

    These are the settings I use on LM Programmer.  The 10.1.0.10 is my private network:

    I hit program on LM Programmer and via WireShark I see the UDP magic packets going through the wrong Ethernet interface:

    This is a separate snapshot of my other Ethernet port, just for reference:

    I got it to send it to the correct IP by only having one connection to one network (disconnected other Ethernet port and disabled Wifi).

    Not sure if this a bug in LM Flash Programmer or really just a limitation?

    I am actually using rev A1 of the TM4C1294NCPDT  so hopefully the Ethernet stack/driver is fully functional.

    SYSCTL_DID0    0x100A0001    Device Identification 0 [Memory Mapped]


    Things are still not working quiet like I would expect them.  I don't seem to get an IP after the flash update (via Ethernet) which makes me think that the Ethernet stack/driver configuration I have is still not 100% correct.  I get an IP if I hit the reset manually on my launchpad.  I  need to look around at other threads regarding this or start a new one.

  • hiowatha said:

    I hit program on LM Programmer and via WireShark I see the UDP magic packets going through the wrong Ethernet interface:

     Hi, I fear your default gateway send traffic to the default network, windows network just work at limit of reliability, using two network card get confused and stop working or present issue like this one...

    hiowatha said:

    I got it to send it to the correct IP by only having one connection to one network (disconnected other Ethernet port and disabled Wifi).

    And IMHO this confirm windows stack malfunction than TIVA or LMFlahprogrammer utility.

  • Thank you Roberto.  I was hoping it was not going to be windows "thing" but oh well.  What your saying make sense.  Thanks again.

  • Besides jumping into ROM code:

                    // 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;
                    HWREG(NVIC_DIS2) = 0xffffffff;
                    HWREG(NVIC_DIS3) = 0xffffffff;
                    HWREG(NVIC_DIS4) = 0xffffffff;

                    //
                    // Also disable the SysTick interrupt.
                    //
                    ROM_SysTickIntDisable();
                    ROM_SysTickDisable();

                    // Return control to the boot loader.
                    ROM_UpdateEMAC(g_ui32SysClock);

    Is there something else that my application needs to do to ensure the Ethernet update successfully happens?

    The LM Flash Programmer says "Program Complete - 97512 Bytes Programmed" which I assume means everything went through correctly, BUT after it reboots itself it never brings up the ethernet.  If I then manually hit the reset button on the launchpad, everything comes up as expected. 

    I wonder if this is all related to the ethernet problems seen on these MCU's (mine is the TM4C1294NCPDT) :http://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/t/343382.aspx

  • hiowatha said:
    I wonder if this is all related to the ethernet problems seen on these MCU's (mine is the TM4C1294NCPDT)

     Hi i got more problem on DK TM4C129xn... than on 1294ncpdt, this one is more stable and suffered less of this issue, I also think is a latest version. The one with LCD controller is more sensitive and finally I lowered again clock to 70MHz to be sure get a reliable network. ON NCPT side I can raise clock to near 100MHz.

     Welcome onboard.

  • Hi, 

    I am using the eflash utility.

    eflash.exe  -m 00:04:A5:80:05:45 -i 10.-:64.-:16.-:181 --verbose typhoon.bin  to flash the firmware for Typhoon over ethernet.

    but on running the utility , it continues to send the Magic packets....

    Starting WINSOCK
    Starting BOOTP/TFTP Server ...
    % Complete: 0%
    Reading file (typhoon.bin) to be downloaded
    ... Allocating buffer for file length 39808
    ... Reading the file
    Setting up network connections
    ... Creating sockete for BOOTP server
    ... Creating sockete for TFTP server
    ... Creating sockete for MAGIG packet transmission
    Sending "Magic" packet to initiate Ethernet Boot Loader
    Starting BOOTP/TFTP Server
    Waiting for packet ...
    ... Resending "Magic" packet.
    Waiting for packet ...
    ... Resending "Magic" packet.
    Waiting for packet ...
    ... Resending "Magic" packet.

    SnapShot on ethereal looks like  

    as per TIVA Document  SW-TM4C-TOOLS-UG-20 , Ethernet bootloader is required for updating the firmware by ethernet .

    Does the TIVA bootloader automatically loads the ethernet bootloader on boot up ?

    or do we have to program ethernet bootloader separately ?

    Thanks

  • Sanchit,

         I am not familiar with the eflash.exe utility, but it almost seems like your application is not "catching" the magic packets.  What I had to do in my application was to catch the magic packets and use that as a trigger to kick myself into the ROM bootloader from my Flash application (my MCU: TM4C1294NCPDT).  The LM Flash Programmer ( I was using this GUI not a CLI) proceeded to flash the bin file.

  • Hi Hiowatha,

    Ok . So , I need to write a code to catch the magic packet in my flash application and then write a code to switch to rom ethernet bootloader from my flash application ? Right ?

    Can I get the reference of it ?

    Which then can trigger BOOTp and TFTP prtotocol to download the firmware via ethernet to TIVA MCU.

     

    Thanks.

    Sanchit

  • Hi Sanchit, 

        I dont recall a specific document describing this unfortunately.  I got most of my information from the HELP text inside of the LM Flash Programmer gui program.  You may want to download/install and see that  helps.  I found tid bits of info on here in these forums, but I can't seem to recall a specific file or example which was very good. Sorry.  For more info at minimum look at the Tiva C ROM bootloader user's guide and the Tiva C bootloader user's guide (flash based).

  • Hi,

    You said: "I did this using a separate program that just sends a couple of UDP messages down port 9". Can you provide your program or code? 

    Thank you.

  • I know this post is over a year old, but I was wondering if you ever got this working? Being able to flash the tm4c1294 over ethernet would be useful for my application.
  • Hi Levi,

    The software LM Flash Programmer does not work because don't give a IP to board, but command line eflash.exe works well. You can find it inside C:\ti\TivaWare\tools\bin folder. You have to put board in "Bootloader" mode using the code:

    // Transfer control to the Ethernet bootloader.
    //
    SoftwareUpdateBegin(g_ui32SysClock);

     

  • Hi Vinicius,

        My apologies.  I lost track of this post and don't remember seeing an email with your question.  In any case sorry about that.  I am sure you have moved on ..

    -hiowatha

  • Hi Levi,
    I ended up going a different direction on ethernet updating. I ended up creating my own bootloader and having it process UDP commands to update itself via ethernet (if that makes sense).

    -hiowatha
  • Ok, no problem! Like I said, eflash.exe works fine to me.
  • Vincinius, is calling SoftwareUpdateBegin(g_ui32SysClock) all that is needed to get the device to program over ethernet? Do you have to mess with bl_config.h or any of the bootloader code? I am wondering because I get stuck in the default interrupt handler after calling SoftwareUpdateBegin(g_ui32SysClock)

    Thanks for your help

    --Levi

  • I did not do any change in bl_config.h or any of the bootloader code. But I changed SoftwareUpdateBegin:

    void
    SoftwareUpdateBegin(uint32_t ui32SysClock)
    {
        //
        // 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;
        HWREG(NVIC_DIS2) = 0xffffffff;
        HWREG(NVIC_DIS3) = 0xffffffff;
        HWREG(NVIC_DIS4) = 0xffffffff;
    
        //
        // Also disable the SysTick interrupt.
        //
        SysTickIntDisable();
        SysTickDisable();
    
        //
        // Return control to the boot loader.  This is a call to the SVC
        // handler in the flashed-based boot loader, or to the ROM if configured.
        //
    //#if ((defined ROM_UpdateEthernet) && !(defined USE_FLASH_BOOT_LOADER))
        ROM_UpdateEMAC(ui32SysClock);
    //#else
        //(*((void (*)(void))(*(uint32_t *)0x2c)))();
    //#endif
    }

  • Hi,excuse me.

    May I ask you for some help?

    I have a board EK-TM4C1294XL and I want to download code to the board using LM flash via ethernet.

    However I failed and I searched the internet found that a special bootloader is needed.

    TI has given an example bootloader and it selects the UART as the port for communicating with the boot loader.I don't know how to change the code to select ethernet.

    Can you give me an example?Thank you 

  • Hi,
    You have to call inside firmware the function SoftwareUpdateBegin(g_ui32SysClock). And you must use eflash.exe command line program, since LM flash does not work via ethernet.
  • Hi,Vinicius Maciel.
    Thank you very much for your replay.
    I asked another person who owns an EK-TM4C1294XL. He download code to the board via Ethernet successfully. He used LM FLash and ROM-based bootloader. However I failed, so I think there may exist some problem with my board.
  • Hi yunluo,

    Well, I never completed the process successfully using LM Flash, maybe because I was using old versions. But eflash.exe works very well for me. Did you tried it?
    You can also verify if the board is sending bootp packages using Wireshark. Use the filter 'bootp'. You should see them after call SoftwareUpdateBegin(g_ui32SysClock). http://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/471/7534.reply.png

  • Hi Vinicius,

    I am really sorry that I quite forgot to replay for your help. I feel so sorry and so sorry.

    Actually, I just need to finish my homework and I gave up to download code via Ethernet because I couldn't manage it and several days later I had to hand in the board to my teacher. Then,after that I had to prepare for other things and I had no time and chance to have a try for what you said, and I was so busy that I forgot to replay.

    Anyway, thank you very much for your help. :-)

  • Did someone find a way to solve the issue of using LM Flash Programmer on a PC that have more than one network connection?

    I am having this problem for a few years now (since we moved from XP to WIN7). Usually I've managed by disabling/disconnecting un-necessary network connection and keeping only one.
    I also found that changing the connections order in the Network Connections advanced settings sometimes help but not always.

    I now have a situation in which this didn't help and I can't disconnect the other network connection and the LM Flash Programmer keeps sending the magic packet to the wrong network.

    Any ideas?

    Thanks in advance.

    Timor
  • I had a problem similar to this a while back. My IT guy made this change to the subnet that I wanted to use. I am not sure what it does but it worked for me.

  • IT WORKS !!!

    Thanks a lot,

    Timor