Skip to content

Conversation

Copy link

Copilot AI commented Nov 23, 2025

The GT911 touchscreen driver's DEVICE_ID macro collides with an identically named macro in STM32MP13 HAL headers (stm32mp135fxx_ca7.h), causing compilation failure on STM32MP13 targets.

Changes:

  • Renamed DEVICE_ID to REG_DEVICE_ID (2 lines: definition and usage)
  • Aligns with existing register naming convention in the driver (REG_STATUS, REG_GT911_CONFIG, etc.)
/* Before */
#define DEVICE_ID  BSWAP_16(0x8140U)

/* After */
#define REG_DEVICE_ID  BSWAP_16(0x8140U)
Original prompt

164/562] Building C object zephyr/drivers/input/CMakeFiles/drivers__input.dir/input_gt911.c.obj
FAILED: zephyr/drivers/input/CMakeFiles/drivers__input.dir/input_gt911.c.obj
ccache /opt/toolchains/zephyr-sdk-0.17.4/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DCORE_CA7 -DHSE_VALUE=24000000 -DKERNEL -DK_HEAP_MEM_POOL_SIZE=0 -DLV_CONF_INCLUDE_SIMPLE=1 -DLV_CONF_PATH="/w/zephyr/zephyr/modules/lvgl/include/lv_conf.h" -DPICOLIBC_LONG_LONG_PRINTF_SCANF -DSTM32MP135Fxx -DUSE_FULL_LL_DRIVER -DUSE_HAL_DRIVER -DZVFS_OPEN_SIZE=0 -D_POSIX_THREAD_SAFE_FUNCTIONS=200809L -D__LINUX_ERRNO_EXTENSIONS -D__PROGRAM_START -D__ZEPHYR_SUPERVISOR__ -D__ZEPHYR__=1 -I/__w/zephyr/zephyr/twister-out/stm32mp135f_dk_stm32mp135fxx/zephyr/samples/modules/lvgl/demos/sample.modules.lvgl.demo_benchmark/zephyr/include/generated/zephyr -I/__w/zephyr/zephyr/include -I/__w/zephyr/zephyr/twister-out/stm32mp135f_dk_stm32mp135fxx/zephyr/samples/modules/lvgl/demos/sample.modules.lvgl.demo_benchmark/zephyr/include/generated -I/__w/zephyr/zephyr/soc/st/stm32 -I/__w/zephyr/zephyr/lib/libc/picolibc/include -I/__w/zephyr/zephyr/lib/posix/c_lib_ext/getopt -I/__w/zephyr/zephyr/lib/midi2/. -I/__w/zephyr/zephyr/soc/st/stm32/common/. -I/__w/zephyr/zephyr/drivers -I/__w/zephyr/zephyr/soc/st/stm32/stm32mp13x/. -I/__w/zephyr/zephyr/subsys/shell/modules/kernel_service/thread/.. -I/__w/zephyr/modules/hal/cmsis/CMSIS/Core_A/Include -I/__w/zephyr/zephyr/modules/cmsis/. -I/__w/zephyr/modules/hal/microchip/include -I/__w/zephyr/modules/hal/st/sensor/inc -I/__w/zephyr/modules/hal/stm32/stm32cube/stm32mp13xx/soc -I/__w/zephyr/modules/hal/stm32/stm32cube/stm32mp13xx/drivers/include -I/__w/zephyr/modules/hal/stm32/stm32cube/common_ll/include -I/__w/zephyr/modules/hal/ti/mspm0/source/ti/devices/msp/. -I/__w/zephyr/modules/hal/ti/mspm0/source/ti/devices/msp/m0p -I/__w/zephyr/modules/hal/ti/mspm0/source/ti/devices/msp/peripherals -I/__w/zephyr/modules/hal/ti/mspm0/source/ti/devices/msp/peripherals/m0p -I/__w/zephyr/modules/hal/ti/mspm0/source/ti/devices/msp/peripherals/m0p/sysctl -I/__w/zephyr/modules/lib/gui/lvgl/src -I/__w/zephyr/zephyr/modules/lvgl/include -isystem /__w/zephyr/zephyr/lib/libc/common/include -Wshadow -fno-strict-aliasing -Werror -Os -imacros /__w/zephyr/zephyr/twister-out/stm32mp135f_dk_stm32mp135fxx/zephyr/samples/modules/lvgl/demos/sample.modules.lvgl.demo_benchmark/zephyr/include/generated/zephyr/autoconf.h -fno-printf-return-value -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-a7 -mabi=aapcs -mfp16-format=ieee -mtp=soft --sysroot=/opt/toolchains/zephyr-sdk-0.17.4/arm-zephyr-eabi/arm-zephyr-eabi -imacros /__w/zephyr/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wdouble-promotion -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=/__w/zephyr/zephyr/samples/modules/lvgl/demos=CMAKE_SOURCE_DIR -fmacro-prefix-map=/__w/zephyr/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/__w/zephyr=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=picolibc.specs -std=c17 -MD -MT zephyr/drivers/input/CMakeFiles/drivers__input.dir/input_gt911.c.obj -MF zephyr/drivers/input/CMakeFiles/drivers__input.dir/input_gt911.c.obj.d -o zephyr/drivers/input/CMakeFiles/drivers__input.dir/input_gt911.c.obj -c /__w/zephyr/zephyr/drivers/input/input_gt911.c
/__w/zephyr/zephyr/drivers/input/input_gt911.c:21: error: "DEVICE_ID" redefined [-Werror]
21 | #define DEVICE_ID BSWAP_16(0x8140U)
|
In file included from /__w/zephyr/modules/hal/stm32/stm32cube/stm32mp13xx/soc/stm32mp13xx.h:97,
from /__w/zephyr/zephyr/soc/st/stm32/stm32mp13x/./soc.h:12,
from /__w/zephyr/zephyr/modules/cmsis/./cmsis_core_a_r.h:17,
from /__w/zephyr/zephyr/modules/cmsis/./cmsis_core.h:10,
from /__w/zephyr/zephyr/include/zephyr/arch/arm/asm_inline_gcc.h:24,
from /__w/zephyr/zephyr/include/zephyr/arch/arm/asm_inline.h:18,
from /__w/zephyr/zephyr/include/zephyr/arch/arm/arch.h:30,
from /__w/zephyr/zephyr/include/zephyr/arch/cpu.h:19,
from /__w/zephyr/zephyr/include/zephyr/kernel_includes.h:36,
from /__w/zephyr/zephyr/include/zephyr/kernel.h:17,
from /__w/zephyr/zephyr/include/zephyr/tracing/tracking.h:16,
from /__w/zephyr/zephyr/include/zephyr/tracing/tracing.h:17,
from /__w/zephyr/zephyr/include/zephyr/drivers/gpio.h:23,
from /__w/zephyr/zephyr/drivers/input/input_gt911.c:11:
/__w/zephyr/modules/hal/stm32/stm32cube/stm32mp13xx/soc/stm32mp135fxx_ca7.h:36802: note: this is the location of the previous definition
36802 | #define DEVICE_ID() ((DBGMCU->IDCODE) & (DBGMCU_IDCODE_DEV_ID_Msk))
|
cc1: all warnings bein...


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Nov 23, 2025
Copilot AI changed the title [WIP] Fix build error for input gt911 driver Fix DEVICE_ID macro conflict with STM32 HAL headers in GT911 driver Nov 23, 2025
Copilot AI requested a review from kartben November 23, 2025 17:30
Copilot finished work on behalf of kartben November 23, 2025 17:30
@kartben kartben closed this Dec 6, 2025
@kartben kartben deleted the copilot/fix-input-gt911-build-error branch December 6, 2025 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants