Hex file to c file
Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow.
Learn more. Asked 7 years, 3 months ago. Active 5 years, 8 months ago. Viewed 12k times. Improve this question. Keith Thompson k 41 41 gold badges silver badges bronze badges. I'm not sure you understand what "hexadecimal values" means. A hexadecimal value is an ascii string that represents a number using hexadecimal characters A-F, just as a decimal value is an ascii string that represents a number using decimal characters Are you actually trying to write the binary data to the file?
DaleWilson - hexadecimal value is an ascii string , Just a nit. Otherwise I might say: Not all ASCII strings are hexadecimal representations of numbers, but all hexadecimal representations of numbers are character strings containing the above mentioned characters. DaleWilson - No problem. I was just struck funny by the phrase. The modified code only output to port B5 and D5. Can you explain that? Quote: I ran your modified code.
Quote: I don't have the tools to do that. Do you have the tools to run the code, or not? Quote: So is there a way to make sure that I port it to gcc correctly without having to hook it up to an actual chip and test it? That depends on the complexity of the code, and on how the application interacts with its environment and on a lot of other things.
You could verify a very simple application by just inspecting the generated machine code. For a complex application you might have to set up a long suite of tests and actually run them, in a simulator or on a real system, with both the old and the new firmware and verify that both generations of the application behaves the same.
We now actually need to define the criteria for "behaves the same", but that is a long story by itself. Suffice to say that it might be acceptable to have some deviation in eg timings as long as the application interacts as it should with its environment. Thanks everyone for reading this post. I got a contractor in to help. It was two line of codes. Looking at the diffs file, I only appear to have changed IAR system include files for the avr-gcc equivalents and altered the ISR syntax.
Only you know what the program should or should not do. I can show you how to port a program, but the functionality is your responsibility. I am not sure if the hex file is from the original source code. I only got what the owner gives me. When I ran the new code, AVR studio did not call the tmr0isr. I guess in IAR, it gets called automatically. So I had to put one line of code in the main function to call the tmr0isr.
I presume that if you do not supply a function of this name, it will use a library default. So you would need to specifically call this function at the beginning of main in another compiler. Please let us know if this was the case. And obviously this is a necessary step in porting IAR code. Skip to main content. Log in or register to post comments. Go To Last Post. Level: Rookie. Posts: 31 View posts. Sep 5, - AM. Fivestar widget 1 2 3 4 5.
Level: Moderator. You should upgrade or use an alternative browser. How to convert hex file to C source code? Thread starter abes Start date Apr 20, Status Not open for further replies. I could not retieve the data back on the hard disk.
Interestingly my laptop hard disk where I had back-up also crashed due to voltage fluctuations. I can get the hex file back from the microcontroller chip but want to get the source code back in order to modify the program. Please help. FvM Super Moderator Staff member. Some manual editing will be usually necessary to make it a valid assembly source. Reconstruction of the high level C code will be completely manual work. There's no unique relation of assembly to C code.
For all practical purposes it is not viable, it may be possible but I haven't seen any such thing. I think It is possible to convert to high-level language, if you have.
Actually it's possible to retrieve the Hard disk information. Usually the problem is: 1. The problem is bad or weak sector or there is wrong record - you can use some software to recover data - Disk Recovery Software and Hard Drive Recovery tool for Windows or you can use SpinRite software, etc. Mechanical - even if the problem is mechanical there are many companies who recover the info directly from the disk surface.
0コメント