Comments (6)
Great.
Thanks a lot
Have a good day
from stmviewer.
Hello, this might be because DWT registers are altered during trace setup. The DWT might be used by the ITM peripheral (as far as I remember it is not used currently). Do you set up the counter by yourself in your code? Why do you want to display the cycles count?
from stmviewer.
Thank you for your answer
In fact i'm interested in monitoring real-time counters such as LSUCNT, CPICNT, EXCCNT with Stmviewer. Here is my c code that i'm using with Stmviewer. The purpose is to know how those counters are impacted by our application.
Is it possible to monitor these counters with Stmviewer in real-time ?
#include "core_cm4.h"
void DWT_Init(void) {
CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk;
DWT->CTRL |= (DWT_CTRL_CYCCNTENA_Msk | DWT_CTRL_CPIEVTENA_Msk | DWT_CTRL_LSUEVTENA_Msk | DWT_CTRL_EXCEVTENA_Msk);
}
volatile void ITM_SendData(int port, unsigned int data) {
while (ITM->PORT[port].u32 == 0);
ITM->PORT[port].u32 = data;
}
void Send_DWT_Counters(void) {
unsigned int cycles = DWT->CYCCNT;
unsigned int cpi_count = DWT->CPICNT;
unsigned int lsu_count = DWT->LSUCNT;
unsigned int exc_count = DWT->EXCCNT;
ITM_SendData(0, cycles);
ITM_SendData(1, cpi_count);
ITM_SendData(2, lsu_count);
ITM_SendData(3, exc_count);
}
int main(void) {
ITM_Init();
DWT_Init();
while (1) {
Send_DWT_Counters();
}
}
from stmviewer.
The main problem is that STMViewer's Trace Viewer module uses the ITM and DWT. If you do not need a synchronous output of the data I'd use the Variable Viewer and just assign these counter values to some global variables and plot them. This way you'll be able to read the counters in real time.
The Trace Viewer aims to be automatic (it sets up the registers by itself), this is why interfering with ITM and DWT in your application results in faulty output.
from stmviewer.
Thank you for the clarifications.
I'll try the solution with the variable counters.
And if can i ask you more please ?
I'm interested to know how i can access to those counters via ITM without writing them in my code (since TraceViewer set them automatically)
i suppose that this solution will be suitable in term of overhead
Thanks again
from stmviewer.
Actually the Trace Viewer does not utilize these counters. You can do it by hand in your application, just the display part in STMViewer should be done using VariableViewer, as it does not change the ITM settings.
from stmviewer.
Related Issues (20)
- Custumization capabilities HOT 2
- My time base is wrong HOT 8
- Invalid data read in sleep mode (WFI) HOT 26
- High DPI font size HOT 4
- CPU/GPU usage when idle HOT 7
- Automatically refresh variables upon openning import from elf dialog HOT 1
- Automatically update variable addresses after importing from ELF HOT 3
- Don't clear past samples upon restarting the acquisition HOT 1
- Dimm start button when depressed
- X axis zooming during acquisition HOT 3
- Space key to start/stop acquisition HOT 2
- Renders at only 30fps (half a refresh rate) HOT 5
- Building - STM32 Target not found HOT 2
- Can't flash board when acquisition is running HOT 1
- Max points setting not respected
- How to Run the program HOT 2
- Closing Acquisition Settings window - saves the changes HOT 1
- Allow relative elf file path in cfg file HOT 4
- Time series plot linking doesn't work if there is bar plot present
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stmviewer.