Posts by ram.techen

    Hello SebastianB,

    Sorry for late reply, I didn't get any e-mail notification from forum unfortunately!

    Here is the whole repository of code, with all build, deploy, and connection instructions: https://github.com/akowalew/piapp/tree/ozone-338c-test (on branch `ozone-338c-test`).

    I posted it into github because here I can't upload files larger than 1MB.

    Simply download whole repository and follow instructions.

    Hopefully it will help you to run the debug session on the target. If not, feel free to ask more questions.

    Kind regards
    Adam

    Hi AlexD

    Thank you for your reply. I did as you wish and I think I have isolated the problem even more!

    The main function has this body:

    Ozone 338c seems is fast as long as I don't open the Local Data window.
    But when I just open Local Data then everything gets slower and all further stepping is very slow, UI takes long time to refresh and so on.
    The same happens with Watch Data window after I add 'Character' variable into it, altough it's not as slow as with Local Data window opened.
    And also the same happens with Global Data window after I declare 'Character' as global.

    So, for me, it looks like maybe there is some problem with ELF parser or some problem with reading variables from memory/registers?

    I have attached both JLinkLog, OzoneDebugLog, ELF file and video recording.
    As you can see, in the beginning I have Local Data closed, and Ozone runs smoothly, steps instantly. When I only open Local Data window then it gets slow. You can see that I am shaking a mouse to show that UI is unresponsive during stepping.

    Kind regards
    Adam

    Hi AlexD

    Thank you for your support.

    As you suggested I am posting here JLinkLog files made with Ozone 338c for both scenarios (with `char Character; Character = 'x';` statements [slow] and without [fast]).
    I am also attaching screen recordings and even whole bare metal project source code.
    In order to compile the project I am using the arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf toolchain from ARM website: https://developer.arm.com/downloads/-/ar…chain-downloads .
    In case project sources can't be opened I have also mirrored them into github: https://github.com/akowalew/piapp/tree/ozone-338c-test

    As you see in FAST scenario stepping over is so fast that I can even hold F10 key continuously and Ozone just runs so fast.
    On the other hand in SLOW scenario the Ozone is fast only in the beggining. When entering the while loop it becomes so slow that I need to wait up to 5 seconds just to press F10 again. Just because of adding a simple variable and assignment into the loop. When I press F10 then whole Ozone is just completely frozen, during that I can't click/view/close/touch/move anything.

    PS: I am also attaching debug log of Ozone. Crucial part is stepping:

    BCK 0231:505 -------------------- Step Over ------------------------- <--- F10 PRESS
    BCK 0231:505 PC is on a new source line
    BCK 0231:505 Stepped a total of 1 machine instruction(s) <--- AFTER THAT UI FREEZES
    GUI 0235:198 Executing script function: AfterTargetHalt <--- UI GETS BACK (AFTER 4 SECONDS)
    ...
    BCK 0245:298 -------------------- Step Over ------------------------- <--- F10 PRESS
    BCK 0245:298 PC is on a new source line
    BCK 0245:298 Stepped a total of 1 machine instruction(s) <--- AFTER THAT UI FREEZES
    GUI 0249:016 Executing script function: AfterTargetHalt <--- UI GETS BACK (AFTER 4 SECONDS)

    So for me it looks like JLink has stepped to the next instruction probably fast, but maybe Ozone because of some bug needs that long time to update its UI?

    Kind regards
    Adam Kowalewski

    Hi AlexD

    Thank you for your response.

    Okay, so I have made another test and I think I have isolated the problem of slowdown on 3.38c!

    I made a very simple bare metal program like that:

    On version 3.34 everything goes all the time fast. But on version 3.38c the Ozone goes fast only until it reaches the while loop. After that all subsequent operations are slowed down dramatically. I kept pressing very fast F10 and this is what Ozone said in Console view:

    So as you see, before the while loop each StepOver is almost instant (less than 50ms) but right when reaching line number 11 (entering the loop) the Ozone gets veeeery slow (2-5 seconds delay).

    What is competely surprising for me is that if I delete line 21 and 22 (so leaving only NOPs and while loop) and fully restart Ozone:

    then it never slows down!


    So, what do you think, why adding a simple instructions like `char Character; Character = 1;` causes this giant slowdown?
    Maybe register allocation issues? Or maybe some ELF parsing issues? Or maybe even some stack calculation issues?

    Kind regards
    Adam


    PS: Yet another thing, maybe it is related!
    If I write a code like that

    Then I put a breakpoint on line 3 (end of function g).
    When program reaches that breakpoint and I press F10 then Ozone just keeps staying on that line, no matter how many times I press F10!
    If after reaching that breakpoint I delete it, then pressing F10 on line 3 makes Ozone to continue forever, and the program doesn't come back to line 14.
    But when I press F11 instead then Ozone properly goes back to line 14.
    So... maybe there is some problem related to stack reading/return address calculation in Ozone?

    Hello SEGGER Team,

    I am really enjoying using JLink PLUS and Ozone for debugging embedded targets, thank you.

    Recently I've started to implement a bare metal application for Raspberry Pi 3B+ (BCM2837, Cortex-A53, aarch64, at the moment single core).

    Yes, I know, SEGGER don't support officially this platform, but I've successfully managed to establish a full debug session using JLink and Ozone, and I am very happy of that. The only thing I had to write was a small little stub in the JLinkScript file for RPi 3B+:

    C: JLinkScript
    void InitTarget(void) {
      CORESIGHT_CoreBaseAddr = 0x80010000;
      JLINK_ExecCommand("CORESIGHT_SetCTICoreBaseAddr=0x80018000");
    }

    The reason I am writing a post here is that in recent Ozone (3.38c) the debugging of this target is very, very slow. Stepping to next lines takes 1-2-3 seconds, resetting the target even more. It's simply unusable. Registers are taking long to update, putting breakpoints slow, memory update is slow. I am working on Xubuntu 24.04 LTS, but on Windows 10 it works even slower.

    [Target interface speed is constantly 15MHz, I am using short JTAG cables, the ELF file is very small (100K). Based on experience with other processors (iMX6, STM32, others) it should work MUCH faster]

    I've tried going to older verions of Ozone and to my surprise I finally found version 3.34 (pure) that is working fast again! Everything works instantly. Stepping is instant, resetting is instant. No lagging. Everything refreshes amazingly fast. Love it.

    So my conclusion is - there is definitely some performance degradation between Ozone versions 3.34 and newer (3.34a is already slower).

    I've attached JLinkLog files from version 3.34 and 3.38c. I have separated with blank spaces crucial moments when stepping in code to next lines.
    As you can see, for 3.38c, the first STEP is maybe even fast, but all other are slower and slower.

    What brings my attention is that the biggest slowdown happens right after the `JLINK_ClrBPEx` function call:

    ...
    TF18006C0 046:381.787 JLINK_ReadRegs_64(NumRegs = 1)
    TF18006C0 046:381.792 SP (32) = 0x7FFE0
    TF18006C0 046:381.797 - 0.011ms returns 0
    TF18006C0 046:381.808 JLINK_FindBP(Addr = 0x0008068C)
    TF18006C0 046:381.814 - 0.007ms returns 6
    TF18006C0 046:381.820 JLINK_ClrBPEx(BPHandle = 0x00000006)
    TF18006C0 046:381.827 - 0.008ms returns 0x00
    TF5BF97C0 046:825.348 JLINK_IsHalted() <---------------- 500ms difference, SLOW!
    TF5BF97C0 046:825.391 - 0.043ms returns TRUE
    TF5BF97C0 046:825.395 JLINK_ReadRegs_64(NumRegs = 1)
    TF5BF97C0 046:825.413 CPSR (41) = 0x200003C9
    ...

    Where for Ozone 3.34 there is no big lag at all:

    ...
    TC30006C0 027:397.701 JLINK_ReadRegs_64(NumRegs = 1, Indexes:
    TC30006C0 027:397.705 194)
    TC30006C0 027:397.711 -- AARCH32_R13=0x3F215040
    TC30006C0 027:397.718 - 0.017ms returns 0
    TC30006C0 027:397.727 JLINK_FindBP(Addr = 0x0008067C)
    TC30006C0 027:397.733 - 0.005ms returns 4
    TC30006C0 027:397.737 JLINK_ClrBPEx(BPHandle = 0x00000004)
    TC30006C0 027:397.743 - 0.006ms returns 0x00
    TC71537C0 027:402.091 JLINK_IsHalted() <--------------- 5ms difference, fast!
    TC71537C0 027:402.124 - 0.033ms returns TRUE
    TC71537C0 027:402.127 JLINK_ReadRegs_64(NumRegs = 1, Indexes:
    TC71537C0 027:402.130 41)
    TC71537C0 027:402.158 -- CPSR=0x200003C9
    ...

    Maybe something has changed in respect to putting and clearing breakpoints in Ozone recently?
    Since stepping in the code involves putting and clearing a temporary breakpoint then maybe that's the issue?

    I have even tried swapping libjlinkarm.so library shipped with Ozone with other versions:
    - For Ozone 3.38c I replaced it with libjlinkarm.so.7.96.8 (older) and it is still slow.
    - However for Ozone 3.34 I replaced it with libjlinkarm.so.8.10.12 (newer) and it is still fast!
    So it looks for me more likely like a bug in recent Ozones.

    Please, take a look on that and fix it if possible.

    I know that for wide number of developers a lag of 1-3 seconds or more is not a problem, but the whole reason I am keeping buying JLink Plus for corporations is exactly to not wait that 1-3 seconds each time when I step over the code. :)

    Kind regards
    Adam

    PS: I would simply keep using version 3.34 and forget about 3.38c, but it has problems with updating 64 bit registers (for example version 3.34 can't set 64-bit PC correctly, leaving upper 32 bits with garbage), but for that I have also a small workaround in jlinkscript

    C: JLinkScript
    void AfterResetTarget(void) {
      JLINK_CPU_WriteReg(33, 0x80000);
    }

    (altough it just solves the problem of setting PC after reset, updating other registers from window is still buggy and leaves garbage in upper halfs, that's why I need to update my Ozone to newer one)

    Hi Alex,

    Thank you for your suggestions. I've installed V3.28b of Ozone and unfortunately, it works still the same. I need to grab a mouse, left click on "Break & Tracepoints" panel, and only then I will be able to issue CTRL+ALT+B hotkey that will open "Set/Clear breakpoint" dialog. When having focus on any other panel (either current source file editor, registers, global data, etc) this hotkey is not working...

    Kind regards
    Adam

    Hi Nino,

    Well... Not exactly. F9 is fine, but only if you are actually in the file and especially in the place you want to put a breakpoint. So, I need to first touch with mouse some exact line in source viewer and then F9 will work.

    At my daily job I just want to immediately set a breakpoint at some function, which name I know upfront, which is not even at any opened file. I just want to open O-Zone, hit CTRL+ALT+B wherever I could be, type the name of function and bam - I have a breakpoint - without even touching a mouse. So simple and fast.

    CTRL+ALT+B should be just a global key binding, like is e.g. CTRL+O (Open file). :)

    Best regards
    Adam

    Hi all,

    I am really enjoying using O-Zone as a debugger. It is great!

    I have a question regarding setting of breakpoints. As far as I know I can set a breakpoint by right-clicking on "Brake & Tracepoints" panel and choosing "Set breakpoint" option. I can also left-click anywhere on this panel to activate it and then press CTRL+ALT+B which will do the same. But... Is there any way to configure O-zone to have this key binding globally available? It is a bit cumbersome to always need first click on "Brake & Tracepoints" panel just in order to set one breakpoint. It can sound strange but is just slows always a bit my work. ;) At my daily job I just want to open O-Zone, hit CTRL+ALT+B and set my breakpoint, without any use of mouse. Is that possible? If not, do you have plans to implement it?

    Kind regards
    Adam