[SOLVED] BreakPoint callback on function name

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

  • [SOLVED] BreakPoint callback on function name

    Actually, I think I can do what I need as follows:


    Break.SetOnSrc("function_name")
    g_var = Elf.GetExprValue("function_name")



    void AfterTargetHalt()
    {
    if (g_var == Target.GetReg("PC"))
    {
    // Execute callback here
    }
    }

    Hoped there might be a more direct way!
  • Hello David,

    Thank you for your inquiry.
    Yes you can use Break.SetOnSrc with symbol names directly.
    How is explained in the Ozone manual in section 7.9.21.3 Break.SetOnSrc.

    An example project where the a callback is executed automatically after the BP is hit can be found here:
    wiki.segger.com/Automated_Tests_with_Ozone#Debug_example

    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.
  • Thank you Nino, that's what I was looking for.

    However, I've noticed that I have to insert a delay which isn't present in the automation example in order for things to work;

    Break.SetOnSrc("TriggerFunc");
    Util.Sleep(5000); // Without this, the Break.SetCommand won't find the TriggerFunc...
    Break.SetCommand("TriggerFunc","ProcessTrigger");

    ...Is this expected?

    Thanks

    David
  • Hello David,

    Depends on where you do the calls.
    Could you provide your .jdebug file for reference?

    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.
  • Hi Nino

    Thanks for your response- Since posting this, I believe this issue might relate to a more significant issue for me where during the target download phase, where I'm seeing the "Timeout while checking target RAM , core does not stop message", UNLESS I override the default TargetDownload routine and place a Sleep(5000) before Exec.Download.

    As this describes a more pressing issue for me to resolve, feel free to mark this post as resolved and I'll raise a support ticket.

    Many thanks

    David