AnsweredAssumed Answered

Access "MCU device ID code" on STM32F103

Question asked by clark.roger on May 27, 2015
Latest reply on May 27, 2015 by peacock.jack.003
Hi,

I'm writing a bootloader, and need to determine the device density and flash size.

I can read the flash size OK, from memory address 0x1FFFF7E0

However I can't seem to read the "MCU device ID code" , which is described on page 1076 of RM0008

DBGMCU_IDCODE
Address: 0xE004 2000
Only 32-bits access supported. Read-only

"This code is accessible using the
JTAG debug port (4 to 5 pins) or the SW debug port (two pins) or by the user software. It is
even accessible while the MCU is under system reset."

However I just get zero when I read this address.

I can't see anything in the docs that say that there is a config register that needs to be enabled to read this register, and I don't have SWD or JPEG enabled by default in the bootloader code, as it doesn't need to communicate via SWD

I noticed that this memory address is "MCU DEVICE ID code located in the external
PPB memory map"  but I'm not sure if this makes any difference to the code that needs to read it

  uint32 *devID =    (uint32 *) (0xE0042000);

Thanks

Roger

Outcomes