Skip to main content
Hiram Hyman
Associate III
September 1, 2022
Solved

TIMER 13

Hi,

I have an issue with calling Timer13 from model.cpp. For instance, htim13.Instance->CCR1 = 95. for instance fails to load. Wasn't a problem for CM7.

c:\st\stm32cubeide_1.7.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.0.202111181127\tools\arm-none-eabi\bin\ld.exe: ./Application/User/gui/Model.o: in function `Model::PWM_DELTA(int)':

C:/TouchGFXProjects/AUGV.08.30.2002/CM7/TouchGFX/gui/src/model/Model.cpp:23: undefined reference to `htim13'

#include <gui/model/Model.hpp>

#include <gui/model/ModelListener.hpp>

#include "stm32h7xx_hal.h"

extern TIM_HandleTypeDef htim13;

Model::Model() : modelListener(0)

{

}

void Model::tick()

{

}

void Model:: PWM_DELTA(int value)

{

value = value * 9.70; //constant to allow 0-100 percent

 htim13.Instance->CCR1 = 95; //change dutyclycle

}

I've written this code multiple times without issue utilizing one processor (CM7). Now I'm using CM4 for PWM, I have a handler failure that I can't resolve.

I just downloaded RM0399 Reference manual so, I still need help. Anyone?

One thing I forgot to mention is that I do have the PWM signal on the scope. So the timer has started.

Hiram

This topic has been closed for replies.
Hiram Hyman
Hiram HymanBest answer
Associate III
September 1, 2022

All,

I found the answer! I'm so used to working with a single processor that I just didn't think that I need to just add TIM_HandleTypeDef htim13; and not extern TIM_HandleTypeDef htim13;

Thanks anyway!

Hiram

2 replies

Hiram Hyman
Associate III
September 1, 2022

Anyone has a possible clue?

Hiram Hyman
Hiram HymanAuthorBest answer
Associate III
September 1, 2022

All,

I found the answer! I'm so used to working with a single processor that I just didn't think that I need to just add TIM_HandleTypeDef htim13; and not extern TIM_HandleTypeDef htim13;

Thanks anyway!

Hiram