zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.75k stars 6.56k forks source link

kconfig: Error in Kconfig options MEMC_STM32 #75488

Closed miggazElquez closed 3 months ago

miggazElquez commented 3 months ago

The Kconfig option MEMC_STM32 is not set correctly:

The option is defined in two files:

So, if you have CONFIG_MEMC=y in your Kconfig options and you are on a STM32 SoC, CONFIG_MEMC_STM32 will be enabled, even if there is no STM32 FMC enabled.

This Kconfig option causes the driver for the STM32 FMC to be compiled, regardless of the presence of an enabled node for the FMC. However, the driver fails to compile if there is no FMC node in the devicetree. So, if you compile a project with CONFIG_MEMC=y on a board with an STM32 SoC and no enabled FMC, the build will fail.

To Reproduce Add CONFIG_MEMC=y in an application. Build on for a board with a STM32 SoC without enabling the fmc The build fails

Expected behavior It shouldn't try to compile the driver for the fmc, and the build should work.

Impact

Annoyance: when building the same project, I have to change the configuration depending on if I enable the fmc or not in the Device tree.

Logs and console output After adding CONFIG_MEMC=y to the sample blinky and running west build -p always -b stm32l562e_dk samples/basic/blinky :

/home/miguel/zephyrproject/zephyr/drivers/memc/memc_stm32.c:21:2: error: #error "No compatible FMC devicetree node found"
   21 | #error "No compatible FMC devicetree node found"
      |  ^~~~~

Environment Os: Linux Toolchain: Zephyr SDK Commit SHA: a6e672f9b2368e6d011da189afd462fec599fd0d

miggazElquez commented 3 months ago

Fixed by https://github.com/zephyrproject-rtos/zephyr/pull/75386

github-actions[bot] commented 3 months ago

Hi @miggazElquez! We appreciate you submitting your first issue for our open-source project. 🌟

Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙

henrikbrixandersen commented 3 months ago

Please use our bug template when reporting bugs. You need to edit this issue to include the information requested in https://github.com/zephyrproject-rtos/zephyr/blob/main/.github/ISSUE_TEMPLATE/001_bug_report.md (e.g. we have no indication of which revision of Zephyr, you are reporting this against).

miggazElquez commented 3 months ago

Done