Hi, I am starting my very first embedded microcontroller project and I need some assistance. I am a bit overwhelmed with all the options in the Keil IDE. I have a phillips P8xLPC76x emulator and I am trying to get its IDE to display the source code in C to step through rather than than the assembly language and show the variable debug info. I have set the option in keil to produce a hex file (hex-80 is the only option), on the options page (debug & browse are ticked). Yet the emulator will not show the source code. I had a look in the emulators help file and it mentioned the following: ------------------------------------------- To produce object files suitable for PDS51 with the Keil C compiler, follow these steps: The compiler needs to be instructed to output line number debug information to the relocatable output file produced by the compilation of each module. This is normally achieved with these compiler command line options: C51 proj.c debug The resulting relocatable object files can then be linked with other modules and libraries to produce the absolute output file: L51 proj.obj to proj.omf dl ds dp This produces an object file called PROJ.OMF which can be loaded by PDS51. The options DL (DEBUGLINES), DS (DEBUGSYMBOLS) and DP (DEBUGPUBLICS) instruct the linker to also produce symbolic and line number information needed by PDS51 for full source-level debugging. You can also specify other options to set the segment starting addresses, etc. -------------------------------------------- The emulator supports loads of object files, i have got it loading the general intel hex format at the mo but i suspect i need the 'keil c compiler - omf51' version?? Can anyone shed some light on what i need to do to enable in keil to get the right hex file with the right debug info. Sorry about the length of the message - just trying to give you some info. Thanks Barry
I do not know about the Philips emulator, but the CEIBO emulator show C source as expected when loading .abs and assembler only when loading .hex. Erik
I'm not completely sure since I am not familiar with the tools you are using but I think you need the OMF file. Here is a knowledge base article that may help. http://www.keil.com/support/docs/181.htm
Thanks for the help. The document you suggested did the trick. The keil's omf file is the the file without the file extension - made by the linker. I renamed the file to .omf and loaded it into the emulator and the source code showed up! I have changed the default filename in keil, so hopefully it should have the correct file extension next time i compile it. Thanks for the help Barry
Hex files have no debug information in them. They're just a way to describe a binary file so that you can locate different pieces. The OMF file has debug information, so that's the one for source-level debugging. Some emulators (Nohau) have trouble with the "browse" information generated, so you shouldn't check that option, but just stick to "debug" information.