[SOLVED] Debug Atmel SAM9261 with JLink and Ozone

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

  • [SOLVED] Debug Atmel SAM9261 with JLink and Ozone

    Hello,

    I'm trying to debug a board with an Atmel SAM9261.

    The application has also a bootloader. I don't have the .elf file of the bootloader but only the applicative part.

    The only way that allow me to connect to the target is performing an "attach to running program".

    I get this log:


    Disabled output of control characters
    J-Link software found at: C:/Program Files/SEGGER/Ozone V3.10b/JLink_x64.dll
    File.Open ("C:/Users/OlivoNic/Documents/Progetti Ozone/PROTHERMETIC/PROTHERMETIC.jdebug");
    Project.AddPathSubstitute ("C:/Users/OlivoNic/Documents/Progetti Ozone/PROTHERMETIC", "$(ProjectDir)");
    Project.AddPathSubstitute ("c:/users/olivonic/documents/progetti ozone/prothermetic", "$(ProjectDir)");
    Project.SetDevice ("AT91SAM9261");
    Target core support plugin loaded.: C:/Program Files/SEGGER/Ozone V3.10b/Plugins/Core/CorePluginARM.dll
    Project.SetHostIF ("USB", "");
    Project.SetTargetIF ("JTAG");
    Project.SetTIFSpeed ("1 MHz");
    Project.AddSvdFile ("C:/Program Files/SEGGER/Ozone V3.10b/Config/CPU/ARM9.svd");
    File not found: C:/msys/1.0/home/yagarto/gcc-4.2.2/gcc/config/arm/lib1funcs.asm
    File.Open: completed in 248 ms
    File.Open ("C:/Users/OlivoNic/Documents/progettiGIT/EPR/ui_copui70_prothermetic/FW/bin/emulator.elf");
    Edit.Preference (PREF_SHOW_EXEC_COUNTERS_ASM, 0);
    Edit.Preference (PREF_SHOW_ENCODINGS_ASM, 0);
    Edit.Preference (PREF_SHOW_EXEC_COUNTERS_SRC, 0);
    69 source files not found
    Debug.SetConnectMode (CM_ATTACH);
    Debug.Start();
    Device "AT91SAM9261" selected.
    TotalIRLen = 4, IRPrint = 0x01
    JTAG chain detection found 1 devices:
    #0 Id: 0x0792603F, IRLen: 04, ARM926EJ-S Core
    CP15.0.0: 0x41069265: ARM, Architecture 5TEJ
    CP15.0.1: 0x1D152152: ICache: 16kB (4*128*32), DCache: 16kB (4*128*32)
    Cache type: Separate, Write-back, Format C (WT supported)
    Connected to target device.
    Memory access: CPU temp. halted: wiki.segger.com/Memory_accesses#Legacy_stop_mode
    J-Link: ARM9 CP15 Settings changed: 51078 from 78, MMU Off, ICache On, DCache Off
    Executed J-Link command "ReadIntoTraceCache 0x20000000 0xA1288"
    Executed J-Link command "ReadIntoTraceCache 0x200A1288 0x70"

    Error (75): Failed to start high speed sampling (HSS).


    When I set a breakpoint the application halt correctly but when I try to do a Step over or a Step Into, the behavior become strange.
    It seems like that the lines of code are not executed in the expected sequential way. The highlighted green line move up and down without following the istructions flow.

    The compiler is GCC 4.2.2 an the optimization is set to -0s
    Other compiler flags: -g -mcpu=arm9

    What I'm doing wrong? What could I try in order to solve this problem?

    Another question: is it possible to see the value of a variable without halting the processor, or this is possible only on Cortex M?

    Thank you

    Regards,

    Nicolò O.
  • nicolo.olivotto wrote:

    It seems like that the lines of code are not executed in the expected sequential way. The highlighted green line move up and down without following the istructions flow.
    Hi Nicolo,

    That's because of compiler doing its best optimising the code, -Os option. Also, instead of -g option it is better to use -g3 : you can see the values of enums and macros in the debugger.

    Hope this helps,

    Vadim
  • Hello Nicolo,

    Thank you for your inquiry.
    How to debug a target with a bootloader in Ozone is explained here:
    wiki.segger.com/Debug_on_a_Target_with_Bootloader

    Best regards,
    Nino
    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.