Main Menu

p89v51rd2 security

Started by lambros sirivlis, June 29, 2004, 08:41:08 AM

Previous topic - Next topic

lambros sirivlis

hello,
I am little confused with P89V51RD2.
if I program (with flash magic) security bit I can't erase or program again the memory flash (via ISP).
The question is:
If I program serial number and leave the security bit
unprogrammed (to update program in the future),code can be recovered via parallel programmer?

You can erase anything but not
security bit (if it is set)via isp.
And if security bit is set then you have no more access to flash if you want to update your program.
So if you want to work with ISP you must leave security bit unset and your code open to a paraller programmer.
It looks strange.


(sory for my bad english)
Thanks
Lambros

Andy Ayre

If you have only set the security bit then you can erase block 0.

If you have set a serial number then you cannot erase block 0. Instead you must either verify the serial number to unlock the device, or reset the serial number, which will erase block 0 and the current serial number.

That is my understanding of how it works.

Embedded Systems Academy, Inc.
support at esacademy dot com

lambros sirivlis

Hello  Andy.
I've tried this but it doesn't work.
I found in datasheet  the support  e-mail of phillips
and send them the same question.
The answer (they answer extremely fast) was:
"Philips Semiconductors answer:
Your assumtions are correct. I think you can get around the security bit for re-programming if you do your own bootloader using the IAP calls. Otherwise, ISP is not possible with the security bit set."

If does not exist some special reason (in hardware)
that it prohibits us to unset the security bit via ISP
 then ...it is strange.

Regards
Lambros Sirivlis

Andy Ayre

Can you please Email me the name of the Philips person who gave you that advice? Or better still forward me that Email? It will help me find out what is going on with this from Philips. Thanks!

Embedded Systems Academy, Inc.
support at esacademy dot com

lambros sirivlis

hello andy
#######################
*** Please do not reply to this message ***

If you have a follow up to this question or want to view the status of your question(s) please go to :
http://www.semiconductors.philips.com/cgi-bin/support/support.pl?command=status&QuestionID=4499&User=sirivlis@otenet.gr

========================================
|| Answer to Question 4499 from Philips Semiconductors
|| 06/29/04 (18:00:15)
||
|| http://www.semiconductors.philips.com/support/
========================================
lambros sirivlis
On above date you submitted question with ID 4499
---------------------------------------------------------------------------
Question:
hello,

I am little confused with P89V51RD2.

if I program (with flash magic) security bit I can't erase or program again the memory flash (via ISP).

The question is:

If I program serial number and leave the security bit

unprogrammed (to update program in the future),code can be recovered via parallel programmer?



You can erase anything but not

security bit (if it is set)via isp.

And if security bit is set then you have no more access to flash if you want to update your program.

So if you want to work with ISP you must leave security bit unset and your code open to a paraller programmer.

It looks strange.





(sory for my bad english)

Thank you

Lambros sirivlis
---------------------------------------------------------------------------
Philips Semiconductors answer:
Your assumtions are correct. I think you can get around the security bit for re-programming if you do your own bootloader using the IAP calls. Otherwise, ISP is not possible with the security bit set.

Jim E.

---------------------------------------------------------------------------
This e-mail is sent to you from the website of Philips Semiconductors
Please do not reply to this message.
###########################

thank you for help.

regards
lambros sirivlis.

Andy Ayre

I'm currently trying to get some more devices so I can test it myself. Will let you know.

Embedded Systems Academy, Inc.
support at esacademy dot com

erikm

cross posted (since this thread is) at www.8052

the support e-mail of phillips and send them the same question
I do not think Philips support is fluent in FlashMagic

From the datasheet
"If the serial number is in use, reading, programming, or erasing of the user code memory or the serial number is blocked until the user transmits a

Andy Ayre

Yes, you can verify a serial number using Flash Magic. Select the device then choose "Serial Number..." from the ISP menu. Enter the serial number into the "Unlock device" section.

Embedded Systems Academy, Inc.
support at esacademy dot com

erikm

>>Enter the serial number into the "Unlock device" section<<

This is, indeed a 'cute' feature, but I, for one, would not dare to use it without a label on the chip with the serial number.

without the label:
A techie replaces a (good) chip and does not record it - two chips lost.
You forget the serial number - one chip lost.

In all cases:
you mistype the serial number - one chip lost.

I can see this being used in big time production, but for amateurs and small manual scale mfg it is a trap.

Erik

Andy Ayre

You can always use the Reset serial number option to clear the serial number. This also erases the device as well. So there is a way to recover the device if you forget the serial number.

Embedded Systems Academy, Inc.
support at esacademy dot com

lambros sirivlis

If i set the security bit AND the serial number, i block isp AND paraller programing or reading.
But in this case the chip is no more accesible via ISP (even if i try to RESET serial number).

The chip accepts the "RESET" option(and erases the devise and serial number) but you can't programing it via ISP.
And in this case you can't reset security bit via isp.
So you lose isp functionality.

Andy Ayre

If you have no ISP functionality, how do you know the serial number and device were erased?

Giving step by step reproduction steps would be useful so I can try them here when I get some devices.

Embedded Systems Academy, Inc.
support at esacademy dot com

lambros sirivlis

sorry Andy, you are right.
I don't know, i "suppose".
I select  "reset serial number"  and  i don't get any
fail message .
-----------------------------------------------------------
1)   i select :

verify after programming,
fill unused flash,
and  6 clocks/cycle.
when ends i get the message:
operation failed.(programming security bit).
----
but the chip is ok and works fine.

2) i select  "set serial number"
after "reset device in isp mode now"
no message.

The chip is ok and works fine.
now i have no access via isp.

3) i select  "reset serial number"
after "reset device in isp mode now"
no message.
The chip is ok and isp works again.
I can reprogram the chip.
4)   i select :

verify after programming,
fill unused flash,
set security bit 1,
and  6 clocks/cycle.

first message"you have selected at least one security bit which once programmed it cannot be erased via isp,a paraller programmer is required.do you want to program security bit?"
i select yes.
second  message"you have selected to program clocks bit which once programmed it cannot be erased via isp,a paraller programmer is required.do you want to program clocks bit?"
i select yes.

when ends i get the message:
operation failed.(programming clock bit).
propably because clock bit is already programmed.
----
The chip is ok and my program runs fine.

5) I open again magic flash .
after "reset device in isp mode now"
chip goes to isp mode.
Now i can read device signature(BF,91), read security bits(security bit 1 is set) but when i press "start" i get the message  Programming is disabled due to security bit 1 being set.

6) i select  "reset serial number"
after "reset device in isp mode now"
no message.

7) I open again magic flash .
after "reset device in isp mode now"
chip goes to isp mode.
Now i can read device signature(BF,91), read security bits(security bit 1 is set) but when i press "start" i get the message  Programming is disabled due to security bit 1 being set.

chip label:
P89V51RD2BN
CM5155.02
kz0413  AC


regards
Lambros sirivlis

lambros sirivlis

after  6th step, my program does not run.
 i suppose block 0  of flash  erased.

Andy Ayre

Ah ha. Now this makes sense. The device IS entering ISP mode, but Flash Magic is stopped you from programming the device.

I'll look into it.

Embedded Systems Academy, Inc.
support at esacademy dot com