Jump to content
froggy

TM4c1294 - Program over Ethernet with LM Flash Utility

Recommended Posts

It would be really awesome for my project if I could update code over Ethernet, instead of USB for my Tiva C connected. I've tried the latest version of the LM Flash Utility (Build 1613) and cannot seem to connect to the Tiva C over Ethernet with the utility. I have a MAC and IP set on my board using the Energia Ethernet UDP library and can verify them with a ping and look at my laptop's ARP table, but I am unsure if this is enough to satisfy the needs of the LM Flash Utility. I was hoping that the functionality would be supported "behind the scenes" in Energia, but that does not seem to be the case. Is there a TI TivaWare/StarterWare function that can be easily called to gain this functionality?

 

Has anyone here had any luck trying to program the Tiva C connected over Ethernet? 

Share this post


Link to post
Share on other sites

I don't think there's a way to make that work.  Certainly not with the lm4flash tool IIRC.  Does LM Flash normally support a "flash over ethernet" option?  I know Energia doesn't support anything of the sort...

 

I guess you'd need some sort of fancy bootloader-over-ethernet code loaded into flash.  Search TI's site to see if there's an application note for that?

Share this post


Link to post
Share on other sites

The LM Flash utility provided by TI does support "flash over ethernet". From what I've seen on TI's forums, you need to make some calls to functions in the TivaWare "swupdate.h" to monitor for Ethernet flash commands. I've tried adding TivaWare stuff to the Energia build without much luck. I think my next step will be to move over to CSS 6, which naturally provides a better environment for calling Energia and TivaWare functions.

 

If anyone has anything to add to this, let me know. If I get flashing over Ethernet to work, I'll update this post to document my steps. 

Share this post


Link to post
Share on other sites

Thanks for the starting point there. The calls to Swupdate don't seem to be working since the LM Flash Utility still hangs on the "trying to connect". Starting the MAC/PHY with the "SoftwareUpdateInit()" function, my callback function is called as expected. I get the same behavior with the Energia UDP/Ethernet libraries where I can see the "magic update packet". 
 
I suspect that the issue is that I don't have the proper Ethernet Bootloader installed, but can't seem to find any information on how to install/build it. Any idea how I can install the Ethernet Bootloader/include it in my projects?
 
 
Comment block from SoftwareUpdateBegin():
 
//*****************************************************************************
//
//! Passes control to the bootloader and initiates a remote software update
//! over Ethernet.
//!
//! This function passes control to the bootloader and initiates an update of
//! the main application firmware image via BOOTP across Ethernet.  This
//! function may only be used on parts supporting Ethernet and in cases where
//! the Ethernet boot loader is in use alongside the main application image.
//! It must not be called in interrupt context.
//!
//! Applications wishing to make use of this function must be built to
//! operate with the bootloader.  If this function is called on a system
//! which does not include the bootloader, the results are unpredictable.
//!
//! \note It is not safe to call this function from within the callback
//! provided on the initial call to SoftwareUpdateInit().  The application
//! must use the callback to signal a pending update (assuming the update is to
//! be permitted) to some other code running in a non-interrupt context.
//!
//! \return Never returns.
 
EDIT:
 
I got the Ethernet update to work by making a few modifications to the SwUpdate.c file. For whatever reason (I didn't really bother looking into this part...), the defines aren't set to use the ROM based Ethernet bootloader in the SoftwareUpdateBegin function, and the ROM Ethernet functions aren't defined in Energia 017's "rom.h" file. The latest version of TivaWare (TivaWare_C_Series-2.1.2.111) does provide the proper definitions for it. I simply added the necessary defines to call the ROM_UpdateEMAC and forced the code to use that, instead of the flash bootloader based update system. It also seems to be important that the MAC address set by the Ethernet library matches the MAC address programmed into user registers (by default this is what is on the sticker on the board).

 

Anyways, I've attached a working Energia example with support for updates over Ethernet. 

EthSwupdate.zip

Share this post


Link to post
Share on other sites

It is certainly possible to add this as a programming method to Energia. The behind the scenes stuff is pretty straightforward, send the "magic packet" (defined in the LM Flash help), start a BOOTP client, then send the compiled binary over TFTP. 

 

I'm working on setting up the Energia build environment right now to take a stab at it. 

 

Edit: It might be even easier than I thought if it's "kosher" to have the TI LM flash utility included in the Energia build. Energia could then just have some dialog option for adjusting your Ethernet settings (perhaps even auto-detect them), and a new "upload over ethernet" option that would make a system call to the flash utility. 

Share this post


Link to post
Share on other sites

@@froggy

Hi,

  This is vidisha and my aim is also same to program TM4C129EXL which has TM4C129ENCPDT using Ethernet Flash based bootloader.

Your's is Flash based bootloader or Rom based?

For Flash based i used code of DK-TM4C129EX i.e boot_emac_flash and could program it also but during uploading of any application code it shows me "attempting to connect"

I used your code and it worked for me but only once , i mean i can't upload the application code for second time. 

why so?

Plz if u have code for Flash based ethernet bootloader and it's demo code plzzz share with me..i need it urgently.

 

Regards

vidisha

Share this post


Link to post
Share on other sites

Hi,

 

I tried this method but without success. Just to be sure about what has to be done : I just need to add swupdate.h to my Energia folder and upload your .ino file with updated MAC address ?

Share this post


Link to post
Share on other sites

Awesome that you got it to work!! I'll give it a try and include it in Energia as an example.

@@energia

Did you forget to include it as an example in the last release? I don't currently have access to any TivaC hardware, so I can't personally verify that it still works in Energia. 
 
Also, I noticed that the "arch/lwiplib.h" doesn't seem to exist anymore, and is instead "architecture/lwiplib.h". Why the change? 
 
 
@@B@tto
Are you able to successfully ping the Tiva board? 

Share this post


Link to post
Share on other sites

 

@@energia

Did you forget to include it as an example in the last release? I don't currently have access to any TivaC hardware, so I can't personally verify that it still works in Energia. 

 

 

From http://energia.nu/ :

 

Energia 18 (aka Energia 1.6.10E18) is based on the latest and greatest Arduino IDE. This release features the new board (core) / library manager. Default the Energia installation comes with support for the MSP430. Other cores such as TivaC, CC3200, MSP432 can be installed through the board manager by selection Tools->Board->Board Manager. For more details on how to install additional cores/boards see the board manager guide guide.

 

 

 
@@B@tto
Are you able to successfully ping the Tiva board? 

 

 

Good remark, I will check that ...

Share this post


Link to post
Share on other sites

Hi,

I've added your EthSwupdate.ino file to a ccs6 project and I get to the stage where the code states "Packet Received Confirmation".

Then my LM flash just stays stuck on "attempting to connect".

I've looked in several forums and couldn't find a solution.

I would be VERY gratefull if you can write a step by step instruction list how to get my TM4c1294 to work and suppport code update using Ethernet.

Thnaks! 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×