Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > FX3 SDK Version cyfxversion.h has global variables instead of defines can not use them for pecompiled options

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



FX3 SDK Version cyfxversion.h has global variables instead of defines can not use them for pecompiled options
Moderator:
RSKV

Post Reply
Follow this topic



FX3 SDK Version cyfxversion.h has global variables instead of defines can not use them for pecompiled options

Lumpi6 posted on 21 Mar 2012 1:34 AM PST
Top Contributor
183 Forum Posts

Hi,

I like to differ between the release versions of the FX3 SDK while compile time. That would not work with the const global variables in cyfxversion.h.

const uint16_t cyfx_version_major = 1;
const uint16_t cyfx_version_minor = 0;
const uint16_t cyfx_version_patch = 1;
const uint16_t cyfx_version_build = 670;
 

I need definitions to differ while compile time. Has Cypress any possibilities actually in the SDK for this issue or may can support this feature in future?

Thanks,

lumpi




Re: FX3 SDK Version cyfxversion.h has global variables instead of defines can not use them for pecompiled options

aasi posted on 21 Mar 2012 01:58 AM PST
Cypress Employee
1073 Forum Posts

Please add more information on your request I want to understand the reason behind this requirement better.

The version number is for tracking purpose and you're free to implement your own method for tracking it. I'm just wondering how using #define s and providing different values based on them is going to help.

Regards,

Anand



Re: FX3 SDK Version cyfxversion.h has global variables instead of defines can not use them for pecompiled options

Lumpi6 posted on 21 Mar 2012 03:35 AM PST
Top Contributor
183 Forum Posts

Hi Anand,

I like to differ before compiling with preprocessor assingments.

e. g.

when the global variables from above (my first post) would be assigned as....

#define CYFX_VERSION_MAJOR 1
#define CYFX_VERSION_MINOR 0
#define CYFX_VERSION_PATCH 1
#define CYFX_VERSION_BUILD 670

then this would be possible...

#if (CYFX_VERSION_BUILD >= 670)
        CyU3PGpifDisable (CyTrue);
#else //(CYFX_VERSION_BUILD < 670)
        CyU3PGpifDisable (CyFalse);
        memset ((void *) 0xe0014000, 0, 0x1000);
#endif
 

Usually all engineers work with the same actual SDK version, but sometimes that is not the case. And if I can differ while compile time between the release version, then it is possible to compile same firmware source with release version 1.0.0 and 1.0.1. It would also be a favour when cypress changes some SDK function names or the parameter count of a function. Then I also can differ between the SDK versions and then it is not relevant with which version I compile the firmware it will work in both cases.

Thanks,

lumpi



Re: FX3 SDK Version cyfxversion.h has global variables instead of defines can not use them for pecompiled options

aasi posted on 22 Mar 2012 11:47 PM PST
Cypress Employee
1073 Forum Posts

Got it. Let me talk to our software team and see how they feel about this.

Regards,

Anand



Re: FX3 SDK Version cyfxversion.h has global variables instead of defines can not use them for pecompiled options

aasi posted on 26 Mar 2012 01:35 AM PST
Cypress Employee
1073 Forum Posts

From next version onwards it will be available both as global variable as well as macro. So you can use it whichever way you want it based on your requirement. Hope this meets your requirement.

Cheers,

Anand



Re: FX3 SDK Version cyfxversion.h has global variables instead of defines can not use them for pecompiled options

Lumpi6 posted on 26 Mar 2012 05:29 AM PST
Top Contributor
183 Forum Posts

Hi Anand,

great thank you. I am looking forward getting next release version higher than 1.0.1

 

thanks,

lumpi6



Re: FX3 SDK Version cyfxversion.h has global variables instead of defines can not use them for pecompiled options

Lumpi6 posted on 24 Apr 2012 03:17 AM PST
Top Contributor
183 Forum Posts

Hi Anand,

 

the new release version 1.1 includes the defines now, thanks. But there is one thing I am not sure about how to take care of it. The header file cyfxversion.h has following note in the header:

 

   NOTE: This header is used internally by the
   library and is there in the solution for
   reference. It should not be included in the
   application source.
 

I think this is because the declaration of the constant variables and if I include this header then the compiler occurs in errors. In that manner the solution of the defines is unuseable for me.

A usable solution for all would be an additional header file e. g. cyfxversionmacro.h with just the macro definitions and then you include this file in the cyfxversion.h like....

 

cyfxversionmacro.h

-------------------------------------------------------------------------

#ifndef _INCLUDED_CYFXVERSIONMACRO_H_
#define _INCLUDED_CYFXVERSIONMACRO_H_

#define CYFX_VERSION_MAJOR (1)
#define CYFX_VERSION_MINOR (1)
#define CYFX_VERSION_PATCH (0)
#define CYFX_VERSION_BUILD (724)

#endif /* _INCLUDED_CYFXVERSIONMACRO_H_ */

-------------------------------------------------------------------------

 

cyfxversion.h

-------------------------------------------------------------------------

#ifndef _INCLUDED_CYFXVERSION_H_
#define _INCLUDED_CYFXVERSION_H_

/* Summary
   Version information for the FX3 API library.

   Description
   The version information is composed of four values.
    * Major number of the release version
    * Minor number of the release version
    * Patch number of the release
    * Build number
 
   NOTE: This header is used internally by the
   library and is there in the solution for
   reference. It should not be included in the
   application source.
 */
#include "cyfxversionmacro.h"


const uint16_t cyfx_version_major = CYFX_VERSION_MAJOR;
const uint16_t cyfx_version_minor = CYFX_VERSION_MINOR;
const uint16_t cyfx_version_patch = CYFX_VERSION_PATCH;
const uint16_t cyfx_version_build = CYFX_VERSION_BUILD;

#endif /* _INCLUDED_CYFXVERSION_H_ */
-------------------------------------------------------------------------

 

And then I am also able to inlcude the "cyfxversionmacro.h" as well.

Regards,

Lumpi



Re: FX3 SDK Version cyfxversion.h has global variables instead of defines can not use them for pecompiled options

Lumpi6 posted on 15 May 2012 04:32 AM PST
Top Contributor
183 Forum Posts

Hi,

can any cypress employee answer to my last post???

Thanks,

lumpi



Re: FX3 SDK Version cyfxversion.h has global variables instead of defines can not use them for pecompiled options

Poul-Erik posted on 24 Jun 2012 08:21 PM PST
Senior Member
14 Forum Posts

I don't know if this is the right place to put a commen about wrong "design".

I version 1.1 of the cyfxversion.h 4 variables are made. This mean that all c-files with include "cyfxversion.h" adde the same variable, and the linker get a problem.

The 4 variables should be removed or decleard as external and included in the library.

Poul-Erik.

 

 



Re: FX3 SDK Version cyfxversion.h has global variables instead of defines can not use them for pecompiled options

RSKV posted on 25 Jun 2012 01:38 AM PST
Cypress Employee
655 Forum Posts

Actually these macros are provided to help you identify the version of the code that you are using.

If you really want to control something based on the version, then we can use some other macros to do that in the application level.

it is possible right.

Regards,

sai krishna.



Re: FX3 SDK Version cyfxversion.h has global variables instead of defines can not use them for pecompiled options

Lumpi6 posted on 25 Jun 2012 05:10 AM PST
Top Contributor
183 Forum Posts

Hi Sai Krishna,

which macros can be used in apllication? I do not understand your post, can you please explain better or give an example?

If you take a look at my post from 24 Apr 2012 03:17 AM PST. That would be a example how I could handle the FX3 SDK versions and also use them as prcompiled options. But up to now no one has answered on that :-(

 

Regards

Lumpi



Re: FX3 SDK Version cyfxversion.h has global variables instead of defines can not use them for pecompiled options

RSKV posted on 25 Jun 2012 08:28 PM PST
Cypress Employee
655 Forum Posts

Hi Lumpi,

Sorry for not replying to your post (24th April) so far. I just started replying to forum posts from past few weeks.

Here is my understanding.

You are trying to use the version number of the SDK in your application code. We can get the version number from those macros in the cyfxversion.h.

I am hoping that you don't want to change those macros. Then you can have your own macros defined in the application layer to do what ever you want.

For example:

#define CYFX_VERSION_MAJOR_APP 1
#define CYFX_VERSION_MINOR_APP 0
#define CYFX_VERSION_PATCH_APP 1
#define CYFX_VERSION_BUILD_APP 670

then this would be possible...

#if (CYFX_VERSION_BUILD_APP >= 670)
        CyU3PGpifDisable (CyTrue);
#else //(CYFX_VERSION_BUILD_APP < 670)
        CyU3PGpifDisable (CyFalse);
        memset ((void *) 0xe0014000, 0, 0x1000);
#endif

If you think that my understanding about your requirement is not clear then please explain me again on your requirement details.

Regards,

sai krishna.

 



Re: FX3 SDK Version cyfxversion.h has global variables instead of defines can not use them for pecompiled options

Lumpi6 posted on 26 Jun 2012 02:40 AM PST
Top Contributor
183 Forum Posts

Hi Sai Krishna,

 

the usual way of changing a version from a software is, that the originator is changing this. That means cypress will count up in a new release the version number. If I write my own macro with version number, then I have to change these version numbers when a new release is used. That would not be necessary if I can include a file of cypress which only have the version macros. What is so hard to understand? The solution what cypress did at the beginning of this post and the solution you described in your last post will not give me any improvement. I still have to handle and update the SDK versions in my application by myself. If I can use macros which are included in the FX3 SDK library or header and which I  can include into my application then I will benefit of that and I can use precompiler directives without taking care of anything.

Thanks,

lumpi



Re: FX3 SDK Version cyfxversion.h has global variables instead of defines can not use them for pecompiled options

RSKV posted on 26 Jun 2012 03:44 AM PST
Cypress Employee
655 Forum Posts

Hi lumpi,

Understood. Let me check with software team regarding this.

Thanks,

sai krishna.



Re: FX3 SDK Version cyfxversion.h has global variables instead of defines can not use them for pecompiled options

kys posted on 29 Jun 2012 11:52 PM PST
Cypress Employee
7 Forum Posts

Hi,

We understand your point, and agree that the right solution is to move the variables to within the library. This will be done in the next SDK release.

Thanks and Regards,

Karthik






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.