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.

Linux/AM3352: First boot using TFTP from Raspberry Pi?

Part Number: AM3352
Other Parts Discussed in Thread: UNIFLASH,

Tool/software: Linux

Hi,

We have a custom board based on AM3352 and BBB. During development we have loaded the boards eMMC using uniflash on a Windows 7 computer, with flasher.sh scripts etc.. 

For production we do not want to use Windows 7, we have Windows 10 on all our test systems, however since the driver handling is different on Win10 we can't use Uniflash on Win10 to flash the boards. So, since the whole flashing process should work on Linux we thought that maybe we could use a Raspberry Pi that we netboot from the Windows computer and then use the Raspberry Pi to flash the board.

i have followed this guide:  but with no luck on Raspbian. I have got it working on Ubuntu 12.04. On the latest raspbian I've tested different approches with both isc-dhcp-server and dnsmaqs, but to no avail.

So, my question in, why would this work fine on and (really) old Ubuntu relese but not on a newer Linux build? Has anyone tried this?

Thanks in advance!

Regards,
Jonas

  • Jonas,

    I haven't tried it, but don't know why it wouldn't work. Can you post logs, particularly from the AM335x to give insight into what exactly is failing? I'm guessing it is a configuration difference between the RPi and Ubuntu.

    I would probably try a Beaglebone Black running Debian on my side, but this is untested and I'm not sure it will work.

    Also, on Win10, MS recently added the RNDIS drivers back to Windows and Uniflash might work with that in place, but I haven't been able to try it. This is assuming you are using USB. For Ethernet, I don't know of any driver issues that should have impacted the process.

    I hope these comments help.
  • Hi Ron,

    I did not know Microsoft added the drivers back. I will try that ASAP, because that would be the best solution for us. Do I still need to use uniflash 3.4 or is Uniflash 4 updated for Sitara?

    When i try booting from raspbian on a Raspberry Pi I get an IP and all from the isc-dhcp-server, but it never starts sending any of the files. So the AM3352 doesn't begin to boot. When monitoring UART0 all I get are the CCCCCCC until I plug the usb cable in. Then the C's stop and usb0 appears on the Raspberry Pi.

    If Windows doesn't work I might try an older version of raspbian and se if that works any better.

    Please let me know what you find out from testing with a BBB.

  • No luck with Windows 10. I am unable to select the RNDIS driver for my board, it goes to serial port as default. I even tried using the add legacy hardware option from the device manager. I'll give the Raspbery Pi another go.
  • Hi again,

    I got a bit further today.

    I hade to add tftp-server and next-server in dhcpd.conf:

    subnet 192.168.2.0 netmask 255.255.255.0
    {
      option tftp-server-name "192.168.2.1";
      next-server 192.168.2.1;
    
      range dynamic-bootp 192.168.2.2 192.168.2.100;
      if substring (option vendor-class-identifier, 0, 10) = "AM335x ROM"
      {
        filename "u-boot-spl-restore.bin";
        log("AM335x ROM");
      }
      elsif substring (option vendor-class-identifier, 0, 10) = "DM814x ROM"
      {
        filename "u-boot-spl-restore.bin";
        log("DM814x ROM");
      }
      elsif substring (option vendor-class-identifier, 0, 17) = "AM335x U-Boot SPL"
      {
        filename "u-boot-restore.img";
        log("AM335x U-Boot SPL");
      }
      else
      {
        filename "zImage";
        log("AM335x zImage");
      }
    
      range 192.168.2.101 192.168.2.199;
    }

    The logs are for debuging. The problem I have now is that I can not seem to find a way of restarting isc-dhcp-server everytime the usb0 interface comes up again (four times for one programming cycle). In newer raspbian releases /etc/network/ip-up is not used anymore it seems...

  • Jonas,

    It seems you are close with the Pi. Good luck.

    As for Windows, check out this recent thread where a possible work around for the USB Serial device to RNDIS was mentioned. However, they haven't confirmed if it actually got things working.

    e2e.ti.com/.../776446

    You'll need to stay with Uniflash 3.4 for Sitara.

    I hope this helps.
  • Thanks for the link Ron. It looks promising to get it up and running on Windows 10 as well.

    in the other thread Joni seems to have been able to make Windows 10 recognize the ROM boot as RNDIS, this is were I fail.

    I'e asked Jon iin the other thread which steps he has taken to get it working that far.

  • A little update on this.

    I was not able to get it working using Windows 10. I found some node.js application (node-beagle-boot) that looked promising but was not able to install it.

    Using NetworkManager method on the Raspberry pi however I have been able to get a little bit further. I am now able to load u-boot SPL etc. and the flasher kernel entierly automagic. Just plug in the USB cable and it starts loading. But, when the flasher kernel is asking for a DHCP lease it does not receives on. But the isc-dhcp-server is offering one, to the correct MAC.

    The strange thing is that (using the dhcpd.conf settings from my post above) I get an IP lease in the range 192.168.2.2-192.168.2.100. But I thought that was only during BOOTP requests? The flasher kernel is sending regular DHCP requests (it looks like that from the logs at least). So I would expect to get an IP in the range 192.168.2.101-192.168.2.199. Could this be the issue?

    Here is the DHCP-log from the Raspberry Pi:

    Mar 11 15:22:02 raspberrypi dhcpcd[360]: usb0: no IPv6 Routers available
    Mar 11 15:22:17 raspberrypi dhcpd[5714]: AM335x zImage
    Mar 11 15:22:17 raspberrypi dhcpd[5714]: DHCPDISCOVER from e6:54:40:53:61:9e via usb0
    Mar 11 15:22:18 raspberrypi dhcpd[5714]: ns1.example.org: host unknown.
    Mar 11 15:22:18 raspberrypi dhcpd[5714]: ns2.example.org: host unknown.
    Mar 11 15:22:18 raspberrypi dhcpd[5714]: DHCPOFFER on 192.168.2.8 to e6:54:40:53:61:9e via usb0
    Mar 11 15:22:18 raspberrypi dhcpd[5714]: AM335x zImage
    Mar 11 15:22:18 raspberrypi dhcpd[5714]: DHCPREQUEST for 192.168.2.8 (192.168.2.1) from e6:54:40:53:61:9e via usb0
    Mar 11 15:22:18 raspberrypi dhcpd[5714]: DHCPACK on 192.168.2.8 to e6:54:40:53:61:9e via usb0

    And as you can see from the "AM335x zImage" the configuration is used. I have since commented ouot the line with filename "zImage" since u-boot is fetching that by it self.

    Here is the output from the Sitara Fetcher script (modified by me somewhat to load g_ether modules and show output of ifconfig:

    ****************************************************
    ****************************************************
    
    Sitara Flash Fetcher Script v2.1 - 03/11/2016
    
    This version is aligned with Processor SDK Linux
    2.0.0 based on the Linux 4.1 kernel.
    
    J-Lo-version 2019-01-31
    insmod /lib/modules/3.12.30/kernel/drivers/usb/gadget/g_ether.ko
    [    3.317854] using random self ethernet address
    [    3.323220] using random host ethernet address
    [    3.329094] usb0: HOST MAC f6:85:25:ca:ae:ec
    [    3.333735] usb0: MAC e6:54:40:53:61:9e
    [    3.337858] using random self ethernet address
    [    3.342962] using random host ethernet address
    [    3.347755] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
    [    3.355019] g_ether gadget: g_ether ready
    lsmod
        Not tainted
    g_ether 1588 0 - Live 0xbf01e000
    usb_f_ecm_subset 2732 0 - Live 0xbf01a000
    usb_f_ecm 4444 1 - Live 0xbf015000
    usb_f_rndis 4608 2 g_ether, Live 0xbf010000
    u_rndis 5164 1 usb_f_rndis, Live 0xbf00d000
    u_ether 8592 4 g_ether,usb_f_ecm_subset,usb_f_ecm,usb_f_rndis, Live 0xbf009000
    libcomposite 21912 4 g_ether,usb_f_ecm_subset,usb_f_ecm,usb_f_rndis, [    3.392596] IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready
    Live 0xbf000000
    udhcpc (v1.23.1) started
    Sending discover...
    [    4.080165] g_ether gadget: high-speed config #1: CDC Ethernet (ECM)
    [    4.087739] IPv6: ADDRCONF(NETDEV_CHANGE): usb0: link becomes ready
    Sending discover...
    Sending discover...
    No lease, forking to background
    lo        Link encap:Local Loopback
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
    
    usb0      Link encap:Ethernet  HWaddr E6:54:40:53:61:9E
              inet6 addr: fe80::e454:40ff:fe53:619e/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:33 errors:0 dropped:0 overruns:0 frame:0
              TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:3533 (3.4 KiB)  TX bytes:1172 (1.1 KiB)
    
    Server IP not found, setting to default
    Getting flasher.sh from server: 192.168.2.1
    tftp: sendto: Network is unreachable
    Unable to fetch flasher script! Exiting...

    Any suggestions would be highly appreciated!

  • Got it working by issuing udhcpc -i usb0 in the fetcher script, if I did not get an IP. 

    Now it is just a mather of plugging in the USB-cable to our board and wait for 90 seconds and the board is up and running!