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.

PROCESSOR-SDK-AM335X: Ethernet boot fails

Part Number: PROCESSOR-SDK-AM335X
Other Parts Discussed in Thread: AM3358

I'm looking to create a custom design based on the AM3358 processor.  In considering how to bootstrap the device during manufacture, it seemed the simplest option would be to use the Ethernet boot capability to load a small Linux build, which I could then use to program the on-board NAND flash, and also perform the production line test functions at the same time.  This would allow me to run multiple boards simultaneously, which is not easy using the USB NET SPL build (which works) or UART (slooooooow).

In order to validate the assumption, I acquired a number of beaglebone black units and a couple of EVM SK units.  Modifying the BBB to set to Ethernet boot (tying J9 pin 44 down during boot) now does use BOOTP to acquire the u-boot SPL binary which executes, but then fails to retrieve the main u-boot image. 

I noticed a number of other posts which has since been locked, but without giving a viable workaround or solution.  One post at  https://e2e.ti.com/support/arm/sitara_arm/f/791/p/558760/2076129#2076129  refers to this being broken since AMSDK8, which it says is still downloadable, but from where?

The symptoms are that the initial u-boot SPL image loads, giving 

U-Boot SPL 2017.01 (Dec 29 2017 - 15:47:46)
Trying to boot from eth device
Card did not respond to voltage select!
** Bad device mmc 0 **
Using default environment

<ethaddr> not set. Validating first E-fuse MAC
cpsw, usb_ether
Error: usb_ether address not set.

cpsw Waiting for PHY auto negotiation to complete...... done
link up on port 0, speed 100, full duplex
BOOTP broadcast 1

and then watchdog after a long wait, to repeat.

Using SDK 04.02.00.09 source files.

Has this problem been resolved?  If I need to use the AMSDK8 to do this, where can I download the sources from?  Or am I wasting my time and should look at another mechanism (or processor!)?

  • Thanks, but I've been all through that in painstaking detail with no joy. I can use the USB ETH mode quite happily, and though the documents reference say that Ethernet mode should work as well, it doesn't.
  • OK, I have asked the software team to look into this. They will respond directly here.
  • Thanks.  Some more info which might help.

    I can get Ethernet boot working on the BBB using SDK am335x-evm-linux-sdk-src-04.02.00.09.tar.xz by modifying u-boot net/bootp.c file adding a single statement in void bootp_request(void)

    iphdr = pkt; /* We need this later for net_set_udp_header() */

    pkt += IP_UDP_HDR_SIZE;

    bp = (struct bootp_hdr *)pkt;

    bp->bp_op = OP_BOOTREQUEST;

    udelay(50);

    bp->bp_htype = HWT_ETHER;

    bp->bp_hlen = HWL_ETHER;

    bp->bp_hops = 0;

    and an identical change statement in static void dhcp_send_request_packet(struct bootp_hdr *bp_offer)

    and a similar change in  net/net.c

    void net_set_ip_header(uchar *pkt, struct in_addr dest, struct in_addr source)

    {

    struct ip_udp_hdr *ip = (struct ip_udp_hdr *)pkt;

    /*

    * Construct an IP header.

    */

    /* IP_HDR_SIZE / 4 (not including UDP) */

    ip->ip_hl_v  = 0x45;

    ip->ip_tos   = 0;

    udelay(50);

    ip->ip_len   = htons(IP_HDR_SIZE);

    ip->ip_id    = htons(net_ip_id++);

    ip->ip_off   = htons(IP_FLAGS_DFRAG); /* Don't fragment */

    ip->ip_ttl   = 255;

    ip->ip_sum   = 0;

    /* already in network byte order */

    net_copy_ip((void *)&ip->ip_src, &source);

    /* already in network byte order */

    net_copy_ip((void *)&ip->ip_dst, &dest);

    }

    The value in udelay(50); does not seem to be important, and the udelay(50); statements can be replaced with puts("."); or similar with the same effect.

    I think this points to a possible board configuration issue, memory access times maybe, or something to do with the timings in the Ethernet section, though moving the statement up or down a line stops it working.

    Very confusing.

  • Kerry,

    It sounds like you might be having trouble with your BOOTP server. I just booted the pre-built images from PLSDK 4.02 over ethernet from my Ubuntu 14.04 machine with no issues. I did this on a closed network between the Beablebone Black and my host machine.

    We have had some issues with older SDKs, but we've worked network boot over Ethernet and USB into our testing so hopefully this doesn't come up in the future.

    Wireshark is a great tool to debug the connection and see the packets going back and forth to figure out where things might be going south.
  • Thanks RonB,

    Interestingly using the pre-built binaries from am335x-evm-linux-sdk-bin-04.02.00.09.tar.xz does indeed work, but building the binaries from the SRC SDK at am335x-evm-linux-sdk-src-04.02.00.09.tar.xz does not.  I'll try rebuilding using the same toolchain as the PSB was built with as I'm using a slightly different cross compiler (gcc version 7.2.0), otherwise that's the only difference I can think of.

    I use wireshark intensively and noted that with my compiled binaries, the ROM boot loader worked ok and loaded the u-boot SPL.  But the u-boot SPL seemed to halt at the instruction given earlier unless the udelay(50) statement was in there.  With the udelay(50); I got nice BOOTP/DHCP packets and successfully loaded and executed a complete Linux kernel and filesystem (compile with the same gcc 7.2.0 compiler), but without the udelay(50) I did not receive any BOOTP/DHCP packets after the load of u-boot SPL.

    I'll keep you up to date.

  • Hi RonB,

    I can now confirm that building the am335x-evm-linux-sdk-src-04.02.00.09.tar.xz with GCC 7.2.0 or the Linaro Toolchain 7.1.1 does not work, but compiling with the SDK toolchain at releases.linaro.org/.../gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf.tar.xz does work.

    So this has resolved my issue. I'm not sure what the incompatibility is with GCC 7 and might spend some time on it if I get a chance.

    Thanks for your help.
  • Kerry,

    Thanks for getting back to us and confirming. GCC differences are always little tricky to track down, but that can be fun if one has the time.

    Happy designing in 2018!