Page 1 of 1

CM3 rpiboot get serial number

Posted: Tue May 09, 2017 10:16 am
by NifAres
Does anybody have a solution to get CM3 serial number when it is connected to HOST in flash mode?

After setup CM3 in flash mode in lsusb -v I got

Code: Select all

Bus 001 Device 048: ID 0a5c:0001 Broadcom Corp. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0a5c Broadcom Corp.
  idProduct          0x0001 
  bcdDevice            0.01
  iManufacturer           2 Raspberry Pi
  iProduct                1 Compute Module
  iSerial                 3 0001
iSerial is 0001 and not real CM serial number that I can get via i.e. /proc/cpuinfo on CM running linux.

Of course, I can try to make a workaround to get this serial number:
  • * setup CM in flash mode
    * write image with working OS to save serial number in a file on eMMC
    * boot CM and wait a some time
    * setup CM in flash mode again
    * read serial number from that file
    * flash final OS image
But, is there a simpler way?

Re: CM3 rpiboot get serial number

Posted: Mon May 22, 2017 12:30 pm
by jrychter

Reading the serial number (or the MAC) at rpiboot stage is important in production. When mass-producing devices with CM modules, one usually needs to program the onboard flash and read the MAC address (for printing stickers, keeping a database of devices, etc). If this requires an additional power down/reboot step, it significantly complicates things and makes production more costly because of the additional time wasted and added complexity.

I am assuming this is not a problem technically — but it is not something that can be done without help from the authors of usbboot/rpiboot.

Re: CM3 rpiboot get serial number

Posted: Mon May 22, 2017 12:54 pm
by gsh
It would be possible to add the board revision as the USB serial number...

Will try and add it with the next bunch of changes


Re: CM3 rpiboot get serial number

Posted: Mon May 22, 2017 1:35 pm
by jrychter
Board revision?

To clarify: what is actually needed is the MAC address. This seems to be derived from the CM serial number. Board revision isn't that helpful.

Re: CM3 rpiboot get serial number

Posted: Mon May 22, 2017 8:00 pm
by NifAres
As USB serial number is required to got CM serial number, not revision number.
Exactly that we can get, when we run on CM eg.

Code: Select all

$ cat /proc/cpuinfo | grep 'Serial'
Serial		: 000000006fd07946

Code: Select all

$ vcgencmd otp_dump | grep '28:'

Re: CM3 rpiboot get serial number

Posted: Fri May 26, 2017 7:26 pm
by NifAres
Thank you very much Gordon.
Today's version of rpiboot has what we need.