2026-03-27 2:23 PM
I am making use of the SWV to plot a 5Hz Sine Wave.
The output on the plotter does not resemble a sine wave:
Any recommendations to fix this?
2026-03-28 1:00 AM - edited 2026-03-28 1:01 AM
How did you set the scala ?
->
To set scaling for SWV plots in STM32CubeIDE, use the toolbar icons in the SWV graph view: switch between seconds and cycles for the X-axis, use the Y-axis best fit button, and zoom in/out as needed. These features allow you to tailor the plot scaling for effective data analysis during debugging.
To set scaling for SWV (Serial Wire Viewer) plots in STM32CubeIDE, you can use the dedicated toolbar icons available in the SWV graph views. These controls allow you to customize both the X-axis (time base) and Y-axis scaling for optimal data visualization:
The SWV graph view toolbar provides the following controls for scaling and visualization:
These controls are accessible directly from the SWV graph view, making it easy to interactively explore and analyze your trace data.
2026-03-28 3:59 AM
Are you sure that the data being sent actually represents a sinewave?
Have you tried sending the data over a UART, and capturing in a terminal?
Please show your sinewave generation code
2026-03-30 12:40 PM
Function I am calling in while loop inside main.c
static void plotInputSignal(void)
{
int i;
for (i = 0; i < HZ_5_SIG_LEN; i++)
{
g_in_sig_sample = _5hz_signal[i];
}
}
5Hz samples (301):
float _5hz_signal[HZ_5_SIG_LEN]=
{
0,0.30902,0.58779,0.80902,0.95106,1,0.95106,0.80902,0.58779,0.30902,1.2246e-16,-0.30902,-0.58779,-0.80902,-0.95106,-1,-0.95106,-0.80902,-0.58779,-0.30902,-2.4493e-16,0.30902,0.58779,0.80902,0.95106,1,0.95106,0.80902,0.58779,0.30902,3.6739e-16,-0.30902,-0.58779,-0.80902,-0.95106,-1,-0.95106,-0.80902,-0.58779,-0.30902,-4.8986e-16,0.30902,0.58779,0.80902,0.95106,1,0.95106,0.80902,0.58779,0.30902,6.1232e-16,-0.30902,-0.58779,-0.80902,-0.95106,-1,-0.95106,-0.80902,-0.58779,-0.30902,-7.3479e-16,0.30902,0.58779,0.80902,0.95106,1,0.95106,0.80902,0.58779,0.30902,-2.6955e-15,-0.30902,-0.58779,-0.80902,-0.95106,-1,-0.95106,-0.80902,-0.58779,-0.30902,-9.7972e-16,0.30902,0.58779,0.80902,0.95106,1,0.95106,0.80902,0.58779,0.30902,1.1022e-15,-0.30902,-0.58779,-0.80902,-0.95106,-1,-0.95106,-0.80902,-0.58779,-0.30902,-1.2246e-15,0.30902,0.58779,0.80902,0.95106,1,0.95106,0.80902,0.58779,0.30902,-2.2056e-15,-0.30902,-0.58779,-0.80902,-0.95106,-1,-0.95106,-0.80902,-0.58779,-0.30902,-1.4696e-15,0.30902,0.58779,0.80902,0.95106,1,0.95106,0.80902,0.58779,0.30902,-1.9607e-15,-0.30902,-0.58779,-0.80902,-0.95106,-1,-0.95106,-0.80902,-0.58779,-0.30902,5.3909e-15,0.30902,0.58779,0.80902,0.95106,1,0.95106,0.80902,0.58779,0.30902,5.3897e-15,-0.30902,-0.58779,-0.80902,-0.95106,-1,-0.95106,-0.80902,-0.58779,-0.30902,-9.0649e-15,0.30902,0.58779,0.80902,0.95106,1,0.95106,0.80902,0.58779,0.30902,5.6346e-15,-0.30902,-0.58779,-0.80902,-0.95106,-1,-0.95106,-0.80902,-0.58779,-0.30902,-2.2044e-15,0.30902,0.58779,0.80902,0.95106,1,0.95106,0.80902,0.58779,0.30902,5.8795e-15,-0.30902,-0.58779,-0.80902,-0.95106,-1,-0.95106,-0.80902,-0.58779,-0.30902,-2.4493e-15,0.30902,0.58779,0.80902,0.95106,1,0.95106,0.80902,0.58779,0.30902,-9.8096e-16,-0.30902,-0.58779,-0.80902,-0.95106,-1,-0.95106,-0.80902,-0.58779,-0.30902,4.4112e-15,0.30902,0.58779,0.80902,0.95106,1,0.95106,0.80902,0.58779,0.30902,6.3694e-15,-0.30902,-0.58779,-0.80902,-0.95106,-1,-0.95106,-0.80902,-0.58779,-0.30902,-2.9392e-15,0.30902,0.58779,0.80902,0.95106,1,0.95106,0.80902,0.58779,0.30902,-4.911e-16,-0.30902,-0.58779,-0.80902,-0.95106,-1,-0.95106,-0.80902,-0.58779,-0.30902,3.9213e-15,0.30902,0.58779,0.80902,0.95106,1,0.95106,0.80902,0.58779,0.30902,-7.3516e-15,-0.30902,-0.58779,-0.80902,-0.95106,-1,-0.95106,-0.80902,-0.58779,-0.30902,-3.429e-15,0.30902,0.58779,0.80902,0.95106,1,0.95106,0.80902,0.58779,0.30902,-1.238e-18,-0.30902,-0.58779,-0.80902,-0.95106,-1,-0.95106,-0.80902,-0.58779,-0.30902,-1.0779e-14
};2026-03-30 12:41 PM
Thank you for the suggestion. Tried it, but it does not work unfortunately.
2026-03-30 1:38 PM
In this example I am incrementing a variable in the while loop with a delay of 500ms.
2026-04-19 12:49 PM
Hey @diktril have you tried MCUViewer? It seems it might be the right tool for you - it can visualize both SWD data using STLink and SWO trace data. If you're interested here're the docs: https://docs.mcuviewer.com.