歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> Linux編程 >> skyeye下開發s3c6410x程序之----編寫helloworld

skyeye下開發s3c6410x程序之----編寫helloworld

日期:2017/3/1 10:01:49   编辑:Linux編程

helloworld.c文件如下:

根據s3c6410x的硬件信息可知uart0的發送寄存器地址為0x7f005020

/*************************************************************************
>File Name: helloworld.c
>Author: muge0913
>Mail: [email protected]
>Created Time: 2013年02月12日星期二 15時33分11秒
************************************************************************/
#defineUTXH0 ((volatile unsigned int *)(0x7f005020))
voidhelloworld(){
constchar * p = "helloworld--muge0913\n";
while(*p){
*UTXH0= *p++;
}
while(1);
}

skyeye.conf:

#skyeyeconfig file for s3c6410,os_test
arch:arm
cpu:arm11
mach:s3c6410x
#physicalmemory
mem_bank:map=M,type=RW,addr = 0x00000000,size =0x00800000,file=./helloworld.bin
#allperiherals IO mapping area
mem_bank:map=I,type=RW,addr = 0x70000000,size = 0x10000000
uart:mod= term

注:把內存的只是從0x00處開始是因為arm處理器上電後從0x00處開始運行。file=表示預先加載到這片內存的鏡像文件。boot=yes表示默認從此處啟動

編譯:

arm-elf-gcc-O2 -c helloworld.c
arm-elf-ld-e helloworld -Ttext 0x00 helloword.o helloword
arm-elf-objcopy-O binary helloworld helloword.bin

運行測試

$skyeye-main.py
$start
$run

相關鏈接:Ubuntu 12.04下安裝skyeye1.3.3 http://www.linuxidc.com/Linux/2013-02/79196.htm

更多Ubuntu相關信息見Ubuntu 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=2

Copyright © Linux教程網 All Rights Reserved