Author Topic: Read Flash Memory?  (Read 15638 times)

DieBaas

  • Jr. Member
  • **
  • Posts: 4
    • View Profile
Read Flash Memory?
« 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

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: Read Flash Memory?
« Reply #1 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
Embedded Systems Academy, Inc.
support at esacademy dot com

DieBaas

  • Jr. Member
  • **
  • Posts: 4
    • View Profile
Re: Read Flash Memory?
« Reply #2 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. :-[

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: Read Flash Memory?
« Reply #3 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
Embedded Systems Academy, Inc.
support at esacademy dot com

Ralf_Brandt

  • Jr. Member
  • **
  • Posts: 4
    • View Profile
Re: Read Flash Memory?
« Reply #4 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

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: Read Flash Memory?
« Reply #5 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
Embedded Systems Academy, Inc.
support at esacademy dot com

dptxp

  • Jr. Member
  • **
  • Posts: 31
    • View Profile
Re: Read Flash Memory?
« Reply #6 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.

Ralf_Brandt

  • Jr. Member
  • **
  • Posts: 4
    • View Profile
Re: Read Flash Memory?
« Reply #7 on: May 06, 2010, 09:48:09 pm »
no it isn't.
Use the security bits, thats what they are for.

dptxp

  • Jr. Member
  • **
  • Posts: 31
    • View Profile
Re: Read Flash Memory?
« Reply #8 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.

Ralf_Brandt

  • Jr. Member
  • **
  • Posts: 4
    • View Profile
Re: Read Flash Memory?
« Reply #9 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

dptxp

  • Jr. Member
  • **
  • Posts: 31
    • View Profile
Re: Read Flash Memory?
« Reply #10 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.

dptxp

  • Jr. Member
  • **
  • Posts: 31
    • View Profile
Re: Read Flash Memory?
« Reply #11 on: May 15, 2010, 04:04:23 am »
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.

frank

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Re: Read Flash Memory?
« Reply #12 on: August 04, 2010, 08:34:35 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?
make MCU alive!

Ralf_Brandt

  • Jr. Member
  • **
  • Posts: 4
    • View Profile
Re: Read Flash Memory?
« Reply #13 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