Reply by Kiran K May 26, 20112011-05-26
Yes, MAM timing seems to be solving the issue. I changed it from 3 to 7 and
then we don't see this issue. We'll try out with some more boards and update
if issue continues to be there.

Thanks for the help.

Regards,
Kiran.

-----Original Message-----
From: l... [mailto:l...] On Behalf Of
Tom Tang
Sent: Thursday, May 26, 2011 1:11 AM
To: l...
Subject: [lpc2000] Re: LPC 2148 - Inconsistency in reading flash

(1) MAM and MAM timing is definitely the first thing to check.
(2) Make sure REMAP is set to flash.
(3) Some of the development tools have the cache options
such as "cache code" and "cache memory" in Keil MDK debugger.
Make sure these fields are unchecked if you open debugger
to read the flash.

regards,
Tom
--- In l..., Kiran K wrote:
>
> Hi -
>
>
>
> We use LPC2148 in our product. We are using flash to store image data to
be
> shown on the screen.
>
>
>
> In some of the boards (around 5% of boards), we are facing issue while
> reading the flash data. The data read is not the data saved onto the
flash.
>
>
>
> 1. The flash location is read using the command - bitMapData > (*((unsigned long *)address)); //where address is the flash memory
location
>
> 2. We use IAP to write to Flash
>
> 3. We are able to see through the "Flash Magic -> ISP -> Display
> Memory" that the data has been written correctly to the flash memory
> location. In addition, this seems to indicate that through ISP, the memory
> location can be read properly
>
> 4. The read from the flash location is inconsistent, that is, if we
> write the same data to all the locations (write 0xFF to all the locations
of
> flash), the reading say from address X is returning value other than 0xFF,
> reading the same location again could give 0xFF (that is, it does not
appear
> to be problem with a particular memory location)
>
> 5. We use Crossworks to generate the hex code (I don't think that
> Crossworks is the issue as 95% of the boards do not have this issue)
>
>
>
> My questions are
>
> 1. What could be the reason for the inconsistent reads?
>
> 2. Should we be reading the flash location in a different way (I
went
> through the manual and did not see any read flash command in IAP command
> list)
>
>
>
> Your help is much appreciated.
> Regards,
>
> Kiran.
>

An Engineer's Guide to the LPC2100 Series

Reply by Tom Tang May 25, 20112011-05-25
(1) MAM and MAM timing is definitely the first thing to check.
(2) Make sure REMAP is set to flash.
(3) Some of the development tools have the cache options
such as "cache code" and "cache memory" in Keil MDK debugger.
Make sure these fields are unchecked if you open debugger
to read the flash.

regards,
Tom
--- In l..., Kiran K wrote:
>
> Hi -
>
>
>
> We use LPC2148 in our product. We are using flash to store image data to be
> shown on the screen.
>
>
>
> In some of the boards (around 5% of boards), we are facing issue while
> reading the flash data. The data read is not the data saved onto the flash.
>
>
>
> 1. The flash location is read using the command - bitMapData > (*((unsigned long *)address)); //where address is the flash memory location
>
> 2. We use IAP to write to Flash
>
> 3. We are able to see through the "Flash Magic -> ISP -> Display
> Memory" that the data has been written correctly to the flash memory
> location. In addition, this seems to indicate that through ISP, the memory
> location can be read properly
>
> 4. The read from the flash location is inconsistent, that is, if we
> write the same data to all the locations (write 0xFF to all the locations of
> flash), the reading say from address X is returning value other than 0xFF,
> reading the same location again could give 0xFF (that is, it does not appear
> to be problem with a particular memory location)
>
> 5. We use Crossworks to generate the hex code (I don't think that
> Crossworks is the issue as 95% of the boards do not have this issue)
>
>
>
> My questions are
>
> 1. What could be the reason for the inconsistent reads?
>
> 2. Should we be reading the flash location in a different way (I went
> through the manual and did not see any read flash command in IAP command
> list)
>
>
>
> Your help is much appreciated.
> Regards,
>
> Kiran.
>

Reply by Timo May 25, 20112011-05-25
On 05/25/2011 11:16 AM, Kiran K wrote:
> In some of the boards (around 5% of boards), we are facing issue while
> reading the flash data. The data read is not the data saved onto the flash.

One of the possible culprits may be MAM. What I have read, MAM off might
not be a working configuration for some parts. Try different
configurations, read erratas and search this mailing list.

--

Timo
Reply by Norman Felder May 25, 20112011-05-25
Hi Kiran,

If I saw those symptoms while accessing an external flash device I would
immediately suspect that I had made a mistake setting up the read timing.
That's the kind of thing you would see if you violated a timing margin
somewhere. With on-chip flash I might suspect a variation of that theme that
leads to the same result. Perhaps a problem with the PLL configuration?

Best regards,
Norman

________________________________
From: Kiran K
To: l...
Sent: Wed, May 25, 2011 2:16:43 AM
Subject: [lpc2000] LPC 2148 - Inconsistency in reading flash

Hi –

We use LPC2148 in our product. We are using flash to store image data to be
shown on the screen.

In some of the boards (around 5% of boards), we are facing issue while reading
the flash data. The data read is not the data saved onto the flash.

1. The flash location is read using the command - bitMapData (*((unsigned long *)address)); //where address is the flash memory location
2. We use IAP to write to Flash
3. We are able to see through the “Flash Magic -> ISP -> Display Memory”
that the data has been written correctly to the flash memory location. In
addition, this seems to indicate that through ISP, the memory location can be
read properly
4. The read from the flash location is inconsistent, that is, if we write
the same data to all the locations (write 0xFF to all the locations of flash),
the reading say from address X is returning value other than 0xFF, reading the
same location again could give 0xFF (that is, it does not appear to be problem
with a particular memory location)
5. We use Crossworks to generate the hex code (I don’t think that
Crossworks is the issue as 95% of the boards do not have this issue)

My questions are
1. What could be the reason for the inconsistent reads?
2. Should we be reading the flash location in a different way (I went
through the manual and did not see any read flash command in IAP command list)

Your help is much appreciated.

Regards,
Kiran.
Reply by Kiran K May 25, 20112011-05-25
Hi -

We use LPC2148 in our product. We are using flash to store image data to be
shown on the screen.

In some of the boards (around 5% of boards), we are facing issue while
reading the flash data. The data read is not the data saved onto the flash.

1. The flash location is read using the command - bitMapData (*((unsigned long *)address)); //where address is the flash memory location

2. We use IAP to write to Flash

3. We are able to see through the "Flash Magic -> ISP -> Display
Memory" that the data has been written correctly to the flash memory
location. In addition, this seems to indicate that through ISP, the memory
location can be read properly

4. The read from the flash location is inconsistent, that is, if we
write the same data to all the locations (write 0xFF to all the locations of
flash), the reading say from address X is returning value other than 0xFF,
reading the same location again could give 0xFF (that is, it does not appear
to be problem with a particular memory location)

5. We use Crossworks to generate the hex code (I don't think that
Crossworks is the issue as 95% of the boards do not have this issue)

My questions are

1. What could be the reason for the inconsistent reads?

2. Should we be reading the flash location in a different way (I went
through the manual and did not see any read flash command in IAP command
list)

Your help is much appreciated.
Regards,

Kiran.