9 Replies Latest reply on Dec 11, 2018 10:04 PM by abhinavg_21

    Newer Version of ThreadX in FX3 SDK?

    RoKl_290166

      Hello,

      in my FX3 firmware-application which is created with FX3 SDK
      1.3.3 I stumbled on a bug in ThreadX which comes with the SDK.

      The technical support of ExpressLogic which sells ThreadX
      confirmed that it’s really a bug in ThreadX and it has been fixed in a later
      version of ThreadX.

      FX3 SDK1.3.3 contains a quite old version of ThreadX so the
      version string I read out is: Copyright (c) 1996-2008 Express Logic Inc. *
      ThreadX ARM9/RVDS Version G5.1.5.1 SN: 2923-115-1301 *

      According to the website of ExpressLogic the latest
      available version of ThreadX is G5.8.5.x

       

      Can you provide me a FX3 SDK with a newer version ThreadX,
      please?

       

      Robert

        • 1. Re: Newer Version of ThreadX in FX3 SDK?
          abhinavg_21

          Hi Robert,

           

           

          Please tell what is the bug that you are facing?

           

          For the time being we don't have any plans to update ThreadX in FX3.

           

          Thanks & Regards

          Abhinav

          • 2. Re: Newer Version of ThreadX in FX3 SDK?
            RoKl_290166

            Hi Abhinav,

             

            Here’s the description of the bug. As already mentioned, the bug seems to be already known by ExpressLogic Support Engineers.

             

            I have a FX3 firmware-implementation where multiple threads are running and I can create a situation where the system hangs up. The root-cause seems to be that a mutex is locked twice by different threads. I attached an exported trace-file recorded with Percepio Tracealyzer V3.1.3.

             

            Explanation of the trace:

             

            The following threads are of interest rgd. the bug (there are more running in the system):

             

            DMA_THREAD, priority=2 (is part of FX3 SDK)

            Appl:Control, priority=10

            Appl:Event, priority=11

            SCTL:Autofunction, priority=12

             

            1.  the mutex s_SnsCtrlChnlMutex is requested and locked by thread SCTL:Autofunction (priority=12).

             

            2.  the mutex s_lockBlfile is requested and locked by thread Appl:Event (priority=11)

             

            3.  the mutex s_SnsCtrlChnlMutex is requested by thread Appl:Event (priority=11)

             

            4.  the mutex s_lockBlfile is requested by thread Appl:Control (priority=10) -> the thread is suspended

             

            5.  to release the mutex s_lockBlfile the priority of thread Appl:Event is raised to 10 due to priority inheritence of the mutex s_lockBlfile. Now, the error happens: the mutex s_SnsCtrlChnlMutex (which was requested by Appl:Event at 3.) is indead locked by thread Appl:Event, too (remember: the mutex is still locked by thread SCTL:Autofunction described at 1.)!!

             

            6.  the mutex s_SnsCtrlChnlMutex and s_lockBlfile are released by thread Appl:Event so thread Appl:Control can lock s_lockBlfile at timestamp 1293, now

             

            7.  the mutex SnsCtrlChnlMutex is requested again by thread Appl:Event and the thread suspends on it. Thread SCTL:Autofunction which is still holding the mutex (according to 1.) never becomes executing to release the mutex. The system hangs up, now.

            • 3. Re: Newer Version of ThreadX in FX3 SDK?
              RoKl_290166

              Hi Cypress guys,

              any news rgd. newer version of ThreadX?

               

              Regards,

              Robert

              • 4. Re: Newer Version of ThreadX in FX3 SDK?
                abhinavg_21

                Hi Robert,

                 

                I have one doubt, if the mutex s_SnsCtrlChnlMutex is already requested and locked by thread SCTL:Autofunction in step 1 then how the mutex s_SnsCtrlChnlMutex is again requested by thread Appl:Event in step 3. According to priority inheritence, Appl:Event should be blocked and SCTL:Autofunction must acquire the priority of Appl:Event. If that happen then these issues will not come. Correct me if my understanding is wrong.

                For the time being there is no plan of updating ThreadX in FX3 SDK.

                 

                Thanks & Regards

                Abhinav

                • 5. Re: Newer Version of ThreadX in FX3 SDK?
                  RoKl_290166

                  Hi Abhinav,

                  yes, you're completely right rgd. the priority inheritence: SCTL:Autofunction should acquire the priority of Appl:Event to release s_SnsCtrlChnlMutex. This is also my expectation but it doesn't happen. I confirmed that the mutex has been locked by SCTL:Autofunction with a counter which is incremented after mutexLock and decremented after mutexRelease. Indead, I observed that this counter got the value of 2 at step 5 after Appl:Event got the mutex, too .

                   

                  Ok, that are bad News for me that I can't get a newer Version of ThreadX! Hence, I Need to think about a Workaround...

                   

                  Best regards,

                  Robert

                  • 6. Re: Newer Version of ThreadX in FX3 SDK?
                    RoKl_290166

                    Hi Abhinav,

                    would it be possible to create a ThreadX-library including the latest ThreadX-Version especially for me?

                    Do your license Terms rgd. ThreadX allow to get a newer Version from ExpressLogic at all?

                    Actually, this Kind of bug is a show-stopper for our Project and I Need to solve the issue immediately!

                     

                    Best regards,

                    Robert

                    • 7. Re: Newer Version of ThreadX in FX3 SDK?
                      abhinavg_21

                      Hi Robert,

                       

                      We don't have the license to use latest ThreadX. But if you can obtain it for you then you can use newer version of ThreadX for your product.

                       

                       

                      Thanks & Regards
                      Abhinav

                      • 8. Re: Newer Version of ThreadX in FX3 SDK?
                        RoKl_290166

                        Hi Abhinav,

                        would it work if I obtain the latest Version of ThreadX and replace the threadx-library libcyu3threadx.a in the FX3-SDK by the new one? Or are there any Special changes made by Cypress to adapt ThreadX to the FX3-SDK?

                         

                        Robert

                        • 9. Re: Newer Version of ThreadX in FX3 SDK?
                          abhinavg_21

                          Hi Robert,

                           

                          Yes it is possible, but you have to make slight changes in the ThreadX source code to make it compatible with FX3. Let us know once you obtain the license and full source code of the new version of ThreadX.

                           

                          Thanks & Regards
                          Abhinav