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.

Is it possible to use boot_serial code sample for Ethernet update?

Other Parts Discussed in Thread: EK-TM4C1294XL, LMFLASHPROGRAMMER

In boot_serial code sample, bl_config.h, I commented UART_ENABLE_UPDATE, and uncommented ENET_ENABLE_UPDATE. Now I have build errors:

<Linking>

 undefined       first referenced                
  symbol             in file                     
 ---------       ----------------                
remark #10371-D: (ULP 1.1) Detected no uses of low power mode state changing instructions
 ConfigureDevice ./boot_loader/bl_startup_ccs.obj

>> Compilation failure
makefile:154: recipe for target 'boot_serial.out' failed
 Updater         ./boot_loader/bl_startup_ccs.obj

error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "boot_serial.out" not built
gmake: *** [boot_serial.out] Error 1
gmake: Target 'all' not remade because of errors.

Can I configure this code sample to support Ethernet update? If not, where can I find boot loader that supports this feature?

My working environment:

Code Composer Studio Version: 6.1.3.00034
TivaWare_C_Series-2.1.3.156
Board: EK-TM4C129XL Rev D
Windows 10 x64

  • Hello Alex,

    Just changing the update mechanism define is not a sufficient method to switch boot mechanism. There are a set of dependent defines that need to be also checked.

    As for the example, we are working on a simplified flash boot loader for Ethernet on EK-TM4C1294XL that would be available in the next software release.

    Regards
    Amit
  • Hello Amit,

    When this new release will be available? I need to start my development now, what are my options?

    Can I use ti\TivaWare_C_Series-2.1.3.156\boot_loader source code to make Ethernet boot loader for ek-tm4c1294xl?

    I understand that Ethernet Flash Downloader (eflash) program described in TivaWare™ Host Tools document can be used to make my own downloader, so I am OK on a host side. Now I need Ethernet bootloader on board side.
  • Hello Alex

    The release would be some time from now. If you can share your CCS project for the flash boot loader, I can perhaps help building one.

    Regards
    Amit
  • Hello Amit,

    Attached my unsuccessful attempt to make ethernet boot loader. This is TivaWare_C_Series-2.1.3.156\examples\boards\ek-tm4c1294xl\boot_serial code sample with UART_ENABLE_UPDATE commented, and ENET_ENABLE_UPDATE uncommented. Build errors are in my original post.

    Hope I make attachment correctly, I used Insert File button.

    Thank you.

    boot_ethernet.zip

  • Correction: build errors are:

    undefined first referenced
    symbol in file
    --------- ----------------
    SysCtlClockFreqSet ./boot_loader/bl_emac.obj
  • Hello Alex

    Add the path "C:\ti\TivaWare_C_Series-2.1.3.156\driverlib\ccs\Debug\driverlib.lib" under ARM Linker-> File Search Path -> Include library file when you click on project properties.

    That will take care of removing this error. I have not yet tested the boot loader...

    Regards
    Amit
  • Hello Amit,

    After adding driverlib.lib to boot_serial project it is successfully built. Now I can download boot_serial and boot_demo1 to the board. Then I reboot the board, and LED1 is blinking. This means, modified boot loader successfully loads another program at address 0x4000. Then I press SW1, LED1 stops blinking. At this stage it stops working, boot loader is not activated. Ethernet adapter on PC is reported as unconnected.

    boot_demo1 has the following code to activate boot loader:

    // Passes control to the bootloader and initiates a remote software update.
    //
    // This function passes control to the bootloader and initiates an update of
    // the main application firmware image via UART0 or USB depending
    // upon the specific boot loader binary in use.
    //
    // \return Never returns.
    //
    //*****************************************************************************
    void
    JumpToBootLoader(void)
    {
    ....
    }

    Probably this is incorrect way to activate Ethernet boot loader. What code should I use for this?

    Assuming that Ethernet boot loader is successfully activated, what IP address should I give to LM Flash Programmer?

    Thank you.
  • Hello Alex,

    The IP address assigned by the switch during the first example must be reused or an IP address that is on the same subnet mask.

    Regards
    Amit
  • Hello Amit,

    I am trying to understand this : "The IP address assigned by the switch during the first example must be reused".

    Let's say I burn boot loader with offset 0. Then I take some program, for example, enet_lwip, set APP_BASE to 0x4000, and configure it to static IP address, for example, 192.168.10.1. Then I burn enet_lwip to device with offset 0x4000, and reboot the board. Boot loader starts enet_lwip, which works with static 192.168.10.1 address.
    Now I ask enet_lwip to activate boot loader. It calls JumpToBootLoader, boot loader is activated and continues to work with the same IP address. Is this correct?
  • Hello Alex

    I have not used a static IP. I rather have used dynamic IP address and once I know the subnet mask, I try to assign it an IP address in the same range as provided by the subnet mask.

    Regards
    Amit
  • Hello Amit,

    For now, I have two projects. First is boot_serial, with commented UART_ENABLE_UPDATE, and uncommented ENET_ENABLE_UPDATE. Second is modified enet_lwip, with APP_BASE = 0x00004000. Exactly like boot_demo1, enet_lwip handles SW1 press and calls JumpToBootLoader. After this I run LM Flash Programmer and try to download some program using Ethernet interface, using IP from enet_lwip. This doesn't work, Flash Programmer hangs on "Attempting to connect" message.

    I need working ethernet bootloader and correct code to activate it, instead JumpToBootLoader.

    Thank you.
  • Hello Alex,

    OK, hpw are you downloading the boot_demp1: using Ethernet or using JTAG?

    Regards
    Amit
  • To prepare board for first use, I download boot loader and application (like boot_demo1) using JTAG, from CCS.
    Ethernet is not working for me.
  • Hello Alex,

    And you can run the other ethernet examples on your board like enet_lwip?

    Regards
    Amit
  • Yes, I can run enet_lwip on my board.

    I can also run enet_lwip with offset 0x4000 together with boot_serial. I need to convert boot_serial for Ethernet update, and to activate it from enet_lwip.

    If necessary, I can attach these two projects to this question, with explanation, how they are working now and what is missing.
  • Hello Alex

    Let me check if I can reproduce the setup on my side with the existing code

    Regards
    Amit
  • Hello Alex,

    The issue was in the bl_config.h file of your project.

    Attached is the correct one... I had to make some changes to the boot_demo1 and demo2 to invoke the ethernet boot loader, but I am able to work between the two images now.

    2727.bl_config.h

    Regards

    Amit

  • Hello Amit,

    I replaced bl_config.h in boot_serial with file you posted. Now I have two programs partially working:

    boot_serial with your bl_config.h file, with offset 0
    enet_lwip with offset 0x4000.

    I burn two programs using JTAG from CCS. Then I reboot the board. enet_lwip is working, it is successfully loaded by boot_serial. I can test this loading WEB page from the board.
    Now I press SW1. enet_lwip executes JumpToBootLoader function. Then I try to run LM Flash Programmer with Ethernet interface, and it shows the following message:

    **ERROR**: Problem starting the BOOTP server!

    It is much better. Probably JumpToBootLoader function should be fixed, currently it is just copied from boot_serial.

    Thank you.
  • Hello Alex,

    The method you have to download the application is incorrect. Only the boot loader should be downloaded by JTAG. Once it is downloaded the application must be downloaded by using the boot interface (in this case ethernet)

    Regards
    Amit
  • Hello Amit,

    I just follow the code sample. When board is powered on, boot_serial loads another application, for example, boot_demo1. From TI documentation, boot_demo1:

    At startup, the application will configure the UART peripheral, wait for SW1 to be pressed and blink LED D1. When the SW1 is
    pressed, LED D1 is turned off, and then the application branches to the boot loader to await the start of an update.

    How can I wake up boot loader, if it is not active? I need to activate it from my application to start Ethernet update.
  • Hello Alex,

    You wrote: "I burn two programs using JTAG from CCS. Then I reboot the board. enet_lwip is working, it is successfully loaded by boot_serial."

    When only the boot loader is present, then the first application must be downloaded by the boot loader. I don't see that happening.

    Regards
    Amit
  • OK, I burn only one program to the board: boot loader. It tries to load application from 0x4000. If it doesn't exist, the board hangs. How can I wake up boot loader to talk with it?

    I am looking at boot_demo_emac_flash code sample from DK-TM4C129X board. It uses this code to transfer control to the bootloader:

    SoftwareUpdateBegin(g_ui32SysClock);

    I will try to do the same in my project.
    Probably we need to buy this board, it has ready-to-use code sample for Ethernet update.
  • Hello Alex,

    Can you send a snapshot of the Configuration and Program Tabs in the LMFlashProgrammer when loading the application to 0x4000?

    Regards
    Amit
  • Finally got it working. This is the summary of my efforts, for future reference.

    1. Boot loader. This is boot_serial code sample, with bl_config.h file attached to this question. Flash offset - 0. Flash erase method - necessary pages only.

    2. enet_lwip code sample. Flash offset - 0x4000. Flash erase method - necessary pages only.
    I added swupdate.c and swupdate.h files to it, and used them by the same way, as in boot_demo_emac_flash code sample from DK-TM4C129X board. Now this program listens for magic packet from PC. When such packet is received, the program activates the boot loader.

    3. Finally, I use eflash code sample instead of buggy LM Flash Programmer. I made two changes in this program:

    // after WSAStartup call
    #if 0
    psHostEnt = gethostbyname("");
    ui32LocalAddress = ((struct in_addr *)*psHostEnt->h_addr_list)->s_addr;
    #else // this is my version
    strcpy(buffer, LOCAL_IP_ADDRESS); // LOCAL_IP_ADDRESS is PC current PC adapter IP
    AddressToBytes(buffer, &ui32LocalAddress, 4, 10);
    #endif

    sUpdateSocket = CreateSocket(ui32LocalAddr, htons(MPACKET_PORT), 1,
    // FALSE replaced with TRUE
    // Now it is working when all network adapters are enabled.
    // Without this change, board receives magic packets only if all other adapters are disabled.
    //FALSE);
    TRUE);

    Don't ask me why, this is sockets voodoo.
    Ensure that eflash.exe is not blocked by Windows Firewall.

    So, I can burn boot_serial (which is now actually ethernet bootloader), and enet_lwip to the board using JTAG. Then I need to reboot the board, and enet_lwip starts. Finally, eflash connects to the board and downloads any other file to it using Ethernet interface.

    This works only with DHCP, I cannot make it working with static IP.
  • Hello Alex,

    AFAIK, eflash is part of LMFlashProgrammer core as well....

    Regards
    Amit
  • Right, burning part is OK, the problem of LM Flash Programmer is in UI. It hangs on connection error and program should be killed by Task Manager.
    Correction for my previous post: now it works also with static IP.
  • Hello Alex

    Maybe the next TivaWare release with the example for ethernet boot loader would fix that for you.