i have the codewarrior metroworks ver6.1
p&e usb multilink pod
with the jtag on the target, while loading a locked or unlocked part there are no errors prompts, nothing scroled out either. you might noice the Memory screen with all zeros, it may be pointed at ram tho. after loading you immediatly do a F5 run again no errors but the target dosnt run. if at anytime you do a reset target you finally get an error prompt.
this whole thingy generated more quesitons. the answers so far sound like a republican speech on iraq:
1)after clearing+loading the entire flash with data (this includes 0xFFBF=0xFE or 0xFC) when does the new setting come into effect. my thinking is the FFBF flash value gets transfured to the volitle upper ram register first time when the part is reset. is this wrong and exactly when does it transfur.
2)again 0xFFBF is just another flash memory location. with or without security a whole chip clear and load is always possible. so why must you load 0xFFBF to 0xFC to set security on. why dosnt 0xFF or 0x00 work just as well? did the chip designers not read the programming manual. lol
3)if you have just cleared and loaded the target flash why cant you emulate? yes i know the part is locked but could there be an option to unlock and emulate? after all you have just loaded the part and its only one bit, in clear text you know the code, why lock out the part? odd, very odd.
if anyone does a search or if the search is turned on here is some code
//in globals.c i set the flash security registors 0xFFB0 FFBF
#pragma CONST_SEG _NONEVOLITLEREG //security code = 1,2,3,4,5,6,7,8
const struct flashreg FlashReg = {{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x06},
{0xFF, 0xFF, 0xFF, 0xFF, 0xFF,},
0xFF, 0xFF, 0xFC};
#pragma CONST_SEG DEFAULT
//in globals.c i also load the ram with the executable that does the backdoor reset
#pragma DATA_SEG _RAMROUTINE2 //sizeof 50bytes
unsigned char FlashRamRoutine2[] = {
0xA6,0x20, //LDA 0X20 ;ENABLE BACKDOOR WRITE FCNFG/KEYACC
0xC7,0x18,0x23, //STA FCNFG ;0x1823 = m(FCNFG)
0xA6,0x01, //LDA 0XFF ;WRITE 1OF8 CODE BYTES security code = 1,2,3,4,5,6,7,8
0xC7,0xFF,0xB0, //STA NVBACKEY+0
0xA6,0x02, // WRITE 2OF8 CODE BYTES
0xC7,0xFF,0xB1,
0xA6,0x03, //WRITE 3OF8 CODE BYTES
0xC7,0xFF,0xB2,
0xA6,0x04, //WRITE 4OF8 CODE BYTES
0xC7,0xFF,0xB3,
0xA6,0x05, //WRITE 5OF8 CODE BYTES
0xC7,0xFF,0xB4,
0xA6,0x06, //WRITE 6OF8 CODE BYTES
0xC7,0xFF,0xB5,
0xA6,0x07, //LWRITE 7OF8 CODE BYTES
0xC7,0xFF,0xB6,
0xA6,0x08, // WRITE 8OF8 CODE BYTES
0xC7,0xFF,0xB7,
0x4F, //CLRA ;DISABLE BACK DOOR
0xC7,0x18,0x23, //STA FCFG
0x81 //return
}; //unsigned char FlashRamRoutine2...
#pragma DATA_SEG DEFAULT
//here is the assoiciaged globals.h
#pragma DATA_SEG _RAMROUTINE2
extern unsigned char FlashRamRoutine2[];
#pragma DATA_SEG DEFAULT
#pragma CONST_SEG _NONEVOLITLEREG
extern const struct flashreg{
const unsigned char NvBackKey[8];
const unsigned char Reserved1[5];
const unsigned char NvProt;
const unsigned char Reserved2;
const unsigned char NvOpt;
}FlashReg;
#pragma CONST_SEG DEFAULT
//this is how the ram based application is called from program flash
//use back door
_asm jsr FlashRamRoutine2; //use back door
//from the linker file myliner.prn
SEGMENTS
NONEVOLITLEREG = READ_ONLY 0xFFB0 TO 0xFFBF;
END
PLACEMENT
_NONEVOLITLEREG INTO NONEVOLITLEREG;
END
Message Edited by jah on 2006-11-2110:08 PM