EK-TM4C1294XL: I don't understand the behavior of the EmacBootloader source code.

Part Number: EK-TM4C1294XL

Tool/software:

I am planning to reuse the BOOTP and TFTP functionalities from the EMACbootloader code in the code I am developing.My understanding of the EMACBootLoader behavior is that the UpdateBootp function acts like the main routine and performs various processes. I believe that the BOOTP packet is sent triggered by the reception of a magic packet. Could you please tell me where the reception processing of the magic packet is performed?Also, if my understanding above is incorrect, I would appreciate it if you could let me know where the reception processing of the magic packet and the subsequent sending of the BOOTP packet are handled.Furthermore, if possible, I would appreciate it if you could provide any documents that explain the processing flow of the EmacBootloader, such as the transition to the TFTP processing.

  • Hi,

    I am planning to reuse the BOOTP and TFTP functionalities from the EMACbootloader code in the code I am developing.

     Can you please clarify if you are going to send BOOTP and TFTP from your application or are you creating your own Ethernet bootloader? I suppose you are creating an application firmware where you want to send BOOTP and TFTP, is that correct? 

    My understanding of the EMACBootLoader behavior is that the UpdateBootp function acts like the main routine and performs various processes.

    More or less, yes. I strongly suggest you refer to the bl_startup_ccs.s file on how UpdateBootp is called. Basically there are two methods to call UpdateBootp. 

    1. If the flash is empty then the UPdateBootp is called after the Ethernet is configured. 

    2. The application receives a magic packet and then the application transfers the control to the bootloader which will call UpdateBootp. 

    I believe that the BOOTP packet is sent triggered by the reception of a magic packet.

    Yes, according to the #2 in my above answer. 

    Could you please tell me where the reception processing of the magic packet is performed

    I strongly suggest you go through the boot_demo_emac_flash example. In this example, the application initialize the Ethernet controller and lwIP stack. Look at the SoftWareUpdateInit function in the swupdate.c file. This function will setup an UDP connection to receive the magic packet sent from the boot server. When a magic packet is received it will then call the callback unction SoftwareUpdateRequestCallback. The SoftwareUpdateRequestCallback is an user supplied callback function. When the magic packet is received the SoftwareUpdateRequestCallback will be called and it will update the flag g_bFirmwareUpdate to true. In the main, the code is in a loop waiting for the g_bFirmwareUpdate to be true. When true it will transfer the control to the bootloader by calling the SoftwareUpdateBegin().