5 Replies Latest reply on Jun 15, 2020 11:13 PM by DheerajK_81

    PSoC Creator PSoC 6 API Definitions

    PaGy_1246781

      Hello All,

       

      I have noticed something strange in PSoC 6 API files generated by PSoC Creator.  As I see it, the PDL does the real work and the API uses customized functions to make the PDL more user friendly.  It appears that the API code and header files reference definitions in file cyfitter.h.

       

      Here is the strange part.  It seems that, in at least one of my API files, cyfitter.h is not included, nor is it included in any of other included files.  Does anyone know how the compiler and the "intelligent" editor in PSoC Creator know these definitions?

       

      The reason I ask is because I am trying to compile the API outside of PSoC Creator, but the compiler (also GCC) can't find the definitions.  And as I look closely at the API files, I don't see any way the compiler should be able to find them.  So why do the compiler and editor in PSoC Creator not have this problem?

       

      Why am I trying to do this?  I like PSoC Creator and am using it to configure my project.  However, I can't use PSoC Creator to build and debug the project (I won't bore you with the details unless someone really wants to know).  I have to build and debug outside of PSoC Creator.  I use a third party tool to bring the configuration from PSoC Creator into my project.  However, this tool doesn't import the API, so I have manually copied the API.  But it won't compile outside of PSoC Creator.

       

      If anyone can tell me why the API files can compile within PSoC Creator, even though they don't include required definitions, I would appreciate it.

       

      Paul

        • 1. Re: PSoC Creator PSoC 6 API Definitions
          GaneshD_41

          Hi Paul,

           

          1. Can you please mention the APIs that you are referring to?

           

          2. Please confirm whether you are following the recommended steps to export the project from PSoC Creator to other IDEs? Please refer page number 387 from the PSoC Creator user guide.

          https://www.cypress.com/file/137441/download

           

          3. Please tell us the IDE/tool that you are using. If you are getting any errors while building the application in your 3rd party IDE, please attach the screenshots of them too.

           

          Thanks

          Ganesh

          • 2. Re: PSoC Creator PSoC 6 API Definitions
            LePo_1062026

            Paul,

             

            I don't know if this will help:

            The PSoC Creator has a special feature that would not be available outside it.

            Any TopDesign and DWR information has to generate the compiler files in Creator.  These files are located in a directory "Generated_Source"

            Any later changes to these files are have to be regenerated from Creator.

             

            I'm assuming you already know this since you stated:

            I like PSoC Creator and am using it to configure my project.

            The cyfiiter.h and project.h files are in the "Generated_Source" directory and the Creator compiler includes these files and the directory they are found in the compiler command.

             

            Len

            • 3. Re: PSoC Creator PSoC 6 API Definitions
              MoTa_728816

              Hi,

               

              I encountered with a similar symptom.

              My interrupt_cfg is undeclared ... why?

               

              The struct definition in "cyfitter_sysint_cfg.h" was not reflected in my source code,

              although the header seemed to be included.

              (I tested by defining another value in that header and the source code reflected it.)

               

              So, I'm afraid that there is/are some glitches in the PDL header definition structure.

               

              And for the time being, although I would think this is a kludge,

              defining the same struct/variable in own code or declaring it allows us proceed.

               

              moto

              • 4. Re: PSoC Creator PSoC 6 API Definitions
                PaGy_1246781

                Hi Ganesh,

                 

                Thanks for the reply.  My answers are below.

                GaneshD_41 wrote:

                 

                Hi Paul,

                 

                1. Can you please mention the APIs that you are referring to?

                Actually, it turns out that the only problem API was that of the SAR ADC (see attached file ADC.h).  Other API headers include cyfitter.h.  They do not cause any trouble when compiling outside of PSoC Creator.

                 

                2. Please confirm whether you are following the recommended steps to export the project from PSoC Creator to other IDEs? Please refer page number 387 from the PSoC Creator user guide.

                https://www.cypress.com/file/137441/download

                I did not use this guide.  The third party tool took care of the configuration and I copied the API files into my outside source directory.

                 

                3. Please tell us the IDE/tool that you are using. If you are getting any errors while building the application in your 3rd party IDE, please attach the screenshots of them too.

                I am using VSCode with some extensions, set up by the RF module manufacturer.

                 

                Thanks

                Ganesh

                I am definitely not an expert on compilers, linkers, etc.  But it seems to me that, if required definitions are not included, then the compiler can't compile.  In other words, I think that that GCC (outside of PSoC Creator environment) is actually doing its job.  In my mind, ADC.h should not compile correctly, but it does when compiled inside the PSoC Creator environment.

                 

                The problem definition is ADC_SAR__HW, which is used by several __STATIC_INLINE functions defined in ADC.h.  In cyfitter.h, ADC_SAR__HW is defined as SAR.  Somehow, the compiler within PSoC Creator knows this definition, even thought cyfitter.h is not included in ADC.h.  My short-term solution is simply to add the line #include "cyfitter.h" to ADC.h.  However, this will be overwritten whenever the application is generated.  I can deal with this for now.  But it would be nice to find a long-term fix.

                 

                Perhaps whoever maintains PSoC Creator could make sure that the code generator for the PSoC 6 SAR puts the include statement in the SAR header file.

                 

                Paul

                • 5. Re: PSoC Creator PSoC 6 API Definitions
                  DheerajK_81

                  Hello Paul,

                   

                  Thank you for pointing this out. I have raised an internal ticket to have the cyfitter header included. Thank you for your interest in Cypress Products.


                  Regards,
                  Dheeraj

                  1 of 1 people found this helpful