cancel
Showing results for 
Search instead for 
Did you mean: 

How to use CAN bus with TouchGFX ?

FFont.18
Associate II

Hello, I am new to TouchGFX. I am developping an UI forSTM32F746G-DISCOVERY board. The goal of my UI is that the user can choose some value of variables and then send it to an other device using CAN bus. All the graphical part is working well, I use three screens and model to acces the variables from all the screens.

However, when I want to use the CAN, I face some issues. CAN driver have been made by my teamworker. I wanted to include the CAN driver file to the Model.cpp but I have includes errors. So I tried to include the stm32f7xx_hal_can.h provided by the project but it doesn't work.

Any idea for including the CAN driver? Maybe I should not include it in the main.cpp.

Thank you

Lucas

Compilation error message:

Converting images

Compiling gui/src/model/Model.cpp

In file included from gui/src/model/../../../../Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_can.h:45:0,

                from gui/src/model/Model.cpp:3:

gui/src/model/../../../../Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_def.h:46:23: fatal error: stm32f7xx.h: No such file or directory

 #include "stm32f7xx.h"

                      ^

compilation terminated.

simulator/gcc/Makefile:220: recipe for target 'build/MINGW32_NT-6.2/gui/src/model/Model.o' failed

make[2]: *** [build/MINGW32_NT-6.2/gui/src/model/Model.o] Error 1

simulator/gcc/Makefile:182: recipe for target 'generate_assets' failed

make[1]: *** [generate_assets] Error 2

simulator/gcc/Makefile:40: recipe for target 'all' failed

make: *** [all] Error 2

12 REPLIES 12

hello , 

I am developing a user interface for the STM32H735G-DISCOVERY board using TouchGFX. The objective is to transmit a sequence of CAN frames to another device via the CAN bus when a button is pressed on the TouchGFX interface. Although I attempted to include the stm32f7xx_hal_can.h provided by the project, it didn't function as expected. How can I integrate CAN functionality into TouchGFX and ensure that it works seamlessly with the UI? thank u 

how u can include library stm32f7xx_hal_can.h  in touch GFX

 

Hello @sana1 ,

I’ve already answered you in this thread. Before starting using CAN start with a very simple project setting on/off a gpio. You need to go step by step to understand what is going on. Watch the video from the link I provided to you in the other thread from youtube. You need to understand how could be the structure of an application based on ToucGFX. Hint: Model.cpp is the border between the HW world and the UI world.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.