hello,
Thanks for your help.
I have moved the page to copy at page 38.
The function needed to do the copy is at page 37.
and the destination is 3F.
(three differents blocks)
I do that:
int TransPrg (void)
{
unsigned char TToTrans[Flash_Sector_Size];
unsigned int ind,data;
long adr,adrFlash;
char valRet;
for (adr =0x3F8000;adr0x3F9FFF;adr=adr+Flash_Sector_Size)
{
valRet=Flash_Erase_Sector((unsigned int *far)adr);
}
for (adr =0x388000;adr0x389FFF;adr=adr+Flash_Sector_Size)
{ for (ind=0;ind
{
data= *(( unsigned int *far) (adr+ind));
TToTrans[ind]=data>>8;
TToTrans[ind+1]=data&0x00ff;
}
adrFlash= adr + 70000;
valRet = Flash_Write_Block (( unsigned int *far) TToTrans,( unsigned int *far)adrFlash,(Flash_Sector_Size/2));
}
}
with Flash_Sector_Size = 0x200
but when I do a step by step execution, in the function
Flash_Erase_Sector there is a line :
if ((unsigned long)far_address >= 0x10000)
{ ...
who call the function :
void _LCMP (void) {
__asm {
#ifdef __HCS12X__
CPD 4,SP
CPEX 2,SP
#else
CPD 4,SP
...
LEAS 4, SP ; release stack arguments
JMP 0, Y
}
}
This function making a long compare, this function is in the file rtshc12.c, and it's at the address 0xC6E2 (0x3F86E2) in the page that i want to erase!
what can i do to do ?