您尚未登录。

楼主 # 2022-08-15 22:08:52

虎太郎
会员
注册时间: 2022-08-03
已发帖子: 5
积分: 0

F1C200s使用SPI驱动SSD1306OLED显示图片(目前图片无法正常显示)

目前已正常配置好SPI驱动,屏幕上也能够正常输出linux内核启动的日志信息。因此尝试使用OLED屏幕来显示单色图片,借鉴了荔枝派zero指南https://www.kancloud.cn/lichee/lpi0/326953/中的程序,但是无法显示出一张正常的图片。观察串口打印输出的结果,如下图所示,struct fb_info指向的每个像素点的位数为16位,但是SSD1306OLED屏幕每个像素点的位数应该为1位,图片无法正常显示的原因可能就是这个,但是目前还不知道该如何解决。
.png

离线

楼主 #1 2022-08-16 09:51:00

虎太郎
会员
注册时间: 2022-08-03
已发帖子: 5
积分: 0

Re: F1C200s使用SPI驱动SSD1306OLED显示图片(目前图片无法正常显示)

这是内核启动过程输出的日志信息,从日志中可以看到 ssd1306 的显存 video memory是16KiB, 缓存 buffer memory 是4KiB,很奇怪,SSD1306内置的显存大小不应该是128×64bit,也就是1KiB吗,暂时还不清楚为什么这里显示的是16KiB。

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.2.0-licheepi-nano (zitao@zitao-virtual-machine) (gcc version 7.2.1 20171011 (Linaro GCC 7.2-2017.11)) #6 Mon Aug 15 16:17:03 CST 2022
[    0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] OF: fdt: Machine model: Lichee Pi Nano
[    0.000000] Memory policy: Data cache writeback
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,115200 panic=5 rootwait root=/dev/mmcblk0p2 earlyprintk rw
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Memory: 55196K/65536K available (6144K kernel code, 235K rwdata, 1468K rodata, 1024K init, 221K bss, 10340K reserved, 0K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] random: get_random_bytes called from start_kernel+0x254/0x42c with crng_init=0
[    0.000047] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000125] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000663] Console: colour dummy device 80x30
[    0.000751] Calibrating delay loop... 203.16 BogoMIPS (lpj=1015808)
[    0.070245] pid_max: default: 32768 minimum: 301
[    0.070664] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.070704] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.072324] CPU: Testing write buffer coherency: ok
[    0.074224] Setting up static identity map for 0x80100000 - 0x80100058
[    0.076423] devtmpfs: initialized
[    0.082853] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.082912] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.083199] pinctrl core: initialized pinctrl subsystem
[    0.085137] NET: Registered protocol family 16
[    0.086546] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.088511] cpuidle: using governor menu
[    0.138037] SCSI subsystem initialized
[    0.138387] usbcore: registered new interface driver usbfs
[    0.138540] usbcore: registered new interface driver hub
[    0.138721] usbcore: registered new device driver usb
[    0.139195] pps_core: LinuxPPS API ver. 1 registered
[    0.139221] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.139691] Advanced Linux Sound Architecture Driver Initialized.
[    0.141967] clocksource: Switched to clocksource timer
[    0.170771] NET: Registered protocol family 2
[    0.172416] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes)
[    0.172499] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.172558] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.172607] TCP: Hash tables configured (established 1024 bind 1024)
[    0.172881] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.172949] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.173437] NET: Registered protocol family 1
[    0.175939] NetWinder Floating Point Emulator V0.97 (double precision)
[    0.177903] Initialise system trusted keyrings
[    0.178445] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.204871] Key type asymmetric registered
[    0.204912] Asymmetric key parser 'x509' registered
[    0.205081] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[    0.205109] io scheduler mq-deadline registered
[    0.205126] io scheduler kyber registered
[    0.207235] sun4i-usb-phy 1c13400.phy: Couldn't request ID GPIO
[    0.217695] suniv-f1c100s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.396793] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.402424] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pe not found, using dummy regulator
[    0.404135] printk: console [ttyS0] disabled
[    0.424392] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 22, base_baud = 6250000) is a 16550A
[    0.803584] printk: console [ttyS0] enabled
[    0.811856] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator
[    0.830652] SCSI Media Changer driver v0.25 
[    0.836454] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pc not found, using dummy regulator
[    0.848721] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pa not found, using dummy regulator
[    0.861476] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.868138] ehci-platform: EHCI generic platform driver
[    0.873745] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.879984] ohci-platform: OHCI generic platform driver
[    0.885750] usbcore: registered new interface driver usb-storage
[    0.892886] udc-core: couldn't find an available UDC - added [g_cdc] to list of pending drivers
[    0.901879] i2c /dev entries driver
[    0.907222] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    0.916918] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pf not found, using dummy regulator
[    0.954813] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[    0.964250] usbcore: registered new interface driver usbhid
[    0.969824] usbhid: USB HID core driver
[    0.973972] fbtft_of_value: buswidth = 8
[    0.977908] fbtft_of_value: debug = 0
[    0.981566] fbtft_of_value: rotate = 0
[    0.985407] fbtft_of_value: fps = 30
[    1.029325] mmc0: host does not support reading read-only switch, assuming write-enable
[    1.039633] mmc0: new high speed SDHC card at address 21e1
[    1.048260] mmcblk0: mmc0:21e1 APPSD 29.5 GiB 
[    1.055447]  mmcblk0: p1 p2
[    1.154624] graphics fb0: fb_ssd1306 frame buffer, 128x64, 16 KiB video memory, 4 KiB buffer memory, fps=33, spi1.0 at 50 MHz
[    1.181436] NET: Registered protocol family 17
[    1.186124] Key type dns_resolver registered
[    1.192745] Loading compiled-in X.509 certificates
[    1.208508] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator
[    1.219934] sun4i-backend 1e60000.display-backend: Couldn't find matching frontend, frontend features disabled
[    1.230783] sun4i-drm display-engine: bound 1e60000.display-backend (ops 0xc0736654)
[    1.239849] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops 0xc07352ac)
[    1.247633] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    1.254284] [drm] No driver support for vblank timestamp query.
[    1.261542] [drm] Initialized sun4i-drm 1.0.0 20150629 for display-engine on minor 0
[    1.272625] sun4i-drm display-engine: fb1: sun4i-drmdrmfb frame buffer device
[    1.281244] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[    1.293174] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[    1.298966] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 1
[    1.309138] hub 1-0:1.0: USB hub found
[    1.313170] hub 1-0:1.0: 1 port detected
[    1.318954] using random self ethernet address
[    1.323550] using random host ethernet address
[    1.330000] usb0: HOST MAC 5a:3e:5c:88:78:11
[    1.334540] usb0: MAC 66:c9:4a:43:47:b7
[    1.338487] g_cdc gadget: CDC Composite Gadget, version: King Kamehameha Day 2008
[    1.346045] g_cdc gadget: g_cdc ready
[    1.350677] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    1.368525] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    1.375362] ALSA device list:
[    1.378349]   #0: Loopback 1
[    1.382356] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    1.390966] cfg80211: failed to load regulatory.db
[    1.408001] random: fast init done
[    1.434825] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    1.443157] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    1.451475] devtmpfs: mounted
[    1.459074] Freeing unused kernel memory: 1024K
[    1.463799] Run /sbin/init as init process
[    2.387529] systemd[1]: System time before build time, advancing clock.
[    2.415639] systemd[1]: Failed to lookup module alias 'autofs4': Function not implemented
[    2.467391] systemd[1]: systemd 241 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid)
[    2.490743] systemd[1]: Detected architecture arm.

离线

#2 2022-08-19 21:28:18

Ican
会员
注册时间: 2022-06-11
已发帖子: 30
积分: 0

Re: F1C200s使用SPI驱动SSD1306OLED显示图片(目前图片无法正常显示)

应该是f1c200s的debe有个clock寄存器需要配置一下极性

离线

楼主 #3 2022-08-21 21:20:25

虎太郎
会员
注册时间: 2022-08-03
已发帖子: 5
积分: 0

Re: F1C200s使用SPI驱动SSD1306OLED显示图片(目前图片无法正常显示)

Ican 说:

应该是f1c200s的debe有个clock寄存器需要配置一下极性

你好,那个请问一下你说的f1c200s的debe指的是什么?这个clock寄存器该怎么配置?我不是很懂。

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn