AnsweredAssumed Answered

STM Studio - only Array variables visible for F4?

Question asked by sim.edmund on Feb 15, 2017
Latest reply on Mar 7, 2018 by S C


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);


      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;