Windows下ARM编程实验

一.环境搭建

1.汇编集成环境:Keil uVision5,可网上查找破解版与基本使用方式
2.由于实验基于ARM9进行,因此需要继续安装ARM9支持包,具体安装方式可参考此链接:MDK5搭建ARM9开发环境

二.Keil运行c/c++程序提示错误

1.Error: L6630E: Invalid token start expected number or ( but found n at position 5 on line 5
解决方法:
在options 的Linker选项卡中不要选择 【Use Memory Layout from …】,并且把下边自动生成的Scatter file文本框清空。

2. L6218E: Undefined symbol Image ERROM1 RO$$Length (referred from s3c2440.o).
解决方法:
options的Asm选项卡下的define栏中输入__EVAL,即定义__EVAL

三.Arm汇编程序(.s)调用c/c++函数

1.在c/c++文件内定义函数
2.假设调用函数名为int Ledlamp(),则需要在文件头写入:IMPORT Ledlamp
3.若提示错误:Error: L6238E: test.o(DATA) contains invalid call from '~PRES8 (The user did not require code to preserve 8-byte aligment of 8-byte data objects)' function to 'REQ8 (Code was permitted to depend on the 8-byte aligment of 8-byte data items)' function Ledlamp.
解决方法:
在汇编文件的开头,添加“PRESERVE8”指令

;for example
PRESERVE8
IMPORT Ledlamp
AREA |DATA|,CODE,READONLY
ENTRY

LDR R13,=0x1000
BL Ledlamp
END

Related post

  1. Shiro基本使用

    2020-10-31

  2. linux文件系统

    2020-11-27

  3. hadoop框架概述

    2021-09-17

  4. Linux运行程序与shell编程

    2020-12-08

There are no comment yet.

COMMENT

Take a Coffee Break

Recommend post

  1. 常用工具指令

    2022-09-18

Category list

ABOUT

Welcome to FullStar, a captivating online destination where the realms of software development and personal reflections intertwine.

April 2025
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
282930  

Life Logs

  1. 回首

    2023-07-14

Return Top