在线时间64 小时
UID370567
注册时间2014-10-1
NXP金币0
TA的每日心情 | 开心 2017-6-8 14:49 |
---|
签到天数: 8 天 连续签到: 1 天 [LV.3]偶尔看看II
高级会员

- 积分
- 853
- 最后登录
- 2018-5-18
|

楼主 |
发表于 2016-3-22 11:22:08
|
显示全部楼层
你好,我用的是MK64FX512VLQ12,现在程序遇到下面问题
再程序的开始我调用 partition_flash( EEPROM_2K_2K, DFLASH_SIZE_96);//EEPROM初始化这个函数
函数体
int partition_flash(int eeprom_size, int dflash_size)
{
/* Test to make sure the device is not already partitioned. If it
* is already partitioned, then return with no action performed.
*/
if ((SIM_FCFG1 & SIM_FCFG1_DEPART(0xF)) != 0x00000F00)
{
printf("\nDevice is already partitioned.\n");
return 0;
}
/* Write the FCCOB registers */
FTFE_FCCOB0 = FTFE_FCCOB0_CCOBn(0x80); // Selects the PGMPART command
FTFE_FCCOB1 = 0x00;
FTFE_FCCOB2 = 0x00;
FTFE_FCCOB3 = 0x00;
/* FCCOB4 is written with the code for the subsystem sizes (eeprom_size define) */
FTFE_FCCOB4 = eeprom_size;
/* FFCOB5 is written with the code for the Dflash size (dflash_size define) */
FTFE_FCCOB5 = dflash_size;
/* All required FCCOBx registers are written, so launch the command */
FTFE_FSTAT = FTFE_FSTAT_CCIF_MASK;
/* Wait for the command to complete */
while(!(FTFE_FSTAT & FTFE_FSTAT_CCIF_MASK));
return 1;
}
刚开始用JLINK写程序的时候,全速跑, partition_flash这个函数过不去,要在此处设断点,然后进入函数里面再单步执行每条命令就能执行过去,只要执行过去一次,以后全速就可以了,这个哪里有问题呢 |
|