Interfacing OLED SSD1306 with nRF52832 on Zephyr

Subject: Query: Interfacing OLED SSD1306 with nRF52832 on Zephyr

Dear Zephyr Dev Zone Community,

I hope this message finds you well. I am currently working on a project that involves interfacing an OLED SSD1306 display with an nRF52832 microcontroller using the Zephyr RTOS. I have encountered some challenges during the integration process and would greatly appreciate your assistance in resolving them.

Specifically, I am facing issues with initializing and communicating with the OLED SSD1306 display through the nRF52832 microcontroller. Despite following the documentation and examples available, I have been unable to achieve successful communication and display output.

Here are some key details about my setup and the issues I'm encountering:

  1. Hardware Setup:

    • OLED SSD1306 display (specify model/version if applicable)
    • nRF52832 microcontroller development board
    • Connections made using (I2C/SPI) interface
    • Power supply and wiring configurations
  2. Software Environment:

    • Zephyr RTOS version: [Specify version]
    • Development environment/tools used: [Specify IDE, SDK, etc.]
    • Relevant code snippets/configuration files: [Provide snippets of initialization code, device tree configuration, etc.]
  3. Issues Encountered:

    • Initialization problems: Difficulty initializing the OLED display driver.
    • Communication errors: Unable to establish communication between the microcontroller and the OLED display.
    • Display output: No output or incorrect display output observed on the OLED screen.

I would greatly appreciate any guidance, tips, or insights you can provide to help me overcome these challenges and successfully interface the OLED SSD1306 display with the nRF52832 microcontroller on the Zephyr RTOS.

Thank you very much for your time and assistance. I look forward to your valuable input and suggestions.

Best regards, Aman

  • build/zephyr/zephyr.dts

    # 0 "C:/ncs/v2.4.2/zephyr/misc/empty_file.c"
    # 0 "<built-in>"
    # 0 "<command-line>"
    # 1 "C:/ncs/v2.4.2/zephyr/boards/arm/nrf52dk_nrf52832/nrf52dk_nrf52832.dts" 1
    
    
    
    
    
    
    
    /dts-v1/;
    # 1 "C:/ncs/v2.4.2/zephyr/dts/arm/nordic/nrf52832_qfaa.dtsi" 1 3 4
    
    
    
    
    
    
    # 1 "C:/ncs/v2.4.2/zephyr/dts/common/mem.h" 1 3 4
    # 8 "C:/ncs/v2.4.2/zephyr/dts/arm/nordic/nrf52832_qfaa.dtsi" 2 3 4
    # 1 "C:/ncs/v2.4.2/zephyr/dts/arm/nordic/nrf52832.dtsi" 1 3 4
    
    
    # 1 "C:/ncs/v2.4.2/zephyr/dts/arm/armv7-m.dtsi" 1 3 4
    
    
    # 1 "C:/ncs/v2.4.2/zephyr/dts/common/skeleton.dtsi" 1 3 4
    # 9 "C:/ncs/v2.4.2/zephyr/dts/common/skeleton.dtsi" 3 4
    / {
     #address-cells = <1>;
     #size-cells = <1>;
     chosen { };
     aliases { };
    };
    # 4 "C:/ncs/v2.4.2/zephyr/dts/arm/armv7-m.dtsi" 2 3 4
    
    / {
     soc {
      #address-cells = <1>;
      #size-cells = <1>;
      compatible = "simple-bus";
      interrupt-parent = <&nvic>;
      ranges;
    
      nvic: interrupt-controller@e000e100 {
       #address-cells = <1>;
       compatible = "arm,v7m-nvic";
       reg = <0xe000e100 0xc00>;
       interrupt-controller;
       #interrupt-cells = <2>;
      };
    
      systick: timer@e000e010 {
       compatible = "arm,armv7m-systick";
       reg = <0xe000e010 0x10>;
      };
     };
    };
    # 4 "C:/ncs/v2.4.2/zephyr/dts/arm/nordic/nrf52832.dtsi" 2 3 4
    # 1 "C:/ncs/v2.4.2/zephyr/dts/arm/nordic/nrf_common.dtsi" 1 3 4
    
    
    
    
    
    
    # 1 "C:/ncs/v2.4.2/zephyr/include/zephyr/dt-bindings/adc/adc.h" 1 3 4
    # 8 "C:/ncs/v2.4.2/zephyr/dts/arm/nordic/nrf_common.dtsi" 2 3 4
    # 1 "C:/ncs/v2.4.2/zephyr/include/zephyr/dt-bindings/adc/nrf-adc.h" 1 3 4
    # 10 "C:/ncs/v2.4.2/zephyr/include/zephyr/dt-bindings/adc/nrf-adc.h" 3 4
    # 1 "C:/ncs/v2.4.2/zephyr/include/zephyr/dt-bindings/dt-util.h" 1 3 4
    # 19 "C:/ncs/v2.4.2/zephyr/include/zephyr/dt-bindings/dt-util.h" 3 4
    # 1 "C:/ncs/v2.4.2/zephyr/include/zephyr/sys/util_macro.h" 1 3 4
    # 34 "C:/ncs/v2.4.2/zephyr/include/zephyr/sys/util_macro.h" 3 4
    # 1 "C:/ncs/v2.4.2/zephyr/include/zephyr/sys/util_internal.h" 1 3 4
    # 18 "C:/ncs/v2.4.2/zephyr/include/zephyr/sys/util_internal.h" 3 4
    # 1 "C:/ncs/v2.4.2/zephyr/include/zephyr/sys/util_loops.h" 1 3 4
    # 19 "C:/ncs/v2.4.2/zephyr/include/zephyr/sys/util_internal.h" 2 3 4
    # 35 "C:/ncs/v2.4.2/zephyr/include/zephyr/sys/util_macro.h" 2 3 4
    # 20 "C:/ncs/v2.4.2/zephyr/include/zephyr/dt-bindings/dt-util.h" 2 3 4
    # 11 "C:/ncs/v2.4.2/zephyr/include/zephyr/dt-bindings/adc/nrf-adc.h" 2 3 4
    # 9 "C:/ncs/v2.4.2/zephyr/dts/arm/nordic/nrf_common.dtsi" 2 3 4
    # 1 "C:/ncs/v2.4.2/zephyr/include/zephyr/dt-bindings/gpio/gpio.h" 1 3 4
    # 10 "C:/ncs/v2.4.2/zephyr/dts/arm/nordic/nrf_common.dtsi" 2 3 4
    # 1 "C:/ncs/v2.4.2/zephyr/include/zephyr/dt-bindings/i2c/i2c.h" 1 3 4
    # 11 "C:/ncs/v2.4.2/zephyr/dts/arm/nordic/nrf_common.dtsi" 2 3 4
    # 1 "C:/ncs/v2.4.2/zephyr/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h" 1 3 4
    # 12 "C:/ncs/v2.4.2/zephyr/dts/arm/nordic/nrf_common.dtsi" 2 3 4
    # 1 "C:/ncs/v2.4.2/zephyr/include/zephyr/dt-bindings/pwm/pwm.h" 1 3 4
    # 13 "C:/ncs/v2.4.2/zephyr/dts/arm/nordic/nrf_common.dtsi" 2 3 4
    
    # 1 "C:/ncs/v2.4.2/zephyr/dts/common/freq.h" 1 3 4
    # 15 "C:/ncs/v2.4.2/zephyr/dts/arm/nordic/nrf_common.dtsi" 2 3 4
    # 1 "C:/ncs/v2.4.2/zephyr/dts/arm/nordic/override.dtsi" 1 3 4
    # 16 "C:/ncs/v2.4.2/zephyr/dts/arm/nordic/nrf_common.dtsi" 2 3 4
    # 24 "C:/ncs/v2.4.2/zephyr/dts/arm/nordic/nrf_common.dtsi" 3 4
    / {
     pinctrl: pin-controller {
    
    
    
    
      compatible = "nordic,nrf-pinctrl";
     };
    
     rng_hci: entropy_bt_hci {
      compatible = "zephyr,bt-hci-entropy";
      status = "okay";
     };
    };
    
    &systick {
    
    
    
    
     status = "disabled";
    };
    # 5 "C:/ncs/v2.4.2/zephyr/dts/arm/nordic/nrf52832.dtsi" 2 3 4
    
    / {
     chosen {
      zephyr,entropy = &rng;
      zephyr,flash-controller = &flash_controller;
     };
    
     cpus {
      #address-cells = <1>;
      #size-cells = <0>;
    
      cpu@0 {
       device_type = "cpu";
       compatible = "arm,cortex-m4f";
       reg = <0>;
       #address-cells = <1>;
       #size-cells = <1>;
    
       itm: itm@e0000000 {
        compatible = "arm,armv7m-itm";
        reg = <0xe0000000 0x1000>;
        swo-ref-frequency = <32000000>;
       };
      };
     };
    
     soc {
      ficr: ficr@10000000 {
       compatible = "nordic,nrf-ficr";
       reg = <0x10000000 0x1000>;
       status = "okay";
      };
    
      uicr: uicr@10001000 {
       compatible = "nordic,nrf-uicr";
       reg = <0x10001000 0x1000>;
       status = "okay";
      };
    
      sram0: memory@20000000 {
       compatible = "mmio-sram";
      };
    
      clock: clock@40000000 {
       compatible = "nordic,nrf-clock";
       reg = <0x40000000 0x1000>;
       interrupts = <0 1>;
       status = "okay";
      };
    
      power: power@40000000 {
       compatible = "nordic,nrf-power";
       reg = <0x40000000 0x1000>;
       interrupts = <0 1>;
       status = "okay";
       #address-cells = <1>;
       #size-cells = <1>;
    
       gpregret1: gpregret1@4000051c {
        compatible = "nordic,nrf-gpregret";
        reg = <0x4000051c 0x1>;
        status = "okay";
       };
    
       gpregret2: gpregret2@40000520 {
        compatible = "nordic,nrf-gpregret";
        reg = <0x40000520 0x1>;
        status = "okay";
       };
      };
    
      bprot: bprot@40000000 {
       compatible = "nordic,nrf-bprot";
       reg = <0x40000000 0x1000>;
       status = "okay";
      };
    
      radio: radio@40001000 {
       compatible = "nordic,nrf-radio";
       reg = <0x40001000 0x1000>;
       interrupts = <1 1>;
       status = "okay";
       ble-2mbps-supported;
      };
    
      uart0: uart@40002000 {
    
    
       compatible = "nordic,nrf-uarte";
       reg = <0x40002000 0x1000>;
       interrupts = <2 1>;
       status = "disabled";
      };
    
      i2c0: i2c@40003000 {
    
    
    
    
    
    
    
       compatible = "nordic,nrf-twim";
       #address-cells = <1>;
       #size-cells = <0>;
       reg = <0x40003000 0x1000>;
       clock-frequency = <100000>;
       interrupts = <3 1>;
       status = "disabled";
      };
    
      spi0: spi@40003000 {
    
    
    
    
    
    
    
       compatible = "nordic,nrf-spi";
       #address-cells = <1>;
       #size-cells = <0>;
       reg = <0x40003000 0x1000>;
       interrupts = <3 1>;
       max-frequency = <((8) * 1000 * 1000)>;
       easydma-maxcnt-bits = <8>;
       status = "disabled";
      };
    
      i2c1: i2c@40004000 {
    
    
    
    
    
    
    
       compatible = "nordic,nrf-twim";
       #address-cells = <1>;
       #size-cells = <0>;
       reg = <0x40004000 0x1000>;
       clock-frequency = <100000>;
       interrupts = <4 1>;
       status = "disabled";
      };
    
      spi1: spi@40004000 {
    
    
    
    
    
    
    
       compatible = "nordic,nrf-spi";
       #address-cells = <1>;
       #size-cells = <0>;
       reg = <0x40004000 0x1000>;
       interrupts = <4 1>;
       max-frequency = <((8) * 1000 * 1000)>;
       easydma-maxcnt-bits = <8>;
       status = "disabled";
      };
    
      nfct: nfct@40005000 {
       compatible = "nordic,nrf-nfct";
       reg = <0x40005000 0x1000>;
       interrupts = <5 1>;
       status = "okay";
      };
    
      gpiote: gpiote@40006000 {
       compatible = "nordic,nrf-gpiote";
       reg = <0x40006000 0x1000>;
       interrupts = <6 5>;
       status = "disabled";
      };
    
      adc: adc@40007000 {
       compatible = "nordic,nrf-saadc";
       reg = <0x40007000 0x1000>;
       interrupts = <7 1>;
       status = "disabled";
       #io-channel-cells = <1>;
      };
    
      timer0: timer@40008000 {
       compatible = "nordic,nrf-timer";
       status = "disabled";
       reg = <0x40008000 0x1000>;
       cc-num = <4>;
       max-bit-width = <32>;
       interrupts = <8 1>;
       prescaler = <0>;
      };
    
      timer1: timer@40009000 {
       compatible = "nordic,nrf-timer";
       status = "disabled";
       reg = <0x40009000 0x1000>;
       cc-num = <4>;
       max-bit-width = <32>;
       interrupts = <9 1>;
       prescaler = <0>;
      };
    
      timer2: timer@4000a000 {
       compatible = "nordic,nrf-timer";
       status = "disabled";
       reg = <0x4000a000 0x1000>;
       cc-num = <4>;
       max-bit-width = <32>;
       interrupts = <10 1>;
       prescaler = <0>;
      };
    
      rtc0: rtc@4000b000 {
       compatible = "nordic,nrf-rtc";
       reg = <0x4000b000 0x1000>;
       cc-num = <3>;
       interrupts = <11 1>;
       status = "disabled";
       clock-frequency = <32768>;
       prescaler = <1>;
      };
    
      temp: temp@4000c000 {
       compatible = "nordic,nrf-temp";
       reg = <0x4000c000 0x1000>;
       interrupts = <12 1>;
       status = "okay";
      };
    
      rng: random@4000d000 {
       compatible = "nordic,nrf-rng";
       reg = <0x4000d000 0x1000>;
       interrupts = <13 1>;
       status = "okay";
      };
    
      ecb: ecb@4000e000 {
       compatible = "nordic,nrf-ecb";
       reg = <0x4000e000 0x1000>;
       interrupts = <14 1>;
       status = "okay";
      };
    
      ccm: ccm@4000f000 {
       compatible = "nordic,nrf-ccm";
       reg = <0x4000f000 0x1000>;
       interrupts = <15 1>;
       length-field-length-8-bits;
       status = "okay";
      };
    
      wdt: wdt0: watchdog@40010000 {
       compatible = "nordic,nrf-wdt";
       reg = <0x40010000 0x1000>;
       interrupts = <16 1>;
       status = "okay";
      };
    
      rtc1: rtc@40011000 {
       compatible = "nordic,nrf-rtc";
       reg = <0x40011000 0x1000>;
       cc-num = <4>;
       interrupts = <17 1>;
       status = "disabled";
       clock-frequency = <32768>;
       prescaler = <1>;
      };
    
      qdec: qdec0: qdec@40012000 {
       compatible = "nordic,nrf-qdec";
       reg = <0x40012000 0x1000>;
       interrupts = <18 1>;
       status = "disabled";
      };
    
      comp: comparator@40013000 {
    
    
    
    
    
    
       compatible = "nordic,nrf-comp";
       reg = <0x40013000 0x1000>;
       interrupts = <19 1>;
       status = "disabled";
       #io-channel-cells = <1>;
      };
    
      egu0: swi0: egu@40014000 {
       compatible = "nordic,nrf-egu", "nordic,nrf-swi";
       reg = <0x40014000 0x1000>;
       interrupts = <20 1>;
       status = "okay";
      };
    
      egu1: swi1: egu@40015000 {
       compatible = "nordic,nrf-egu", "nordic,nrf-swi";
       reg = <0x40015000 0x1000>;
       interrupts = <21 1>;
       status = "okay";
      };
    
      egu2: swi2: egu@40016000 {
       compatible = "nordic,nrf-egu", "nordic,nrf-swi";
       reg = <0x40016000 0x1000>;
       interrupts = <22 1>;
       status = "okay";
      };
    
      egu3: swi3: egu@40017000 {
       compatible = "nordic,nrf-egu", "nordic,nrf-swi";
       reg = <0x40017000 0x1000>;
       interrupts = <23 1>;
       status = "okay";
      };
    
      egu4: swi4: egu@40018000 {
       compatible = "nordic,nrf-egu", "nordic,nrf-swi";
       reg = <0x40018000 0x1000>;
       interrupts = <24 1>;
       status = "okay";
      };
    
      egu5: swi5: egu@40019000 {
       compatible = "nordic,nrf-egu", "nordic,nrf-swi";
       reg = <0x40019000 0x1000>;
       interrupts = <25 1>;
       status = "okay";
      };
    
      timer3: timer@4001a000 {
       compatible = "nordic,nrf-timer";
       status = "disabled";
       reg = <0x4001a000 0x1000>;
       cc-num = <6>;
       max-bit-width = <32>;
       interrupts = <26 1>;
       prescaler = <0>;
      };
    
      timer4: timer@4001b000 {
       compatible = "nordic,nrf-timer";
       status = "disabled";
       reg = <0x4001b000 0x1000>;
       cc-num = <6>;
       max-bit-width = <32>;
       interrupts = <27 1>;
       prescaler = <0>;
      };
    
      pwm0: pwm@4001c000 {
       compatible = "nordic,nrf-pwm";
       reg = <0x4001c000 0x1000>;
       interrupts = <28 1>;
       status = "disabled";
       #pwm-cells = <3>;
      };
    
      pdm0: pdm@4001d000 {
       compatible = "nordic,nrf-pdm";
       reg = <0x4001d000 0x1000>;
       interrupts = <29 1>;
       status = "disabled";
      };
    
      flash_controller: flash-controller@4001e000 {
       compatible = "nordic,nrf52-flash-controller";
       reg = <0x4001e000 0x1000>;
    
       #address-cells = <1>;
       #size-cells = <1>;
    
    
       flash0: flash@0 {
        compatible = "soc-nv-flash";
        erase-block-size = <4096>;
        write-block-size = <4>;
       };
      };
    
      ppi: ppi@4001f000 {
       compatible = "nordic,nrf-ppi";
       reg = <0x4001f000 0x1000>;
       status = "okay";
      };
    
      mwu: mwu@40020000 {
       compatible = "nordic,nrf-mwu";
       reg = <0x40020000 0x1000>;
       status = "okay";
      };
    
      pwm1: pwm@40021000 {
       compatible = "nordic,nrf-pwm";
       reg = <0x40021000 0x1000>;
       interrupts = <33 1>;
       status = "disabled";
       #pwm-cells = <3>;
      };
    
      pwm2: pwm@40022000 {
       compatible = "nordic,nrf-pwm";
       reg = <0x40022000 0x1000>;
       interrupts = <34 1>;
       status = "disabled";
       #pwm-cells = <3>;
      };
    
      spi2: spi@40023000 {
    
    
    
    
    
    
    
       compatible = "nordic,nrf-spi";
       #address-cells = <1>;
       #size-cells = <0>;
       reg = <0x40023000 0x1000>;
       interrupts = <35 1>;
       max-frequency = <((8) * 1000 * 1000)>;
       easydma-maxcnt-bits = <8>;
       status = "disabled";
      };
    
      rtc2: rtc@40024000 {
       compatible = "nordic,nrf-rtc";
       reg = <0x40024000 0x1000>;
       cc-num = <4>;
       interrupts = <36 1>;
       status = "disabled";
       clock-frequency = <32768>;
       prescaler = <1>;
      };
    
      i2s0: i2s@40025000 {
       compatible = "nordic,nrf-i2s";
       #address-cells = <1>;
       #size-cells = <0>;
       reg = <0x40025000 0x1000>;
       interrupts = <37 1>;
       status = "disabled";
      };
    
      gpio0: gpio@50000000 {
       compatible = "nordic,nrf-gpio";
       gpio-controller;
       reg = <0x50000000 0x1000>;
       #gpio-cells = <2>;
       status = "disabled";
       port = <0>;
      };
     };
    
     sw_pwm: sw-pwm {
      compatible = "nordic,nrf-sw-pwm";
      status = "disabled";
      generator = <&timer2>;
      clock-prescaler = <0>;
      #pwm-cells = <3>;
     };
    };
    
    &nvic {
     arm,num-irq-priority-bits = <3>;
    };
    # 9 "C:/ncs/v2.4.2/zephyr/dts/arm/nordic/nrf52832_qfaa.dtsi" 2 3 4
    
    &flash0 {
     reg = <0x00000000 ((512) * 1024)>;
    };
    
    &sram0 {
     reg = <0x20000000 ((64) * 1024)>;
    };
    
    / {
     soc {
      compatible = "nordic,nRF52832-QFAA", "nordic,nRF52832", "nordic,nRF52", "simple-bus";
     };
    };
    # 10 "C:/ncs/v2.4.2/zephyr/boards/arm/nrf52dk_nrf52832/nrf52dk_nrf52832.dts" 2
    # 1 "C:/ncs/v2.4.2/zephyr/boards/arm/nrf52dk_nrf52832/nrf52dk_nrf52832-pinctrl.dtsi" 1
    
    
    
    
    
     &pinctrl {
        uart0_default: uart0_default {
            group1 {
                psels = <((((((0) * 32U) + (6)) & 0x7FU) << 0U) | ((0U & 0xFFFFU) << 16U))>,
                    <((((((0) * 32U) + (8)) & 0x7FU) << 0U) | ((1U & 0xFFFFU) << 16U))>,
                    <((((((0) * 32U) + (5)) & 0x7FU) << 0U) | ((2U & 0xFFFFU) << 16U))>,
                    <((((((0) * 32U) + (7)) & 0x7FU) << 0U) | ((3U & 0xFFFFU) << 16U))>;
            };
        };
    
        uart0_sleep: uart0_sleep {
            group1 {
                psels = <((((((0) * 32U) + (6)) & 0x7FU) << 0U) | ((0U & 0xFFFFU) << 16U))>,
                    <((((((0) * 32U) + (8)) & 0x7FU) << 0U) | ((1U & 0xFFFFU) << 16U))>,
                    <((((((0) * 32U) + (5)) & 0x7FU) << 0U) | ((2U & 0xFFFFU) << 16U))>,
                    <((((((0) * 32U) + (7)) & 0x7FU) << 0U) | ((3U & 0xFFFFU) << 16U))>;
                low-power-enable;
            };
        };
    
        i2c0_default: i2c0_default {
            group1 {
                psels = <((((((0) * 32U) + (26)) & 0x7FU) << 0U) | ((12U & 0xFFFFU) << 16U))>,
                    <((((((0) * 32U) + (27)) & 0x7FU) << 0U) | ((11U & 0xFFFFU) << 16U))>;
            };
        };
    
        i2c0_sleep: i2c0_sleep {
            group1 {
                psels = <((((((0) * 32U) + (26)) & 0x7FU) << 0U) | ((12U & 0xFFFFU) << 16U))>,
                    <((((((0) * 32U) + (27)) & 0x7FU) << 0U) | ((11U & 0xFFFFU) << 16U))>;
                low-power-enable;
            };
        };
    
        i2c1_default: i2c1_default {
            group1 {
                psels = <((((((0) * 32U) + (26)) & 0x7FU) << 0U) | ((12U & 0xFFFFU) << 16U))>,
                    <((((((0) * 32U) + (25)) & 0x7FU) << 0U) | ((11U & 0xFFFFU) << 16U))>;
            };
        };
    
        i2c1_sleep: i2c1_sleep {
            group1 {
                psels = <((((((0) * 32U) + (26)) & 0x7FU) << 0U) | ((12U & 0xFFFFU) << 16U))>,
                    <((((((0) * 32U) + (25)) & 0x7FU) << 0U) | ((11U & 0xFFFFU) << 16U))>;
                low-power-enable;
            };
        };
    
        pwm0_default: pwm0_default {
            group1 {
                psels = <((((((0) * 32U) + (17)) & 0x7FU) << 0U) | ((22U & 0xFFFFU) << 16U))>;
                nordic,invert;
            };
        };
    
        pwm0_sleep: pwm0_sleep {
            group1 {
                psels = <((((((0) * 32U) + (17)) & 0x7FU) << 0U) | ((22U & 0xFFFFU) << 16U))>;
                low-power-enable;
            };
        };
    
        spi0_default: spi0_default {
            group1 {
                psels = <((((((0) * 32U) + (27)) & 0x7FU) << 0U) | ((4U & 0xFFFFU) << 16U))>,
                    <((((((0) * 32U) + (26)) & 0x7FU) << 0U) | ((5U & 0xFFFFU) << 16U))>,
                    <((((((0) * 32U) + (28)) & 0x7FU) << 0U) | ((6U & 0xFFFFU) << 16U))>;
            };
        };
    
        spi0_sleep: spi0_sleep {
            group1 {
                psels = <((((((0) * 32U) + (27)) & 0x7FU) << 0U) | ((4U & 0xFFFFU) << 16U))>,
                    <((((((0) * 32U) + (26)) & 0x7FU) << 0U) | ((5U & 0xFFFFU) << 16U))>,
                    <((((((0) * 32U) + (28)) & 0x7FU) << 0U) | ((6U & 0xFFFFU) << 16U))>;
                low-power-enable;
            };
        };
    
        spi1_default: spi1_default {
            group1 {
                psels = <((((((0) * 32U) + (31)) & 0x7FU) << 0U) | ((4U & 0xFFFFU) << 16U))>,
                    <((((((0) * 32U) + (30)) & 0x7FU) << 0U) | ((5U & 0xFFFFU) << 16U))>,
                    <((((((0) * 32U) + (29)) & 0x7FU) << 0U) | ((6U & 0xFFFFU) << 16U))>;
            };
        };
    
        spi1_sleep: spi1_sleep {
            group1 {
                psels = <((((((0) * 32U) + (31)) & 0x7FU) << 0U) | ((4U & 0xFFFFU) << 16U))>,
                    <((((((0) * 32U) + (30)) & 0x7FU) << 0U) | ((5U & 0xFFFFU) << 16U))>,
                    <((((((0) * 32U) + (29)) & 0x7FU) << 0U) | ((6U & 0xFFFFU) << 16U))>;
                low-power-enable;
            };
        };
    
        spi2_default: spi2_default {
            group1 {
                psels = <((((((0) * 32U) + (25)) & 0x7FU) << 0U) | ((4U & 0xFFFFU) << 16U))>,
                    <((((((0) * 32U) + (23)) & 0x7FU) << 0U) | ((5U & 0xFFFFU) << 16U))>,
                    <((((((0) * 32U) + (24)) & 0x7FU) << 0U) | ((6U & 0xFFFFU) << 16U))>;
            };
        };
    
        spi2_sleep: spi2_sleep {
            group1 {
                psels = <((((((0) * 32U) + (25)) & 0x7FU) << 0U) | ((4U & 0xFFFFU) << 16U))>,
                    <((((((0) * 32U) + (23)) & 0x7FU) << 0U) | ((5U & 0xFFFFU) << 16U))>,
                    <((((((0) * 32U) + (24)) & 0x7FU) << 0U) | ((6U & 0xFFFFU) << 16U))>;
                low-power-enable;
            };
        };
    
    };
    # 11 "C:/ncs/v2.4.2/zephyr/boards/arm/nrf52dk_nrf52832/nrf52dk_nrf52832.dts" 2
    
    / {
        model = "Nordic nRF52 DK NRF52832";
        compatible = "nordic,nrf52-dk-nrf52832";
    
        chosen {
            zephyr,console = &uart0;
            zephyr,shell-uart = &uart0;
            zephyr,uart-mcumgr = &uart0;
            zephyr,bt-mon-uart = &uart0;
            zephyr,bt-c2h-uart = &uart0;
            zephyr,sram = &sram0;
            zephyr,flash = &flash0;
            zephyr,code-partition = &slot0_partition;
        };
    
        leds {
            compatible = "gpio-leds";
            led0: led_0 {
                gpios = <&gpio0 17 (1 << 0)>;
                label = "Green LED 0";
            };
            led1: led_1 {
                gpios = <&gpio0 18 (0 << 0)>;
                label = "Green LED 1";
            };
            led2: led_2 {
                gpios = <&gpio0 19 (0 << 0)>;
                label = "Green LED 2";
            };
            led3: led_3 {
                gpios = <&gpio0 20 (0 << 0)>;
                label = "Green LED 3";
            };
        };
    
        pwmleds {
            compatible = "pwm-leds";
            pwm_led0: pwm_led_0 {
                pwms = <&pwm0 0 (((20) * 1000UL) * 1000UL) (1 << 0)>;
            };
        };
    
        buttons {
            compatible = "gpio-keys";
            button0: button_0 {
                gpios = <&gpio0 13 ((1 << 4) | (1 << 0))>;
                label = "Push button switch 0";
            };
            button1: button_1 {
                gpios = <&gpio0 14 ((1 << 4) | (1 << 0))>;
                label = "Push button switch 1";
            };
            button2: button_2 {
                gpios = <&gpio0 15 ((1 << 4) | (1 << 0))>;
                label = "Push button switch 2";
            };
            button3: button_3 {
                gpios = <&gpio0 16 ((1 << 4) | (1 << 0))>;
                label = "Push button switch 3";
            };
        };
    
        arduino_header: connector {
            compatible = "arduino-header-r3";
            #gpio-cells = <2>;
            gpio-map-mask = <0xffffffff 0xffffffc0>;
            gpio-map-pass-thru = <0 0x3f>;
            gpio-map = <0 0 &gpio0 3 0>,
                       <1 0 &gpio0 4 0>,
                       <2 0 &gpio0 28 0>,
                       <3 0 &gpio0 29 0>,
                       <4 0 &gpio0 30 0>,
                       <5 0 &gpio0 31 0>,
                       <6 0 &gpio0 11 0>,
                       <7 0 &gpio0 12 0>,
                       <8 0 &gpio0 13 0>,
                       <9 0 &gpio0 14 0>,
                       <10 0 &gpio0 15 0>,
                       <11 0 &gpio0 16 0>,
                       <12 0 &gpio0 17 0>,
                       <13 0 &gpio0 18 0>,
                       <14 0 &gpio0 19 0>,
                       <15 0 &gpio0 20 0>,
                       <16 0 &gpio0 22 0>,
                       <17 0 &gpio0 23 0>,
                       <18 0 &gpio0 24 0>,
                       <19 0 &gpio0 25 0>,
                       <20 0 &gpio0 26 0>,
                       <21 0 &gpio0 27 0>;
        };
    
        arduino_adc: analog-connector {
            compatible = "arduino,uno-adc";
            #io-channel-cells = <1>;
            io-channel-map = <0 &adc 1>,
                             <1 &adc 2>,
                             <2 &adc 4>,
                             <3 &adc 5>,
                             <4 &adc 6>,
                             <5 &adc 7>;
        };
    
    
        aliases {
            led0 = &led0;
            led1 = &led1;
            led2 = &led2;
            led3 = &led3;
            pwm-led0 = &pwm_led0;
            sw0 = &button0;
            sw1 = &button1;
            sw2 = &button2;
            sw3 = &button3;
            bootloader-led0 = &led0;
            mcuboot-button0 = &button0;
            mcuboot-led0 = &led0;
            watchdog0 = &wdt0;
        };
    };
    
    
    
    &adc {
        status = "okay";
    };
    
    &gpiote {
        status = "okay";
    };
    
    &gpio0 {
        status = "okay";
    };
    
    arduino_serial: &uart0 {
        status = "okay";
        compatible = "nordic,nrf-uarte";
        current-speed = <115200>;
        pinctrl-0 = <&uart0_default>;
        pinctrl-1 = <&uart0_sleep>;
        pinctrl-names = "default", "sleep";
    };
    
    arduino_i2c: &i2c1 {
        compatible = "nordic,nrf-twi";
        status = "okay";
        pinctrl-0 = <&i2c1_default>;
        pinctrl-1 = <&i2c1_sleep>;
        pinctrl-names = "default", "sleep";
    };
    
    &i2c1 {
        compatible = "nordic,nrf-twi";
    
    
        pinctrl-0 = <&i2c1_default>;
        pinctrl-1 = <&i2c1_sleep>;
        pinctrl-names = "default", "sleep";
    };
    
    &pwm0 {
        status = "okay";
        pinctrl-0 = <&pwm0_default>;
        pinctrl-1 = <&pwm0_sleep>;
        pinctrl-names = "default", "sleep";
    };
    
    &spi0 {
        compatible = "nordic,nrf-spi";
    
    
        pinctrl-0 = <&spi0_default>;
        pinctrl-1 = <&spi0_sleep>;
        pinctrl-names = "default", "sleep";
    };
    
    &spi1 {
        compatible = "nordic,nrf-spi";
        status = "okay";
        pinctrl-0 = <&spi1_default>;
        pinctrl-1 = <&spi1_sleep>;
        pinctrl-names = "default", "sleep";
    };
    
    
    arduino_spi: &spi2 {
        compatible = "nordic,nrf-spi";
        status = "okay";
        cs-gpios = <&arduino_header 16 (1 << 0)>;
        pinctrl-0 = <&spi2_default>;
        pinctrl-1 = <&spi2_sleep>;
        pinctrl-names = "default", "sleep";
    };
    
    &flash0 {
    
        partitions {
            compatible = "fixed-partitions";
            #address-cells = <1>;
            #size-cells = <1>;
    
            boot_partition: partition@0 {
                label = "mcuboot";
                reg = <0x00000000 0xc000>;
            };
            slot0_partition: partition@c000 {
                label = "image-0";
                reg = <0x0000C000 0x32000>;
            };
            slot1_partition: partition@3e000 {
                label = "image-1";
                reg = <0x0003E000 0x32000>;
            };
            scratch_partition: partition@70000 {
                label = "image-scratch";
                reg = <0x00070000 0xa000>;
            };
            storage_partition: partition@7a000 {
                label = "storage";
                reg = <0x0007a000 0x00006000>;
            };
        };
    };
    # 0 "<command-line>" 2
    # 1 "C:/ncs/v2.4.2/zephyr/boards/shields/ssd1306/ssd1306_128x64.overlay" 1
    
    
    
    
    
    
    &arduino_i2c {
        status = "okay";
        compatible = "nordic,nrf-twi";
    
    
        ssd1306@3c {
                compatible = "solomon,ssd1306fb";
                reg = <0x3c>;
                label = "SSD1306";
                width = <128>;
                height = <64>;
                segment-offset = <0>;
                page-offset = <0>;
                display-offset = <0>;
                multiplex-ratio = <63>;
                segment-remap;
                com-invdir;
                prechargep = <0x22>;
        };
    };
    # 0 "<command-line>" 2
    # 1 "c:/ncs/v2.4.2/zephyr/samples/subsys/display/lvgl/nrf52dk_nrf52832.overlay" 1
    &pinctrl {
        i2c0_default: i2c0_default {
            group1 {
                psels = <((((((0) * 32U) + (26)) & 0x7FU) << 0U) | ((12U & 0xFFFFU) << 16U))>,
                <((((((0) * 32U) + (27)) & 0x7FU) << 0U) | ((11U & 0xFFFFU) << 16U))>;
            };
        };
    
        i2c0_sleep: i2c0_sleep {
            group1 {
                psels = <((((((0) * 32U) + (26)) & 0x7FU) << 0U) | ((12U & 0xFFFFU) << 16U))>,
                <((((((0) * 32U) + (27)) & 0x7FU) << 0U) | ((11U & 0xFFFFU) << 16U))>;
            };
        };
    };
    
    &i2c0 {
        compatible = "nordic,nrf-twi";
        status = "okay";
        pinctrl-0 = <&i2c0_default>;
        pinctrl-1 = <&i2c0_sleep>;
        pinctrl-names = "default", "sleep";
    
    
        ssd1306: ssd1306@3c {
            compatible = "solomon,ssd1306fb";
            reg = <0x3C>;
            label = "SSD1306";
            height = <64>;
            width = <128>;
            segment-offset = <0>;
            page-offset = <0>;
            display-offset = <0>;
            multiplex-ratio = <63>;
            prechargep = <0x22>;
            com-invdir;
            segment-remap;
        };
    };
    
    / {
     chosen {
      zephyr,display = &ssd1306;
     };
    };
    # 0 "<command-line>" 2
    # 1 "C:/ncs/v2.4.2/zephyr/misc/empty_file.c"
    

  • LVGL code is looking like this  could you explain what's getting wrong

    LVGL code is looking like this

  • Hello, 

    sorry for the late reply. Have you been able to solve the issue on your side?

    Kind regards,
    Øyvind

Related