Tool/software: Code Composer Studio
Hi,
In the DSP core, I have defined the Structure type as belows:
typedef struct MmwDemo_DSS_DataPathObj_t
{
float invOneQFormat;
uint16_t minRange;
uint16_t maxRange;
float velResolution;
MmwDemo_detectedObjActual detObj2D[100];
...
}
The type MmwDemo_detectedObjActual is defined as follows:
typedef struct MmwDemo_detectedObjActual_t
{
uint16_t rangeIdx; /*!< @brief Range index */
uint16_t dopplerIdx; /*!< @brief Doppler index */
uint16_t range; /*!< @brief Range (meters in oneQformat) */
int16_t speed; /*!< @brief Doppler (m/s in oneQformat) */
int16_t sinAzim; /*!< @brief wx sin(Azim). Q format provides the bitwidth. */
uint16_t peakVal; /*!< @brief Peak value */
uint16_t rangeSNRdB; /*!< @brief Range SNR (dB) */
uint16_t dopplerSNRdB; /*!< @brief Doppler SNR (dB) */
uint16_t sinAzimSNRLin; /*!< @brief omega SNR (linear scale) */
uint16_t sinElevSNRLin; /*!< @brief omega SNR (linear scale) */
int16_t x; /*!< @brief x - coordinate in meters. Q format provides the bitwidth. */
int16_t y; /*!< @brief y - coordinate in meters. Q format provides the bitwidth. */
int16_t z; /*!< @brief z - coordinate in meters. Q format provides the bitwidth. */
}MmwDemo_detectedObjActual;
If I define the type MmwDemo_DSS_DataPathObj_t as above, the value of the variable invOneQFormat will be changed in the program excution,that is to say, if I set the value of invOneQFormat=0.005, when the proggram is excuted for a while, the value of invOneQFormat is channed into an very small value,.But if I defined the MmwDemo_DSS_DataPathObj_t as follwing:
typedef struct MmwDemo_DSS_DataPathObj_t
{
float invOneQFormat;
uint16_t minRange;
uint16_t maxRange;
MmwDemo_detectedObjActual detObj2D[100];
float velResolution;
...
}
This problem will be solved.The value of the variable invOneQFormat will not be changed. What is the reason for that? The difference of this two definition is the number of the bytes before the declaration MmwDemo_detectedObjActual detObj2D[100]; ,the first one is 12,and the second one is 8. I have tried that if the byte number is 4, the variable invOneQFormat value will be unchanged too.Can anyone tell me the reason for that?
Thanks,
Regards,
Rata