<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>LPC MicrocontrollersのトピックAzure ThreadX</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Azure-ThreadX/m-p/1444008#M48484</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;The ThreadX demo in LPCXpresso SDK is missing&amp;nbsp;&lt;EM&gt;Tx_initialize_low_level.S.&amp;nbsp;&lt;/EM&gt;&lt;EM&gt;It has been replaced by&amp;nbsp;Tx_initialize_low_level.c which accesses the CMSIS interface, I assume to achieve the same thing.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I have a ThreadX 5.0 project targeted at the Kinetis family that needs porting to the LPC55x. This uses the&amp;nbsp;Tx_initialize_low_level.S&lt;SPAN&gt;&amp;nbsp;to set up the managed interrupts.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN&gt;My question is, how do you use&amp;nbsp;Tx_initialize_low_level.c in place of my&amp;nbsp;Tx_initialize_low_level.S&amp;nbsp;to achieve the same thing. I can’t find any documentation to help guide me.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN&gt;Dave C&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Apr 2022 08:59:40 GMT</pubDate>
    <dc:creator>DaveTonyCook</dc:creator>
    <dc:date>2022-04-14T08:59:40Z</dc:date>
    <item>
      <title>Azure ThreadX</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Azure-ThreadX/m-p/1444008#M48484</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;The ThreadX demo in LPCXpresso SDK is missing&amp;nbsp;&lt;EM&gt;Tx_initialize_low_level.S.&amp;nbsp;&lt;/EM&gt;&lt;EM&gt;It has been replaced by&amp;nbsp;Tx_initialize_low_level.c which accesses the CMSIS interface, I assume to achieve the same thing.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I have a ThreadX 5.0 project targeted at the Kinetis family that needs porting to the LPC55x. This uses the&amp;nbsp;Tx_initialize_low_level.S&lt;SPAN&gt;&amp;nbsp;to set up the managed interrupts.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN&gt;My question is, how do you use&amp;nbsp;Tx_initialize_low_level.c in place of my&amp;nbsp;Tx_initialize_low_level.S&amp;nbsp;to achieve the same thing. I can’t find any documentation to help guide me.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN&gt;Dave C&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2022 08:59:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Azure-ThreadX/m-p/1444008#M48484</guid>
      <dc:creator>DaveTonyCook</dc:creator>
      <dc:date>2022-04-14T08:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Azure ThreadX</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Azure-ThreadX/m-p/1445013#M48496</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;How about debug a demo project to check?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Alice&lt;/P&gt;</description>
      <pubDate>Mon, 18 Apr 2022 08:18:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Azure-ThreadX/m-p/1445013#M48496</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2022-04-18T08:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: Azure ThreadX</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Azure-ThreadX/m-p/1447324#M48535</link>
      <description>&lt;P&gt;How about you don't delete the readme file associated with the GIT Hub download! Thanks for your useless comment!&lt;/P&gt;&lt;P&gt;We are porting an existing project based on ThreadX 5.0 which uses&amp;nbsp;tx_initialize_low_level.s... debugging the&amp;nbsp;tx_initialize_low_level.c would not provide the information I need to make a discussion regarding risk and timescale before we start the project nor would it answer the question regarding ThreadX managed interrupts.&lt;/P&gt;&lt;P&gt;I found that if you download Azure ThreadX from GIT hub the tx_initialize_low_level.s file is present along with a very helpful readme file, readme_threadx.txt which explains how to deal with Managed Interrupts.&lt;/P&gt;&lt;P&gt;It states that ISRs for Cortex-M using the IAR tools can be written completely in C, as your demo code has been, (or assembly language) without any calls to _tx_thread_context_save or _tx_thread_context_restore. These ISRs are allowed access to the ThreadX API that is available to ISRs. &lt;STRONG&gt;This answers my original question.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If I could give some feedback:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;It would help if the readme_threadx.txt file is kept with both the &lt;STRONG&gt;demo code&lt;/STRONG&gt; and the &lt;STRONG&gt;Azure ThreadX RTOS installation&lt;/STRONG&gt;.&lt;/LI&gt;&lt;LI&gt;Update the Azure ThreadX in the SDK or advice users to download latest from GIT Hub as Microsoft do. The O/S component of the SDK for the LPC55x (M33) is not the latest at V6.1.8. The latest from GIT Hub is V6.1.11.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I have attached the readme file for your information please refer to sec 6.1 Managed Interrupts. I hope this helps you help others with further enquiries on this topic. For the help you have provided, thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Microsoft's Azure RTOS ThreadX for Cortex-M33&lt;/P&gt;&lt;P&gt;Using the IAR Tools&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;1. Building the ThreadX run-time Library&lt;/P&gt;&lt;P&gt;Import all ThreadX common and port-specific source files into an IAR project.&lt;BR /&gt;Configure the project to build a library rather than an executable. This&lt;BR /&gt;results in the ThreadX run-time library file tx.a, which is needed by&lt;BR /&gt;the application.&lt;BR /&gt;Files tx_thread_stack_error_handler.c and tx_thread_stack_error_notify.c&lt;BR /&gt;replace the common files of the same name.&lt;/P&gt;&lt;P&gt;2. Demonstration System&lt;/P&gt;&lt;P&gt;No demonstration is provided because the IAR EWARM 8.50 simulator does&lt;BR /&gt;not simulate the Cortex-M33 correctly.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;3. System Initialization&lt;/P&gt;&lt;P&gt;The entry point in ThreadX for the Cortex-M33 using IAR tools is at label&lt;BR /&gt;__iar_program_start. This is defined within the IAR compiler's startup code.&lt;BR /&gt;In addition, this is where all static and global preset C variable&lt;BR /&gt;initialization processing takes place.&lt;/P&gt;&lt;P&gt;The ThreadX tx_initialize_low_level.s file is responsible for setting up&lt;BR /&gt;various system data structures, and a periodic timer interrupt source.&lt;/P&gt;&lt;P&gt;The _tx_initialize_low_level function inside of tx_initialize_low_level.s&lt;BR /&gt;also determines the first available address for use by the application, which&lt;BR /&gt;is supplied as the sole input parameter to your application definition function,&lt;BR /&gt;tx_application_define. To accomplish this, a section is created in&lt;BR /&gt;tx_initialize_low_level.s called FREE_MEM, which must be located after all&lt;BR /&gt;other RAM sections in memory.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;4. Register Usage and Stack Frames&lt;/P&gt;&lt;P&gt;The following defines the saved context stack frames for context switches&lt;BR /&gt;that occur as a result of interrupt handling or from thread-level API calls.&lt;BR /&gt;All suspended threads have the same stack frame in the Cortex-M33 version of&lt;BR /&gt;ThreadX. The top of the suspended thread's stack is pointed to by&lt;BR /&gt;tx_thread_stack_ptr in the associated thread control block TX_THREAD.&lt;/P&gt;&lt;P&gt;Non-FPU Stack Frame:&lt;/P&gt;&lt;P&gt;Stack Offset Stack Contents&lt;/P&gt;&lt;P&gt;0x00 LR Interrupted LR (LR at time of PENDSV)&lt;BR /&gt;0x04 r4 Software stacked GP registers&lt;BR /&gt;0x08 r5&lt;BR /&gt;0x0C r6&lt;BR /&gt;0x10 r7&lt;BR /&gt;0x14 r8&lt;BR /&gt;0x18 r9&lt;BR /&gt;0x1C r10&lt;BR /&gt;0x20 r11&lt;BR /&gt;0x24 r0 Hardware stacked registers&lt;BR /&gt;0x28 r1&lt;BR /&gt;0x2C r2&lt;BR /&gt;0x30 r3&lt;BR /&gt;0x34 r12&lt;BR /&gt;0x38 lr&lt;BR /&gt;0x3C pc&lt;BR /&gt;0x40 xPSR&lt;/P&gt;&lt;P&gt;FPU Stack Frame (only interrupted thread with FPU enabled):&lt;/P&gt;&lt;P&gt;Stack Offset Stack Contents&lt;/P&gt;&lt;P&gt;0x00 LR Interrupted LR (LR at time of PENDSV)&lt;BR /&gt;0x04 s16 Software stacked FPU registers&lt;BR /&gt;0x08 s17&lt;BR /&gt;0x0C s18&lt;BR /&gt;0x10 s19&lt;BR /&gt;0x14 s20&lt;BR /&gt;0x18 s21&lt;BR /&gt;0x1C s22&lt;BR /&gt;0x20 s23&lt;BR /&gt;0x24 s24&lt;BR /&gt;0x28 s25&lt;BR /&gt;0x2C s26&lt;BR /&gt;0x30 s27&lt;BR /&gt;0x34 s28&lt;BR /&gt;0x38 s29&lt;BR /&gt;0x3C s30&lt;BR /&gt;0x40 s31&lt;BR /&gt;0x44 r4 Software stacked registers&lt;BR /&gt;0x48 r5&lt;BR /&gt;0x4C r6&lt;BR /&gt;0x50 r7&lt;BR /&gt;0x54 r8&lt;BR /&gt;0x58 r9&lt;BR /&gt;0x5C r10&lt;BR /&gt;0x60 r11&lt;BR /&gt;0x64 r0 Hardware stacked registers&lt;BR /&gt;0x68 r1&lt;BR /&gt;0x6C r2&lt;BR /&gt;0x70 r3&lt;BR /&gt;0x74 r12&lt;BR /&gt;0x78 lr&lt;BR /&gt;0x7C pc&lt;BR /&gt;0x80 xPSR&lt;BR /&gt;0x84 s0 Hardware stacked FPU registers&lt;BR /&gt;0x88 s1&lt;BR /&gt;0x8C s2&lt;BR /&gt;0x90 s3&lt;BR /&gt;0x94 s4&lt;BR /&gt;0x98 s5&lt;BR /&gt;0x9C s6&lt;BR /&gt;0xA0 s7&lt;BR /&gt;0xA4 s8&lt;BR /&gt;0xA8 s9&lt;BR /&gt;0xAC s10&lt;BR /&gt;0xB0 s11&lt;BR /&gt;0xB4 s12&lt;BR /&gt;0xB8 s13&lt;BR /&gt;0xBC s14&lt;BR /&gt;0xC0 s15&lt;BR /&gt;0xC4 fpscr&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;5. Improving Performance&lt;/P&gt;&lt;P&gt;To make ThreadX and the application(s) run faster, you can enable&lt;BR /&gt;all compiler optimizations.&lt;/P&gt;&lt;P&gt;In addition, you can eliminate the ThreadX basic API error checking by&lt;BR /&gt;compiling your application code with the symbol TX_DISABLE_ERROR_CHECKING&lt;BR /&gt;defined.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;6. Interrupt Handling&lt;/P&gt;&lt;P&gt;The Cortex-M33 vectors start at the label __vector_table and is typically defined in a&lt;BR /&gt;startup.s file (or similar). The application may modify the vector area according to its needs.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;6.1 Managed Interrupts&lt;/P&gt;&lt;P&gt;ISRs for Cortex-M using the IAR tools can be written completely in C (or assembly&lt;BR /&gt;language) without any calls to _tx_thread_context_save or _tx_thread_context_restore.&lt;BR /&gt;These ISRs are allowed access to the ThreadX API that is available to ISRs.&lt;/P&gt;&lt;P&gt;ISRs written in C will take the form (where "your_C_isr" is an entry in the vector table):&lt;/P&gt;&lt;P&gt;void your_C_isr(void)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;/* ISR processing goes here, including any needed function calls. */&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;ISRs written in assembly language will take the form:&lt;/P&gt;&lt;P&gt;PUBLIC your_assembly_isr&lt;BR /&gt;your_assembly_isr:&lt;/P&gt;&lt;P&gt;PUSH {r0, lr}&lt;/P&gt;&lt;P&gt;; ISR processing goes here, including any needed function calls.&lt;/P&gt;&lt;P&gt;POP {r0, lr}&lt;BR /&gt;BX lr&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;7. IAR Thread-safe Library Support&lt;/P&gt;&lt;P&gt;Thread-safe support for the IAR tools is easily enabled by building the ThreadX library&lt;BR /&gt;and the application with TX_ENABLE_IAR_LIBRARY_SUPPORT. Also, the linker control file&lt;BR /&gt;should have the following line added (if not already in place):&lt;/P&gt;&lt;P&gt;initialize by copy with packing = none { section __DLIB_PERTHREAD }; // Required in a multi-threaded application&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;7. IAR Thread-safe Library Support&lt;/P&gt;&lt;P&gt;Thread-safe support for the IAR tools is easily enabled by building the ThreadX library&lt;BR /&gt;and the application with TX_ENABLE_IAR_LIBRARY_SUPPORT. Also, the linker control file&lt;BR /&gt;should have the following line added (if not already in place):&lt;/P&gt;&lt;P&gt;initialize by copy with packing = none { section __DLIB_PERTHREAD }; // Required in a multi-threaded application&lt;/P&gt;&lt;P&gt;The project options "General Options -&amp;gt; Library Configuration" should also have the&lt;BR /&gt;"Enable thread support in library" box selected.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;8. VFP Support&lt;/P&gt;&lt;P&gt;ThreadX for Cortex-M33 supports automatic ("lazy") VFP support, which means that applications threads&lt;BR /&gt;can simply use the VFP and ThreadX automatically maintains the VFP registers as part of the thread&lt;BR /&gt;context.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;9. Revision History&lt;/P&gt;&lt;P&gt;For generic code revision information, please refer to the readme_threadx_generic.txt&lt;BR /&gt;file, which is included in your distribution. The following details the revision&lt;BR /&gt;information associated with this specific port of ThreadX:&lt;/P&gt;&lt;P&gt;06-02-2021 Release 6.1.7 changes:&lt;BR /&gt;tx_thread_secure_stack_initialize.s New file&lt;BR /&gt;tx_thread_schedule.s Added secure stack initialize to SVC hander&lt;BR /&gt;tx_thread_secure_stack.c Fixed stack pointer save, initialize in handler mode&lt;/P&gt;&lt;P&gt;04-02-2021 Release 6.1.6 changes:&lt;BR /&gt;tx_port.h Updated macro definition&lt;BR /&gt;tx_thread_schedule.s Added low power support&lt;/P&gt;&lt;P&gt;03-02-2021 The following files were changed/added for version 6.1.5:&lt;BR /&gt;tx_port.h Added ULONG64_DEFINED&lt;/P&gt;&lt;P&gt;09-30-2020 Initial ThreadX 6.1 version for Cortex-M33 using IAR's ARM tools.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Copyright(c) 1996-2020 Microsoft Corporation&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;A href="https://azure.com/rtos" target="_blank"&gt;https://azure.com/rtos&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 14:47:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Azure-ThreadX/m-p/1447324#M48535</guid>
      <dc:creator>DaveTonyCook</dc:creator>
      <dc:date>2022-04-21T14:47:30Z</dc:date>
    </item>
  </channel>
</rss>

