Loading...
 

SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world. And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4.
You can get more information from the ac6-tools website and download (registration required) various documents highlighting:

System Workbench for STM32


NOT TRUE! - Eclipse Complaints: undefined reference to `TIM_TimeBaseInit'

Hi All,

SW4STM32 complaints about undefined references but it’s not true. Everything is there for the compiler to find via #include “stm32f10x.h”. I added #include “stm32f10x_tim.h” but that’s not even necessary because in #include “stm32f10x.h” other declarations lead to the appropriate peripheral library headers files. I have checked this thoroughly with stm32f10x_stdperiph_lib_um.chm reference manual. Screenshot of SW4STM32 view attached.


void InitializeLEDs(void)
{
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE);

GPIO_InitTypeDef gpioStructure;
gpioStructure.GPIO_Pin = GPIO_Pin_12 | GPIO_Pin_13;
gpioStructure.GPIO_Mode = GPIO_Mode_Out_PP;
gpioStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOD, &gpioStructure);

GPIO_WriteBit(GPIOD, GPIO_Pin_12 | GPIO_Pin_13, Bit_RESET);
}

void InitializeTimer(void)
{
RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE);

TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
TIM_TimeBaseStructure.TIM_Prescaler = 40000;
TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
TIM_TimeBaseStructure.TIM_Period = 500;
TIM_TimeBaseStructure.TIM_ClockDivision = TIM_CKD_DIV1;
TIM_TimeBaseStructure.TIM_RepetitionCounter = 0;
TIM_TimeBaseInit(TIM2, &TIM_TimeBaseStructure);
TIM_Cmd(TIM2, ENABLE);
}

int main()
{
InitializeLEDs();
InitializeTimer();

for (;;)
{
int timerValue = TIM_GetCounter(TIM2);
if (timerValue == 400)
GPIO_WriteBit(GPIOD, GPIO_Pin_12, Bit_SET);
else if (timerValue == 500)
GPIO_WriteBit(GPIOD, GPIO_Pin_12, Bit_RESET);
}
}

TIM_Cmd, TIM_TimeBaseInit and TIM_GetCounter are ALL defined in stm32f10x_tim.h so I don’t know what eclipse is complaining about. Maybe again one of those those eclipse oddities? See screenshot.

TIM_Cmd, TIM_TimeBaseInit and TIM_GetCounter are ALL defined in stm32f10x_tim.h so I don’t know what eclipse is complaining about. Maybe again one of those eclipse oddities? See screenshot attached.


Same here. I brought up the issue (without explicit examples) a couple of days ago. Compiler here builds ok anyways. But the red flags remain and the ctrl-space shows not resolved on code entry / edit.
Annoying.



Hi,

This a very know issue :-(

I solve using

Project >> C/C++ Index >> Freshen all files

best regards
Eng.Mazen Aljeddani


Hi,

For the compiling Error I think you should check
“stm32f110x_hal_conf.h”

And make sure

  1. define HAL_TIM_MODULE_ENABLED


is defined since it will include the header for the Timer moudle as

  1. ifdef HAL_TIM_MODULE_ENABLED

#include “stm32f7xx_hal_tim.h”

  1. endif /* HAL_TIM_MODULE_ENABLED */


best regards
Eng.Mazen Aljeddani

Bosnia and Herzegovina

Thanks, Mazen,
For me, your suggestion solved a problem - after I enable one timer error disappeared.

Ratko