22.3. ID codes and locking mechanism
Here are several ID codes inside the MCU. It is recommended that Keil, IAR and other tools use
this ID Code (located at 0x4001 5800 ) locks debugging.
After the chip is powered on, the hardware reads the 0x1FFF 0FF8 address of the flash 's factory
config. byte and loads it into the DBG _IDCODE register.
Do not read the RM for py32f002b, there are many errors.
Better read RM for PY32L020, it's the same thing, it's the same chip inside.
And all the features of the PY32L020 are in PY32F002B, (48 MHz, deepstop, all Vrefbuf).
for PY32F002B -
"After the device is powered on, the hardware reads the factory config of the flash. byte's 0x1FFF 01F8
address, loaded into the DBGMCU_IDCODE register."