[SOLVED] Loading symbols only from ELF file

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] Loading symbols only from ELF file

    Hi,

    I'm working on the project which consists of several applications compiled separatlely. Some of them are supplied by another companies and available as binary only. Our build system prepares single hex file with all needed applications and settings in right places.

    I'm interested in debugging two applications we develop. I have ELF files for them, but there is no way to flash them directly. I need to flash merged hex file to have target running.

    Is there any way to flash hex file and load only symbols from ELF files? I found workaround to debug single application by loading elf with File.Open and then in AfterTargetDownload I erase flash with Target.EraseChip and flash merged hex with Exec.Download. I think this is more like a hack rather than solution and I guess there is simpler way to achieve the same behavior. Moreover this allows me to debug just one application at the time.

    In the past I worked with some other debug IDEs which provided functionality to load symbols only. I did not find it in Ozone manual, could you help me with this, please?

    Best regards,
    TRoland
  • Hi TRoland,
    Thank you for your inquiry.

    There are two options here, depending what you actually want to do.
    1) In case you want to debug the application without changing it, you could use "Attach to running program".
    Ozone User Manual (UM08025) - Chapter 5.3.1.2 Attach to Running Program:
    segger.com/downloads/jlink/UM08025_Ozone.pdf
    In this case no data is downloaded and Ozone simply attaches to the application.

    2) If you only want to flash the elf file, but preserve the memory containing the other images, you could use the Read modify Write method:
    wiki.segger.com/Read-Modify-Write_Flash

    Best regards,
    Fabian
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi Fabian,

    Thank you for your reply.

    I'd like to have 'single click' solution which flashes target before debugging. I think RWM should solve part of my problem - it will reflash only part of memory.

    Second part of my problem is to load multiple ELF files at once. Correct me if I'm wrong, but I think once I load ELF file with File.Load old symbols are removed. Is there any way to load symbols from 2 ELF files?

    Best regards,
    TRoland
  • Hi TRoland,

    troland wrote:

    Second part of my problem is to load multiple ELF files at once. Correct me if I'm wrong, but I think once I load ELF file with File.Load old symbols are removed. Is there any way to load symbols from 2 ELF files?
    This is correct. Only the last elf files debug information is kept.
    Debugging multiple elf files is on the wish list but not yet available.

    There are two solutions here:
    1) You download the elf file you want to debug as last elf file, with RMW enabled, so no data is lost during the process.
    2) You convert the .elf files to .hex files or similar, so that they do not contain debug information.

    The simplest and most direct approach here is probably 1).

    Best regards,
    Fabian
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi Fabian,

    Thank you for your explanation!

    I'll use RMW for now. I'll keep eye on Ozone updates to not miss multiple ELF files debugging feature in future.

    I think we can close thread as solved.

    Best regards,
    Roland
  • Hi Roland,
    Good to hear that you are up and running again.

    BR
    Fabian
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.