[SOLVED] JLink stack trace 0xA5A5A5A4

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

  • [SOLVED] JLink stack trace 0xA5A5A5A4

    Freescale K64F, KDS 3.2, FreeRTOS-aware debugging on Windows 8.1, JLink_Windows_V612a:
    One (and only one) of the tasks shows bad stack trace information.
    Program is running fine, plenty of stack space for this task.
    Please see image attached.
    Any idea what's going on?
    Thanks!
    Best Regards, Dave
    Images
    • Segger_bad_stack_trace.PNG

      58.13 kB, 863×681, viewed 1,095 times

    The post was edited 1 time, last by DaveN ().

  • Hello Dave,

    in general the IDE (KDS), or precisely its GDB client, is responsible for the stack trace.

    Did you turn on any compiler optimization?

    Regards
    Arne
    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.
  • Hello Dave,

    it's unlikely, that the task itself is the cause. Any suspended task is treated in the same way, so I suspect the function call xQueueGenericReceive().

    I just gave it a try using a sample project based on FreeRTOS V9.0.0 and a FRDM-K64F board, unfortunately the stack trace is OK and the task is
    suspended from within vPortYieldFromISR() called by xQueueGenericReceive():

    Source Code

    1. Thread #4 536805376 (Logger [P: 2]) (Suspended : Container)
    2. vPortYieldFromISR() at port.c:907 0xffa0
    3. xQueueGenericReceive() at queue.c:1,401 0x107ee
    4. LoggerTask() at Logger.c:184 0x1850
    5. 0x0


    Which version of FreeRTOS are you using? Is it possible for you to send us your queue.c file?

    Regards
    Arne
    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 Arne - I'm also using FreeRTOS 9.0.0 (with no changes).
    IIRC other tasks using xQueueGenericReceive show normal stack trace.
    I've attached the FreeRTOSConfig.h in case that is helpful.
    Thanks,
    Best Regards, Dave

    PS: Is 0xA5A5A4 a known special fill sequence?
    Files

    The post was edited 1 time, last by DaveN ().

  • Hello Dave,

    so far I was not able to reproduce it.

    Is it possible for you to send us the full project?
    If not, maybe you can strip it down to the specific task.

    Best regards,
    Arne

    PS: 0xA5 is the task stack fill byte, used for stack overflow detection (freertos.org/Stacks-and-stack-overflow-checking.html).
    This might have something to do with the value seen in the stack trace...
    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.
  • Hello Dave,

    if it is not too large, just send it to segger.com/support/technical-support/

    Best regards,
    Arne
    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.
  • Hello Dave,

    thanks for the project. You have turned on size optimization (-Os) for the debug build.

    This is the reason for the faulty stack trace. If you turn it off and rebuild the project with no optimization (-O0), it will work as expected.

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