I have followed the blog article "Printing to an I2C OLED display using nRF Connect SDK" and implemented the solution on an nRF52840dk. Everything works well.
Ref: Printing to an I2C OLED display using nRF Connect SDK
Now I would like to implement the same code on an nRF52840 dongle, where I have connected the same OLED display. Now the build fails.
The error message I get when building is:
Found devicetree overlay: nrf52840dongle_nrf52840.overlay
devicetree error: /v2.5.0/zephyr/boards/shields/ssd1306/ssd1306_128x32.overlay:13 (column 1): parse error: undefined node label 'arduino_i2c'
The problem seems to be that ssd1306_128x32.overlay file located in zephyr/boards/shields/ssd1306 contains the &arduino_i2c... lines below which are not defined for the nRF52840 dongle:
&arduino_i2c {
status = "okay";
ssd1306_ssd1306_128x32: ssd1306@3c {
compatible = "solomon,ssd1306fb";
reg = <0x3c>;
width = <128>;
height = <32>;
segment-offset = <0>;
page-offset = <0>;
display-offset = <0>;
multiplex-ratio = <31>;
segment-remap;
com-invdir;
com-sequential;
prechargep = <0x22>;
};
};
How can this be fixed? Anything for example to be added to the nrf52840dongle_nrf52840.overlay in my project directory. Currently, the nrf52840dongle_nrf52840.overlay file looks like this:
/ {
chosen {
zephyr,display = &ssd1306_ssd1306_128x32;
};
};
&pinctrl {
i2c0_default: i2c0_default {
group1 {
psels = <NRF_PSEL(TWIM_SCL, 0, 10)>,
<NRF_PSEL(TWIM_SDA, 0, 13)>;
};
};
i2c0_sleep: i2c0_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SCL, 0, 10)>,
<NRF_PSEL(TWIM_SDA, 0, 13)>;
};
};
};
&i2c0 {
compatible = "nordic,nrf-twim";
status = "okay";
pinctrl-0 = <&i2c0_default>;
pinctrl-1 = <&i2c0_sleep>;
pinctrl-names = "default", "sleep";
clock-frequency = <100000>;
};