cancel
Showing results for 
Search instead for 
Did you mean: 

STM-STUDIO-STM32 - Snapshot acquisition mode

Andrea Canepa
Senior

This STM software allows to monitor and modify the value of some variables in real-time using the SWD or JTAG connection in a non-intrusive way.

In the documentation for the use of this software (https://www.st.com/resource/en/user_manual/cd00291015.pdf) we talk about the "Snapshoot" mode (Par.2.5.2): using the code to be integrated into your firmware you can perform sampling of the variables at a given time. This is very useful, because in "Direct acquisition mode" (the standard one) there are some cases in which the variables assume non-coherent values.

Following the instructions for the operation in "Snapshot mode", I have integrated in my firmware the necessary code ("softTrace" subdirectory), but by compiling the program I always get an error:

'_FAR_DATA_' undeclared (first use in this function) 

This error is in the source "acqTrigger.c" line 310, one of the files to be included in the project, made by STM.

Now my question is: has any of you already used STM Studio in this mode? Did you succeed? Problems? What do you advise to do?

Andrea.

1 ACCEPTED SOLUTION

Accepted Solutions
Andrea Canepa
Senior

I use Atollic TrueStudio with GNU compiler.

However, since I did not receive an answer from the community, I contacted the STM support directly and solved the problem.

The solution that has been communicated to me is the following:

You can patch dataAcq.h structure as follow :

 

// Defines for variable placement out of the 256 bytes 0 page

#if defined(__CSMC__) // Cosmic STM8

#define _NEAR_DATA_ @near

#define _FAR_DATA_ @far

#elif defined(__RAISONANCE__) // Raisonance STM8

#define _NEAR_DATA_ data

#define _FAR_DATA_

#elif defined(__IAR_SYSTEMS_ICC__) // IAR STM8 and STM32

#define _NEAR_DATA_

#if __ICCARM__ // STM32

#define _FAR_DATA_

#else // STM8

#define _FAR_DATA_ __far

#endif

#elif defined(__ARMCC_VERSION) // Keil STM32

#define _NEAR_DATA_

#define _FAR_DATA_

#elif defined ( __GNUC__ ) //Patch GNU Compiler

#define _NEAR_DATA_

#define _FAR_DATA_ //End Patch GNU Compiler

#endif

Regards

Andrea

View solution in original post

4 REPLIES 4
Amel NASRI
ST Employee

Hello @Andrea Canepa​ ,

Sorry for delay to answer your question.

Could you please let me know the compiler you used?

_NEAR_DATA_ and _FAR_DATA_ are defined in dataAcq.h and they have been defined for almost all compilers tested with STMStudio.

If you still have an issue, you might modify dataAcq.h by replacing the line 171:

#elif defined(__ARMCC_VERSION) // Keil STM32

by

#else

Please try this way and let me know the result.

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Andrea Canepa
Senior

I use Atollic TrueStudio with GNU compiler.

However, since I did not receive an answer from the community, I contacted the STM support directly and solved the problem.

The solution that has been communicated to me is the following:

You can patch dataAcq.h structure as follow :

 

// Defines for variable placement out of the 256 bytes 0 page

#if defined(__CSMC__) // Cosmic STM8

#define _NEAR_DATA_ @near

#define _FAR_DATA_ @far

#elif defined(__RAISONANCE__) // Raisonance STM8

#define _NEAR_DATA_ data

#define _FAR_DATA_

#elif defined(__IAR_SYSTEMS_ICC__) // IAR STM8 and STM32

#define _NEAR_DATA_

#if __ICCARM__ // STM32

#define _FAR_DATA_

#else // STM8

#define _FAR_DATA_ __far

#endif

#elif defined(__ARMCC_VERSION) // Keil STM32

#define _NEAR_DATA_

#define _FAR_DATA_

#elif defined ( __GNUC__ ) //Patch GNU Compiler

#define _NEAR_DATA_

#define _FAR_DATA_ //End Patch GNU Compiler

#endif

Regards

Andrea

Mbert.1
Associate II

ciao, devo usare la modalità "istantanea", ma non riesco a trovare la sottodirectory "softTrace", puoi imparare come usare e dove trovare i file dataAcq.h datAcq.c?

I can't help you: I stopped using this software because it is no longer maintained and is obsolete.