Reply by Vinod Ganesh September 26, 20082008-09-26
Normally Constant data is stored in flash and its not reccomended for
keeping read/write data in flash

On Fri, Sep 26, 2008 at 9:51 PM, wrote:

> Hello,
>
> I also have to store variables in Flash, but it's because I ran out of RAM
> memory. I have one variable which is a struct and already occupies 16 Kb.
> So, I have a lot of free flash memory to allocate this variable, but I can't
> allocate it in RAM. So, I've already created a memory section in Flash and I
> have allocated it. The application has compiled and linked without any
> problem. But I have a lot of questions. What can happen doing this? The time
> needed for writing into flash is different from the time writing into RAM?
> Does this variable will still contain their value, although I power off my
> device ? In that case, if I initiliaze the its value each time to 0 is
> enough? To do this, is it better to use IAP functions, or is it enough doing
> what I did of allocating a memory section? I have read that a big problem
> can be that the times I write in flash memory is a limited number (~100.000
> times).
>
> Thanks for any help.
>
> Hi,
> >Has anyone used the flash on a LPC2468 as application data storage? I have
> a file system and wish to store files on the unused part of the flash. What
> are the ways of gaining access?
> >
> >Thanks for your help.
> >
> >Regards,
> >
> >Zhao
> >
>
>

An Engineer's Guide to the LPC2100 Series

Reply by rtstofer September 26, 20082008-09-26
--- In l..., tapenot@... wrote:
>
> Hello,
>
> I also have to store variables in Flash, but it's because I ran out
of RAM memory. I have one variable which is a struct and already
occupies 16 Kb. So, I have a lot of free flash memory to allocate this
variable, but I can't allocate it in RAM. So, I've already created a
memory section in Flash and I have allocated it. The application has
compiled and linked without any problem. But I have a lot of
questions. What can happen doing this?
It's a really bad idea...
>The time needed for writing into flash is different from the time
writing into RAM?
By orders of magnitude. And you have to disable interrupts and run
the IAP code out of RAM which means you need to compile it for a RAM
address (but you are out of RAM) but place it in flash and then move
it when you want to execute it.

>Does this variable will still contain their value, although I power
off my device ?
Yes, it's flash.
>In that case, if I initiliaze the its value each time to 0 is enough?
Sure, but you have to use IAP to do it. And your code needs to run
from RAM and the interrupts have to be disabled and you don't have any
RAM. And so on...
>To do this, is it better to use IAP functions, or is it enough doing
what I did of allocating a memory section?
It will only be 0 the very first time the CPU starts. After that it
will always contain what you previously wrote. And you will always
have to use IAP functions to write the flash.
> I have read that a big problem can be that the times I write in
flash memory is a limited number (~100.000 times).
Yes, that is a problem for your application.

This is such a bad idea. Why don't you use an external EEPROM (SPI or
I2C) or some kind of external SRAM? Or just get a uC with enough SRAM
to do the job correctly?

Richard

Reply by tape...@hotmail.com September 26, 20082008-09-26
Hello,

I also have to store variables in Flash, but it's because I ran out of RAM memory. I have one variable which is a struct and already occupies 16 Kb. So, I have a lot of free flash memory to allocate this variable, but I can't allocate it in RAM. So, I've already created a memory section in Flash and I have allocated it. The application has compiled and linked without any problem. But I have a lot of questions. What can happen doing this? The time needed for writing into flash is different from the time writing into RAM? Does this variable will still contain their value, although I power off my device ? In that case, if I initiliaze the its value each time to 0 is enough? To do this, is it better to use IAP functions, or is it enough doing what I did of allocating a memory section? I have read that a big problem can be that the times I write in flash memory is a limited number (~100.000 times).

Thanks for any help.
Hi,
>Has anyone used the flash on a LPC2468 as application data storage? I have a file system and wish to store files on the unused part of the flash. What are the ways of gaining access?
>
>Thanks for your help.
>
>Regards,
>
>Zhao
>

Reply by Zhao Liu September 17, 20082008-09-17
Hi All,
Got the sample code to work going to implement my own now. Thanks for the help.

Another thing I'm stuck on is how to copy interrupt vectors to ram and do i set MEMMAP during IAP programming only?

Thanks for the help.

Z.L.
--- On Sun, 9/14/08, Herbert Demmel wrote:

> From: Herbert Demmel
> Subject: Re: [lpc2000] Re: flash data storage on lpc
> To: l...
> Date: Sunday, September 14, 2008, 1:12 PM
> At 10:35 13.09.2008 -0400, you wrote:
> >So I guess I'm on the right track. there is no
> other easier way of doing this.
> >
> >Can I have INT routine in RAM? I would like to run my
> SD card driver
> >there so I may update firmware using hex store in the
> card memory.
>
> Yes, that is possible, be aware that you have to copy the
> interrupt
> vectors to RAM as well and set MEMAP=2
>
> Herbert

Reply by Harshal Doshi September 15, 20082008-09-15
can you share your code. I will update that with iap code.
and i will not have to work for file system!!
On 9/13/08, z...@yahoo.com wrote:
>
> Hi,
> Has anyone used the flash on a LPC2468 as application data storage? I have
> a file system and wish to store files on the unused part of the flash.
> What are the ways of gaining access?
>
> Thanks for your help.
>
> Regards,
>
> Zhao
>
>

--
Doshi Harshal
POTENT
F-27, VRAJWADI COMPLEX,
Nr. UTKARSH SCHOOL,
OLD PADRA ROAD,
VADODARA
GUJARAT 390015, INDIA
PH: 09429071421

Reply by Bruce Paterson September 14, 20082008-09-14
There's a flash eeprom emulator code example in the files section of
this user group.

Cheers,
Bruce

-----Original Message-----
From: l... [mailto:l...] On Behalf
Of z...@yahoo.com
Sent: Sunday, 14 September 2008 12:35 AM
To: l...
Subject: [lpc2000] Re: flash data storage on lpc

So I guess I'm on the right track. there is no other easier way of doing
this.

Can I have INT routine in RAM? I would like to run my SD card driver
there so I may update firmware using hex store in the card memory.

Hi,
>Has anyone used the flash on a LPC2468 as application data storage? I
have a file system and wish to store files on the unused part of the
flash. What are the ways of gaining access?
>
>Thanks for your help.
>
>Regards,
>
>Zhao
>
>

Reply by Herbert Demmel September 14, 20082008-09-14
At 10:35 13.09.2008 -0400, you wrote:
>So I guess I'm on the right track. there is no other easier way of doing this.
>
>Can I have INT routine in RAM? I would like to run my SD card driver
>there so I may update firmware using hex store in the card memory.

Yes, that is possible, be aware that you have to copy the interrupt
vectors to RAM as well and set MEMAP=2

Herbert
Reply by zhli...@yahoo.com September 13, 20082008-09-13
So I guess I'm on the right track. there is no other easier way of doing this.

Can I have INT routine in RAM? I would like to run my SD card driver there so I may update firmware using hex store in the card memory.

Hi,
>Has anyone used the flash on a LPC2468 as application data storage? I have a file system and wish to store files on the unused part of the flash. What are the ways of gaining access?
>
>Thanks for your help.
>
>Regards,
>
>Zhao
>
>

Reply by sunnyloves1983 September 13, 20082008-09-13
IAP is not a difficult issue,you can refer to the user manual of
lpc24xx which can be download form the office website of NXP
But there are some key points to you
1.you should shut down all INTs
2.the data must align
Reply by "J.C. Wren" September 13, 20082008-09-13
The demo code at http://jcwren.com/arm has examples of using IAP.
--jc

On Sat, Sep 13, 2008 at 9:43 AM, wrote:

> I only read from it most of the time. I'm just not sure how to use IAP
> to write stuff to flash and read from it. I suppose to write functions in
> RAM space? what other ways to are there to do the same thing?
>
> Any suggestion is much appreciated.
>
> Thanks.
>
> Zhao
> Hi,
> >Has anyone used the flash on a LPC2468 as application data storage? I have
> a file system and wish to store files on the unused part of the flash. What
> are the ways of gaining access?
> >
> >Thanks for your help.
> >
> >Regards,
> >
> >Zhao
> >
> >
> >
> >
>