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.

EK-TM4C1294XL: How to download application by Ethernet

Part Number: EK-TM4C1294XL
Other Parts Discussed in Thread: ENERGIA

Hi,

if I have my EK-TM4C1294XL connected to my home network (by ethernet cable) is there a way to load an application without having to connect it to PC by USB cable?

For example if I have compiled with Energia IDE the simplest project that one could imagine (the Blink example), which steps should I follow to load the application to my board using ethernet connection?

thanks

Simone

  • I have tried the following steps:
    1)with LM Flash Programmer (in ICDI configuration) I program the "boot_emac_flash.bin" provided in TivaWare_C_Series-2.1.4.178\examples\boards\ek-tm4c1294xl\boot_emac_flash\ccs\Debug\ folder
    2)compile with Energia IDE the example (e.g. Blink example) and locate the related bin file
    3)with LM Flash Programmer (in Ethernet configuration and Client IP address / Client MAC address configured with the values of my board) I program the application bin file

    But the LED on the board does not blink (i.e. the application does not run)

    Hereafter the configuration TAB and Program TAB for step 3)

  • Nobody can help me?

    regards,

    Simone

  • Hi Simone,
    Your application (the blinky program) would have started in a non-zero address while the bootloader will start at 0x0. This means that in the Program tab of the LM Flash Programmer you will need to specify the program offset address that matches your application starting address.
  • Hi Charles,
    thanks for your reply. I cannot exactly understand what you mean.

    In particular:
    1) how/where can I verify the starting address of the example application (on Energia side)?
    2) should I specify a "Program Address Offset" equal to 0x0 when I program the bootloader via ICDI?
    (it is not possible to specify a "Program Address Offset" when programming the application via ethernet)

    regards
  • Hi Simone,
    I'm also trying to get the example boot_emac_flash to work but run into some problem. I'm not familiar with Energia but if you look at typical linker command file you would normally see the program allocated to the beginning of Flash which is 0x0. Since your bootloader already occupies the flash area starting at 0x0, your application will need to start at a different offset. Normally the TivaWare application example (i.e. boot_demo_emac_flash) will start at 0x4000. This is the reason I was telling that in the LM flash programmer you will need to specify 0x4000 as the offset when loading your application.
  • OK, but just a question: if I use Energia (or any other compilation tool) just to compile the source code into .bin file (not to download the code into the board) is the linker command file relevant?

    ragards,
    Simone
  • Hi Simone,

     If you use Energia or other compilation tool then the link command is still relevant. The linker command file specify how your code is allocated among different memory. Below is the typical CCS link command file.

     BTW, I'm still trying to get the boot_demo_emac_flash to work. For some reason the LM flash programmer is stuck with "Attempting to connect..." message when I hit Program.

    #define APP_BASE 0x00000000
    #define RAM_BASE 0x20000000
    
    /* System memory map */
    
    MEMORY
    {
        /* Application stored in and executes from internal flash */
        FLASH (RX) : origin = APP_BASE, length = 0x00100000
        /* Application uses internal RAM for data */
        SRAM (RWX) : origin = 0x20000000, length = 0x00040000
    }
    
    /* Section allocation in memory */
    
    SECTIONS
    {
        .intvecs:   > APP_BASE
        .text   :   > FLASH
        .const  :   > FLASH
        .cinit  :   > FLASH
        .pinit  :   > FLASH
        .init_array : > FLASH
    
        .vtable :   > RAM_BASE
        .data   :   > SRAM
        .bss    :   > SRAM
        .sysmem :   > SRAM
        .stack  :   > SRAM
    }
    
    __STACK_TOP = __stack + 512;

  • Hello Charles.

    The #define APP_BASE, inside app's code,  seems that it must be on the same address like in the linker file. 

    #define APP_BASE 0x0010000
    That way it seems that all run as expected.
    John
  • Hi John,

    I was trying to show a non bootloader linker file for an application. For an application with bootloader, the application will start at an non-zero starting address, typically at 0x4000 for TivaWare examples like below. Thanks for catching if my earlier linker example was confusing.

     

    #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
    }
    
    /* Section allocation in memory */
    
    SECTIONS
    {
        .intvecs:   > APP_BASE
        .text   :   > FLASH
        .const  :   > FLASH
        .cinit  :   > FLASH
        .pinit  :   > FLASH
        .init_array : > FLASH
    
        .vtable :   > RAM_BASE
        .data   :   > SRAM
        .bss    :   > SRAM
        .sysmem :   > SRAM
        .stack  :   > SRAM
    }

  • Hi Simone,
    Just wanted to let you know that I got the boot_demo_emac_flash to work. Below are the steps I used.

    1. Program the enet_io example to the flash.
    2. Run the program and make sure you have the terminal (Putty or Hyperterminal or Tera of your choice) window open. It should acquire the IP address via DHCP. Record this IP address. The sole reason to run this example first is to acquire the IP address.
    3. Open the LM flash program and load the bottloader boot_emac_flash while in ICDI mode.
    4. Go back to the configuration tab and select Ethernet as the interface.
    5. Input the IP address you acquire from step 2 and the MAC address on the back your launchpad board.
    6. Go to the program tab and provide the boot_demo_emac_flash.bin
    7. Hit 'Program' and run the program. You will see blinky LED.
  • Thank you.

    Unfortunately at the moment I have not the board with me. I will try it on Friday or Saturday.

    In the meanwhile I have a further question: after the first programming of the demo app via ethernet, are you able to perform a second app download (of the same demo app or another app) via ethernet without having to re-program the bootloader? moreover, in this case, is there the need to hit some button on the board?

    (in my application scenario the board would be difficult to be accessed, so I would appreciate the capability to download new application to the board completely remotely)

    thanks for your help

    Simone

  • Hi Simone,
    Yes, the demo app (the boot_demo_emac_flash.bin blinky program) will have additional code to listen for a magic packet telling that a firmware upgrade is request is being made and, when this packet is received, transfers control into the boot loader to perform the upgrade. In the LM Flash Program, when you hit the 'Program' button it sends out the magic packet. The magic packet comprises 6 bytes of 0xAA followed by the target MAC address repeated 4 times. When the application receives this magic packet it transfers the control to the bootloader. There i no need to press any button on the board.

    Please refer to the boot_demo_emac_flash example.
  • Thank you very much.
    So I suppose that I have to include in my specific application the functions to manage the magic packet.
    In any case I will let you know if the steps you suggested work.
    Then I will try to integrate the special functions in my application. Maybe Energia IDE is not the best way for such application, since if I understood well it has only 1 linker file, while in CCS each project has its own linker file that can be modified to specify the correct start address.

    regards
    Simone
  • Hi Simone,
    Yes, you will need to incorporate code to detect/handle the magic packet. I will suggest you start with the boot_demo_emac_flash and see how it is done and you can later adapt to your own application. As I said, I'm not familiar with Energia other than it creates another abstraction to simplify the development. I tend to think that it can has its own linker file per project but I don't know how it is done. For bootloader project I will recommend that you use CCS IDE environment as all the readily available examples are made for this environment.
  • Hello Simone.
    You may also want to check at the following project's link.
    e2e.ti.com/.../587260
    In case you have any questions regarding it, please address it here. It's well documented although. (I think so at least ;-)
    John
  • Hi Charles,

    I performed the 7 steps, but unfortunately i get stucked when trying to load the boot_demo_emac_flash.bin. LM Flash Programmer displays "Attempting to connect..." and the program download does not succeed.

    From which folder of "TivaWare_C_Series-2.1.4.178\examples\boards\ek-tm4c1294xl\boot_emac_flash" and "TivaWare_C_Series-2.1.4.178\examples\boards\ek-tm4c1294xl\boot_demo_emac_flash" should I take the bin files?

    ccs

    ewarm

    gcc

    rvmdk ?

    Are there any differences?

    regards,

    Simone

    I'm using LM Flash Programmer 1613. In this phase I'm not using CCS to modify/compile projects, I just try to load the binary files as provided in the TivaWare_C_Series-2.1.4.178 package.

  • Hi Simone,
    If you are using CCS then you will take the bin files from under ccs/Debug folder.

    When you run enet_io example did it succeed to return you the IP address that it acquires from DHCP server and show on the terminal window? You want to make sure you don't wait too long before you try the boot_emac_flash demo as other users in your network may run their applications to acquire the IP that you just got.
  • Charles, as I said "in this phase I'm not using CCS to modify/compile projects, I just try to load the binary files as provided in the TivaWare_C_Series-2.1.4.178 package.". So, which bin shall I take?

    And yes, I can see the ip on terminal.

    regards

    Simone

  • Hi Simone,
    I understand what you said. When I ran the demo, neither did I recompile/modify anything in CCS. I used the existing binary file in the respective Debug folder for both the boot_emac_flash and boot_demo_emac_flash. I loaded the boot_emac_flash first in ICDI interface mode and then the boot_demo_emac_flash in Ethernet interface mode, both using LM Flash Programmer. I didn't even open the CCS.

    I have been traveling since yesterday. I will be driving in a minute so won't be able to respond to you until later time. Sorry for the inconvenience.
  • OK, thanks for your help.

    I configured my router to release always the same IP address to my Board, so I think it shouldn't happen that other devices take that IP.

    regards

    Simone

  • Can you confirm if the CRC32 when downloading boot_emac_flash.bin (from the CCS folder) is 0xDED30C44 also for you?

    Thanks
    Simone
  • I solved my problem. Just removed LM Flash programmer from Windows firewall exceptions and then re-added it. I caught the problem running Wireshark and noticing that no packet was present with ip.dst equal to the IP address of the board.

    Thank you for your help Charles.

    Regards,

    Simone

  • Hi Simone,
    Glad your problem is solved.