I’ve tried to setup 2 screens to see which error message I am getting. I think it’s an issue with the device tree:
When I have 2 screens, I get:
eCube/src/screen_mgr.c:14: undefined reference to `__device_dts_ord_65'
Line 14 is where I access the second screen:
l14: const struct device *epd02_device = DEVICE_DT_GET(DT_NODELABEL(epd2));
My dts looks like this:
&spi0 {
compatible = "nordic,nrf-spim";
status = "okay";
sck-pin = < 17 >;
mosi-pin = < 19 >;
miso-pin = < 20 >;
cs-gpios = <&gpio0 03 GPIO_ACTIVE_LOW>,
<&gpio0 04 GPIO_ACTIVE_LOW>;
epd1: ssd16xxfb@0 {
compatible = "solomon,ssd16xxfb";
label = "ssd16xx01";
spi-max-frequency = <4000000>;
reg = <0>;
width = <200>;
height = <200>;
pp-width-bits = <8>;
pp-height-bits = <16>;
dc-gpios = <&gpio1 06 GPIO_ACTIVE_LOW>;
reset-gpios = <&gpio1 05 GPIO_ACTIVE_LOW>;
busy-gpios = <&gpio1 04 GPIO_ACTIVE_HIGH>;
gdv = [00];
sdv = [41 a8 32];
vcom = <0x00>;
border-waveform = <0x05>;
tssv = <0x80>;
};
epd2: ssd16xxfb@1 {
compatible = "solomon,ssd16xxfb";
label = "ssd16xx02";
spi-max-frequency = <4000000>;
reg = <1>;
width = <200>;
height = <200>;
pp-width-bits = <8>;
pp-height-bits = <16>;
dc-gpios = <&gpio1 03 GPIO_ACTIVE_LOW>;
reset-gpios = <&gpio1 02 GPIO_ACTIVE_LOW>;
busy-gpios = <&gpio1 01 GPIO_ACTIVE_HIGH>;
gdv = [00];
sdv = [41 a8 32];
vcom = <0x00>;
border-waveform = <0x05>;
tssv = <0x80>;
};
};
Where I think it might be a device tree issue is when I leave the node epd2
in the dts file, but comment out l14
(This way there is only one screen in the code but 2 nodes in the device tree).
In this case I get a runtime error, device_is_ready(epd01_device)
is false. It is true when i remove the epd2
node.
I had a look in the generated device tree, and this is what i see in the spi0 node:
spi0: spi@40003000 {
compatible = "nordic,nrf-spim";
#address-cells = < 0x1 >;
#size-cells = < 0x0 >;
reg = < 0x40003000 0x1000 >;
interrupts = < 0x3 0x1 >;
status = "okay";
label = "SPI_0";
sck-pin = < 0x11 >;
mosi-pin = < 0x13 >;
miso-pin = < 0x14 >;
cs-gpios = < &gpio0 0x3 0x1 >, < &gpio0 0x4 0x1 >;
epd1: ssd16xxfb@0 {
compatible = "solomon,ssd16xxfb";
label = "ssd16xx01";
spi-max-frequency = < 0x3d0900 >;
reg = < 0x0 >;
width = < 0xc8 >;
height = < 0xc8 >;
pp-width-bits = < 0x8 >;
pp-height-bits = < 0x10 >;
dc-gpios = < &gpio1 0x6 0x1 >;
reset-gpios = < &gpio1 0x5 0x1 >;
busy-gpios = < &gpio1 0x4 0x0 >;
gdv = [ 00 ];
sdv = [ 41 A8 32 ];
vcom = < 0x0 >;
border-waveform = < 0x5 >;
tssv = < 0x80 >;
};
epd2: ssd16xxfb@1 {
compatible = "solomon,ssd16xxfb";
label = "ssd16xx02";
spi-max-frequency = < 0x3d0900 >;
reg = < 0x1 >;
width = < 0xc8 >;
height = < 0xc8 >;
pp-width-bits = < 0x8 >;
pp-height-bits = < 0x10 >;
dc-gpios = < &gpio1 0x3 0x1 >;
reset-gpios = < &gpio1 0x2 0x1 >;
busy-gpios = < &gpio1 0x1 0x0 >;
gdv = [ 00 ];
sdv = [ 41 A8 32 ];
vcom = < 0x0 >;
border-waveform = < 0x5 >;
tssv = < 0x80 >;
};
};
Maybe it’s not the right way to have 2 slave devices on one SPI node?
(another possibility: The error looks very similar when I forgot to add CONFIG_SSD16XX=y
and CONFIG_DISPLAY=y
to the prj.conf
with the initial screen).