I started off my project with the Zigbee light_bulb sample, and I added some new functionality that needs to manipulate various GPIOs. These GPIOs are neither buttons/keys nor LEDs. I added the definitions to $PROJECT_DIR/boards/nrf52840dongle_nrf52840.overlay with compatible = "gpio-keys"
. I see the following issues:
- They aren't actually keys/buttons. This DTS file works fine in practice, but it feels hacky. Is there a more appropriate compatible= string to be using? https://devzone.nordicsemi.com/f/nordic-q-a/85362/problem-using-nrf-connect-sdk-devicetree-gpio-definitions-in-code/360543#360543 suggests adding a custom DTS binding; is this what Nordic recommends? Or is there a better "generic gpio" compatible= string I could use?
- When I build this project from the command line using west / ninja it compiles just fine. When I load it into Segger and try to build through the IDE, Segger doesn't find my .overlay file unless I copy it into the project root directory (one level up from boards/ ). What could cause this discrepancy -- are there Segger-specific build settings that need to be kept in sync with the rest of the project?
- I see examples like this:
Most of the samples seem to define an alias for e.g.gpiocus0
and then reference it using DT_ALIAS() in the C code. Is there a way to avoid all of this indirection and just referencegpiocus_0
from C? I don't like having to have 2-3 subtly-different names pointing to the same node. I'd prefer to get rid of the labels and aliases if possible. - It might be helpful to add a Device Tree tag in this forum.