cancel
Showing results for 
Search instead for 
Did you mean: 

STM Studio - only Array variables visible for F4?

Edmund Sim
Associate
Posted on February 15, 2017 at 06:52

Hi,

I am having a problem using STM Studio (version 3.5.1) - variables that are not arrays are not available to be imported and traced, while arrays are available. The problem is specific to the F4,  

I have verified that all requirements are met: i.e. the variables are global, the linker has not eliminated them, and that the debug information for the variables is available in the .out file (i.e. if I run the iarElfDumpArm program that comes with IAR Workbench, the missing variables are there, with all type and location information.)  What's even stranger, is that if I have a structure that contains both a simple variable and an array, only the array member is available to be traced in STM Studio.

If I compile the same code for the L4, STM Studio can see all variables (arrays and simple variables).

So has anyone out there had any luck using the F4 with STM Studio? 

Thanks for any help out there, Edmund

p.s.  Here's an example of a simple main.c file, with comments besides each variable declaration to indicate whether it is visible or not. I've also attached the .out file for the F4.

/* Private function prototypes -----------------------------------------------*/

void ModifyDataBuffer(uint8_t* data, uint8_t bufLen);

void InitDataBuffer(uint8_t* data, uint8_t bufLen);

void DoNopDelays(uint32_t numNops);

// Variable declarations

#define MAX_ARRAY_SIZE 100

typedef struct

{

       uint8_t byteMember; // Not visible in STM Studio

       uint8_t arrayMember[MAX_ARRAY_SIZE]; // Visible in STM Studio

} TestStruct_t;

uint8_t DataArray1[MAX_ARRAY_SIZE];  // Visible in STM Studio

uint8_t DataArray2[MAX_ARRAY_SIZE]; / / Visible in STM Studio

uint8_t byteVal; // Not visible in STM Studio

uint16_t word16Val; // Not visible in STM Studio

uint32_t word32Val; // Not visible in STM Studio

TestStruct_t myTestStruct; // Only the Array element is visible in STM Studio

/**

* @brief Main program

*/

int main(void)

{

   InitDataBuffer(DataArray1, MAX_ARRAY_SIZE);

   InitDataBuffer(DataArray2, MAX_ARRAY_SIZE);

   ModifyDataBuffer(DataArray1, MAX_ARRAY_SIZE);

   while(1)

   {

      ModifyDataBuffer(DataArray2, MAX_ARRAY_SIZE);

      byteVal = DataArray2[10]; // use byteVal so that linker doesn't remove it

      myTestStruct.byteMember = DataArray1[10];

      myTestStruct.arrayMember[0] = byteVal;

   }

return 0;

}

void InitDataBuffer(uint8_t* data, uint8_t bufLen)

{

   for (int i = 0; i < bufLen; i++)

   {

      data[i] = i;

   }

}

void ModifyDataBuffer(uint8_t* data, uint8_t bufLen)

{

   for (int i = 0; i < bufLen; i++)

   {

      data[i] = data[i] + bufLen;

   }

}
1 REPLY 1
S C
ST Employee
Posted on March 07, 2018 at 14:49

Hello,

word16Val and word32Val are optimized by the linker, and not present in the out file.

uint8_t variables appear in the out file under the type 'std::uint8_t' which is probably due to F4 build context (type definition), and unfortunately badly parsed by the STMStudio (3.5.1). Tables appear anyway because parsed differently.

The bug is taken into account and we are now evaluating the possibility to provide a new version fixing it.

Meanwhile the variable may be manually specified by right click in the 'display variables settings' panel.