Hi, I'm relatively new to Nordic microcontrollers and have recently completed the beginner's course. Sorry in advance if I made an obvious mistake.
I am currently trying to use the nRF52dk (nrf52832) to display any words on the Waveshare 2.42-inch OLED Module. From the manufacturer, it seems it uses the SSD1309 instead of the popular SSD1306, and it comes with the SPI configuration. The screen is 128x64. I tried using the CFB and LVGL sample. For the CFB example, I use this as the device overlay and put it in the boards folder.
boards/nrf52dk_nrf52832.overlay
/ { chosen { zephyr,display = &ssd1306_ssd1306_128x64_spi; }; }; &arduino_spi { status = "okay"; ssd1306_ssd1306_128x64_spi: ssd1306@0 { compatible = "solomon,ssd1306fb"; reg = <0>; spi-max-frequency = <10000000>; width = <128>; height = <64>; segment-offset = <0>; page-offset = <0>; display-offset = <0>; multiplex-ratio = <63>; segment-remap; com-invdir; prechargep = <0x22>; data_cmd-gpios = <&arduino_header 11 0>; /* reset-gpios = <&arduino_header 14 GPIO_ACTIVE_LOW>; */ }; };
I added the shield in the CMakeLists.txt
CONFIG_STDOUT_CONSOLE=y CONFIG_HEAP_MEM_POOL_SIZE=16384 CONFIG_DISPLAY=y CONFIG_SSD1306=y CONFIG_DEBUG=y CONFIG_CFB_LOG_LEVEL_DBG=y CONFIG_CHARACTER_FRAMEBUFFER=y CONFIG_SPI=y
I did not change the sample main.c code from the "cfb" sample.
This is what is printed once it is successfully built and flashed, but the device does not turn on.
Initialized ssd1306@0
font width 10, font height 16
font width 15, font height 24
font width 20, font height 32
x_res 128, y_res 64, ppt 8, rows 8, cols 128
I am using the nRF Connect VScode extension and SDK v3.0.0
I used Kconfig.ssd1306 from zephyr. I am not sure if this is the correct way to approach Kconfig.
# SSD1306 display controller configuration options # Copyright (c) 2018 Phytec Messtechnik GmbH # SPDX-License-Identifier: Apache-2.0 menuconfig SSD1306 bool "SSD1306 display driver" default y depends on DT_HAS_SOLOMON_SSD1306FB_ENABLED || DT_HAS_SINOWEALTH_SH1106_ENABLED select I2C if $(dt_compat_on_bus,$(DT_COMPAT_SOLOMON_SSD1306FB),i2c) select SPI if $(dt_compat_on_bus,$(DT_COMPAT_SOLOMON_SSD1306FB),spi) select I2C if $(dt_compat_on_bus,$(DT_COMPAT_SINOWEALTH_SH1106),i2c) select SPI if $(dt_compat_on_bus,$(DT_COMPAT_SINOWEALTH_SH1106),spi) help Enable driver for SSD1306 display driver. if SSD1306 config SSD1306_DEFAULT_CONTRAST int "SSD1306 default contrast" default 128 range 0 $(UINT8_MAX) help SSD1306 default contrast. config SSD1306_REVERSE_MODE bool "SSD1306 reverse mode" help SSD16XX reverse video mode. endif # SSD1306
Please let me know if more details need to be provided, as I am new to the embedded world.