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.

RTOS/TM4C129XNCZAD: How can I update TI embedded software remotely ?

Part Number: TM4C129XNCZAD
Other Parts Discussed in Thread: EK-TM4C1294XL, UNIFLASH

Tool/software: TI-RTOS

Hi,

In our project, it is needed to update embedded software of the board by means of network. Is it possible or any references about this issue? It is wanted to update ".bin" file remotely.

Thanks for your answers.

Best Regards,

Cengizhan YAPICIOĞLU  

  • Hi,
    There are various bootloader examples in the TivaWare library. You can use the bootloader to update the embedded software by ethernet, UART, SPI, USB and I2C. See details in the Bootloader user's guide in <TivaWare_Install>/docs/SW-TM4C-BOOTLDR-UG-2.1.4.178.pdf.
  • Hi,

    I see the realted documents at my installation file and found "4. Ethernet Update" section. In there, it is mentioned that ConfigureEnet() and UpdateBOOTP() functions although it is not seen that these functions takes any ".bin" files and also I can not find any other things at that part.Furthermore, I could not find "bl_*.c" files that is needed to import ConfigureEnet() and UpdateBOOTP(). I want  to make what LM Flah programmer does but one difference that is I want to use Ethernet.Could you please help me about these topics. Thanks in advance.

    King Regards,

    Cengizhan YAPICIOĞLU 

  • Hi,
    Did you have a chance to run the TivaWare boot_emac_flash example? The CCS project is under <TivaWare_Installation>/examples/boards/ek-tm4c1294xl/boot_emac_flash. The boot_emac_flash project is the bootloader which needs to be first programmed into the flash using the CCS or Uniflash flash programmer. There is also the boot_demo_emac_flash example which is the application bin file that you want to use to load into the flash via the LM flash programmer. When the the boot_emac_flash bootloader starts on the MCU it will send the BOOTP command to the LM Flash Programmer running on the PC side. The LM Flash programmer will then send the boot_demo_emac_flash.bin file using TFTP protocol to the MCU while the MCU programs the bin data into the flash.

    This below post may be helpful to you.
    e2e.ti.com/.../2453437
  • Hi,

    The post link is broken and I also have a problem with finding <TivaWare_Installation>/examples/boards/dk-tm4c1294xl/boot_emac_flash which is not exist. Furthermore, I looked the bootloader documentation and notice that ConfigureEnet()and UpdateBootP() is inside the bl_emac.c file and these requires bl_config.h although I have bl_config.h.tmpl file. When I try to use that with convert to header file it needs uip third_party packages but I use TI-RTOS. Another thing is, I looked the example (it is not in my installation docs but I found it from web) but can not find anything on boot_emac_flash just comment lines. Then, I focused the boot_demo_emac_flash but can not figured out SofwareUpdateBegin(); SofwareupdateInit();. The related document can not include these and I can not find them. 

    When I follow the document, I have a TI-RTOS project that is based on udpecho example not use uip or lwip or something like that. Could you please help me about these topics? The related ones can not solve my problem. 

    Thanks in advance.

    King Regards,

    Cengizhan YAPICIOĞLU 

  • Did you install the complete TivaWare from

     as shown below?

  • Hello Cengizhan,

    RE: Broken Link - try this post link, it should work: e2e.ti.com/.../667007
  • Hi ,
    I followed the link and firstly, insert the .bin file that is required to give an IP address by means of debugging from JTAG interface. Subsequenlty, I program the emac_boot_flash.bin with "Porgram Address Offset 0x0 " and I faced an error."Problem Stating the BOOTP Server" Could I do something wrong? I focus the UDP port 67 and 69 and also that is used by computer but I moved to another one that is not use 67 and 69 ports but the result is the same I have same error. I also turn off the firewall as I read from the forum issues.
    Best Regards,
    Cengizhan Yapıcıoğlu

  • Did you run the enet_lwip example first to record the IP address?

    1. Run enet_lwip example and record the IP address. The IP address will be displayed via the terminal window.
    2. Program the emac_boot_flash into the flash via the JTAG interface.
    3. Open the LM flash programmer and enter the IP address and MAC address from step 1 as shown in the picture from my earlier reply
    4. Run the emac_boot_flash program
    5. Go to the LM flash programmer under Program tab, specify the boot_demo1.bin and hit Program button

    Once the programming is done you should see the boot_demo1.bin programmed to the flash starting at 0x4000. Open a memory browser to check it.
  • Hi,

    Is it necessary to use enet_lwip example for that. We have an RTOS Project that use UDP with static IP. Initialy,I run thsi and record MAC and Ip address.Subsequently, program the emac_boot_flash by means of JTAG interface address 0x0. Then, I open the LM Flash and choose Ethernet interface and fill MAC and IP fields and then run emac_boot_flash but I can not see anything on wireshark.Furthermeore,I can not receive any answers from the recorded IP address with ping command.

    Another thing is, we want to do it with programmatically and I see "bl_emac.c" - Funct,ons to Update via Internet which of them I have to use for update image(.bin) from it? At the Bootloader document there is no detailed document about that.Could you please help us about these two main topics ?

    * Should I use static IP instead of DHCP(enet_uip or lwip) ?

    * Which functions or .c .h file I have to use to do it programmatically?

    Thanks in advance for your answers.This is a very important requirement for us.

    King Regards,

    Cengizhan YAPICIOĞLU

  • Hi,

    Cengizhan Yapıcıoğlu said:
    Subsequently, program the emac_boot_flash by means of JTAG interface address 0x0. Then, I open the LM Flash and choose Ethernet interface and fill MAC and IP fields and then run emac_boot_flash but I can not see anything on wireshark

      Did you go to the Program tab as shown below to provide the .bin file and hit Program button? You didn't mention that you went to the Program tab to hit the Program button. 

    Once the boot_emac_flash is running it should have sent the BOOTP request to the LM flash programmer. Once the LM flash programmer receives the BOOTP request and after the ARP the .bin will be downloaded to the MCU via the TFTP protocol. 

  • Hi again,
    We use TivaWare C series 2.0.1.11577 and there is no boot_demo_emac_flash example under examples/boards/dk-tm4c129x only boot_demo_uart and boot_demo_usb. Could be related with these ?

  • Hi,

      The latest version is 2.1.4.178. Your version is quite old. The latest version can be downloaded from 

    You should see the boot_emac_flash and boot_demo_emac_flash in either the dk-tm4c129x or ek-tm4c1294xl folder. I really suggest you to try these examples as is and get a feel for how it works before you attempt to modify per your custom need. 

  • Hi again,
    The problem was about the software version I used.Now, I could start tftp by means of Ethernet. But the board can not open with the sending image that includes udp, uart and i2c communications instead of boot_emac_demo_flash.. Is there any settings for BOOTLOADER start address and FIRMWARE program start address ? I see the tftp packets with WireShark.
    Thanks in advance for your answer.
    Best Regards,
    Cengizhan YAPICIOĞLU

  • Cengizhan Yapıcıoğlu said:
    But the board can not open with the sending image that includes udp, uart and i2c communications instead of boot_emac_demo_flash.. 

    Sorry I cannot understand what you are trying to say here. What do you mean by sending image that include udp, uart and i2c? I'm lost here. In your screen capture you are showing the board is generating the BOOTP request and subsequently the TFTP started to download your firmware to the flash. As far as bootloader is concerned I think this is working. 

    Cengizhan Yapıcıoğlu said:
    Is there any settings for BOOTLOADER start address and FIRMWARE program start address ? I see the tftp packets with WireShark.

    Please refer to the bl_config.h file. There is define for APP_START_ADDRESS. See below example. The APP_START_ADDRESS is the address at which your application firmware will be programmed to. 0x4000 is address the example chooses to use. You can use different address if you want. 

    //*****************************************************************************
    //
    // The starting address of the application. This must be a multiple of 1024
    // bytes (making it aligned to a page boundary). A vector table is expected at
    // this location, and the perceived validity of the vector table (stack located
    // in SRAM, reset vector located in flash) is used as an indication of the
    // validity of the application image.
    //
    // The flash image of the boot loader must not be larger than this value.
    //
    // Depends on: None
    // Exclusive of: None
    // Requires: None
    //
    //*****************************************************************************
    #define APP_START_ADDRESS 0x00004000

    If you look at the boot_demo_emac_flash_ccs.cmd  file for the boot_demo_emac_flash example the application is linked to the address 0x4000 which is matching the APP_START_ADDRESS 0x00004000 in the bl_config.h file in the boot_emac_flash bootloader. The bootloader itself must start at 0x0. 

    /* The starting address of the application. Normally the interrupt vectors */
    /* must be located at the beginning of the application. */
    #define APP_BASE 0x00004000
    #define RAM_BASE 0x20000000

    /* System memory map */

    MEMORY
    {
    /* Application stored in and executes from internal flash */
    FLASH (RX) : origin = APP_BASE, length = 0x000fc000
    /* Application uses internal RAM for data */
    SRAM (RWX) : origin = 0x20000000, length = 0x00040000
    }

  • Hi,
    As you recommend that the problem was about the program base address and I could update firmware but I can not install second time firmware via Ethernet.

    1-) Should I install everytime the .bin file for boot_emac and lw_ip after Ethernet update via ICDI or it's only one time operation?

    2-) In my case it works truely only the first time like following. I checked the program start address for me and it is 0x0 but when I change the bin to start 0x4000(through .cfg file) (only image to update not the first firmware in your case I chnage boot_demo_emac not the enet_lw ip) remote update is successful.

    3-) Another thing was I change the first program address to 0x4000(think as lw_ip side) and call boot_emac via ICDI. But I can not seee BOOTP requests on wireshark. If lw_ip side starts 0x0 it works perfectly.

    Thnaks for your answers.
  • Cengizhan Yapıcıoğlu said:
    1-) Should I install everytime the .bin file for boot_emac and lw_ip after Ethernet update via ICDI or it's only one time operation?

    Glad that you are making good progress. 

    No, you do not need to install boot_emac_flash (the bootloader) each time. This is supposed to be a one time only process. As I mentioned before, the bootloader will first check if there is valid application firmware at 0x4000 (or whichever application starting address you specify). The way it checks for valid application firmware is by verifying if the stack pointer and the reset vector are equal to 0xFFFFFFFF or not. If they are all F's then it means that there is no application present. It will then send the BOOTP request to the server. Once the BOOTP request is received by the server then the TFTP will start to download the application firmware. What happens if there is already an application firmware present at 0x4000? In this case, the bootloader will just jump to the application. It will not send the BOOTP request. You might be under the impression that each time you reload the boot_emac_flash it will restart the BOOTP again. The reason is probably that you erase the entire flash. Each time you erase the entire flash and program the boot_emac_flash again the stack pointer and reset vector at 0x4000 is empty and the bootloader will the BOOTP process.

    Cengizhan Yapıcıoğlu said:
    2-) In my case it works truely only the first time like following. I checked the program start address for me and it is 0x0 but when I change the bin to start 0x4000(through .cfg file) (only image to update not the first firmware in your case I chnage boot_demo_emac not the enet_lw ip) remote update is successful.

    If you change the APP_START_ADDRESS to 0x0 then you are overwriting the bootloader (the boot_emac_flash) which resides at 0x0. I already mentioned that the boot_emac_flash must reside at 0x0 and your application can be at 0x4000 or others of your choice. You are asking the bootloader to overwrite itself and of course the bootloader will not be able to boot load the next time since it is overwritten by the application firmware. 

    The boot_demo_emac_flash is the example application firmware. It is a simple blinky program. However, it also contains code to detect if there is a magic packet sent by the server. While the demo program is running (blinking the LED) and if you hit the Program button in LM flash programmer,  the demo program will jump to the bootloader to restart the BOOTP process. Please check the demo code. This is why I asked you to run the boot_emac_flash and boot_demo_emac_flash as is and understand how they work before you modify them.

    If you are going to build your own application firmware and if you want to be able to jump back to the bootloader then you must incorporate code to detect the magic packets sent by the server. Please read the boot_demo_emac_flash code. 

    The boot_emac_flash (the bootloader) also has configuration that allows you to force bootloading even if there is already application firmware present by detecting a pin pressed. Check in the bl_config.h for the #define FORCED_UPDATE_PERIPH, FORCED_UPDATE_PORT, FORCED_UPDATE_PIN, FORCED_UPDATE_POLARITY.

    Cengizhan Yapıcıoğlu said:
    3-) Another thing was I change the first program address to 0x4000(think as lw_ip side) and call boot_emac via ICDI. But I can not seee BOOTP requests on wireshark. If lw_ip side starts 0x0 it works perfectly.

    As I said, if you meant the first program the boot_emac_flash which is the bootloader then it MUST reside at 0x0. You cannot change to 0x4000. Think about it. After the CPU comes of of reset it will fetch the stack pointer and the reset vector at 0x0 and if there is nothing there then how is it able to bootload? Are you asking if you can have the application firmware at 0x0 (the boot_demo_emac_flash) while the bootloader at 0x4000 (the boot_emac_flash)? This will not work. 

  • Hi,
    Is the issue resolved? I will close this thread for now. If you have questions you can reopen this thread or open a new thread.