(2)watdog(c写)

test.c:

#define VIC0INTENABLE   (*(volatile unsigned long *)0x71200010)

#define VIC0INTSELECT   (*(volatile unsigned long *)0x7120000C)
#define VIC0SOFTINT       (*(volatile unsigned long *)0x71200018)

int (*printf)(char *,...) = (void *)0x57e11d4c;//0x57e11d4c  u-boot中的打印函数。
int main()
{
__asm__ __volatile__(
"mrs r0,cpsr\n"
"bic r0,r0,#0x80\n"
"msr cpsr,r0\n"
:
:
:"r0","memory"
);
VIC0INTENABLE |=(1<<26);
VIC0INTSELECT &=~(1<<26);
VIC0SOFTINT |=(1<<26);

}


*******************************************************************

makefile:

all:

arm-none-linux-gnueabi-gcc -c vector.s -o vector.o

arm-none-linux-gnueabi-ld -Ttext=0 vector.o -o vector

arm-none-linux-gnueabi-objcopy -Ielf32-littlearm -O binary vector vector.bin

cp vector.bin /tftpboot/

arm-none-linux-gnueabi-gcc -c test.c -o test.o

arm-none-linux-gnueabi-ld -Ttext=0x50000000 test.o -o test

arm-none-linux-gnueabi-objcopy -Ielf32-littlearm -O binary test test.bin

cp test.bin /tftpboot/

clean:

rm -rf *.o *.bin   /tftpboot/*.bin


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值