EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

EMC & Flash

Started by mjscottinpa October 7, 2009
I'm using an LPC2478, and the system has DSRAM and FLASH on the EMC. The SDRAM is fine, but when I try to program the flash, from code in the flash on the LPC2478, I get nothing. Whenever I try any write based operation like reading the chip ID I get nothing. The write protect is pulled high, all the signals look right when looked at on the oscilloscope. Power is good, it is setup on the static bus side of the emc and all the timing is programmed via static control registers, I have two boards and both are doing the same thing.

I looked for an NXP app note on using flash on the emc and have not been able to find anything.

Any thoughts?

Mike Scott

An Engineer's Guide to the LPC2100 Series

Hi,

I have the same problem, I am using a spansion S29GL256P 32MB.

I know that the NXP LPC2478 board and the EA board have External Flash, if
someone could send come C code to configure, write and read I really
appreciate.

Thanks
2009/10/7, mjscottinpa :
>
> I'm using an LPC2478, and the system has DSRAM and FLASH on the EMC. The
> SDRAM is fine, but when I try to program the flash, from code in the flash
> on the LPC2478, I get nothing. Whenever I try any write based operation like
> reading the chip ID I get nothing. The write protect is pulled high, all the
> signals look right when looked at on the oscilloscope. Power is good, it is
> setup on the static bus side of the emc and all the timing is programmed via
> static control registers, I have two boards and both are doing the same
> thing.
>
> I looked for an NXP app note on using flash on the emc and have not been
> able to find anything.
>
> Any thoughts?
>
> Mike Scott
>


Shoudn't the reading and wrintg on the flash be done in blocks?

2009/10/7 Alberto de Martini

> Hi,
>
> I have the same problem, I am using a spansion S29GL256P 32MB.
>
> I know that the NXP LPC2478 board and the EA board have External Flash, if
> someone could send come C code to configure, write and read I really
> appreciate.
>
> Thanks
>
> 2009/10/7, mjscottinpa >:
> >
> >
> >
> > I'm using an LPC2478, and the system has DSRAM and FLASH on the EMC. The
> > SDRAM is fine, but when I try to program the flash, from code in the
> flash
> > on the LPC2478, I get nothing. Whenever I try any write based operation
> like
> > reading the chip ID I get nothing. The write protect is pulled high, all
> the
> > signals look right when looked at on the oscilloscope. Power is good, it
> is
> > setup on the static bus side of the emc and all the timing is programmed
> via
> > static control registers, I have two boards and both are doing the same
> > thing.
> >
> > I looked for an NXP app note on using flash on the emc and have not been
> > able to find anything.
> >
> > Any thoughts?
> >
> > Mike Scott
> >
> >
> >
>
>
>


--- In l..., Felipe de A N L wrote:
>
> Shoudn't the reading and wrintg on the flash be done in blocks?
>
> 2009/10/7 Alberto de Martini >
> >
> > Hi,
> >
> > I have the same problem, I am using a spansion S29GL256P 32MB.
> >
> > I know that the NXP LPC2478 board and the EA board have External Flash, if
> > someone could send come C code to configure, write and read I really
> > appreciate.
> >
> > Thanks
> >
> > 2009/10/7, mjscottinpa >:
You can try the Search feature and one of the postings will mention NXP AN10771

http://www.nxp.com/acrobat_download/applicationnotes/AN10771_1.pdf

I don't have that device so I don't know if the AN is useful or not.

Richard

yes, the reading e writing must be done in blocks. In my case, i am trying
to read a simple block that contains the fhash information a I didnt get
anything

2009/10/7 rtstofer

> --- In l... , Felipe de A N
> L wrote:
> >
> > Shoudn't the reading and wrintg on the flash be done in blocks?
> >
> > 2009/10/7 Alberto de Martini
> >
> > >
> > >
> > > Hi,
> > >
> > > I have the same problem, I am using a spansion S29GL256P 32MB.
> > >
> > > I know that the NXP LPC2478 board and the EA board have External Flash,
> if
> > > someone could send come C code to configure, write and read I really
> > > appreciate.
> > >
> > > Thanks
> > >
> > > 2009/10/7, mjscottinpa >:
>
> You can try the Search feature and one of the postings will mention NXP
> AN10771
>
> http://www.nxp.com/acrobat_download/applicationnotes/AN10771_1.pdf
>
> I don't have that device so I don't know if the AN is useful or not.
>
> Richard
>
>
>


Why dont you paste your initialization code here, flash size and wire
connection, maybe someone will be able to heĺp.

Cya.

2009/10/7 Alberto de Martini

> yes, the reading e writing must be done in blocks. In my case, i am trying
> to read a simple block that contains the fhash information a I didn´t get
> anything
>
> 2009/10/7 rtstofer > >
> >
> >
> >
> > --- In l... > 40yahoogroups.com>, Felipe de A N
>
> > L wrote:
> > >
> > > Shoudn't the reading and wrintg on the flash be done in blocks?
> > >
> > > 2009/10/7 Alberto de Martini
> > >
> > > >
> > > >
> > > > Hi,
> > > >
> > > > I have the same problem, I am using a spansion S29GL256P 32MB.
> > > >
> > > > I know that the NXP LPC2478 board and the EA board have External
> Flash,
> > if
> > > > someone could send come C code to configure, write and read I really
> > > > appreciate.
> > > >
> > > > Thanks
> > > >
> > > > 2009/10/7, mjscottinpa >:
> >
> > You can try the Search feature and one of the postings will mention NXP
> > AN10771
> >
> > http://www.nxp.com/acrobat_download/applicationnotes/AN10771_1.pdf
> >
> > I don't have that device so I don't know if the AN is useful or not.
> >
> > Richard
> >
> >
> >
>
>
>


mjscottinpa wrote:
> ... when I try to program the flash, from code in the
> flash on the LPC2478, I get nothing...

If you mean that you execute your code from the same flash as the one,
which you try to program, you can't do that.

Have you marked flash addresses as 'volatile'? Otherwise the compiler
may optimize your accesses away. Check the disassembly.

--

Timo

Hmmm... I have a 2468 board that I am debugging. Flash is soldered in and working fine (using CS0). SDRAM is currently depopulated but I don't forsee an issue. The SDRAM doesn't have an output enable per-se that can create a conflict.

How did you connect the flash? Perhaps PM a PDF of the flash connection or post in the user files section? Sounds like you might have a slight misconnection somewhere...

--- In l..., "mjscottinpa" wrote:
>
> I'm using an LPC2478, and the system has DSRAM and FLASH on the EMC. The SDRAM is fine, but when I try to program the flash, from code in the flash on the LPC2478, I get nothing. Whenever I try any write based operation like reading the chip ID I get nothing. The write protect is pulled high, all the signals look right when looked at on the oscilloscope. Power is good, it is setup on the static bus side of the emc and all the timing is programmed via static control registers, I have two boards and both are doing the same thing.
>
> I looked for an NXP app note on using flash on the emc and have not been able to find anything.
>
> Any thoughts?
>
> Mike Scott
>

The flash is 4M x 16, A22-A1, D15-D0, CS0, OE, WE, RESETOUT. The SDRAM
is 2 chips (16M X 16) connected as a 16M X 32 connecting all the
dynamic control lines and is working fine. My problem is gaining
access to programming the flash. This is accomplished by writing three
words to the flash, unlocking the programming feature, and then
writing the address and data you want programmed. The code for
programming was provided by the flash manufacturer, and I'm assuming
is correct. It does look correct based on the data sheet. You use the
same general sequence to read the manufacturer ID and part ID. In all
cases I get 0xffff out of the flash. There does not appear to be any
contensions in looking at the data lines and chip selects.

Static Init is:

EMCStaticConfig0 = 0x1 | (1 << 19);
EMCStaticWaitRd0 = 1f;
EMCStaticWaitTurn0 = 0x0f;
EMCStaticWaitWen0 = 2;
EMCStaticWaitWr0 = 0x1f;

Code to read the mfg id is:

#define sysAddress(offset) ((volatile int16 *)(0x80000000 +
(((int16)offset)<<1)))

*sysAddress(0x555) = 0x00AA; // write data 0x00AA to device addr 0x555
*sysAddress(0x2AA) = 0x0055; // write data 0x0055 to device addr 0x2AA
*sysAddress(0x555) = 0x0090; // write data 0x0090 to device addr 0x555

Delay_150_Nano_Seconds();

// Read the product ID
id1 = *sysAddress(0x0000); // get first ID byte
id2 = *sysAddress(0x0001); // get second ID byte

Remeber that we shift the address left by one position because the
flash is 16 bits wide and A0 is not connected.

FYI to all; most flashes are block erased and programmed byte by byte.

How are you programming your external flash?
> Hmmm... I have a 2468 board that I am debugging. Flash is soldered
> in and working fine (using CS0). SDRAM is currently depopulated but
> I don't forsee an issue. The SDRAM doesn't have an output enable
> per-se that can create a conflict.
>
> How did you connect the flash? Perhaps PM a PDF of the flash
> connection or post in the user files section? Sounds like you might
> have a slight misconnection somewhere...
>
> --- In l..., "mjscottinpa" wrote:
>>
>> I'm using an LPC2478, and the system has DSRAM and FLASH on the
>> EMC. The SDRAM is fine, but when I try to program the flash, from
>> code in the flash on the LPC2478, I get nothing. Whenever I try any
>> write based operation like reading the chip ID I get nothing. The
>> write protect is pulled high, all the signals look right when
>> looked at on the oscilloscope. Power is good, it is setup on the
>> static bus side of the emc and all the timing is programmed via
>> static control registers, I have two boards and both are doing the
>> same thing.
>>
>> I looked for an NXP app note on using flash on the emc and have not
>> been able to find anything.
>>
>> Any thoughts?
>>
>> Mike Scott
>

Hi Mike,

--- In l..., mjscott@... wrote:
> Static Init is:
>
> EMCStaticConfig0 = 0x1 | (1 << 19);
> EMCStaticWaitRd0 = 1f;
> EMCStaticWaitTurn0 = 0x0f;
> EMCStaticWaitWen0 = 2;
> EMCStaticWaitWr0 = 0x1f;
>

Try setting bit 7 (PB) in EMCStaticConfig0.
With this bit currently being cleared, you're lacking the write pulse at the WE pin!

Regards,
Rolf


The 2024 Embedded Online Conference