cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F746G-DISCO, STM32CubeIDE

AD�?b
Senior

Can I use FreeRTOS when using MVP?

1 ACCEPTED SOLUTION

Accepted Solutions
Martin KJELDSEN
Chief III

Sure. The two are not mutually exclusive. One is an RTOS the other is a software pattern.

/Martin

View solution in original post

11 REPLIES 11
Martin KJELDSEN
Chief III

Sure. The two are not mutually exclusive. One is an RTOS the other is a software pattern.

/Martin

I did PWM with DMA. Errors pop up:

../Core/Src/main.cpp:571:25: error: 'htim3' was not declared in this scope

../Core/Src/main.cpp:571:48: error: 'duty' was not declared in this scope

?

Nothing MVP is going on in main.cpp yet. You're referncing some symbols that aren't available. This is board bringup. You've defined a function Up() but you're using a reference to htim3 that isn't defined anywhere.

What made you write the code in this way? did you copy it from somewhere?

void Up(void){
	HAL_TIM_PWM_Start_DMA(&htim3, TIM_CHANNEL_1, &duty, 1);
}

I once wrote a program in STemWin. Now I wanted to convert it to TouchGFX. The Up () routine worked correctly. FreeRTOS was not enabled. In lines 52 and 53 there is an automatically generated tim3 handle. Is that not enough?

htim3 is not defined anywhere.

Lines 52 and 53:

DMA_HandleTypeDef hdma_tim3_ch1_trig;
DMA_HandleTypeDef hdma_tim3_ch2;

I noticed that when TouchGFX is off, main.c with TIM_HandleTypeDef appears. After joining TouchGFX, main.ccp appears without TIM_HandleTypeDef. Why? After manual addition, the program compiles without error.

One more remark. I noticed that when, when setting up a new project, when I choose C and not C ++ "TIM_HandleTypeDef htim3;" is generated automatically. Does C or C ++ have any meaning?

It does for TouchGFX applications.

Before CubeIDE 1.1 developers would always create a C project (default setting) and then add TouchGFX (c++), but this meant that the C++ compiler was not enabled for the project. Dead in the water. So now what happens is that CubeIDE when noticing that TouchGFX is enabled, can change the project to C++.

I'm not really sure why you're experiencing what you are in terms of generation of handle definitions.

Hi Martin.

I was looking for a solution to the problem. In my opinion, when TouchGFX and C ++ are enabled, the handle should generate automatically. Unfortunately it is not generated automatically. I had to add it manually.