在线时间2 小时
UID3111323
注册时间2015-3-28
NXP金币0
该用户从未签到
新手上路

- 积分
- 13
- 最后登录
- 2015-4-19
|
本帖最后由 popsnake 于 2015-4-6 17:39 编辑
感觉脱机后就没有跑起来,下面是PRM配置:
/* This is a linker parameter file for the fxth870000 */
NAMES END /* CodeWarrior will pass all the needed files to the linker by command line. But here you may add your own files too. */
SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */
Z_RAM = READ_WRITE 0x0090 TO 0x00FF;
RAM = READ_WRITE 0x0100 TO 0x028F;
/*ROM = READ_ONLY 0xC000 TO 0xDFBF;*/
ROM = READ_ONLY 0xC000 TO 0xDFFD;
INTVECTS = READ_ONLY 0xDFFE TO 0xDFFF; //Reserved for Interrupt Vectors
PARAM = READ_WRITE 0x0050 TO 0x008D;
FMW_PARAM = READ_WRITE 0x008E TO 0x008F;
END
PLACEMENT /* Here all predefined and user segments are placed into the SEGMENTS defined above. */
DEFAULT_RAM, /* non-zero page variables */
INTO RAM;
_PRESTART, /* startup code */
STARTUP, /* startup data structures */
ROM_VAR, /* constant variables */
STRINGS, /* string literals */
VIRTUAL_TABLE_SEGMENT, /* C++ virtual table segment */
DEFAULT_ROM,
COPY /* copy down information: how to initialize variables */
INTO ROM;
_DATA_ZEROPAGE, /* zero page variables */
MY_ZEROPAGE INTO Z_RAM;
/* PARAM registers */
BATTERY_BACKED_RAM INTO PARAM;
FMW_BATTERY_BACKED_RAM INTO FMW_PARAM;
END
STACKSIZE 0x30
VECTOR ADDRESS 0xDFFE _Startup
//VECTOR 0 _Startup
编译后的固件.s19文件解析:
S0270000465854483837787830325F537461727465725F50726F6A6563745F52656C32392E61627312
S123C00045013294CCC007A7FDCDC0569BAE018C960100C6180AA5102703CF005C5FCDC0AB//启动向量指向_Startup,初始化栈指针
S123C02061956F017F5F8C960050960052960054960056956F024501006C0126017CC60165
S123C04001A50126031104651004A5012604110020CF100020CBA60DC71809A632C718025F
S123C060811001100310001301130312001501150314001005100710041205120712048C77
S114C0805F818080808080808080808080808080804B
S123DFE0C090C08FC08EC08DC08CC08BC08AC089C088C087C086C085C084C083C082C00016 //启动向量
S9030000FC
函数实现:
#pragma CODE_SEG DEFAULT
void main(void)
{
/* Initial Setup */
vfnSetupMCU();
//vfnSetSTOPMode(STOP4);
//EnableInterrupts;
DisableInterrupts
my_test=1;
/* Next, check if this is the first time we're executing code */
if(SPMSC2_PDF == CLEAR)
{
/* This is the first time */
//vfnSetPWU(); /* Set periodic wake up */
//vfnSetRDE(&tRDEData); /* RDE only needed for backwards compatibility */
// TPMS_INTERRUPT_FLAG = CLEAR; /* Clear interrupt flag */
//TPMS_CONT_ACCEL_GV = CLEAR; /* Clear CONT flag */
}
else
{
/* this is not the first time. */
/* only PWU should wake us up every second, so flag it for RDE */
//tRDEData.u8ElapsedTime = 1u;
}
PTAPE_PTAPE0=1;
PTADD_PTADD0=1;
for(;;)
{
my_test++;
PTAD_PTAD0=(my_test%2);
} /* loop forever */
}
void vfnSetupMCU(void)
{
/* enable bandgap for V, T measurements, enable stop4 mode */
SPMSC1 = (SPMSC1_BGBE_MASK | SPMSC1_LVDE_MASK | SPMSC1_LVDSE_MASK);
/* enable STOP mode, Enable RFM, disable COP */
SIMOPT1 = ((SIMOPT1_STOPE_MASK | SIMOPT1_RFEN_MASK | SIMOPT1_BKGDPE_MASK) \
& (~((UINT8)SIMOPT1_COPE_MASK)));
//SIMOPT1 =(( SIMOPT1_RFEN_MASK | 0) \
// & (~((UINT8)SIMOPT1_COPE_MASK)));
}
Auto-detection is successful.
File is of type Motorola S-Record Format.
Device FXTH870000_FLASH
Erasing ..........
Erase Command Succeeded.
Device FXTH870000_FLASH
cmdwin::fl::write
-------------------------
Flash Operation. ...
Auto-detection is successful.
File is of type Motorola S-Record Format.
Device FXTH870000_FLASH
Programming .....
Device FXTH870000_FLASH
Program Command Succeeded
Flash Operation. done
fl::target -lc "LC for Simple Flash"
fl::target -b 0x90 0x200
fl::target -v off -l off
cmdwin::fl::device -d "FXTH870000_FLASH" -o "8kx16x1" -a 0xc000 0xdfff
cmdwin::fl::protect all off
Beginning Operation ...
-------------------------
Performing target initialization ...
Device FXTH870000_FLASH
Detect frequence ...
Frequence 3876.54 Khz
Flash Operation.
UnProtecting ......
Unprotect Command Succeeded.
Device FXTH870000_FLASH
cmdwin::fl::image -f "D:\\CarElectornic\\TirePressureMonitor\\CW_MCU_workspace1\\FXTH87xx02_Starter_Project_Rel29\\FLASH\\FXTH87xx02_Starter_Project_Rel29.abs.s19" -t "Auto Detect" -re on -r 0xc000 0xdfff -oe off
cmdwin::fl::erase image
Beginning Operation ...
-------------------------
Auto-detection is successful.
File is of type Motorola S-Record Format.
Device FXTH870000_FLASH
Erasing ..........
Erase Command Succeeded.
Device FXTH870000_FLASH
cmdwin::fl::write
-------------------------
Flash Operation. ...
Auto-detection is successful.
File is of type Motorola S-Record Format.
Device FXTH870000_FLASH
Programming .....
Device FXTH870000_FLASH
Program Command Succeeded
Flash Operation. done

QQ:349201233
|
|