STM32_Profiler icon indicating copy to clipboard operation
STM32_Profiler copied to clipboard

"DWT->LAR" not recognized when compiling for STM32F103

Open v-ivanyshyn opened this issue 10 months ago • 0 comments

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.

v-ivanyshyn avatar Aug 22 '23 02:08 v-ivanyshyn