-
Notifications
You must be signed in to change notification settings - Fork 8.4k
drivers: spi: nrfx: Add explicit dependency to GPIO #85390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drivers: spi: nrfx: Add explicit dependency to GPIO #85390
Conversation
|
@anangl , would you mind reviewing this PR? |
drivers/spi/Kconfig.nrfx
Outdated
| default y | ||
| depends on SOC_FAMILY_NORDIC_NRF | ||
| depends on MULTITHREADING | ||
| depends on GPIO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now we will get:
- A CMake warning will be issued that the SPI driver is not compiled in.
- A linker error in
spi_nor.cfailing to reference a SPI driver.With this it becomes more obvious that SPI driver is enabled by default because of the external flash mounted on the DK.
I'm afraid it might still not be obvious enough. The linker error is quite cryptic, as it says about undefined reference to __device_dts_ord_*. How do you know that the device is SPI?
Hence, I think it should be select GPIO. Then, for CONFIG_GPIO=n, we'll get a Kconfig warning that GPIO got the value y, although it was supposed to be n. And in menuconfig, one can find out what exactly makes this option set to y.
This dependency was always there but not explicitly defined. By adding the explicit dependency it becomes more obvious what is wrong when SPI is enabled but GPIO disabled. This was found when building `samples/bluetooth/peripheral` for `nrf54l15dk/nrf54l15/cpuapp` with `CONFIG_GPIO=n`. Before we got: - A linker error in `spi_nrfx_common.c` failing to reference some nrfx_gpiote APIs. - A linker error in `spi_nrfx_spim.c` failing to reference the GPIO dts entry. Now we will get a warning of that GPIO is not enabled With this it becomes more obvious that SPI driver is enabled by default because of the external flash mounted on the DK. Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
472d5b4 to
41882b7
Compare
|
@anangl , can you please have a look at this? |
|
ping @tbursztyka |
This dependency was always there but not explicitly defined. By adding the explicit dependency it becomes more obvious what is wrong when SPI is enabled but GPIO disabled.
This was found when building
samples/bluetooth/peripheralfornrf54l15dk/nrf54l15/cpuappwithCONFIG_GPIO=n.Before we got:
spi_nrfx_common.cfailing to reference some nrfx_gpiote APIs.spi_nrfx_spim.cfailing to reference the GPIO dts entry.Now we will get:
spi_nor.cfailing to reference a SPI driver.With this it becomes more obvious that SPI driver is enabled by default because of the external flash mounted on the DK.