Discussion Forum

Is it possible to add a HEX File as a part of a program or data set to my project?

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Read-Only
Author
Stefan Pindl
Posted
18-Nov-2009 14:49 GMT
Toolset
ARM
New! Is it possible to add a HEX File as a part of a program or data set to my project?

In my application I use one block of the flash area as data area. A external progam creates a HEX file containing this datas: (example:

:020000040800F2
:020000020000FC
:207C0000207A6D657F04000007000000090000000900000009000000090000000900000041
:207C20000900000009000000090000000900000009000000090000000900000009000000FC

)
This data area can be written by a flashloader program directly to the specified block.
This works fine in my target system without the debugger. But, if I load the generated hex file by the linker to the target memory with the ulink debugger the specified datas are missing (of course)!
Therefore
Is there any possibility to link the external hex file to my application hexfile?
P.S. I've read the "http://www.keil.com/support/docs/2666.htm" app-note as well as "http://www.keil.com/forum/docs/thread15460.asp" and "http://www.keil.com/forum/docs/thread3592.asp" and "http://www.keil.com/forum/docs/thread3564.asp" but I couldn't find a usefull hint to integrate the external hex file directly to the application hexfile!

Read-Only
Author
while (1);
Posted
19-Nov-2009 06:32 GMT
Toolset
ARM
New! RE: Is it possible to add a HEX File as a part of a program or data set to my project?

One possible solution is to convert it to binary file, then convert binary to a code constant variable and position it in your program at absolute position where you want it to be.

Read-Only
Author
Stefan P.
Posted
20-Nov-2009 07:05 GMT
Toolset
ARM
New! RE: Is it possible to add a HEX File as a part of a program or data set to my project?

Ok, I know so far how to convert a hex file to a binary file! But how to convert this binary to a code constant array? And how to place this at an absolute adress?
I need to to this at every run of the compiler linker, because my datas might be changed each time!

Read-Only
Author
while (1);
Posted
20-Nov-2009 07:13 GMT
Toolset
ARM
New! RE: Is it possible to add a HEX File as a part of a program or data set to my project?

For converting bin to c, you will have to find an utility online, you can look for something like bin2c, or you will have to write such an utility yourself.
For absolute address positioning you can use "__at" directive or you can use custom defined linker script.
You will have to read the documentation on using __at or linker script for details.

Next Thread | Thread List | Previous Thread Start a Thread | Settings