Discussion in "ARM Development" started by    shyam    Oct 7, 2008.
Tue Oct 07 2008, 04:06 pm
#1
for the past few days i have been working on my data logger.
here are the specification as well as the problem i am facing:

1.controller : LPC2138
2.memory : flash 512kb
3. Ram : 32 Kib
WINArm windows Xp

using IAP when i beed to erase data from the sectors i need to erase the complete sector.
that means to erase one data i need delete approx 128 records.
i have already used around 230 kbs for code.
section size addr
.text 210516 0
.data 2524 1073741824
.bss 7816 1073744348
.stack 8192 1073752320
.comment 1632 0
.debug_aranges 736 0
.debug_pubnames 7835 0
.debug_info 33986 0
.debug_abbrev 2730 0
.debug_line 10207 0
.debug_frame 5760 0
.debug_str 450 0
.debug_loc 7140 0
Total 299524

now i need to optimise the memory (flash use)
i can invest only 20 sectors from base 14 to 19
the rest (remaining) shall be used by code and configuration data..
my proble:
1. i need to edit one selected report (i.e. delete it from flash and update from RAM). without affecting any other record..
2.i can write minimum of 256 bytes at atime.. my record sze is only 100 bytes.. i need to utilise the (now wasted memory too..).

if some of u frnds have come across this problem before please help me by providing a logic to go by.
thnx in advance...


Post made: Sunday 05 October 2008 - 18:44:50
Posted by: pdi33

Post: maybe 'linked list' logic...
just an idea not sure still...
Tue Oct 07 2008, 04:10 pm
#2
hi Pdi33..

thnks for the reply..

maybe 'linked list' logic



well linked list is a handy tool when u r playing with RAM

here i am dealing with flash.. malloc (dynamic allocation of memory) may not work here.
i dont think i will be able to implement linked list in memory(flash), cause it has to be written sequentially 256 bytes at a time.
Tue Oct 07 2008, 06:56 pm
#3
shyam, i have a good explample that resembles your requirement, Wavecom's Flash APIs.

What they do is same what you want. Now think about logic.. how we can do the same
Tue Oct 07 2008, 07:58 pm
#4
this is what i am doing=>sector no.20 declare as SWAP.
each record = 60 bytes so in one page (256 bytes we can have 4 records!!)
so 1 record write to SWAP
2 record write to SWAP +256
3 record write to swap +512
4 record write to swap +768

5th record..
read record1 and save data1
read record 2 and save data2
read record3 and save data3
read record 4 and save data4

erase SWAP
catenate data1 data2 data3 data4 to data,

write @ TESTSLOT+0
...
...
...
write @ TESTSLOT+256


i already had some partial successs....

lets see. what is in store....
my client says i will have 2 stay @ his place unless this issue is solved!!!!!
missing my office


Wed Oct 08 2008, 03:53 am
#5
with the help and suggestion of ExperimenterUK
I have almost solved one of my problems..

now i can write/use 240 kbs of the 256 blocks..
previously...
I cud write only 60 bytes in the 256 blocks!!

wish he wud had posted his suggestions here...
I wud have thanked him a hundred times...

will post the logic tommorrow.. almost similar yo the one in the previous post!
Thu Oct 09 2008, 02:49 am
#6
:blush
Still .. as admin you could add those thanks to my "Thanked" count

Not that I care about that sort of thing


[ Edited Thu Oct 09 2008, 04:02 am ]
 shyam like this.
Sun Oct 26 2008, 02:38 am
#7
what was the logic?

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

ztaletpzca
Wed Apr 24 2024, 11:19 pm
IrardlPex
Wed Apr 24 2024, 08:42 pm
Charlestehed
Wed Apr 24 2024, 05:20 pm
Robertgurse
Wed Apr 24 2024, 02:43 pm
Richardedils
Wed Apr 24 2024, 04:07 am
Malcolmaccek
Wed Apr 24 2024, 01:21 am
ChrisLub
Tue Apr 23 2024, 05:21 pm
Davidbab
Tue Apr 23 2024, 10:41 am