NifAres
Posts: 3
Joined: Fri Apr 21, 2017 12:18 am
Location: Opole, Poland

CM3 rpiboot get serial number

Tue May 09, 2017 10:16 am

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?
--
Serafin W.
Senior System Architect @ Binartech ( www.binartech.com )

jrychter
Posts: 20
Joined: Tue Jun 28, 2016 11:03 am
Contact: Website

Re: CM3 rpiboot get serial number

Mon May 22, 2017 12:30 pm

Anyone?

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.
--J.
Founder at PartsBox: https://partsbox.io/ (keep track of your electronic components)

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

Re: CM3 rpiboot get serial number

Mon May 22, 2017 12:54 pm

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

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

jrychter
Posts: 20
Joined: Tue Jun 28, 2016 11:03 am
Contact: Website

Re: CM3 rpiboot get serial number

Mon May 22, 2017 1:35 pm

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.
--J.
Founder at PartsBox: https://partsbox.io/ (keep track of your electronic components)

NifAres
Posts: 3
Joined: Fri Apr 21, 2017 12:18 am
Location: Opole, Poland

Re: CM3 rpiboot get serial number

Mon May 22, 2017 8:00 pm

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
or

Code: Select all

$ vcgencmd otp_dump | grep '28:'
28:6fd07946
--
Serafin W.
Senior System Architect @ Binartech ( www.binartech.com )

NifAres
Posts: 3
Joined: Fri Apr 21, 2017 12:18 am
Location: Opole, Poland

Re: CM3 rpiboot get serial number

Fri May 26, 2017 7:26 pm

Thank you very much Gordon.
Today's version of rpiboot has what we need.

Regards
--
Serafin W.
Senior System Architect @ Binartech ( www.binartech.com )

Return to “Compute Module”