nikoku
Posts: 6
Joined: Tue Jun 19, 2018 7:42 am

cm3 network boot problem, rpiboot emmc overload problem

Tue Jun 19, 2018 12:55 pm

i am very new on raspberries!

my aim is to netboot cm3 on our own carrier board to be developed.

in order to get acquainted to raspberry/raspbian i managed successfully to netboot a
raspian stretch on rpi 3 b v1.2. i have setup a dhcp/tftp/nfs server running debian
stretch for this purpose. dhcp net boot worked with no sd card plugged into the rpi 3 b
or with an sd card, where only bootcode.bin was residing in /boot. as a side
remark i would notice that the second variant was net booting much faster than the
first one.

next step was to setup a raspbian lite on a cm3 v1.0. raspbian is too big to fit on the
emmc of the cm3. with the cm3 on a cmio v3.0 i managed successfully to load raspbian
lite on the emcc, i could boot from the emmc and work via ssh remotely on the cm3.

next step was to prepare the cm3 for net booting. for this purpoes i made the
following steps:

1) echo program_usb_boot_mode=1 | sudo tee -a /boot/config.txt
after rebooting the cm3, i checked with vcgencmd otp_dump | grep 17: and found as
expected, that the highest nonzero digit has changed from 1 to 3 (as on the rpi 3 b).

2) i removed from /boot on the emmc all files apart bootcode.bin.

3) i plugged the cm3 on a gumstix "raspberry pi eth + usb", because it features
a lan9512. (this forum seems to indicate that only lan9512 and lan9514 allow for
netbooting (although rpi 3 b + features a lan7515)).

4) after powering the gumstix (and cm3), i could neither see a dhcp request nor any net
activity with tcpdump. i have no clue why it doesn't work. what am i doing wrong?

5) to rule out simple errors and after carefully reading again all documentation on
this issue, i repeated the whole sequence with a second cm3. unfortunately with the
same negative result.

in order to go back to emmc booting i tried to (over)load again the emmc with rpiboot.
i followed again fastidiously the instructions, but rpiboot never comes further than
"Waiting for BCM2835/6/7", no sdx device is coming up on the debian stretch host
(dmesg, lsusb, etc).

now my two cm3 seem unaccessible. the only differenec i can see with respect to the
first successfull emmc writing with rpiboot, is the command
"echo program_usb_boot_mode=1 | sudo tee -a /boot/config.txt" in between.

nikoku
Posts: 6
Joined: Tue Jun 19, 2018 7:42 am

Re: cm3 network boot problem, rpiboot emmc overload problem

Wed Jun 20, 2018 12:27 pm

hi together

digging in the rpi forums, i found a hint to overcome the hanging rpiboot problem which i have
posted yesterday: "One thing to try is connecting the OTGID pin to 3V3" this worked!

is there an explanation why this is necessary now (see my post for details)?

now i am able again to mount the two emmc partitions created at the
beginning on my linux host. /boot contains as expected only bootcode.bin.
nevertheless i see no dhcp request from this cm3 once plugged on the gumstix carrier board.
i have checked that the gumstix ethernet and all other infrastructure works fine with a cm3
with a full raspbian lite installed on the emmc.

have i missed an important detail to netboot the cm3?

are there any other cm3 carrier boards with suitable lan9512/14 available.

is the lan9512 mounted on the gumstix really suited to netboot the cm3?

thank you and best regards
nik

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1581
Joined: Sat Sep 10, 2011 11:43 am

Re: cm3 network boot problem, rpiboot emmc overload problem

Thu Jun 21, 2018 12:35 pm

By default, the CM3 has SD card boot enabled first and then falls back to USB device boot.

Device boot is when the Pi appears as a USB device when plugged into a PC (i.e. it's how we program using rpiboot). And clearly, this worked for you originally.

You then enabled host USB boot, this is a separate and conflicting mode (the USB will only boot in device _or_ host mode, not both) to device boot. So as it boots it notices that you've enabled both modes and therefore, uses the OTG pin to decide between device and host mode.

This is why you needed to ground the OTG pin to make it work.

To make it boot in host mode, you'll need to remove the OTG jumper. It'll then search the USB network for a PID/VID that matches the 9512/4 or 7515. If it finds either of these then it'll start sending packets to boot. If there are no packets then for some reason it's not enumerating the device correctly. Are you sure the LAN9512 is correctly clocked and the LAN_RUN pin is enabled correctly?

Gordon
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

nikoku
Posts: 6
Joined: Tue Jun 19, 2018 7:42 am

Re: cm3 network boot problem, rpiboot emmc overload problem

Thu Jun 21, 2018 2:17 pm

hi gordon,

thank you for your explantion concerning boot modes and emmc flashing with rpiboot.

the problem of the failing cm3 netboot on the gumstix carrier is still unsolved:

after preparing the emmc on a cmio i can plug a cm3 on the gumstix carrier, boot from emmc and access
the cm3 without any problems on the network (ssh, sshd, etc).

lsusb delivers:
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. SMC9512/9514 USB Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.99.3.6 netmask 255.255.128.0 broadcast 10.99.127.255
inet6 fe80::18f6:2409:6fe6:d88c prefixlen 64 scopeid 0x20<link>
ether 00:15:c9:29:34:91 txqueuelen 1000 (Ethernet)
RX packets 9256 bytes 591955 (578.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 478 bytes 95182 (92.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

this implied for me, that the gumstix carrier ( https://store.gumstix.com/gumstix-pi-co ... ernet.html )
shall be suited for network boot. but as posted before, i don't get any dhcp request (or other net traffic) from the cm3,
once i empty /boot completely or leave only bootcode.bin.

i have chosen the gumstix, since it seems the only cm3 carrier with a suitable lan9512 available. are there others?
the idea to circumvent the missing ethernet on the cmio with a usb to ethernet cable adapter failed, because i found
no one with lan9512/14.

what shall i do to check that the LAN_RUN pin is enabled correctly. i thought checking the lan working with emmc boot
shall be sufficient.

digging now even deeper in the raspberry forums, i found no post indicating a carrier board for the cm3, where a successfull
dhcp boot worked.

thank you again and best regards
nik

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1581
Joined: Sat Sep 10, 2011 11:43 am

Re: cm3 network boot problem, rpiboot emmc overload problem

Thu Jun 21, 2018 2:34 pm

Use a scope to check the signals
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

nikoku
Posts: 6
Joined: Tue Jun 19, 2018 7:42 am

Re: cm3 network boot problem, rpiboot emmc overload problem

Fri Jun 22, 2018 2:07 pm

is there anybody in a position to report dhcp/tftp booting of a cm3 on a purchasable carrier board??

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1581
Joined: Sat Sep 10, 2011 11:43 am

Re: cm3 network boot problem, rpiboot emmc overload problem

Fri Jun 22, 2018 3:00 pm

Yep, works fine with a CMIO3 board and the LAN9512, LAN9514 and LAN9515 demonstration boards.

Try enabling bootcode UART using:

sed -i -e "s/BOOT_UART=0/BOOT_UART=1/" bootcode.bin


Using that bootcode.bin as the only file on the eMMC

Then connect up a serial cable with 115200 baud 8 bits no parity one stop bit...
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

nikoku
Posts: 6
Joined: Tue Jun 19, 2018 7:42 am

Re: cm3 network boot problem, rpiboot emmc overload problem

Tue Jun 26, 2018 11:56 am

hi gordon

enabling uart with "sed -i -e "s/BOOT_UART=0/BOOT_UART=1/" bootcode.bin" was very useful, but i am still puzzled:

i did the following:
1) installed a new raspbian stretch lite (release date 2018-04-18) on cm3 emmc
2) found no BOOT_UART=0 in /boot/bootcode.bin
3) therefore i made an rpi-update
4) now BOOT_UART=0 found in /boot/bootcode.bin
5) sed -i -e "s/BOOT_UART=0/BOOT_UART=1/" bootcode.bin
6) removed every file apart from bootcode.bin
7) plugged cm3 on the gumstix carrier. after powering, i see indeed dhcp requests issued from the cm3:

Raspberry Pi Bootcode

Found SD card, config.txt = 0, start.elf = 0, recovery.elf = 0, timeout = 0
Trying USB
Hub device found at addr 4, enumerating HUB
Initialise hub
Found 3 ports, multi_tt = 1
Setting interface 0
Enabling PORT POWER on port 1
Enabling PORT POWER on port 2
Enabling PORT POWER on port 3
Waiting for devices to respond to reset
Found device on port 1
Found highspeed device
Device found: type = Ethernet adapter, addr = 5
Trying booting from Ethernet device addr 5
Initialise ethernet with MAC b8:27:eb:32:9e:af
Wait for Link up
Link up
Sending DHCP request
Waiting for dhcp_reply
Sending DHCP request

the problem is, that the mac address used for the dhcp request of the cm3 is not the one of the lan9512 of the gumstix carrier routed to the rj45. therefore i cannot see it on the net. it seems to be a raspberry mac address?

it seems, that the lan9512 ist not recognized as an ethernet boot device? is there a way to cure this?

which firmware do you recommendate (no rpi-update, rpi-upate, BRANCH=next rpi-update, etc)?

what do i have to do to see the serial line on a cmio?

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 3294
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: cm3 network boot problem, rpiboot emmc overload problem

Tue Jun 26, 2018 12:32 pm

The serial line is accessible on a CMIO via GPIOs 14 (TX) and 15 (RX) (and any GND pin).

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1581
Joined: Sat Sep 10, 2011 11:43 am

Re: cm3 network boot problem, rpiboot emmc overload problem

Tue Jun 26, 2018 12:52 pm

the problem is, that the mac address used for the dhcp request of the cm3 is not the one of the lan9512 of the gumstix carrier routed to the rj45. therefore i cannot see it on the net. it seems to be a raspberry mac address?
Yes it will be, the bootrom doesn't read the MAC address out of the device, creates an address from the Raspberry Pi serial number. To change this you should add program_mac_address=xx:xx:xx:xx:xx:xx to force it to be anything else.
it seems, that the lan9512 ist not recognized as an ethernet boot device? is there a way to cure this?
Yes it is that's what "Device found: type = Ethernet adapter, addr = 5" means
which firmware do you recommendate (no rpi-update, rpi-upate, BRANCH=next rpi-update, etc)?
Anything except BRANCH=next should work fine, only rpi-update has the UART enabling capability
what do i have to do to see the serial line on a cmio?
Not sure what you mean, you can see it already as above?
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1581
Joined: Sat Sep 10, 2011 11:43 am

Re: cm3 network boot problem, rpiboot emmc overload problem

Tue Jun 26, 2018 12:57 pm

Note: program_mac_address is something you add to the config.txt this is then a permanent change (it is written to OTP inside the SOC).
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

nikoku
Posts: 6
Joined: Tue Jun 19, 2018 7:42 am

Re: cm3 network boot problem, rpiboot emmc overload problem

Tue Jun 26, 2018 2:27 pm

hi gordan,

after following your advice with program_mac_address my cm3 boots now from the net with dhcp on the gumstix carrier.
if i got it right it means, that my cm3 is now glued forever to the gumstix carrier, which is not a problem.

thanks again
nik

Return to “Compute Module”