Flash Magic Forum

In-System Programming Support => LPC9xx/LPC9xxx => Topic started by: DieBaas on November 24, 2009, 10:10:48 PM

Title: Read Flash Memory?
Post by: DieBaas on November 24, 2009, 10:10:48 PM
Why is the Display Memory function in Flash Magic disabled. I want to read the flash of a 89LPC938.

Thanx
Title: Re: Read Flash Memory?
Post by: Andy Ayre on November 25, 2009, 07:36:33 AM
Because it's not supported. Flash Magic can only support the commands shown in the device user manuals from NXP.

Andy
Title: Re: Read Flash Memory?
Post by: DieBaas on November 26, 2009, 09:52:10 PM
So how do I read the flash memory after I've programed it? Any suggestion. I don't have a ICP programmer, but will reading the flash be possible with one?

PS: Sorry about the topic thing. Will start a new one next time. :-[
Title: Re: Read Flash Memory?
Post by: Andy Ayre on November 27, 2009, 08:46:40 AM
Use the CRC feature to check that the CRC of your device matches the CRC of your hex file.

Andy
Title: Re: Read Flash Memory?
Post by: Ralf_Brandt on May 03, 2010, 12:45:54 PM
Strange!
Maybe you need to get an updated Doc from NXP.

The Bootlodercode supplyied by NXP does contain a
Function 09 -Read User

And if I open a Terminal and type in:
:0500000900000fff00e4
I will get a perfect Memory Dump.
Tested with a brand new 89LPC921.

So at least the current 921 do support memory read.

Regards
Ralf
Title: Re: Read Flash Memory?
Post by: Andy Ayre on May 03, 2010, 07:57:25 PM
As I said before, FM only supports the documented commands. If you can find that command in an NXP document please post a link to it. If you want to rely on an undocumented command it's possible with a terminal program.

Andy
Title: Re: Read Flash Memory?
Post by: dptxp on May 06, 2010, 05:36:24 AM
This is bad. This means that anyone can read the code. And there is no way to stop this.
Title: Re: Read Flash Memory?
Post by: Ralf_Brandt on May 06, 2010, 09:48:09 PM
no it isn't.
Use the security bits, thats what they are for.
Title: Re: Read Flash Memory?
Post by: dptxp on May 06, 2010, 10:36:57 PM
Security bit 1 stops movc from the sector in which it is set, bit 2 stops erase and program, bit 3 makes device useless for ISP.

So with movc to use and ISP to be enabled, only bit 2 set in all sectors except the one with ISP, can be a bit of help.

There is no read option, except the way given in the post (do not know if it is true), so there is no read protection bit.
Title: Re: Read Flash Memory?
Post by: Ralf_Brandt on May 11, 2010, 10:39:02 AM
ISP FN 9 read user memory will use IAP FN 7

"      mov   DP0H, R4   ; Data Pointer High Byte
      mov   DP0L, R5   ; Data Pointer Low Byte
      clr   A
      movc   A, @A+DPTR
      mov   R7, A
      ret
"
And IAP FN 7 will use movc, so Bit 1 will work
Title: Re: Read Flash Memory?
Post by: dptxp on May 15, 2010, 03:01:28 AM
Actually they are bits 0 to 2, I had also made the same mistake.
So Bit 0 (not 1) is to disable movc. But how can one set it if movc is used in the software?
The software will not work.
Title: Re: Read Flash Memory?
Post by: dptxp on May 15, 2010, 04:04:23 AM
Quote from: Ralf_Brandt on May 03, 2010, 12:45:54 PM
Strange!
Maybe you need to get an updated Doc from NXP.

The Bootlodercode supplyied by NXP does contain a
Function 09 -Read User

And if I open a Terminal and type in:
:0500000900000fff00e4
I will get a perfect Memory Dump.
Tested with a brand new 89LPC921.

So at least the current 921 do support memory read.

Regards
Ralf


There is no such doc, please give link if there is one.
Title: Re: Read Flash Memory?
Post by: frank on August 04, 2010, 08:34:35 PM
Quote from: Ralf_Brandt on May 03, 2010, 12:45:54 PM
Strange!
Maybe you need to get an updated Doc from NXP.

The Bootlodercode supplyied by NXP does contain a
Function 09 -Read User

And if I open a Terminal and type in:
:0500000900000fff00e4
I will get a perfect Memory Dump.
Tested with a brand new 89LPC921.

So at least the current 921 do support memory read.

Regards
Ralf

Hi Ralf_Brandt,

Can you upload the latest bootloader code from NXP?
Title: Re: Read Flash Memory?
Post by: Ralf_Brandt on October 13, 2010, 02:20:00 PM
Sorry I haven't been around for a whlie.
The Bootloader code I was refferencing to is at:
http://www.nxp.com/documents/other/an10337.zip
and
http://www.nxp.com/documents/other/Adding_ISP_in_source_code.zip