Chinaunix首页 | 论坛 | 博客
  • 博客访问: 472536
  • 博文数量: 223
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 2145
  • 用 户 组: 普通用户
  • 注册时间: 2014-03-01 10:23
个人简介

该坚持的时候坚持,该妥协的时候妥协,该放弃的时候放弃

文章分类

全部博文(223)

文章存档

2017年(56)

2016年(118)

2015年(3)

2014年(46)

我的朋友

分类: 嵌入式

2016-09-19 23:17:41

1、集成开发环境

2、准备工作
从 sd/nor flash启动
格式化nand flash
 硬件连接:
1、Jlink连接
2、串口连接
3、nand启动
3、安装gdb server
tar xvzf arm-linux-gdb-7.5.tar.gz
./build-all
出错情况:configure: error: no termcap library found
make[1]: *** [configure-gdb] Error 1
make[1]: Leaving directory `/home/doctmp/part1/lesson1/ARM-tools/arm-linux-gdb-7.5/gdb-7.5'
make: *** [all] Error 2
最后在REHL的Package中找到了解决办法,安装ncurses-devel。
4、安装Jlink软件
tar xvzf JLink_Linux_V434a.tgz
cp -d libjlinkarm.sl* /usr/lib
cp 45-jlink.rules /etc/udev.rules.d/
 ./JLinkGDBServer 
5、安装eclipse
tar xvzf eclipse-cpp-helios-SR2-linux-gtk.tar.gz
出错提示:没有jdk或jre.Package包中找Open JDK安装
./eclipse >>help>>install newsoftware>>work with>> next finish(很漫长)
6、调试
导入led文件成为工程文件
project >>去掉Build Automatically
选择debug configurations
main:
gdb debugger选择arm-linux-gdb
commands:输入init2400文件
# connect to the J-Link gdb server
target remote localhost:2331
# Set JTAG speed to 30 kHz
monitor endian little
monitor speed 30
# Reset the target
monitor reset
monitor sleep 10
#
# CPU core initialization (to be done by user)
#
# Set the processor mode
monitor reg cpsr = 0xd3
#config MMU 配置MMU
#flush v3/v4 cache
monitor cp15 7, 7, 0, 0 = 0x0
#/* flush v4 TLB  协处理器*/
monitor cp15 8, 7, 0, 0 = 0x0
#disable MMU stuff and caches
monitor cp15 1, 0, 0, 0 =0x1002
#Peri port setup
monitor cp15 15, 2, 0, 4 = 0x70000013
#disable watchdog kangear 关闭看门狗
monitor MemU32 0x53000000  =  0x00000000
monitor sleep 10
#disable interrupt kangear 关闭中断
monitor MemU32 0x4A000008  =  0xffffffff
monitor MemU32 0x4A00001C  =  0x7fff
 
#set clock 
 
#initialize system clocks --- locktime register
monitor MemU32 0x4C000000 = 0xFF000000
     
#initialize system clocks --- clock-divn register
monitor MemU32 0x4C000014 = 0x5            #CLKDVIN_400_148
     
#initialize system clocks --- mpll register
monitor MemU32 0x4C000004 = 0x7f021    #default clock
 
 
#config sdram
monitor MemU32 0x53000000 0x00000000  
monitor MemU32 0x4A000008 0xFFFFFFFF  
monitor MemU32 0x4A00001C 0x000007FF  
monitor MemU32 0x53000000 0x00000000  
monitor MemU32 0x56000050 0x000055AA  
monitor MemU32 0x4C000014 0x00000007  
monitor MemU32 0x4C000000 0x00FFFFFF  
monitor MemU32 0x4C000004 0x00061012  
monitor MemU32 0x4C000008 0x00040042  
monitor MemU32 0x48000000 0x22111120  
monitor MemU32 0x48000004 0x00002F50  
monitor MemU32 0x48000008 0x00000700  
monitor MemU32 0x4800000C 0x00000700  
monitor MemU32 0x48000010 0x00000700  
monitor MemU32 0x48000014 0x00000700  
monitor MemU32 0x48000018 0x0007FFFC  
monitor MemU32 0x4800001C 0x00018005  
monitor MemU32 0x48000020 0x00018005  
monitor MemU32 0x48000024 0x008E0459  
monitor MemU32 0x48000028 0x00000032  
monitor MemU32 0x4800002C 0x00000030  
monitor MemU32 0x48000030 0x00000030 
  
# Setup GDB for faster downloads
#set remote memory-write-packet-size 1024
monitor speed auto
break _start
load

阅读(598) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~