Bootloader Problem after first use of "execute" funktion

Started by adhome1, February 26, 2008, 11:55:41 PM

Previous topic - Next topic

adhome1

Hallo,

I do have a P89C668. Normaly I start bootloader with this code:

#pragma asm
MOV AUXR1,#20H ;set the ENBOOT bit
MOV R0,#8 ;FOSC
MOV R1,#06H ;program status byte or boot vector
MOV DPTR,#0000h ;specify status byte
MOV A,#10 ;
CALL 0xFFF0 ;execute the function
#pragma endasm
WDTRST = 0x1E;
WDTRST = 0xE1;   // RESET


After programming with Flashmagic I reset by normal powerunplug.
Today I tried the first time the "execute" function in Flashmagic.
The device did reset after programming. Function working (;

But after that, i can not excecute the bootloader anymore. The device is simple not responding after the code.
Normaly, all ports must go on. But there is nothing. No reset by watchdog.
(After Powerunplug, the normal program is running)

Did the execute function change the bootvector?

If you need additional infos please ask.

(Sorry for my bad english. I'm german)

Andy Ayre

To get the device back into ISP mode you must meet the requirements for ISP entry as described in the device user manual. Have you confirmed you are doing that with a scope? What did you find?

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

Jan Waclawek

Quote from: Andy Ayre on February 27, 2008, 07:31:52 AM
To get the device back into ISP mode you must meet the requirements for ISP entry as described in the device user manual. Have you confirmed you are doing that with a scope? What did you find?

But, Andy, setting the statusbyte to nonzero overrides the hardware bootloader entry condition - and there is nothing to check with scope on that.

Nevertheless, from the OP's post it's not clear for me, how does he reset the device after programming the statusbyte, nor what are exactly the symptoms...

Jan Waclawek

Andy Ayre

I interpreted the poster's message as meaning that they were able to execute their code, but not get back into ISP mode. Flash Magic automatically clears the status byte after programming, so if you want to reset back into the bootloader you need to explicitly set the status byte again.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

Jan Waclawek

Quote from: Andy Ayre on February 27, 2008, 12:30:16 PM
I interpreted the poster's message as meaning that they were able to execute their code, but not get back into ISP mode. Flash Magic automatically clears the status byte after programming, so if you want to reset back into the bootloader you need to explicitly set the status byte again.
This is what they appear to do, indeed, i.e. enter the bootloader from the user code via programming the statys byte.

It appears then, that after having entered the bootloader and programmed the part successfully using FM, they used an option in FM to automatically run the user code. I don't have/use '668, but the datasheet does not mention a "reset" option via ISP (such as that in the 'V51RD2's ISP command set) - isn't this some sort of misunderstanding?

Jan Waclawek

adhome1

Thanks for the help. I found the problem. With the new firmware i added some code. This results in, that my compiler moved the Bootcode (i posted)
to the end of the codemomory at FD03

This can of cause not working.

Thanks for the help.