Visual Live Watch FreeRTOS static tasks

Sysprogs forums Forums VisualGDB Visual Live Watch FreeRTOS static tasks

This topic contains 4 replies, has 2 voices, and was last updated by  elivoe 3 days, 23 hours ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #28860

    elivoe
    Participant

    Hi,

     

    I am using VisualGDB for embedded software development on Infineon XMC microcontrollers. There I am using FreeRTOS with static tasks to keep heap allocation as little as possible.

    I found two problems regarding the visual live watch windows and static tasks in FreeRTOS:

    1. The FreeRTOS tab disappears if there are only static tasks/queues/… in the code (no heap allocation of FreeRTOS).
    2. There is a problem with the stack usage values, as you can see in the attached picture.

    It would be great if you could fix those problems as static tasks are quite useful for embedded development.

     

    Thank you very much!

    Yours,

    Elias

     

    Attachments:
    You must be logged in to view attached files.
    #28862

    support
    Keymaster

    Hi,

    No problem, we will be happy to look into this. Would you be able to share a basic project that reproduces both issues? You can either attach it here as a zip file (make sure you delete the built files), or upload it to an external file sharing service.

    #30307

    elivoe
    Participant

    Hi,

     

    I am again debugging a FreeRTOS based system with tasks with statically allocated RAM. So I have created a demo project with and tried to get closer to the problem. The demo project runs on a XMC4500 as I don’t have an STM32 in the office to test it. But I think you should be able to just copy the code from the main.cpp and test it with an STM32 project.

    I have summarized what the two problems behave like:

    Problem 1:
    If nothing from the FreeRTOS heap is allocated the system does not recognize that there is FreeRTOS running on the controller. In the live watch windows the FreeRTOS button is not visible.  As soon as there is at least one task with dynamically allocated RAM created or anything else allocated from the FreeRTOS RAM (i.e. via pvPortMalloc(1)), all tasks (cynamically and statically allocated) show up in the live watch  view. The problem could be that the ucHeap field gets removed if there is nothing allocated from the FreeRTOS heap. Are you checking for this field?

    Problem 2:
    If there are two or more tasks with statically allocated RAM created the live watch view in FreeRTOS mode shows strange stack usage value for all tasks except the first created (only talking about the tasks with statically allocated RAM). In this example the live watch shows the following stack usage for the first demo task: 708 bytes remaining which would be fine, but shows 631612121 / 631612829 bytes for demo task 2.

    It is also interesting that the stack usage for task on the heap is formatted in the style 92/400 and the format of the task in the stack is 708 bytes remaining.

     

    See my attached screenshots for further details.

     

    Hope this information and the attached demo project can help you finding the problem.

    Attachments:
    You must be logged in to view attached files.
    #30348

    support
    Keymaster

    Hi,

    Thanks for the detailed demonstration. We have updated Live Watch to properly support statically allocated threads and queues. Please try this build: VisualGDB-5.6.1.4098.msi

    #30357

    elivoe
    Participant

    Hi,

     

    I have tested the build and it works perfectly. Thank you very much for the adaptions!

    • This reply was modified 3 days, 23 hours ago by  elivoe.
Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.