Jenchen · 2020年03月09日

How to debug a no-source project using Keil MDK

Below is step-by-step way of debugging a project wihout building the porject locally.

Step 1: Create a project with no source.

Step 2: Select device. STAR is Armv8-M mainline architecture processor but CMSIS-PACK for STAR processor is not ready. Please select ARMCM33_DSP_FP_TZ temporary(Of course you should select the other according to what features being concluded)

Step 3: manage run-time environment according to the application. CMSIS-CORE and Device-Startup must be selected. (if you can not see valid version on the right side, you should first use “packet installer” to install the relevant packets)

Be aware that Keil assists to validate the configuration. For instance, when tick “Keil RTX5”, in “Sel.” Column a mark in yellow will appear. At the same time the tips will be in the validation output grid. After ticking “RTOS2:Keil RTX5” as required by the hint, the yellow will disappear.

Now the project has been created. Let’s go on
Step 4: connect to star and begin debugging.
Click “option for target” on the GUI or just press “ALT”+”F8” on the keyboard to call the option setup window as below picture shows. Change to “Debug” tab, choose debugger and then click “setting” to enter the Driver setup sub-window.Iif the right IDCODE and Device name appears, then it means Keil has connected to Star by the debugger successfully.
On the other hand, the software image file should be burned into the board, take ThreadX.stress case on MPS2 as an example, you should put stress.elf into the SD of the MPS2 as below:

And define which elf to run.

After the board has powered up, click “debug” button on the uvision to enter debug mode.

In case of “can’t load xxx.axf” issue, remove the tick of “Load Application at Startup”.

The snapshot of debugger GUI:
15.png

There are many useful information, except source code: the general info like Register, Memory,symbol, call stack, etc. as well as the dedicated info like NVIC, Fault report, MPU, etc.

Remember to use the image file that contains debug info like .elf, .axf rather than .bin or .hex.
Then you can get disassembling code to control the running and debugging even if you have no source code.

推荐阅读
关注数
2911
内容数
13
“星辰”处理器是安谋科技CPU设计团队设计的一款嵌入式处理器,基于最新的Armv8-M架构,可用于微控制器或者集成片上系统等芯片类型。
目录
极术微信服务号
关注极术微信号
实时接收点赞提醒和评论通知
安谋科技学堂公众号
关注安谋科技学堂
实时获取安谋科技及 Arm 教学资源
安谋科技招聘公众号
关注安谋科技招聘
实时获取安谋科技中国职位信息