本文介绍了通过JTAG恢复STM32 MCU的打磨痕迹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一块带有STM32 MCU的板.我想为该板制作自定义固件,因为库存极少.不幸的是,电路板制造商善良地磨掉了所有标记.是否可以通过jtag获取设备/家庭ID并将其交叉引用到型号?我所能找到的一切都是关于获取芯片的唯一ID的,这不是我所需要的.

I have a board with presumably an STM32 mcu. I want to make custom firmware for that board as the stock one is very buggy. Unfortunately the board manufacturers were kind enough to grind off all the markings. Is there any way to get the device/family id via jtag and cross reference it to a model number? Everything I could find was about getting the unique id of the chip, which is NOT what I need.

推荐答案

pystlink 中(SWD程序员) )是实现,几乎可以成功识别任何STM32 MCU.

In pystlink (SWD programmer) is implementation, which almost successfully identify any STM32 MCU.

原理是:

  1. 从寄存器 CPUID 位于地址0xe000ed00上,因此可以在此文件 stm32devices.py
  2. 读取IDCODE_REG(M0和M0 +的寄存器与M3,M4和M7的地址不同)前12位是DEV_ID,它标识家族并再次查看stm32devices.py文件
  3. 从寄存器FLASH_SIZE_REG中读取闪存大小(每个系列的寄存器都在不同的地址上),并通过stm32devices.py文件再次标识具体的设备
  1. read PART_NO from register CPUID at address 0xe000ed00 and with this is possible to identify if MCU is CortexM0, M3, M4, .. in this file stm32devices.py
  2. read IDCODE_REG (M0 and M0+ has this register on different address than M3, M4 and M7) first 12bits is DEV_ID, which identify family and again look into stm32devices.py file
  3. read flash size from register FLASH_SIZE_REG (each family has this register on different address) and identify concrete device again by stm32devices.py file

或者只是连接SWD并保持pystlink来检测正确的MCU.

Or simply connect SWD and keep pystlink to detect right MCU.

这篇关于通过JTAG恢复STM32 MCU的打磨痕迹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-28 17:28