Skip to content

Question: Why are the semaphore, mutex and byte pool _tx_*_created_count symbols mandatory (non-optional) for ThreadX detection? #92

@kennedyho-renesas

Description

@kennedyho-renesas

Hi @raphaelmeyer ,

First of all, thank you very much for your contribution on the ThreadX support in RTOS Views, it has been incredibly useful and greatly benefits all ThreadX users.

While testing ThreadX detection in RTOS Views, I have noticed that tryDetect() looks for the following 4 mandatory symbols (all 4 need to exist at the same time) for ThreadX detection to be valid.

  • _tx_thread_created_count
  • _tx_semaphore_created_count
  • _tx_mutex_created_count
  • _tx_byte_pool_created_count

Reference: https://github.com/mcu-debug/rtos-views/blob/61ecf956b574f06f41964d0b7f8a113ddd71ec2b/src/rtos/rtos-threadx.ts#L158C1-L184C19

This seems to work fine for ThreadX applications that use all the 4 ThreadX objects.
However, for minimal or size-optimized ThreadX applications that do not create 1 or more of these objects, ThreadX is not detected.
For example, if the application does not create a mutex by calling tx_mutex_create(), the linker typically omits the mutex module entirely, which causes the _tx_mutex_created_count to not be included in the image. In this case, ThreadX detection will fail for RTOS Views even though the application is running ThreadX.

My questions regarding this would be:

  • Is there a specific technical reason or design intent behind requiring all 4 symbols to be present for a ThreadX detection to be valid?
  • Would it be possible to relax the rules for ThreadX detection, such that only _tx_thread_created_count is mandatory, and making other symbols for semaphore, mutex and byte pool symbols optional (opt for getVarIfEmpty set to true for example) so that minimal or size-optimized ThreadX applications can still be detected?

Please let me know your insights regarding this, and thank you once again for your contribution.

Best regards,
Kennedy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions