[开发工具] 如何通过STVP_CmdLine读写MCU的OTP数据

[复制链接]
777|3
 楼主| lanjackg2003 发表于 2020-10-26 14:42 | 显示全部楼层 |阅读模式
请问一下,如何通过STVP_CmdLine接口读取MCU的OTP数据
目前,STVP_CmdLine的使用帮助支持以下功能.
  1. Usage:STVP_CmdLine [-BoardName=STxxx] [-Port=xxx] [-ProgMode=xxx] [-Device=STxxx]
  2. [-Tool_ID=x]|[-NbTools=x] [-version] [-verbose]|[-no_verbose] [-log]|[-no_log] [-loop]|[-no_loop]
  3. [-help] [-no_progProg] [-no_progData] [-no_progOption] [-progress]|[-no_progress]
  4. [-warn_protect]|[-no_warn_protect] [-readProg] [-readData] [-readOption]
  5. [-erase]|[-no_erase] [-blank]|[-no_blank] [-verif]|[-no_verif]
  6. [-FileProg=fname.hex/s19] [-FileData=fname.hex/s19] [-FileOption=fname.hex/s19]
  7. With:
  8. [-BoardName=STxxx] ==========> Programming Tool name (ST-LINK, RLINK, STICE, ...)
  9. [-Tool_ID=x] ================> ST-LINK Programming Tool ID (0, 1, 2...)
  10. [-NbTools=x] ================> Number of ST-LINK Tools with same device connected (Tool_ID is automatically incremented)
  11. [-Port=xxx] =================> Communication Port (USB, LPT1)
  12. [-ProgMode=xxx] =============> Programming mode or protocol (SWIM, JTAG, SWD)
  13. [-Device=STxxx] =============> Device name (exact same name as in STVP)
  14. [-version] ==================> Display version of this application
  15. [-verbose] ==================> Display messages, warnings, errors
  16. [-log] ======================> Generate or append Result.log log file
  17. [-loop] =====================> Loop on actions until 'Space' key hit
  18. [-progress] =================> Display progress of each action
  19. [-warn_protect] =============> Message Box if programming Option Byte protection
  20. [-no_progProg] ==============> Do not program PROGRAM MEMORY (used to verify device from a file)
  21. [-no_progData] ==============> Do not program DATA MEMORY (used to verify device from a file)
  22. [-no_progOption] ============> Do not program OPTION BYTE (used to verify device from a file)
  23. [-readProg] =================> Read PROGRAM MEMORY
  24. [-readData] =================> Read DATA MEMORY
  25. [-readOption] ===============> Read OPTION BYTE
  26. [-erase] ====================> Erase the device (before programming)
  27. [-blank] ====================> Blank Check the device (before programming)
  28. [-verif] ====================> Verify the device after programming
  29. [-FileProg=fname.hex/s19] ===> File name to program PROGRAM MEMORY area (hex or s19)
  30. [-FileData=fname.hex/s19] ===> File name to program DATA MEMORY area (hex or s19)
  31. [-FileOption=fname.hex/s19] => File name to program OPTION BYTE area (hex or s19)
可以对PROGRAM MEMORY与OPTION BYTE进行读取,依OPTION读取为示例
  1. STVP_CmdLine.exe -BoardName=ST-LINK -ProgMode=SWD -Tool_ID=0 -Device=STM32F205xG -progress -readOPTION
  2. STVP_CmdLine version 1.6

  3. Verbose ON
  4. Log activity ON
  5. Display Progress ON
  6. Message box warning if protect option byte ON
  7. Loop mode ON
  8. Erase device OFF
  9. Blank check device OFF
  10. Verify device ON

  11. Configuration:
  12. BoardName=ST-LINK ST-LINK_ID=0 Device=STM32F205xG Port=USB ProgMode=SWD

  13. Hit 'Esc' key to abort during communication.

  14. >>> Reading OPTION BYTE
  15. 25 50 75 100 <<< Reading OPTION BYTE succeeds

由于其没有支持OTP数据参数,所以不知道如何读取OTP的数据。

如果传参使用-readData,命令行返回
  1. >>> Reading DATA MEMORY
  2. (API) ERROR : Unknown memory Area name
  3. <<< Reading DATA MEMORY fails





氧化二氢 发表于 2020-10-26 23:02 | 显示全部楼层
谢谢分享
香水城 发表于 2020-10-28 07:23 | 显示全部楼层

STLINK UTiltiy 也支持命令行,你用它试试。
 楼主| lanjackg2003 发表于 2020-11-13 12:52 | 显示全部楼层
香水城 发表于 2020-10-28 07:23
STLINK UTiltiy 也支持命令行,你用它试试。

是的,后面改用这个
解决了问题
您需要登录后才可以回帖 登录 | 注册

本版积分规则

56

主题

441

帖子

7

粉丝
快速回复 在线客服 返回列表 返回顶部