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:
When starting the simulation, it is always stuck at the Wait till HSE is ready block.
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"
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.
Next, open the keil installation directory, copy
the newly created one "Debugconfig.ini"
to the keil installation directory,
then click the magic wand tool in the keil software, switch to the Debug option setting interface,
then click Initiallization File, select the icon with the next three points,
and then select keil This file in the installation directory "Debugconfig.ini"
.
Click the OK button to save the settings. At this time, when using software simulation, you can directly enter the main function.