Keil Logo

Using Keil Hex file for programming

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

Details Message
Author
Yaron Lederman
Posted
20-Apr-2017 10:52 GMT
Toolset
ARM
New! Using Keil Hex file for programming

Hi,

I'd like to use the .hex output of the Keil compiler to program ADU320 flash.

After reading thu http://www.keil.com/support/docs/1584/ i created a python which turns the hex file to c sructure
Then I read the ADU320 flash to compare FLASH content with Hex output

The data in the ADU320 flash differs from HEX file

so what needs to be programmed ?

Thank you
Yaron

Author
Andrew Neil
Posted
20-Apr-2017 14:11 GMT
Toolset
None
New! RE: i created a python which turns the hex file to c sructure

Why? What is the point of that?

Surely, your programming tool already has a 'Verify' facility??

"The data in the ADU320 flash differs from HEX file"

So how, exactly, does it differ?

Are you sure that the chip was actually programmed with the same code in the first place?

Note that a Hex file typically only contains data for the locations that actually need to be programmed - so there may be "gaps" ...

Does the code use Flash for any data storage?

Maybe you have bugs in your python converter and/or your comaprison tool?

Author
Yaron Lederman
Posted
20-Apr-2017 15:28 GMT
Toolset
ARM
New! RE: i created a python which turns the hex file to c sructure

My product is a module based on the ADU320.
I have a host system which simulates customer system and want to program the module. Until now I used the Keil with ULINK programmer to program module

The point of the converter is to allow easy embedding of module ADU320 code into host system

The hex file is the output of the compilation which is then programmed with Keil with ULINK programmer. Why should the files differ in such a case ?

They differ at many places and the python seems to work well after some random tests in the hex layout

i look for gaps in the he altho it looks consecutive

any idea how the keil goes about programming from code - pointers?

Thank you

Author
Hans Schneebauer
Posted
24-Apr-2017 10:27 GMT
Toolset
ARM
New! RE: i created a python which turns the hex file to c sructure

>After reading thu http://www.keil.com/support/docs/1584/ i created a python
>which turns the hex file to c sructure

I don't know why you are doing this. A hex file is text and two hex files can be compared with a text editor to see if they are identical. If the hex file comes from different sources (programmer or MDK), you might have to convert it. However, there are free tools available to convert files to any format with many options. Please see:
http://www.keil.com/support/docs/274.htm (convert to binary file)
http://www.keil.com/support/docs/2218.htm (convert to C compatible constants)

Please send an example of the code differences in the support case you have opened.

Author
Westonsupermare Pier
Posted
24-Apr-2017 15:32 GMT
Toolset
ARM
New! RE: i created a python which turns the hex file to c sructure

.HEX file do not have to be linear, or describe all memory. You'd do better converting each to a binary image for the ROM(s) in question and doing a binary compare. If you normalize the files you might be able to do a diff/compare, but if you understood the data and what it is describing you'd appreciate there are more effective ways to do that.

The Keil tools send programming code into RAM, and then send blocks of binary data in to RAM, and execute the programming code. They don't send the .HEX or .AXF files directly.

Author
Yaron Lederman
Posted
25-Apr-2017 09:56 GMT
Toolset
ARM
New! RE: i created a python which turns the hex file to c sructure

Hi,

Thank you for the links actually I looked for these kind of tools but then wrote them..
Now I verified with my program again and after reading the KEIL programming process I reset my module before creating the dump from within my design, so that I was not running with debugger, and now indeed the Keil output and memory dump look identical.

I also dumped from within the Keil using the save command and received the same file.

So I think we can close the support case

Thank you

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

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.