-
Import this reference project into STM32CubeIDE and then "Build Project".
-
Run/Debug to see how this demo works.
-
Add the code below in fir_processing.c
#ifdef TEST_SWV float32_t swv_aFIR_F32_1kHz_15kHz = 0.0f; float32_t swv_aFIR_F32_Output = 0.0f; #endif
-
Modify the code below (enclosed by #ifdef TEST_SWV, #else and #endif) inside FIR_PROCESSING_F32Process() definition in fir_processing.c under Src:
void FIR_PROCESSING_F32Process(void) { ... GUI_USE_PARA(DataID); #ifdef TEST_SWV swv_aFIR_F32_1kHz_15kHz = aFIR_F32_1kHz_15kHz[counter_FIR_Dd]*25 + 75; GRAPH_DATA_YT_AddValue(aGraph_Data[1], swv_aFIR_F32_1kHz_15kHz); #else GRAPH_DATA_YT_AddValue(aGraph_Data[1], (aFIR_F32_1kHz_15kHz[counter_FIR_Dd])*25 + 75); #endif if (++counter_FIR_Dd == GUI_COUNTOF(aFIR_F32_1kHz_15kHz)) { counter_FIR_Dd = 0; } #ifdef TEST_SWV swv_aFIR_F32_Output = (aFIR_F32_Output[counter_FIR_Ds])*20 + 25; GRAPH_DATA_YT_AddValue(aGraph_Data[0], swv_aFIR_F32_Output); #else GRAPH_DATA_YT_AddValue(aGraph_Data[0], (aFIR_F32_Output[counter_FIR_Ds])*20 + 25); #endif if (++counter_FIR_Ds == GUI_COUNTOF(aFIR_F32_Output)) { counter_FIR_Ds = 0; } }
-
Define TEST_SWV in as shown below and then build project:
-
Setup "Debug Configuration"
-
Run Debug again and do not press "Resume" button yet.
-
Setup SWV Data Trace Timeline Graph
-
Press "Resume" button and you will see waveform in SWV Data Trace Timeline Graph aligned with that in LCD:
- SWV: Trace Log / SWV: ITM Timeline Graph
- SWV: Exception Trace Log
- SWV: Statistical Profiling
- Dynamic printf