STM32F407 software simulation can not enter the main function solution

   Recently, when using the keil software simulation function to simulate the STM32F407 microcontroller, it was found that the main function could not be entered.
  The software simulation settings are as follows:
insert image description here
  When starting the simulation, it is always stuck at the Wait till HSE is ready block.
insert image description here
  After looking for a solution online for a long time, I finally got it. Let me share the solution with you.
First create a new one "新建文本文档.txt", change the file name and suffix "Debugconfig.ini"
insert image description hereinsert image description here
to

map 0x40000000, 0x40007FFF read write // APB1 

map 0x40010000, 0x400157FF read write // APB2 

map 0x40020000, 0x4007FFFF read write // AHB1 

map 0x50000000, 0x50060BFF read write // AHB2 

map 0x60000000, 0x60000FFF read write // AHB3 

map 0xE0000000, 0xE00FFFFF read write // CORTEX-M4 internal peripherals

After the content input is complete, save and exit.
insert image description hereNext, open the keil installation directory, copy
insert image description here
the newly created one "Debugconfig.ini"to the keil installation directory,
insert image description here
then click the magic wand tool in the keil software, switch to the Debug option setting interface,
insert image description here
then click Initiallization File, select the icon with the next three points,
insert image description here
and then select keil This file in the installation directory "Debugconfig.ini".
insert image description here
Click the OK button to save the settings. At this time, when using software simulation, you can directly enter the main function.

insert image description here

Guess you like

Origin blog.csdn.net/qq_20222919/article/details/129385312