问题描述
我有一块带有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.
原理是:
- 从寄存器
CPUID
位于地址0xe000ed00
上,因此可以在此文件stm32devices.py
- 读取
IDCODE_REG
(M0和M0 +的寄存器与M3,M4和M7的地址不同)前12位是DEV_ID
,它标识家族并再次查看stm32devices.py
文件 - 从寄存器
FLASH_SIZE_REG
中读取闪存大小(每个系列的寄存器都在不同的地址上),并通过stm32devices.py
文件再次标识具体的设备
- read
PART_NO
from registerCPUID
at address0xe000ed00
and with this is possible to identify if MCU is CortexM0, M3, M4, .. in this filestm32devices.py
- read
IDCODE_REG
(M0 and M0+ has this register on different address than M3, M4 and M7) first 12bits isDEV_ID
, which identify family and again look intostm32devices.py
file - read flash size from register
FLASH_SIZE_REG
(each family has this register on different address) and identify concrete device again bystm32devices.py
file
或者只是连接SWD并保持pystlink来检测正确的MCU.
Or simply connect SWD and keep pystlink to detect right MCU.
这篇关于通过JTAG恢复STM32 MCU的打磨痕迹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!