简体   繁体   English

使用Keil Uvision 4模拟汇编代码(arm cortex m3)

[英]simulate assembly code (arm cortex m3) with keil uvision 4

I used this guide Simulating ARM code which shows how to simulate assembly code (arm 7 little endian) and works perfectly well. 我使用了本指南《 模拟ARM代码》 ,该指南展示了如何模拟汇编代码(arm 7 little endian),并且效果很好。 I just changed the device from arm 7 little endian to arm cortex m3 and these are the errors : 我只是将设备从arm 7 little endian更改为arm cortex m3,这些是错误:

Build target 'Target 1' 
assembling test.s...
linking...
sa.axf: Error: L6320W: Ignoring --entry command. Cannot find argument 'Reset_Handler'.
sa.axf: Warning: L6320W: Ignoring --first command. Cannot find argument '__Vectors'.
Target not created

I believe that the problem is that my project doesn't have some startup files.If this is the case how i can fix this? 我相信问题是我的项目没有启动文件。如果是这种情况,我该如何解决?

The Cortex-M family uses a different exception model from "clasic ARM" and thus needs different startup. Cortex-M系列使用与“经典ARM” 不同的异常模型 ,因此需要不同的启动。 I'm not sure how Keil works with it, but maybe try adding a Reset_Handler label at the start of your code. 我不确定Keil是如何工作的,但是也许尝试在代码的开头添加一个Reset_Handler标签。 You may also need to add a startup file with vector definitions. 您可能还需要添加带有矢量定义的启动文件。 It might be easier to use some of the examples they should have provided, or a new project wizard if it has one. 使用他们应该提供的一些示例或使用新的项目向导(如果有)可能会更容易。

Obviously the main() function entry point was previously defined as 'Reset_Handler' function, and now you don't have it in your project so that linker complained. 显然,main()函数的入口点以前已定义为'Reset_Handler'函数,现在您的项目中没有该函数,因此链接器会抱怨。 And it is probably just a beginning of your problems. 这可能只是您问题的开始。

If you want to port existing example from ARM7 architecture to Cortex M3, it might not be good idea if you used assembler since those are very different architectures. 如果要将现有示例从ARM7架构移植到Cortex M3,则使用汇编器可能不是一个好主意,因为它们是非常不同的架构。

If you absolutely have to do it, than at least find some working example for the new architecture (does not have to do what you need), and start from there in order to have a working start up file, tool set project file(s), and known good working environment in general. 如果绝对必须这样做,那么至少要找到新架构的一些可行示例(不必做您需要做的事),然后从那里开始,以便拥有一个正常运行的启动文件,工具集项目文件。 ),并且总体而言已知良好的工作环境。 Then start porting old stuff one step at the time. 然后一步一步开始移植旧东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM