Re: issues with devicetree in 2.2

Bolivar, Marti

"Trevor Clarke via"
<> writes:

'm using Zephyr 2.2 for stm32 through platformio. I'm trying to use the
newer device tree API to configure hardware through an overlay.
I've got an overlay with:

&usart3 { current-speed = <31250>; };
/ { aliases { midi-port = &usart2; }; };

In devicetree_unfixed.h I get defines like DT_ALIAS_MIDI_PORT_BASE_ADDRESS
so I know my overlay is being processed.

In my C code I do:

#define MIDI_DEV DT_ALIAS(midi_port)
struct device* midiin = device_get_binding(MIDI_DEV);
In the zephyr master branch, it would be DT_LABEL(MIDI_DEV).

However: this won't work in 2.2.

When I compile (complete clean and rebuild which re-runs cmake, etc.) I see:

warning: implicit declaration of function 'DT_ALIAS';

A search through my build artifacts and through the zephyr source shows no
definie for DT_ALIAS. I'm following the examples in the documentation. Am I
missing something?
This new DT API is only in the master branch, not Zephyr 2.2.

Since you're on 2.2, use the old API:


Trevor R.H. Clarke
Computer Science House
Rochester Institute of Technology

Join to automatically receive all group messages.