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.

[参考译文] CC2540:读取芯片 ID

Guru**** 633810 points
Other Parts Discussed in Thread: CC2541, CC2540
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1126175/cc2540-read-chip-id

器件型号:CC2540
Thread 中讨论的其他部件:CC2541CC 调试器

您好!

你好。

客户希望通过使用 SmartRFProgConsole.exe 读取 CCDebugger 连接到 PC 的电路板上的芯片 ID

他有两个不同的程序:一个用于 CC2540、另一个用于 CC2541、因此他希望自动检测芯片并使用正确的程序对其进行编程。

请提供建议。 非常感谢。

此致、

Ray Vincent

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    寄存器 CHIPID (0x624A)包含芯片识别号、可用于评估器件是 CC2540还是 CC2541。

    调试命令 GET_CHIP_ID 允许读取前面提到的寄存器的内容:

    我希望这将有所帮助、

    此致、

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好 Clement、

    你好。  感谢您的回答、但我们通常如何发出调试命令、具体如何发出 get_chip_ID? 请提供建议。

    此致、

    Ray Vincent

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Ray:

    此 E2E 主题上提供了可能的 SmartRFProgConsole 命令列表。  

    SmartRFProgConsole [Target][Actions][File][Interface Slow][Change / IEEE address][Flash lock][Bootloader ID]
    The order of the parameters is irrelevant.
    
    Target: [S][AU][AS][B]
    S     System-on-Chip (programmed via USB)
          Type S(n), where n is the board ID number, to select a specific EB.
          Otherwise, if there are multiple boards, the one to be programmed will be
          selected at random.
    AU    EB application (programmed via USB)
          Type AU(n), where n is the board ID number, to select a specific EB.
          Otherwise, if there are multiple boards, the one to be programmed will be
          selected at random.
    AS(n) EB application (programmed via the EC2 adapter on serial port COMn).
          (only SmartRF04EB)
    B(n)  EB bootloader (programmed via the EC2 adapter on serial port COMn).
          (only SmartRF04EB)
    
    Actions to perform: [P][EP][EPV][EPVC][PV][PVC][V][R][RP][EP][WP][CE]
    P     Program                                                  (all targets)
    EP    Erase and program                                        (all targets)
    EPV   Erase, program and verify                                (all targets)
    EPVC  Erase, program and verify (CRC each page=>faster)        (only target S)
    PV    Program (append) and verify                              (only target S)
    PVC   Program and verify (CRC each page=>faster)               (only target S)
    V     Verify against hex or hem file                         (targets S, AS, B)
    VC    Verify against hex or hem file (CRC each page=>faster) (targets S, AS, B)
    R     Read into hex file                                       (only target S)
    RP=   Read flash page into binary file                         (only target S)
    EP=   Erase flash page                                         (only target S)
    WP=   Write flash page from binary file                        (only target S)
    EWP=  Erase and Write flash page from binary file              (only target S)
    CE    Full chip erase                                          (only target S)
    
    File: F="f"
    "f"   Flash image file name (intel hex file (*.hex), or hex merge file (*.hem))
          A merge file can contain one or more file/change specifications.
          See "example.hem" for how to create one.
    
    Interface Slow(Target = S): [IS]
    IS    Program SoC (System on chip) with reduced speed on the debug interface.
    
    Change hex file before programming (e.g. for serial number): [A=a,D=d][EKF="f"]
    A=a,D=d     Change one or more bytes in the hex file before downloading it.
    a     Hexadecimal address (e.g. 2C03, 01BC25)
    d     One or more bytes to be changed, in hexadecimal format, separated with
          dots (e.g. 4B, 1.2.3.A.B.C, 12.34.56.AB.CD.EF or 12.3.AB)
    EKF   Patch hex file with Encryption Key data.
    "f"   Certificate file from Certicom with encryption key data.
    
    IEEE MAC address related options [KI(F=f)] [RI(F=f,[PRI][SEC])] [WI(F=f,I=i)]
    (only CC243x, CC253x and CC254x)
    KI(F=f)     Keep the IEEE MAC address currently on the chip when programming it
    RI(F=f,[PRI][SEC]) Read out the IEEE MAC address currently on the chip
           For devices with both a primary and a secondary address, the option "PRI"       or "SEC" can be used to specify which to read. "PRI" is default.
    WI(F=f,I=i) Write the given IEEE MAC address to the chip when programming it
    f     The chip's flash size in kB (only used for CC243x)
          CC243x:  32, 64, or 128  (determines the location of the IEEE address)
          CC253x, CC254x:  set to 0        (not used)
    i     IEEE MAC address to write in hexadecimal format, separated
          with dots (e.g. 00.12.4B.00.00.00.00.01).
          8 bytes for CC243x and CC253x, and 6 bytes for CC254x.
    
    Flash lock (Target = S): [L(c)][LB(c)][LD(c)][LA(c)][LP(x-y)][LD][LPD(x-y)]
    "L(c), LB(c), LD(c), LA(c)" only CC243x, cc111x and CC251x. "LP(x-y), LD, LPD(x-y)" only CC253x and CC254x
    c     Code for write protection of the upper section of the flash:
          CC111x, CC251x: 0=All, 1=24 kB, 16 kB,  8 kB, 4 kB, 2 kB, 1 kB, 7=None
          CC2430, CC2431: 0=All, 1=64 kB, 32 kB, 16 kB, 8 kB, 4 kB, 2 kB, 7=None
    L(c)     Write protect section only (L(7) is equal to omitting this parameter)
    LB(c)    Write protect section + boot block
    LD(c)    Write protect section, and block debug commands
    LA(c)    Write protect section + boot block, and block debug commands
    LP(x-y)  Write protect flash pages from page x to page y.
             Several ranges can be given separated with a comma:
             E.g. LP(0-26,48-126), LP(0,1,2,8-10).
    LD       Block debug commands
    LPD(x-y) Write protect flash pages and block debug commands.
    
    Bootloader ID (Target = B): I=i
    i     Becomes the EB ID number when programming new bootloader. Use 1-4 digits
          (e.g. 0123, 3, or 45). Important: EBs that are used on the same computer
          must have unique ID numbers!
    
    Read/Erase/Write Flash page options: RP=n, EWP=n, WP=n, EP=n
    n     The Page number
    
    Examples:
    SmartRFProgConsole S EPV F=C:\test.hex A=135,D="1 23 45"
    SmartRFProgConsole S P F="C:\test.hex"
    SmartRFProgConsole EPV AU(0123) F=D:\Test.hex
    SmartRFProgConsole B(1) EPV "F=C:\Filename with spaces.hex" I=1234
    SmartRFProgConsole S EP F="C:\Test flash lock.hex" LB(3)
    SmartRFProgConsole S EP F="C:\Test flash lock.hex" LD
    SmartRFProgConsole S EP F="C:\Test flash lock.hex" LP(0-126)
    SmartRFProgConsole S EP F="C:\Test flash lock.hex" LPD(0-126)
    SmartRFProgConsole S EPV F="C:\test.hex" WI(F=0,I=00.12.4B.00.00.00.00.01)
    SmartRFProgConsole S EPV F="C:\test.hex" KI(F=1)
    SmartRFProgConsole S EPV F="C:\test.hex" EKF=certificate_example.txt
    SmartRFProgConsole S PVC F="C:\test.hex"
    SmartRFProgConsole S RP=1 F="C:\test.bin"
    SmartRFProgConsole S EP=1
    SmartRFProgConsole S WP=1 F="C:\test.bin"
    SmartRFProgConsole S EWP=1 F="C:\test.bin"
    
    To list all connected EBs/programmers (max 64):
    SmartRFProgConsole X
    
    Status messages are printed to stdout, error messages to stderr.
    
    Return Codes:
          0 = Success
          1 = System error
          2 = Parameter error
          3 = Illegal parameter combinations
          4 = Missing parameters
          5 = Missing image file or communication error

    它似乎不是为了发出 get_chip_ID 命令或读取通用 XDATA 内存空间而设计的。  下面也是 SmartRF 闪存编程器用户手册。  他们可以考虑第三方解决方案、例如 cc-tool。

    此致、
    Ryan

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Ryan、

    你好。 请参阅以下客户对您的回复的回复。 非常感谢。

    为了能够从 CC2541/CC2540读取 CHIP_ID、我需要做什么? 它是否可以由 PC 和 CCDebugger 完成? 如果不是、是否可以通过其他方式来实现? 如果是、我需要什么硬件、我需要什么软件、从哪里可以获得?

    此致、

    Ray Vincent

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    GET_CHIP_ID 可与 PC 以及连接到 CC254x 器件的 CC 调试器硬件配合使用。  您可以使用 SMARTRFTM-Studio 或 FLASH-PROGRAMMER GUI 查看芯片识别、但对于命令行解决方案、您可以考虑前面提到的 cc-tool 选项。

    此致、
    Ryan

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Ryan、

    你好。 请查看客户的另一个回复。 非常感谢。

    因此、有一个命令行解决方案。 听起来不错。 您写了:"但对于命令行解决方案、您可以考虑前面提到的 cc-tool 选项"。 但是、我仍然不明白您所指的命令行。 我不知道什么是 cc 工具。 唯一的命令行工具"之前提到过"是:SmartRFProgConsole.exe。 但您还写道:"似乎不是为了发出 get_chip_ID 命令或读取通用 XDATA 内存空间而设计的。 因此、请告诉我应该使用哪个命令行来读取芯片 ID、以及应该使用哪些参数。

    此致、

    Ray Vincent

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    https://manpages.ubuntu.com/manpages/focal/en/man1/cc-tool.1.html 
    https://github.com/dashesy/cc-tool 

    有一个测试选项可以打印目标信息。  我没有亲自测试过它。

    此致、
    Ryan