Hi
i want to put a table data at flash (at specific address). How can i save it to the compiled output file? The FLASH.INI file do this? How?
Thanks a lot.
A table is simply an initialised data structure; eg, an array.
Is there a reason why it needs to be at a specific address?
Yes, the specific address is important.
today im using a flash_write function to write this table, which writes every restart (not good)
"the specific address is important"
Would you care to share the reason?
Use scatter loading file. You can define the RO data/ table in a section and allocate that section to a fixed memory location. For more information see the scatter loading section in realview linker manual.
Regards
Suvidh
Thanks Suvidh
its seems a little complex but can solve my problem. another doubt is: If i want to fill the memory with some code like "jump to ###", what is the most easiest way to do this?
thanks again!
"its seems a little complex"
Only because of the fixed address - hence the question, why do you (think you) need it at a fixed address? If you explain what you're trying to achieve, somebody may be able to suggest a less complex way of doing it...
"If i want to fill the memory with some code like 'jump to ###', what is the most easiest way to do this?"
How about a table of function pointers? (although, of course, that would be calls rather than jumps)
Again, if you explain what you're trying to achieve, somebody may be able to suggest a simpler and/or more appropriate way of doing it...
If you are to do in assembly - You can use
LDR PC,abcd_addr
abcd_addr is your jump address. You can hava a section x and define a series of this instruction. Place that section at whatever fixed address you want. This is how I load the Interrupt vector table .
suvidh
thanks again suvidh.
can you send your example of scatter loading file? there is no examples in keil manual at home page.
andy,
try this to understand what i need... http://www.keil.com/support/man/docs/armlink/armlink_chdhbhfi.htm
"try this to understand what i need"
That doesn't say anything about why you think that you need to fix this table at an absolute address.
Of course, you may well have very good reasons; but if it isn't really necessary to your application, then you can make your life a whole lot easier by removing the unnecessary restriction!
So, again, if you say what you're actually trying to achieve then people may be able to suggest alternative ways to do it without having to resort to fixed, absolute addresses - thus saving you all this grief with scatter loading, etc!
Anybody said to you that my life is not easy because of a fixed address?? Maybe this restriction is unnecessary to you... think about it.
Mr. Sudivh already helped me with the answers that i was looking for. If i want some alternative to what i want to do, ill post a thread with this title: "Help, i need a alternative to do..."
90% of the users who get into troubles with absolute addresses, jump tables etc are trying to solve the wrong problem.
How do we know that you are not among those 90%? That is a reason why a well defined question normally mentions the reason behind the problem. Even if you think your indended solution is the best, you might be wrong.
"Anybody said to you that my life is not easy because of a fixed address??"
Yes: you did!
On 28-Sep-2007 at 07:37 you yourself said, "its seems a little complex"
As I said at the time, it is the fixed address that makes it "complex" - it would be a lot simpler it it weren't for the fixed address!
But, if you're happy with a "complex" solution where a simple one may well be sufficient - then, of course, you don't need any more suggestions!
"If you see every problem as a nail, then you will always propose a hammer as the solution"
Or, as Hans-Bernhard Broeker once said,
"This ... only proves that if you absolutely insist, you can drive a 10-inch nail into concrete using a fine-tip soldering iron, even if you have a perfectly usable hammer at hand. It spectacularly fails to answer the actual question, though: why the heck would anyone want to do such a thing?" http://www.keil.com/forum/docs/thread10430.asp
You can get more idea about how to do this from this article.
http://www.keil.com/support/docs/3237.htm