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.

DM648 Ethernet Boot to NOR Flash

I'm working on the DM648 EVM board before our custom board arrives.  I need to write code to program the NOR flash memory via the Ethernet port, with a host processor (ARM).  This will be used for firmware updates and the normal boot mode will be from flash. 

 

Looking at the way the DM648_NORWriter project works, supplied with the DVSDK, I think I need to do the following steps:

1) Enter Ethernet boot mode using the ROM bootloader

2) Host listens for the BOOTP packet from the DM648

3) The host then downloads a modified version of DM648_NORWriter in AIS format

4) The modified DM648_NORWriter program downloads the UBL (in AIS format) over Ethernet and programs it into flash

5) The modified DM648_NORWriter program downloads the my application (in AIS format) over Ethernet and programs it into flash

6) Change the boot switches and restart.

 

I have set the board into Ethernet boot mode and I can capture the BOOTP packet using wireshark so I know that the ROM bootloader is working . For the modified DM648_NORWrite program, do I need to add the network stack, from the NDK hello world example and open a socket to download the UBL and my application, or is the network stack going to be running from the ROM bootloader and I can simply open a socket to a server running on the host to download the programs?

 

Is there a simpler method of doing this, rather than having to develop and maintain 3 packages?  Any advise or code from people that have successfully done this would be appreciated.

 

Simon

  • Simon,

    Here are the comments from our ethernet expert.

    Regards,

    Brad

    "The steps look good. However DM 648 ROM is using UDP (not TCP) for ethernet boot. So the user will have to run the network stack as part of the DM648_NORWriter

    As ROM bootloader is meant to download small application/program, the best way to approach this issue is to download and run stack as part of DM648_NORWriter or similar application. For example, after the modified DM648_NORWriter is successfully downloaded (Step 3), DM648_NORWriter will start running and can complete rest of the steps. At this point all the processing (network, flashing etc) has to be handled by the modified DM648_NORWriter."

     

  • Brad,

     

    Thanks for the reply and comments, it's good to know I'm on the right track.  I have some further questions about the detail for step 3, if you could put them to your Ethernet expert I'd be grateful. 

     

    Firstly in SPRAAJ1D, page 14, table 10 it has the destination port set to 9.  When I capture the Bootp packet in wireshark it has a destination port of 67.  Is this a mistake in the documentation? Does the host download the application to port 9 or 67?

     

    Secondly, I have some code running on a PC to act as the host.  It is able to receive a bootp message from other PCs as they boot, but it can't get the packet from the DaVinci, even though wireshark can see it.  I think this is because the TI packet has the destination IP address as 0.0.0.0, whilst a PC sets this to 255.255.255.255 so that it is broadcast.  Any suggestions on what I have to do to receive the TI bootp packet?  The code I'm using comes from here:  http://www.codeproject.com/KB/IP/bootp_daemon.aspx  It never returns from the select function call, before the socket can be read, because it doesn't think anything has arrived.

     

    Finally, Page 31 of SPRAAJ1D says that the parameters needed for genAIS are source IP, source MAC, destination IP, destination MAC, header type and packet size.  Does this mean that to convert a .out file with different genAIS parameters have to be used for every host IP and MAC address used and for every DaVinci we buy?  Page 15 says that the DM648 MAC address is read from EFUSE, does this change for each chip or are all new chips set to a default value?  As far as I can see the DM648 will not have an IP address at this time so the destination IP address will have to be 0.0.0.0 

     

    I don't find the information provided gives enough detail to implement a host boot server.  It would be useful if TI provided the boot ROM code, like it does for the F2812, and more details of how to use genAIS.  Some example code and description would be a great help.

     

    Regards,

    Simon

  • Simon,

    Regarding the BOOTP packet. The DM648 BOOTP format is TI specific and will not work with standard BOOTP server. You will have to use a custom server which accepts all 0 as IP address.

    Regarding Efuse. The MAC address for each chip/device is supposed to be unique and is efused on the device. ROM code uses this MAC address.

    genAIS is a provided as a sample application. In real world scenario, the server application will determine the MAC address (from the TI BOOTP) and will generate the packets from a.out to be sent to DM648 in real time.

    Sorry, we don't provide ROM bootloader source code.

    Regards,
    Gaurav

  • Thanks Gaurav, you said

    Gaurav said:
    genAIS is a provided as a sample application. In real world scenario, the server application will determine the MAC address (from the TI BOOTP) and will generate the packets from a.out to be sent to DM648 in real time.

     

    Where can we find information on how to do this?  Is there any documentation other than SPRAAJ1D?


    How are we supposed to transmit the packets generated by genAIS?  Is it a UDP or RAW socket that we have to use and with what parameters?


    Each of the c files generated by genAIS have 42 bytes of information above the boot table frame header, (magic number 544B).   Can we remove these and send the remaining bytes as the payload to our own UDP socket communications?

     
    Can you please clarify what port numbers does the Bootloader on the DM648 use, as I stated above the DM648 bootp packet we capture from our EVM board doesn't match that specified in SPRAAJ1D.


  • Simon,

    There is no detailed documentation on how to write the server. You can use PCAP library (http://en.wikipedia.org/wiki/Pcap) to achieve these functionalities (capture and send the packet). I have used RAW sockets to send/receive the packets.

    "Each of the c files generated by genAIS have 42 bytes of information above the boot table frame header, (magic number 544B).   Can we remove these and send the remaining bytes as the payload to our own UDP socket communications? "
    This information is required for the ROM code to extract the code and copy it to the memory area indicated in the header. Also there is information regarding the end of packet.
    Once the user program is downloaded, then there is no restriction.

    "Can you please clarify what port numbers does the Bootloader on the DM648 use, as I stated above the DM648 bootp packet we capture from our EVM board doesn't match that specified in SPRAAJ1D."
    Table 10 has a typo. I will request an update. As you suggested, the BOOTP destination UDP port (byte offset 36-37) is 0x67. The ROM code on the other hand, expects the packets (boot table) to have 0x9 as destination UDP port (see comments on Page 15).

    Thanks,
    Gaurav