Cart New Account Login

HomeAbout usProductsSupportForumsBlogCustomer Service

search inside this forum
viewing C source code
anthony h. Apr 18, 2015 at 01:12 PM (13:12 hours)
Staff: Takao Y.

  • Hi All,
    I hope someone can help me out with this. I'm trying unsuccessfully to get (C) source level debugging working on the usb coldfire multilink. I'm producing two files, .s19 and using object copy to produce an elf file. I emailed P&E support to show my files before I bought the product and they told my my object files were fine for C level debugging, so think these are OK.
    What I do, to load the s.19,
    HLOAD name
    which reports
    “31 source line recordings in 1 file
    859 symbols
    110608 object bytes loaded”

    I them load the map produced with make map
    “HLOADMAP name
    31 source line recordings in 1 file
    859 symbols
    110608 object bytes loaded”

    In my source window I make sure I have source/assembler clicked. And from the left click menu I have name.map ( only option ) selected as source, should there be a list of c files?

    However I can see no source just assembler, when I break in a function. I can see variables in the watch window.

    For elf I use m68k-coff-objcopy-O srec -R .id -R .system $(output).cof $(output).elf

    Anyway with the elf on load it gives the same message and no source.

    Can anyone advise how I view the C source code? In my make I'm using “-gcoff3 -g” so think I'm giving out debug information.

    Thanks




    Comments

  • Greetings,

    Using the hload commands only loads your object file into RAM. If you actually want to debug flash, then use PROGCFZ software to flash program your chip with your S19 or ELF file. This could be a reason why you may see odd behavior when moving the program counter to flash addresses.

    Note, that S19 file is just a binary file and has no debugging information. Usually a MAP file is generated with an S19 file during compilation that has the debugging information. ELF file has both binary and debug info if compiled correctly. Using OBJCOPY to generate an ELF file from an S19 file will only have binary information. Have your compiler generate the ELF file for you. It is THE standard for object files.

    Within ICDCFZ, then you can either hload S19 file and then hloadmap the MAP file, or just hload the ELF file to get both. This should populate the source file paths.

    If you are not seeing a list of C files, that means you did not compile with the correct file paths. The ICD software will not dig through any directories to find source files so make sure to compile with full or relative path to the source file.


    Takao Yamada

  • Hi Thank you for the swift reply Takao,
    I'm still slightly confused and have a few more questions.
    For the moment I'll just talk about .s19, .map file and running in RAM. This works fine except I can't see source. As shown in my first email I load the .s19 then .map ICDCFZ shows the following messages for both


    “HLOAD name
    31 source line recordings in 1 file
    859 symbols
    110608 object bytes loaded”
    “HLOADMAP name
    31 source line recordings in 1 file
    859 symbols
    110608 object bytes loaded”



    After this I can see my variables in the watch window and can set break points by function name. However no source, it does say “31 source line recordings in 1 file” so I presume it's loading source files but the locations are wrong? You say “If you are not seeing a list of C files, that means you did not compile with the correct file paths” I'm unsure how I can compile with the wrong path? The code wouldn't compile? Do you mean in my make file I need to use absolute path rather than relative? EG from my make file

    SOURCE= Source
    COMMON= ../../CommonFiles


    objects = $(SOURCE)/Controls.o\
    $(COMMON)/TaskManger_Control.o\

    Are you saying I need to change my make to show absolute paths?
    Eg
    SOURCE= c:/tony/documents/development/projects/development/test/Source
    COMMON= c:/tony/documents/development/projects/CommonFiles
    etc?

    Is there no way I can say inside ICDCFZ to set source code paths or have a start up file showing them?
    Thanks for the help.

  • I should add my compiler produces m68k-coff, I use object copy to produce .19 and .elf

  • Greetings,

    I want you to try using the 'SOURCEPATH x' command within ICDCFZ, where x can be the relative or full path. See if this will display your source code. If it does, then your ELF or MAP file still has problems with source pathing.

    Take a look inside your MAP file and you will see all of the paths. Check to see if these are correct and that paths are not just directories but to the actual file. Again, ICD software does not have the capability to find files within a directory.


    Takao Yamada

  • Hi,
    As far as I can see my .map file contains no path data. I tried to use SOURCEPATH to point to a file. Ran the code it stop at the break point for a function shown in the source code. But no source code is shown.
    My compiler output coff using m68-coff-gcc, this is converted in my make file using object copy. I can see the s19 and elf are half the size of coff.

    make commands
    oc      = m68k-coff-objcopy

       $(oc) -O srec -R .id -R .system $(output).cof $(output).s19

       $(oc) -O srec -R .id -R .system $(output).cof $(output).elf


    Is the fact it is coff and the conversion issue? if so how can I get round it ? Thankyou.

  • Greetings,

    I have never used m68k-coff before so I am limited in how I can help you in compiling and linking.

    I think what you need is to use our GNU C Compiler and it has instructions on how to use it:
    http://www.pemicro.com/products/product_viewDetails.cfm?product_id=15320003

    This is the compiler we use at P&E for many years and it has never given us problems with getting the files compiled. For $30 it is an easy and quick solution. We can send you the compiler electronically as well.


    Takao Yamada

  • Thank you I'll contact my board vendor, their hardware library files are coff so hopefully they'll release their source to me so I can compile the libs as m68k-elf rather than m68k-coff.

    Just to confirm this is the compiler for the 5206e colfire.

  • Greetings,

    It will work for all ColdFire. However, you should get the synchronous cable from us to get it working with our hardware tools. It is only needed for the MCF5272 and MCF5206/5206E:
    http://www.pemicro.com/products/product_viewDetails.cfm?product_id=15320043


    Takao Yamada

Add comment


   Want to comment? Please login or create a new PEMicro account.







© 2017 P&E Microcomputer Systems Inc.
Website Terms of Use and Sales Agreement