We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello alltogether,
for me a binary-file (.hex or .bin) looks like there is no structure in it.
Do you know if it could be possible, to mark all my binarys, so that i can recognize? E. g. with a unique string i could grep or ? Or let's say line xyz start always with with same chars.
Do I have the opportunity to mark all my binaries like that? Is it actually posible?
I develop with ARMClang
Greets
why?
the debugger resolves itr without your 'help'
hi,
what do you mean with the debugger? How can he help me in this situation?
I'd like to just download binaries on the hardware that are made by me (binaries that have my mark)
again why?, knowing why might bring up a solution
puts("The MARK of the BEEF"); // Should be visible
You could also put stuff in startup.s after or in the vector table, ie DCD 0xDEADBEEF
Generally you can also put strings, and arrays in the C file also, static const often works well, but you usually want to refer to them somewhere so the linker doesn't do dead code/data removal on it.
pdev said:a binary-file (.hex or .bin)
A Hex file is not binary!
A hex file is a text file - which represents binary data.
pdev said:mark all my binarys, so that i can recognize? E. g. with a unique string
Sure you could; eg,
static uint8_t my_magic_marker[] = { 0x01, 0x02, 0x03, 0x04, 0x05 };
Perhaps more useful would be some thing like
static char date_string[] = __DATE__; static char time_string[] = __TIME__;
Which you could then send to some output device - to verity that you're running the right version; eg,
printf( "Built on %s at %s.\n", date_string[], time_string[] );
pdev said:i could grep or ?
grep is usually for text files - so probably not the best tool here?
Thanks,
My .hex looks like this
:020000040800F2:1000000078930220E90002086D6602083D58020854
.....
I dont see there any strings it have in my printfs.
Do I use a wrong hex? i use the Objects/<Projectname>.hex
Again, .hex is not a binary file!
It is the binary encoded into a text format - so you are not going to see your "strings" without decoding it back to the binary.
There are plenty of references online which describe the Intel Hex format; eg,
http://www.keil.com/support/docs/1584/
https://en.wikipedia.org/wiki/Intel_HEX
As all ready noted, you do seem to be making a lot of unnecessary work for yourself here!
I would suggest that you just get on and start writing some programs, loading them, and running them.
Once you've got to grips with these basics, then you can start worrying about fancy details like this!
Do you have teachers / supervisors / colleagues / co-workers to help you?
Or start here:
http://www2.keil.com/mdk5/learn
http://www.keil.com/books/