Hello, I'm trying to figure out how to do something and I'm getting no where. Hope someone here can point me to some info on this... I have a program that uses three different short int 16 x 16 tables. My code is very stable and I don't need to change it much any more. What I'd like to find out is if there is a way to use Philip's flash tool to just program the tables and not the program. The tables change daily and I'm the only guy who has a seat of the Keil ARM tools. It's a real pain for the guys who are doing the testing to have to email me a new table set, me compile it, the send them back a hex file for them to flash the uC. Does anyone have any tips or sample code on how to do this (if it is possible)? I'm a hardware engineer, so make it simple :)
Some Ideas Fix the table locations then make a program to "edit" the hex file. Make the tables fall in full flash pages. Create the tables directly as as a hex file. Then send that as an update. There is always a second set of tools.
Will this table updating be necessary in the final product? If so, shouldn't you build-in some easy means to do it? "What I'd like to find out is if there is a way to use Philip's flash tool..." Have you tried asking Philips, or their microcontroller forum?
> Some Ideas Fix the table locations then > make a program to "edit" the hex file. > Make the tables fall in full flash pages. > Create the tables directly as as a hex > file. Then send that as an update. That's what I'd like to find out how to do! > There is always a second set of tools. If DKARM cost $200 that would be an option, at $2000 it not...
> Will this table updating be necessary in > the final product? Yes, from time to time. > If so, shouldn't you build-in some easy > means to do it? Yes, thats kinda what I'm trying to get some ideals and pointers on. >> "What I'd like to find out is if there >> is a way to use Philip's flash tool..." > > Have you tried asking Philips, or their > microcontroller forum? I know Philip's flash tool can do this, but I'm going to have to make DKARM put the tables in the some place every time and thats what I don't know how to do. I figured Keil's forum should be the place to ask this type of question...
"I'm going to have to make DKARM put the tables in the some place every time and thats what I don't know how to do." Assigning physical addresses is the Linker's job - so you need to look to the DKARM Linker Manual (or Locator, if it has a separate Locator). C51 also provides the _at_ keyword, which can be used to assign absolute addresses in the 'C' source code. I don't know if DKARM has similar - check the Compiler manual. "I figured Keil's forum should be the place to ask this type of question..." Yep - just trying to clarify what you're doing and where you're coming from.
"If DKARM cost $200 that would be an option, at $2000 it not..." But what is $2000 worth in terms of both your time and the time of these other guys...?
First you need to fix the loction of the tables so they do not move. The flash tools act as a programmer so it is easier. Look up the format for Intel Hex it is simple. the last line of the file is the end record. Append your new records to the end. Most programmers do not care if the same area is writen to twice. So this new data will over-write the tables the compiler put in. Then append a new end record. You should be able to try it with a text editor before you write any code to insure the phillps tools accept it.
You can use the _at_ attribute to locate any variable at a fixed address. This includes also arrays. Example: const int myval _at_ 0x20000 = 0x1234; I suggest to contact your local Keil support for further questions.
"const int myval _at_ 0x20000 = 0x1234;" So, when is C51 going to allow "_at_" to be used with initialisers then Reinhard? Seems like you're neglecting your old customers who've been paying their subscriptions for years when you give it to these ARM upstarts!
> You can use the _at_ attribute to locate > any variable at a fixed address. This > includes also arrays. > > Example: > const int myval _at_ 0x20000 = 0x1234; > I suggest to contact your local Keil > support for further questions. THAT's what I've been looking for!!! Thanks Reinhard! I may not have been clear, but I've known that I needed to fix the tables in flash at a certain location but I was not sure as to how to do it. Is the linker smart enough not to use the memory locations I set using the _at_ attribute's ? I've tried several times to read the linker script documentation to figure out how to do it there but after several minutes of reading I go into seizures and loose all muscle control. It isn't pretty. Thanks for the tip!
Is the linker smart enough not to use the memory locations I set using the _at_ attribute's? Yes. That is, if you locate variables using _at_ the segment that is created is an absolute segment located at the specified address. The linker understands this and does not locate other segments in the same memory. Jon
Stefan, we have tried to add _at_ with initialization to C51. It requires that we re-write major parts of the Compiler front-end (more than 6 months of work). We have it done now in CARM, since this is a complete new compile engine with a lot of innovation. The feature will also come in C51, but do not expect it soon (there are acceptable procedures in the Support KB). We are working here about 12-14 hours per day (and sometimes even on the weekend) to get the tools done. They are really complex and even the latest C51 toolset has many improvements (maybe not so much in the compiler, but in the debugger + IDE side). Sorry, I know this answer is not optimal for you. Reinhard
"We are working here about 12-14 hours per day (and sometimes even on the weekend) to get the tools done." I'm sorry, now I feel guilty for asking. Please take a holiday.
Can the _at_ attribute be used with GNU or only with the Keil ARM tools? I tried it with a GNU project and I got a: error: parse error before "_at_" If I can't use the '_at_' with GNU how hard is it to convert a project to use the Keil ARM tools? My code has been running so well that I've never wanted to mess with the new Keil ARM compiler because I was afraid that it would take too much time to get it running. Again, thanks for al of the help!!!
There are several programs that are configured for GNU GCC and Keil CARM. The changes are listed in: http://www.keil.com/support/docs/2968.htm