Flash writes

Questions about the BASICtools and MakeItC
Post Reply
YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Flash writes

Post by YahooArchive »

>from the help line
>I am trying to store one persistant integer variable for my GPS
>control program. Simple test programs work but not in my full
>program. The compiler reports my code occupying 13K or $3400 words.
>This should put the top of my code at ~$6400 according to the help
>file memory map. I am not quite clear from the help for "Write"
>whether I have to have a clear 4K ($1000) block free or whether
>alignment has to be on $1000 hex boundaries. I have no Data
>allocations and minimal String Constants. Wherever I put the start
>of my subblock I either am obviously overwriting my code (below
>$6400) or I get a Data Abort error at run time. I use the minimum
>subblock size (256) as I only have one integer to store.

The User Manual lays out the memory map for the Flash. Blocks have to
be erased and "prepared" on $1000 hex boundaries.

So in your case it would probably be easier to copy the String
contents back into the block after you erase $7000. You can not use a
string function to do it, as the individual strings will be seperated
by 0's. So declare a String Array, but copy elements by--

DIM SaveStrings(128)

For i=0 to 127 by 4
SaveStrings(i) = *($7e00 + i*4)
next i

' write your value

Write ($7e00, SaveStrings, 512)

I haven't tried this, let us know how it works

PS remember the Flash is only rated for 100K writes, so don't be doing
it all the time.



YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: Flash writes

Post by YahooArchive »

Thanks for the clarification and suggestions. However even if I set the base for
the Write to $7000 I get a Data Abort message on execution irrespective of
whether I set the subblock to 0 ir 256. It seems the processor somehow knows
that block is in use.

I think I need to find some other way besides using a persistant variable to
solve my problem. I probably should have used the Express rather than the Mite
so as to have more room in Flash. How about having a SuperMite card using the
LPC 2106, but physically similar to the Mite to give the convenience of a single
board solution with the advantages of the larger Flash, RAM, and Xtal clock?

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: Flash writes

Post by YahooArchive »

>However even if I set
>the base for the Write to $7000 I get a Data Abort message on
>execution irrespective of whether I set the subblock to 0 ir 256. It
>seems the processor somehow knows that block is in use.

It really should work, though my example should not have had the by 4
in the FOR statement. As for the call with by 0, that forces the
sector to be erased. The problem being if you call with a write to the
same sector, it assumes it was already erased. You can look at the
data in the Flash with the @addr typed into the enter line.

>How about having a SuperMite card using the LPC 2106, but physically
>similar to the Mite to give the convenience of a single board
>solution with the advantages of the larger Flash, RAM, and Xtal >clock?

You could add a 24LC02 or similar, a couple wires and 50 cents or less.

As for an ARMmite with a 2106, you would lose ADs and the battery
backed up clock. But the reason we don't is, the volume demand is not
there. We would consider doing a "special" but you would have to order
10 or more units at a time, and it would get a snapshot of the current
firmware, with no promise of firmware upgrades.

Since this topic came up the SuperPRO has been added, which has much more Flash

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: Flash writes

Post by YahooArchive »

I can't get by the Data Abort errors whatever I do whenever my main 13K of code
is loaded.

I'd forgotten the 2106 has no A/D. I am using the A/D in this application. It is
a one off app so a special is not a solution. The 24LC02 certainly would be a
way to go. However I am zeroing in on a solution to my problem that does not
require persistant storage.

Anyway thanks for the help.

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: Flash writes

Post by YahooArchive »

--- In ARMexpress@yahoogroups.com, "Richard Grubb" <rgrubb@...> wrote:
>
>
> I think I need to find some other way besides using a persistant
variable to solve my problem. I probably should have used the Express
rather than the Mite so as to have more room in Flash. How about having
a SuperMite card using the LPC 2106, but physically similar to the Mite
to give the convenience of a single board solution with the advantages
of the larger Flash, RAM, and Xtal clock?
>

I second that motion!

Post Reply