开发环境搭建
VirtualBox
Ubuntu
RaiDrive
MobaXterm
SourceInsight
BeyondCompare
交叉编译工具链
环境变量
/home/xlbtlmy/Desktop/IMX6/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin
led.s
.global _start
_start:
ldr r0, =0X020C4068
ldr r1, =0XFFFFFFFF
str r1, [r0]
ldr r0, =0X020C406C
str r1, [r0]
ldr r0, =0X020C4070
str r1, [r0]
ldr r0, =0X020C4074
str r1, [r0]
ldr r0, =0X020C4078
str r1, [r0]
ldr r0, =0X020C407C
str r1, [r0]
ldr r0, =0X020C4080
str r1, [r0]
ldr r0, =0X020E0068
ldr r1, =0X5
str r1,[r0]
ldr r0, =0X020E02F4
ldr r1, =0X10B0
str r1,[r0]
ldr r0, =0X0209C004
ldr r1, =0X0000008
str r1,[r0]
ldr r0, =0X0209C000
ldr r1, =0
str r1,[r0]
loop:
b loop
Makefile
ARM_LINUX_IMX6=/home/xlbtlmy/Desktop/IMX6/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin
PREFIX_IMX6=arm-linux-gnueabihf-
CC=$(ARM_LINUX_IMX6)/$(PREFIX_IMX6)gcc
LD=$(ARM_LINUX_IMX6)/$(PREFIX_IMX6)ld
OBJCOPY=$(ARM_LINUX_IMX6)/$(PREFIX_IMX6)objcopy
OBJDUMP=$(ARM_LINUX_IMX6)/$(PREFIX_IMX6)objdump
#TARGET=$(OPT)
TARGET=led
BIN=$(TARGET).bin
ELF=$(TARGET).elf
DIS=$(TARGET).dis
$(BIN):$(TARGET).o
$(LD) -Ttext 0X87800000 $^ -o $(ELF)
$(OBJCOPY) -O binary -S -g $(ELF) $(BIN)
$(OBJDUMP) -D $(ELF) > $(DIS)
%.o:%.s
$(CC) -g -c -o $@ $<
clean:
rm -rf *.o *.bin *.elf *.dis
|