在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 1925|回复: 0

[资料] BSP配置文件及生成下载

[复制链接]
发表于 2012-11-1 21:40:36 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
BSP配置文件及生成下载
VxWorks BSP主要配置文件 config.h , Makefile 注解和 BSP生成下载实例。
相关内容可参考 VxWorks BSP和启动过程
Config.h文件注解 Makefile 文件注解 BSP生成下载过程实例
config.h

#ifndef INCconfigh
#define INCconfigh

#define BSP_VER_1_2 1
#define BSP_VER_1_1 1
#define BSP_VERSION "1.2"
#define BSP_REV "/3"
#include "configAll.h"



#define DEFAULT_BOOT_LINE \
"Emac(0,0)405GP:vxWorks h=172.16.1.159 e=172.16.254.52 \
u=xxx pw=xxx tn=vxTarget"

#undef LOCAL_MEM_AUTOSIZE
#define LOCAL_MEM_SIZE 0x02000000
#define LOCAL_MEM_LOCAL_ADRS 0x00000000
#define USER_RESERVED_MEM 0

#undef SDRAM_ECC_ENABLE

#define ROM_BASE_ADRS 0xfff80000
#define ROM_TEXT_ADRS (ROM_BASE_ADRS + 0x100)
#define ROM_WARM_ADRS (ROM_TEXT_ADRS+0x0004)
#define ROM_SIZE 0x0007f000
#define RAM_LOW_ADRS 0x00010000
#define RAM_HIGH_ADRS 0x00C00000
#define USER_RESERVED_MEM 0

#define INCLUDE_CACHE_SUPPORT
#define USER_D_CACHE_ENABLE
#define USER_I_CACHE_ENABLE
#undef USER_D_CACHE_MODE
#define USER_D_CACHE_MODE (CACHE_COPYBACK)

#define TIMER_CLOCK_EXTERNAL

#undef INCLUDE_TIMESTAMP

#ifdef TIMER_CLOCK_EXTERNAL
#define AUX_CLK_RATE_MIN (EXT_TIMER_CLK_FREQ / (1 << 21) )
#define AUX_CLK_RATE_MAX (EXT_TIMER_CLK_FREQ / (1 << 9) )
#define AUX_CLK_RATE_DEFAULT (EXT_TIMER_CLK_FREQ / (1 << 17) )
#else

#endif

#define WDT_RATE_MIN 1
#define WDT_RATE_MAX 5000

#define INCLUDE_RTC

#undef INCLUDE_EI
#undef INCLUDE_EX
#undef INCLUDE_ENP
#undef INCLUDE_LN
#undef INCLUDE_SM_NET
#undef INCLUDE_SM_SEQ_ADDR

#undef INCLUDE_SW_FP

#define INCLUDE_SERIAL

#define INCLUDE_PCI
#ifdef INCLUDE_PCI

//定义PCI设备的初始化地址 参见 PCI设备(网卡)初始化代码分析
# define PMM0_LOCAL_ADRS PCI_MEMORY_START // 定义PCI空间起始地址
# define PMM0_PCI_LOW_ADRS 0x80000000 // 定义PCI空间低位地址
# define PMM0_PCI_HIGH_ADRS 0x00000000 // 定义PCI空间高位地址
# define PMM0_PCI_MASK_ATTRIB (PMM_MASK_512MB | PMM_ENABLE)
# define PMM1_LOCAL_ADRS PMM_UNUSED
# define PMM1_PCI_LOW_ADRS PMM_UNUSED
# define PMM1_PCI_HIGH_ADRS PMM_UNUSED
# define PMM1_PCI_MASK_ATTRIB PMM_UNUSED
# define PMM2_LOCAL_ADRS PMM_UNUSED
# define PMM2_PCI_LOW_ADRS PMM_UNUSED
# define PMM2_PCI_HIGH_ADRS PMM_UNUSED
# define PMM2_PCI_MASK_ATTRIB PMM_UNUSED

# define PTM1_LOCAL_ADRS LOCAL_MEM_LOCAL_ADRS
# define PTM1_SIZE_ATTRIB PTM_SIZE_2GB | PTM_ENABLE
# define PTM2_LOCAL_ADRS PTM_UNUSED
# define PTM2_SIZE_ATTRIB PTM_UNUSED
#endif

#define INCLUDE_NETWORK
#define INCLUDE_EMAC_NETWORK
#undef INCLUDE_PCI_NETWORK

#ifdef INCLUDE_EMAC_NETWORK
#define DEFAULT_EMAC_HW_ADDR "xxxxxxxxxxxx"
#endif

#define WDB_COMM_TYPE WDB_COMM_SERIAL
#define WDB_TTY_CHANNEL 0
#else
#undef WDB_COMM_TYPE
#define WDB_COMM_TYPE WDB_COMM_SERIAL
#undef WDB_TTY_CHANNEL
#define WDB_TTY_CHANNEL 0
#endif

#ifdef NUM_TTY
#undef NUM_TTY
#endif
#define NUM_TTY 2
#ifdef WDB_TTY_BAUD
#undef WDB_TTY_BAUD
#endif
#define WDB_TTY_BAUD 57600
#ifdef CONSOLE_BAUD_RATE
#undef CONSOLE_BAUD_RATE
#endif
#define CONSOLE_BAUD_RATE 57600
#undef INCLUDE_ENV_VARS
#undef INCLUDE_TIMEX
#undef INCLUDE_HW_FP
#undef INCLUDE_TFTP_CLIENT
#define INCLUDE_SW_FP
#define INCLUDE_ELF
#define INCLUDE_NET_SHOW
#define INCLUDE_PING
#undef INCLUDE_DEMO
#define ETHERNET_ADR_SET
#define INCLUDE_USER_APPL
#undef PCIDEBUG
#ifdef INCLUDE_USER_APPL
#define USER_APPL_INIT _appEntry()
#endif
#endif
#if defined(PRJ_BUILD)
#include "prjParams.h"
#endif
Makefile
# Makefile - make rules for board
#
#*/
CPU = PPC40x
TOOL = gnu
TGT_DIR=$(WIND_BASE)/target
include $(TGT_DIR)/h/make/defs.bsp
include $(TGT_DIR)/h/make/make.$(CPU)$(TOOL)
include $(TGT_DIR)/h/make/defs.$(WIND_HOST_TYPE)
## Only redefine make definitions below this point, or your definitions will
## be overwritten by the makefile stubs above.
TARGET_DIR = xxx
VENDOR = IBM
BOARD = xxx
RELEASE = vxWorks vxWorks.st bootrom_uncmp.hex
USR_ENTRY = usrInit
# ROM_TEXT_ADRS, ROM_SIZE, RAM_HIGH_ADRS, 和RAM_LOW_ADRS 在config.h,Makefile和
Makefile.*文件中 # 都要定义,且必须要保持一致,
ROM_TEXT_ADRS = fff80100 # ROM 起始地址
ROM_SIZE = 0007f000 # ROM 空间大小
RAM_LOW_ADRS = 00010000 # RAM 低地址 vxWorks */
RAM_HIGH_ADRS = 00C00000 # RAM 高地址存储 bootrom */
HEX_FLAGS = -a 100
#ADDED_CFLAGS = -gdwarf -O0 # for debug
MACH_EXTRA = appentry.o # 注意:这里加载用户的程序模块,程序调用在usrRoot()
BOOTCONFIG = bootconfig.c # bsp bootconfig.c for bootrom
## Only redefine make definitions above this point, or the expansion of
## makefile target dependencies may be incorrect.
include $(TGT_DIR)/h/make/rules.bsp
include $(TGT_DIR)/h/make/rules.$(WIND_HOST_TYPE)
Tornado for x86下BSP的生成,下载和Target Server的配置实例,
Pentium主机,3Com网卡,软盘引导,ftp下载VxWorks映像。
1.在C:\Tornado\target\config\pcPentium目录下修改BSP文件config.h。
#elif (CPU_VARIANT == PENTIUM)
#define DEFAULT_BOOT_LINE
"elt(0,0)HOST:c:\\Tornado\\target\\config\\pcPentium\\vxWorks
h=90.0.0.3 e=90.0.0.50 u=target pw=target tn=target"
#define INCLUDE_ELT //3Com网卡
#define INCLUDE_END //END驱动
2.打开Tornado选择新建一个bootable vxworks image,选择建 A BSP,选择
pcPentium,建完后编译就可以在相应的目录下生成vxworks的映像文件。
3.制作bootrom;选择Build Boot Rom,选择pcPentium,再选择bootrom_uncmp,
生成 bootrom_uncmp。拷贝 bootrom_uncmp到host\x86-win32\bin下,插入空白
盘到软区,在dos界面进入目录host\x86-win32\bin下,用命令"mkboot a:
bootrom_uncmp "生成引导盘
4. 在Start > Programs > Tornado2 > FTP Server,点开Security下的
user/rights菜单,新建用户User Name:target,Password:target,Home
Directory为VxWorks映像所在目录如 C:\Tornado\target\config\pcPentium\。
注意这些配置要和config.h中的一致。
5.将bootrom的启动盘插入目标机的软驱,启动目标机,系统从软驱启动,随后登
陆FTP,从主机下载vxworks文件,目标机提示7秒内按任意键选择Boot方式(手工
,自动),手工方式可对FTP用户,口令,IP等参数进行修改。
通常是等待7秒后系统autoboot。
屏幕显示:
Attached TCP/IP interface to elt0.
Attaching network interface lo0... done. //TCP/IP网络连接成功
Loading... 602128 //通过ftp下载VxWorks映像
Starting at 0x01080000 //下载成功,从RAM_LOW_ADRS 0x01080000
开始执行VxWorks系统
Attached TCP/IP interface to elt unit 0
Attaching interface lo0...done //TCP/IP网络连接成功
(注意这里网络初始化成功和上边的不同,上边是Bootrom映像网络初始化来下载VxWorks,这里
VxWorks系统初始化网络。)
VxWorks
Copyright 1984-1998 Wind River Systems, Inc.
CPU: xxxx --- Intel x82
VxWorks: 5.4
BSP version: 1.2/4
Creation date: Jan xx 2001
WDB: Ready.
至此目标机系统启动完成。
6.配置Target Server下载应用程序.
打开Tornado,在Tools菜单下选择Target Sever再选择configure进行配置(Tools
> Target Server > Configure > New)给出Target Server名字描述如net00.在
(Target Server Properties > Back End)选择WdbRpc. Target Name/IP Address
框内输入Target的IP: 90.0.0.50.
Core File and Symbols选项(Target Server Properties > Core File and
Symbols): C:\Tornado\target\config\pcPentium\vxWorks等等。
配置的内容根据系统的具体情况定。点击Launch启动Target Sever,随后在主界
面下选择已启动的Target Sever就可以下载 *.o或*.out程序。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条

小黑屋| 手机版| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-11-16 07:37 , Processed in 0.012894 second(s), 7 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表