Skip to main content
MM..1
Super User
April 14, 2022
Solved

Header files STM32WB conflict with TouchGFX

  • April 14, 2022
  • 2 replies
  • 1138 views

I try add to pnucleo WB55 project touchgfx package and result is

../Drivers/CMSIS/Device/ST/STM32WBxx/Include/stm32wb55xx.h:1084:29: error: expected identifier before '(' token
 1084 | #define LCD ((LCD_TypeDef *) LCD_BASE)
 | ^
../TouchGFX/target/generated/TouchGFXGeneratedHAL.hpp:44:66: note: in expansion of macro 'LCD'
 44 | TouchGFXGeneratedHAL(touchgfx::DMA_Interface& dma, touchgfx::LCD& display, touchgfx::TouchController& tc, uint16_t width, uint16_t height) :
 | ^~~
../Drivers/CMSIS/Device/ST/STM32WBxx/Include/stm32wb55xx.h:961:31: error: expected ')' before '(' token
 961 | #define LCD_BASE (APB1PERIPH_BASE + 0x00002400UL)
 | ^
../Drivers/CMSIS/Device/ST/STM32WBxx/Include/stm32wb55xx.h:1084:46: note: in expansion of macro 'LCD_BASE'
 1084 | #define LCD ((LCD_TypeDef *) LCD_BASE)
 | ^~~~~~~~
../TouchGFX/target/generated/TouchGFXGeneratedHAL.hpp:44:66: note: in expansion of macro 'LCD'
 44 | TouchGFXGeneratedHAL(touchgfx::DMA_Interface& dma, touchgfx::LCD& display, touchgfx::TouchController& tc, uint16_t width, uint16_t height) :
 |

and next more errors around defined LCD.

Primary colision is in generated files = hard to edit.

Howto solve this ?

 TouchGFXGeneratedHAL(touchgfx::DMA_Interface& dma, touchgfx::LCD& display, touchgfx::TouchController& tc, uint16_t width, uint16_t height) :
 touchgfx::HAL(dma, display, tc, width, height)
 {
 }

This topic has been closed for replies.
Best answer by MM..1

WB 1.12.1, TGFX 4.17.0 , IDE 1.7.0

My solution

#ifndef TouchGFXGeneratedHAL_HPP
#define TouchGFXGeneratedHAL_HPP
 
#include <touchgfx/hal/HAL.hpp>
 
#undef LCD

2 replies

Osman SOYKURT
ST Technical Moderator
April 19, 2022

Hello MM..1,

Can you give more information about your configuration please ?

  • Which version of TouchGFX Designer do you use ?
  • Which version of the board setup do you use ?

This bug was identified before TouchGFX Designer 4.19.0, and have been resolved since.

/Osman

ST Software Developer | TouchGFX
MM..1
MM..1AuthorBest answer
Super User
April 19, 2022

WB 1.12.1, TGFX 4.17.0 , IDE 1.7.0

My solution

#ifndef TouchGFXGeneratedHAL_HPP
#define TouchGFXGeneratedHAL_HPP
 
#include <touchgfx/hal/HAL.hpp>
 
#undef LCD