STM32_Profiler
STM32_Profiler copied to clipboard
"DWT->LAR" not recognized when compiling for STM32F103
The compiler shows error in the function
void PROFILING_START(const char *profile_name)
{
prof_name = profile_name;
event_count = 0;
CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk;
DWT->LAR = 0xC5ACCE55; // <<<<<<<< 'DWT_Type {aka struct <anonymous>}' has no member named 'LAR'
DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk; // enable counter
//DWT->CYCCNT = time_start = 0;
time_start = DWT->CYCCNT;
}
Looking at the core headers, "LAR" field is in "ITM_Type" struct, not in "DWT_Type". The issue occurs within Platformio IDE using stm32cube framework.