如题!如下面代码没有s12xd的支持,强行使用s12xe的部分连擦除都不能完成,郁闷中!!!忘大神指点一二!!!!
switch (PARTID)
{
//S12XS 256k flash
case MASK_0M05M:
if (!((ProgSRec.LoadAddr >= 0x7C0000UL) && (ProgSRec.LoadAddr <= 0x7FEFDFUL)))
return(SRecRangeError);
break;
//S12XS 128k flash
case MASK_0M04M: //Falling to next case
case MASK_1M04M:
if (!((ProgSRec.LoadAddr >= 0x7E0000UL) && (ProgSRec.LoadAddr <= 0x7FEFDFUL)))
return(SRecRangeError);
break;
//S12XE 1024k flash
case MASK_0M48H: //Falling to next case
case MASK_1M48H: //Falling to next case
case MASK_2M48H: //Falling to next case
case MASK_3M48H: //Falling to next case
case MASK_4M48H_5M48H:
if (!((ProgSRec.LoadAddr >= 0x700000UL) && (ProgSRec.LoadAddr <= 0x7FEFDFUL)))
return(SRecRangeError);
break;
//S12XE, S12XF 512k flash
case MASK_0M25J: //Falling to next case
case MASK_1M25J: //Falling to next case
case MASK_2M25J_3M25J: //Falling to next case
case MASK_1M64J_2M64J:
if (!((ProgSRec.LoadAddr >= 0x780000UL) && (ProgSRec.LoadAddr <= 0x7FEFDFUL)))
return(SRecRangeError);
break;
//S12XE 256k flash
case MASK_0M53J: //Falling to next case
case MASK_1M53J_2M53J:
if (!((ProgSRec.LoadAddr >= 0x780000UL) && (ProgSRec.LoadAddr <= 0x79FFFFUL)) && \
!((ProgSRec.LoadAddr >= 0x7E0000UL) && (ProgSRec.LoadAddr <= 0x7FEFDFUL)))
return(SRecRangeError);
break;
default:
return(UnknownPartID);
}
//address is OK, program the record to flash
if(Error = PFlash_Program(ProgSRec.LoadAddr, (UINT16 *)&ProgSRec.Data))
return(Error);
if(Error = PFlash_Program(ProgSRec.LoadAddr+8, (UINT16 *)&ProgSRec.Data[8]))
return(Error);
if(Error = PFlash_Program(ProgSRec.LoadAddr+16, (UINT16 *)&ProgSRec.Data[16]))
return(Error);
if(Error = PFlash_Program(ProgSRec.LoadAddr+24, (UINT16 *)&ProgSRec.Data[24]))
return(Error);
} |