This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to set DBGMCU_CR register on MDK?

IDE:MDK5.23.0.0

MCU:STM32F103RET6

Code generate:STM32CubeMX

Q1:How to set the DBGMCU_CR register on MDK?

I tried two solutions to set DBGMCU_CR on MDK, but failed.

Solution 1

Add the conf_STM32F103RE.ini file on Options->Debug->Initialization file.

It seems the settings is invalid.

When the system run the main function first line, the DBGMCU_CR is 0x00000307.

Q2:The reason why the system run to main function theDBGMCU_CR is 0x00000307?It says the reset value is 0x00000000 in rm0008.

Solution 2

Exchange the file at DebugConfig folder and set the DbgMCU_CR from 0x00000007 to 0x00000000.

The DbgMCU_CR register value is 0x00000007 after compile.

Q3:The reason why the original DbgMCU_CR is 0x00000007?What settings on mdk caused this result?

Both two solutions failed, when the system run the main function first line, the DBGMCU_CR is 0x00000307.

I want to set the DBGMCU_CR register to 0x00000000, so the IWDG will reset the system when the system in stop mode.

If I set the DBGMCU_CR register to 0x00000000 on main function, the IWDG will reset the system when the system in stop mode.

Thanks for your attention.

Parents
  • Not sure which version of STM32F103 DFP you are using. If it is not the latest one with v2.3.0 then download the latest packs and check the updated .ini file or the .dbgconf file.

    "Q1:How to set the DBGMCU_CR register on MDK?"

    --> You can either set it in .ini file or .dbgconf file.

    Q2 and Q3 are related and the simple answer is to check the last screenshot that you attached.

    These settings are device-specific and not depends on the mood of the user.

Reply
  • Not sure which version of STM32F103 DFP you are using. If it is not the latest one with v2.3.0 then download the latest packs and check the updated .ini file or the .dbgconf file.

    "Q1:How to set the DBGMCU_CR register on MDK?"

    --> You can either set it in .ini file or .dbgconf file.

    Q2 and Q3 are related and the simple answer is to check the last screenshot that you attached.

    These settings are device-specific and not depends on the mood of the user.

Children