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
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.
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
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!
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.
I'm currently trying to get some more devices so I can test it myself. Will let you know.
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
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.
>>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
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.
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.
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.
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
after 6th step, my program does not run.
i suppose block 0 of flash erased.
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.
Version 2.01 is now available that allows you to program the device even though security bit 1 is set. Thanks for pointing this out!
Thank you Andy.
it sounds great!!!
many thanks to you and to Eric for help.
Regards
Lambros
hi andy.
2.01 works fine.
A small observation:
IF clock bit was previously set and security bit unset
and you select in step 4 of flash magic
verify after programming,
fill unused flash,
set security bit 1,
and 6 clocks/cycle
then flash magic does not set security bit.
You have to select in step 4 of flash magic
verify after programming,
fill unused flash,
set security bit 1,
and "uncheck" 6 clocks/cycle.
Then flash magic sets security bit.
Can flash magic "first read" and then write if a bit is not set?
Regards
Lambros Sirivlis
I tried this and I cannot reproduce it. When you choose "Read Security Bits..." from the ISP menu, does it show security bit 1 as being set?
1) select in step 4 of flash magic
verify after programming,
fill unused flash,
6 clocks/cycle
After reset magic flash shows correctly that
security bit is unset and clock bit set(6 cycles)
2) select in step 4 of flash magic
verify after programming,
fill unused flash,
set security bit 1,
and 6 clocks/cycle
then flash magic does not set security bit.
(security bit is "unset")
3) select in step 4 of flash magic
verify after programming,
fill unused flash,
set security bit 1,
and "uncheck" 6 clocks/cycle.
Then flash magic sets security bit.
Now security bit is set and clock bit is set.
Andy i'm not very shure about this cause i done this 3 steps only
one time with a single chip.
I'll try it again tomorrow.
regards
Lambros Sirivlis
1) select in step 4 of flash magic
verify after programming,
fill unused flash,
6 clocks/cycle
After reset magic flash shows correctly that
clock bit set (6 cycles)
security bit 1 is "unset" (correct)
my program runs ok
2) select in step 4 of flash magic
verify after programming,
fill unused flash,
set security bit 1,
and 6 clocks/cycle
Message: Operation failed(programming security bit )
I read :
clock bit set (6 cycles)
security bit 1 is "unset" (wrong)
my program runs ok
3) select in step 4 of flash magic
verify after programming,
fill unused flash,
set security bit 1,
and "uncheck" 6 clocks/cycle.
I read :
clock bit set (6 cycles)
security bit 1 is set (correct)
my program runs ok
Maybe flash magic (in my 2nd step) quits because has to set
an already programmed bit (clock bit)
Andy,
if i'm not asking too much
can you add an option to serial number window?
A box to check that says:
"Always use the same serial number".
And if you check this box flash magic after programming
automatically sets this serial number.
Serial number works like password so you can use the same
number always.
(it's easier to remember it if you want to unlock the device later)
Regards
Lambros Sirivlis
It appears the device is switching baud rate, so I've sent the problem to Philips for analysis.
I'll add your suggestion to our to do list. Thanks.
thank you Andy.