[Evaluation and experience of Zhongke Yihaiwei EQ6HL45 development platform] + ARM Cortex-M0 soft core processor (Part 3)
[Copy link]
5. Use Keil to compile and debug the program
Open Keil MDK and open the built-in uvproj project file. This project file is developed using an old version of Keil MDK. For the new version MDK5, messages such as "Unsupported device" and "Old version support files need to be installed" may be prompted.
Then just click Build to complete the compilation-link-file format conversion, and finally get the code.hex file we need. Note: This hex file is in Verilog-hex format, not the Intel-hex format we often use in MCU development.
5.1. Keil Project Settings
Pay attention to the project's setting options, including the ROM and RAM area location settings, file output, and debugging settings, as shown in the figure:
5.2. Keil simulation debugging software code
-
How to solve the error " ** * error 65: access violation at 0x0000000C : no 'read' permission" during Keil simulation
- Solution steps:
-
-
Option->Debug->Use_Simulator->CPU.DLL Parameter, change to -REMAP. Phenomenon: Still error, the memory address has changed: ** * error 65: access violation at 0x40023800: no 'read' permission
-
Option->Debug->Use_Simulator->Initialization_File, open and create a new .ini file, write map 0x40000000, 0x400FFFFF read write in it and save it (MAP is not case sensitive, note that there is a space between read and write, not a comma)
-
Then enter the Debugger
-
Alternatively, you can skip the second step and set the map after entering the Debugger: Debug->Memory_map, manually enter 0x40000000, 0x400FFFFF (there is an example of 0x4000FFFF above the input box, but this address value is not large enough, we need a larger 0x400FFFFF). The difference between step 2 and 4 is that every time you exit the Debugger, the settings in step 4 will be lost, which is more troublesome, so generally only use the method in step 2
-
It seems that this error of STM32F4 cannot be corrected by changing the DLL and its parameters in the settings. This is because there is no corresponding DLL file in the ARMBIN under the keil installation directory (view the file instructions through the "File Description" item~)
———————————————— Copyright Statement: This article is an original article by CSDN blogger "Maple_Leaf_15", which complies with the CC 4.0 BY-SA copyright agreement. Please attach the original source link and this statement for reprinting. Original link: https://blog.csdn.net/Maple_Leaf_15/article/details/51057991
Following the above steps, the screenshot of step 2 is as follows:
The screenshots of step 4 are as follows:
5.3. Debugging process and results
During debugging, you can enter the AHB2LED address 0x50000000 in the Memory window in the Keil Debug interface to view the value there. You can see that after executing the assembly code:
STR R0, [R1]
Afterwards, the value here changes between 0x55 and 0xAA as expected:
|