检测树莓派硬件版本

    本文地址:http://tongxinmao.com/Article/Detail/id/233

    cat /proc/cpuinfo | grep 'Revision' | awk '{print $3}'

    The variants currently available are :

    Model and PCB RevisionRAMHardware Revision Code from cpuinfo
    Model B Rev 1256MB0002
    Model B Rev 1
    ECN0001 (no fuses, D14 removed)
    256MB0003
    Model B Rev 2256MB0004
    0005
    0006
    Model A256MB0007
    0008
    0009
    Model B Rev 2512MB000d
    000e
    000f
    Model B+512MB0010
    0013
    900032
    Compute Module512MB0011
    Compute Module512MB0014 (Embest, China)
    Model A+256MB0012
    Model A+256MB0015 (Embest, China)
    Model A+512MB0015 (Embest, China)
    Pi 2 Model B v1.11GBa01041 (Sony, UK)
    Pi 2 Model B v1.11GBa21041 (Embest, China)
    Pi 2 Model B v1.21GBa22042
    Pi Zero v1.2512MB900092
    Pi Zero v1.3512MB900093
    Pi Zero W512MB9000C1
    Pi 3 Model B1GBa02082 (Sony, UK)
    Pi 3 Model B1GBa22082 (Embest, China)



    In order to find out what hardware revision you have you can run the following command at the command prompt or via a terminal window :

     cat /proc/cpuinfo

    This will give you a text output something like this :

    Processor       : ARMv6-compatible processor rev 7 (v6l)
    BogoMIPS        : 847.05
    Features        : swp half thumb fastmult vfp edsp java tls
    CPU implementer : 0x41
    CPU architecture: 7
    CPU variant     : 0x0
    CPU part        : 0xb76
    CPU revision    : 7
    Hardware        : BCM2708
    Revision        : 0002
    Serial          : 000000000abc0ab1

    In this example I’ve got a PCB with a Revision code of 0002. That is a plain old “Model B Revision 1.0”.

    NOTE : The Revision number given in cpuinfo file is the hardware revision number. This is not the same as the Raspberry Pi Revision. In this example I have a Model B Revision 1.0 with a hardware revision code of 0002.

    Model Information

    With the latest version of Raspbian you can also retrieve the Pi model as a string by using :

    cat /proc/device-tree/model

    This will output the model information. For example :

    Raspberry Pi 3 Model B Rev 1.2


    上一篇:CJSON源码
    下一篇:XPRINTER-58 USB蓝牙打印机USB描述符