question

GRyoji-3468 avatar image
0 Votes"
GRyoji-3468 asked GRyoji-3468 commented

AzureRTOS(ThreadX) TX_ENABLE_IAR_LIBRARY_SUPPORT compile option

It seems that ThreadX of Azure RTOS has a compile option called "TX_ENABLE_IAR_LIBRARY_SUPPORT".
Let me ask you a few questions about that.
1. What is the effect of enabling this?
2. Also, are there any conditions or restrictions when using it?
For example, the CPU that can be used and the target environment are limited.
3. Do I need to enable it when developing in an IAR environment?
Also, is there any inconvenience when not enabled?

azure-rtos
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@GRyoji-3468 Community Members, SME's on this topic or our team will review your scenario and circle back at the possible earliest time.
Meanwhile, please look into this post from Renesas : https://en-support.renesas.com/knowledgeBase/16977607 and see if it helps.

TX_ENABLE_IAR_LIBRARY_SUPPORT is defined when the IAR compiler and libraries are used, it is specific to the port and valid only in that context. When IAR is used it is defined, otherwise not.

0 Votes 0 ·

AshokPeddakotla-MSFT, Thank you for your quick response.

I checked the information on the web page you introduced, but there was no detailed explanation
about the function when "TX_ENABLE_IAR_LIBRARY_SUPPORT" was defined,
so I hope you will get a more detailed answer.

0 Votes 0 ·

1 Answer

AndresMlinar avatar image
1 Vote"
AndresMlinar answered GRyoji-3468 commented

The IAR C run-time library offers thread local storage and reentrancy support. In order to use those capabilities with ThreadX this symbol needs to be defined during compilation. For more information about the IAR C run-time library please refer to their documentation.

This capability is port specific and hence documented on the port readme file (for Cortex M7, that file is here https://github.com/azure-rtos/threadx/blob/master/ports/cortex_m7/iar/readme_threadx.txt)

Here is the relevant chapter from that readme file:

  1. IAR Thread-safe Library Support

Thread-safe support for the IAR tools is easily enabled by building the ThreadX library
and the application with TX_ENABLE_IAR_LIBRARY_SUPPORT. Also, the linker control file
should have the following line added (if not already in place):

initialize by copy with packing = none {​​​​​ section __DLIB_PERTHREAD }​​​​​; // Required in a multi-threaded application

The project options "General Options -> Library Configuration" should also have the
"Enable thread support in library" box selected.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Andres Mlinar,
Thank you for your answer.
The information you provided was very useful and helpful to us.

In addition, although it is the "readme_threadx.txt" file on GitHUB that you notified,
it was not included in the zip file of the sample project
(for example, Azure_RTOS_6.1_Renesas_RZA1_RSK_IAR_Samples_2021_04_28.zip),
so I did not know its existence.
If possible, I would appreciate it if you could include such readme.txt in those sample projects as well.

0 Votes 0 ·