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

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

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

0 Likes
14 Replies
Anonymous
Not applicable

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

0 Likes
Anonymous
Not applicable

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

0 Likes
Anonymous
Not applicable

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

   

Regards,

   

Anand

0 Likes
Anonymous
Not applicable

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

0 Likes
Anonymous
Not applicable

Hi Anand,

   

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

   

 

   

thanks,

   

lumpi6

0 Likes
Anonymous
Not applicable

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

0 Likes
Anonymous
Not applicable

Hi,

   

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

   

Thanks,

   

lumpi

0 Likes
Anonymous
Not applicable

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.

0 Likes
Anonymous
Not applicable

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.

0 Likes
Anonymous
Not applicable

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

0 Likes
Anonymous
Not applicable

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.

0 Likes
Anonymous
Not applicable

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

0 Likes
Anonymous
Not applicable

Hi lumpi,

   

Understood. Let me check with software team regarding this.

   

Thanks,

   

sai krishna.

0 Likes
KarthikS_81
Employee
Employee
Welcome! 5 replies posted First solution authored

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

0 Likes