您尚未登录。

#1 Re: 全志 SOC » F1C200S使用panel_simple驱动SPI+RGB液晶控制芯片 » 2020-12-05 16:42:31

我已经调试好了,用gpio模拟时序实现的,但是侧边界有2mm不能显示,不知道是不是要设置偏移量

#2 Re: 全志 SOC » 主线Linux驱动 16路GPIO+全端口中断扩展芯片 AW9523B 驱动尝鲜 » 2020-11-03 20:16:15

路过大神帖子,学习一下,另外aodzip大神能不能给个buildroot-tiny200开发包的PWM和RTP按键的驱动示例,不胜感激!

小弟在mangoPi R3开发液晶过程中遇到棘手问题,若能提供建议,不胜感激!
https://whycan.com/t_5503.html

#3 Re: 全志 SOC » F1C200S使用panel_simple驱动SPI+RGB液晶控制芯片 » 2020-11-03 19:23:29

孤星泪 说:

前面那个方框应该是mtp服务程序导致usb的log,和这个没有关系。

建议挂逻辑分析仪看下时序对不对,

顺便把屏幕的手册上传一下,

是spi 9bit 下降沿吗?

是RGB+SPI 3线9bit 上升沿

芯片手册如下
https://whycan.com/files/members/5375/ST7701S_SPEC_%20V1_3.pdf

#4 全志 SOC » F1C200S使用panel_simple驱动SPI+RGB液晶控制芯片 » 2020-11-03 10:37:22

xpf170702031
回复: 11

控制芯片型号ST7701S,接口使用
第一种方式:
1.使用panel-sitronix-st7789v.c仿造一个7701s出来,并且编译成模块
static const struct drm_display_mode default_mode = {
    .clock = 27500,
    .hdisplay = 960,
    .hsync_start = 960 + 38,
    .hsync_end = 960 + 38 + 12,
    .htotal = 960 + 38 + 12 + 12,
    .vdisplay = 320,
    .vsync_start = 320 + 18,
    .vsync_end = 320 + 18 + 8,
    .vtotal = 320 + 18 + 8 + 4,
    .vrefresh = 60,
};

static int st7789v_prepare(struct drm_panel *panel)
{
    struct st7789v *ctx = panel_to_st7789v(panel);
    int ret;

    ret = regulator_enable(ctx->power);
    if (ret)
        return ret;
    gpiod_set_value(ctx->reset, 1);
    msleep(20);
    gpiod_set_value(ctx->reset, 0);
    msleep(20);
    gpiod_set_value(ctx->reset, 1);
    msleep(120);
    /* We need to wait 120ms after a sleep out command */

    ST7789V_TEST(ret, st7789v_write_command(ctx,0xff));
    ST7789V_TEST(ret, st7789v_write_data(ctx, 0x77));
    ST7789V_TEST(ret, st7789v_write_data(ctx, 0x01));
    ST7789V_TEST(ret, st7789v_write_data(ctx, 0x00));
    ST7789V_TEST(ret, st7789v_write_data(ctx, 0x00));
    ST7789V_TEST(ret, st7789v_write_data(ctx, 0x13));
..........省略初始化命令和数据

dts修改(在spi设备节点里面增加):
st7701s@0x01 {
        compatible = "sitronix,st7701s";
        reg = <1>;
        spi-max-frequency = <32000000>;
        buswidth = <8>;
        reset-gpios = <&pio 4 11 GPIO_ACTIVE_LOW>;
        backlight = <&pwm_bl>;
        status = "okay";
        port {
            panel_input: endpoint {
                        remote-endpoint = <&tcon0_out_lcd>;
                    };
            };
        };

结果:
不能驱动出fb0,原因未知,请各路大神给点意见,分析分析
FluxBB bbcode 测试

#5 Re: 全志 SOC » 使用aodzip/buildroot-tiny200开发包烧写F1C200S到SD卡,系统启动依赖于USB_device连接到PC » 2020-11-03 09:54:47

vip888888 说:

这和插usb没有关系吧,又不涉及到nand或者nor,你串口打印乱码是不是你的设备没有和电脑共地?接上usb之后因为共地所以才显示正常了?你设备树控制个led不接串口应该可以启动吧?测试下咯。

大神,你说得对,接地不好导致的,膜拜!!

#6 Re: 全志 SOC » 使用aodzip/buildroot-tiny200开发包烧写F1C200S到SD卡,系统启动依赖于USB_device连接到PC » 2020-11-02 11:25:47

我想要实现:SD卡引导系统启动,不依赖于USB,nand,nor,请路过的大神帮忙!

①linux用dd烧录到TF卡
②windows用win32diskimager烧录到TF卡
这两个方法已经试过了,不能单独引导启动,必须插上USB-device线连接PC;

请看uboot打印中有个“Allwinner mUSB OTG (Peripheral)”

#7 Re: 全志 SOC » 使用aodzip/buildroot-tiny200开发包烧写F1C200S到SD卡,系统启动依赖于USB_device连接到PC » 2020-11-02 11:20:31

马前卒 说:

长篇大论没看懂, 一句话说清楚吧

问题:buildroot-tiny200开发包不支持单独使用SD启动?

#9 全志 SOC » 使用aodzip/buildroot-tiny200开发包烧写F1C200S到SD卡,系统启动依赖于USB_device连接到PC » 2020-11-01 23:39:19

xpf170702031
回复: 8

1.git拉取最新的buildroot-tiny200开发包;
2.编译buildroot;
3.执行flash-mmc-all.sh烧写SD卡;
  cat flash-mmc-all.sh
    #!/bin/bash
    MMC=/dev/sdb
    sudo umount "$MMC"1 "$MMC"2 "$MMC"3
    sudo chmod 666 /dev/sdb
    dd if=output/images/sysimage-sdcard.img of="$MMC" bs=4k
    sync
4.插上SD卡,板子上电,console口打印乱码;此时,插上USB线连接PC机,系统立刻正常启动,进入终端交互;
5.问题来了,没有nand,nor,是不是buildroot-tiny200开发包不支持单独SD启动???请大神帮忙解答

下面贴出spl的源码:

bootargs_common=console=ttyS0,115200 earlyprintk rootwait consoleblank=0 net.ifnames=0 biosdevname=0

mmc_kernel=zImage
mmc_fdt=devicetree.dtb
mmc_ubootpart=1
mmc_bootpart=2
mmc_rootpart=3

nand_fdt_offset=0x80000
nand_fdt_length=0x4000
nand_kernel_offset=0x100000
nand_kernel_length=0x700000
nand_rootpart=3
nand_overlaypart=4

sf_fdt_offset=0x70000
sf_fdt_length=0x10000
sf_kernel_offset=0x80000
sf_kernel_length=0x580000
sf_rootpart=3
sf_overlaypart=4

stderr=serial,vga
stdin=serial
stdout=serial,vga
kernel_addr_r=0x80000000
fdt_addr_r=0x80700000
ramdisk_addr_r=0x80708000
bootm_size=0x1700000

boot_slot_0=empty
boot_slot_1=empty
scan_boot_slot_0=if mmc dev 0; then setenv boot_slot_0 mmc0; fi;
scan_boot_slot_1=if mmc dev 1; then setenv boot_slot_1 mmc1; else if sf probe; then setenv boot_slot_1 spi-nor; else if mtd list; then setenv boot_slot_1 spi-nand; fi; fi; fi;
scan_boot_slot=run scan_boot_slot_0; echo "========================="; echo "Boot Device: ${boot_device}"; echo "Boot Slot 0: ${boot_slot_0}"; echo "Boot Slot 1: ${boot_slot_1}"; echo "========================="; 

dfu_wait_timeout=1
mmc_dfu_info=setenv dfu_alt_info "all raw 0x0 0x37000;u-boot raw 0x10 0x7f0;boot part ${dfu_mmc_dev} ${mmc_bootpart};rom part ${dfu_mmc_dev} ${mmc_rootpart};devicetree.dtb fat ${dfu_mmc_dev} ${mmc_bootpart};zImage fat ${dfu_mmc_dev} ${mmc_bootpart}"
nand_dfu_info=all raw 0x0 0x8000000;u-boot raw 0x0 0x80000;dtb raw 0x80000 0x20000;kernel raw 0x100000 0x700000;rom raw 0x800000 0x2000000
nor_dfu_info=all raw 0x0 0x1000000;u-boot raw 0x0 0x70000;dtb raw 0x70000 0x10000;kernel raw 0x80000 0x580000;rom raw 0x600000 0x700000
dfu_mmc=mmc dev ${dfu_mmc_dev}; run mmc_dfu_info; dfu 0 mmc ${dfu_mmc_dev} ${dfu_wait_timeout};
dfu_nand=setenv dfu_alt_info "${nand_dfu_info}"; dfu 0 mtd spi-nand0 ${dfu_wait_timeout};
dfu_nor=setenv dfu_alt_info "${nor_dfu_info}"; dfu 0 sf 0:0 ${dfu_wait_timeout};
dfu_boot=if test "${boot_slot_1}" = "spi-nand"; then echo "DFU waiting on SPI-NAND..."; run dfu_nand; fi; if test "${boot_slot_1}" = "spi-nor"; then echo "DFU waiting on SPI-NOR..."; run dfu_nor; fi; if test "${boot_slot_1}" = "mmc1"; then echo "DFU waiting on MMC1..."; setenv dfu_mmc_dev 1; run dfu_mmc; fi; if test "${boot_slot_1}" = "empty" && test "${boot_slot_0}" = "mmc0"; then echo "DFU waiting on MMC0..."; setenv dfu_mmc_dev 0; run dfu_mmc; fi;

flasher_ptr_counter=0x80000000
flasher_ptr_buffer=0x80000004
flasher_size_buffer=0x800000
flasher_nandimage=sysimage-nand.img
flasher_norimage=sysimage-nor.img
flash_nand=size mmc 0:${mmc_bootpart} ${flasher_nandimage}; setexpr size_image ${filesize}; mw ${flasher_ptr_counter} ${size_image}; mtd erase spi-nand0; flasher_offset=0; while itest *${flasher_ptr_counter} > 0; do if itest ${size_image} > ${flasher_size_buffer}; then blocksize=${flasher_size_buffer}; else blocksize=0x${size_image}; fi; setexpr size_image ${size_image} - ${blocksize}; mw ${flasher_ptr_counter} ${size_image}; load mmc 0:${mmc_bootpart} ${flasher_ptr_buffer} ${flasher_nandimage} ${flasher_size_buffer} ${flasher_offset}; mtd write spi-nand0 ${flasher_ptr_buffer} ${flasher_offset} ${flasher_size_buffer}; setexpr flasher_offset ${flasher_offset} + ${blocksize}; done;
flash_nor=size mmc 0:${mmc_bootpart} ${flasher_norimage}; setexpr size_image ${filesize}; mw ${flasher_ptr_counter} ${size_image}; flasher_offset=0; while itest *${flasher_ptr_counter} > 0; do if itest ${size_image} > ${flasher_size_buffer}; then blocksize=${flasher_size_buffer}; else blocksize=0x${size_image}; fi; setexpr size_image ${size_image} - ${blocksize}; mw ${flasher_ptr_counter} ${size_image}; load mmc 0:${mmc_bootpart} ${flasher_ptr_buffer} ${flasher_norimage} ${flasher_size_buffer} ${flasher_offset}; sf update ${flasher_ptr_buffer} ${flasher_offset} ${flasher_size_buffer}; setexpr flasher_offset ${flasher_offset} + ${blocksize}; done;
flasher_boot=if test -e mmc 0:${mmc_bootpart} ${flasher_norimage}; then if test "${boot_slot_1}" = "spi-nor"; then echo "Flashing SPI-NOR from MMC0..."; run flash_nor; run nor_boot; fi; fi; if test -e mmc 0:${mmc_bootpart} ${flasher_nandimage}; then if test "${boot_slot_1}" = "spi-nand"; then echo "Flashing SPI-NAND from MMC0..."; run flash_nand; run nand_boot; fi; fi;

genbootargs=setenv bootargs ${bootargs_common} root=${rootdev} ${overlayfs_config}

fel_boot=echo "Booting from FEL..."; rootdev=/dev/ram0; run genbootargs; bootz ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r};
mmc_boot=mmc dev ${devnum}; echo "Booting from MMC${devnum}..."; rootdev=/dev/mmcblk${devnum}p${mmc_rootpart}; run genbootargs; load mmc ${devnum}:${mmc_bootpart} $kernel_addr_r ${mmc_kernel}; load mmc ${devnum}:${mmc_bootpart} ${fdt_addr_r} ${mmc_fdt}; bootz ${kernel_addr_r} - ${fdt_addr_r};
nor_boot=echo "Booting from SPI-NOR..."; sf probe; sf read ${fdt_addr_r} ${sf_fdt_offset} ${sf_fdt_length}; sf read ${kernel_addr_r} ${sf_kernel_offset} ${sf_kernel_length}; rootdev=/dev/mtdblock${sf_rootpart}; overlayfs_config="overlayfsdev=/dev/mtdblock${sf_overlaypart}"; run genbootargs; bootz ${kernel_addr_r} - ${fdt_addr_r};
nand_boot=echo "Booting from SPI-NAND..."; mtd read spi-nand0 ${fdt_addr_r} ${nand_fdt_offset} ${nand_fdt_length}; mtd read spi-nand0 ${kernel_addr_r} ${nand_kernel_offset} ${nand_kernel_length}; rootdev=/dev/mtdblock${nand_rootpart}; overlayfs_config="overlayfsdev=/dev/mtdblock${nand_overlaypart}"; run genbootargs; bootz ${kernel_addr_r} - ${fdt_addr_r};
nor_nand_boot=if test "${boot_slot_1}" = "spi-nor"; then run nor_boot; fi; if test "${boot_slot_1}" = "spi-nand"; then run nand_boot; fi;

bootcmd_fel=if test "${boot_device}" = "fel"; then run fel_boot; fi;
bootcmd_dfu=if test "${boot_device}" != "mmc0" || test "${boot_slot_1}" = "empty"; then run dfu_boot; fi;
bootcmd_flasher=if test "${boot_device}" = "mmc0"; then run flasher_boot; fi;
bootcmd_mmc0=if test "${boot_device}" = "mmc0"; then devnum=0; run mmc_boot; fi;
bootcmd_mmc1=if test "${boot_device}" = "mmc1"; then devnum=1; run mmc_boot; fi;
bootcmd_spi=if test "${boot_device}" = "spi"; then run nor_nand_boot; fi;
bootcmd_ums=if test "${boot_slot_0}" = "mmc0"; then echo "Emulating SD Reader on MMC0..."; ums 0 mmc 0:0; fi;

boot_targets=fel dfu flasher mmc0 mmc1 spi ums
bootcmd=run scan_boot_slot; for target in ${boot_targets}; do run bootcmd_${target}; done

下面是插上USB_device线,系统正常启动的打印
U-Boot SPL 2020.07 (Nov 01 2020 - 01:02:04 +0800)
DRAM: 64 MiB
Trying to boot from MMC1


U-Boot 2020.07 (Nov 01 2020 - 01:02:04 +0800) Allwinner Technology

CPU:   Allwinner F Series (SUNIV)
Model: Allwinner F1C200s Generic Device
DRAM:  64 MiB
MMC:   mmc@1c0f000: 0
Setting up a 960x320 lcd console (overscan 0x0)
In:    serial
Out:   vga
Err:   vga
Allwinner mUSB OTG (Peripheral)
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0 is current device
=========================
Boot Device: mmc0
Boot Slot 0: mmc0
Boot Slot 1: empty
=========================
DFU waiting on MMC0...
switch to partitions #0, OK
mmc0 is current device
musb-hdrc: peripheral reset irq lost!
switch to partitions #0, OK
mmc0 is current device
Booting from MMC0...
4317552 bytes read in 700 ms (5.9 MiB/s)
15845 bytes read in 6 ms (2.5 MiB/s)
## Flattened Device Tree blob at 80700000
   Booting using the fdt blob at 0x80700000
   Loading Device Tree to 816f9000, end 816ffde4 ... OK
Cannot setup simplefb: node not found

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
....................................正常启动部分省略




下面是进入uboot的打印:

U-Boot SPL 2020.07 (Nov 01 2020 - 01:02:04 +0800)
DRAM: 64 MiB
Trying to boot from MMC1


U-Boot 2020.07 (Nov 01 2020 - 01:02:04 +0800) Allwinner Technology

CPU:   Allwinner F Series (SUNIV)
Model: Allwinner F1C200s Generic Device
DRAM:  64 MiB
MMC:   mmc@1c0f000: 0
Setting up a 800x480 lcd console (overscan 0x0)
In:    serial
Out:   vga
Err:   vga
Allwinner mUSB OTG (Peripheral)
Hit any key to stop autoboot:  0
=>
=> printenv bootargs_common
bootargs_common=console=ttyS0,115200 earlyprintk rootwait consoleblank=0 net.ifnames=0 biosdevname=0
=> pr
  printenv protect
=> printenv bootcmd
bootcmd=run scan_boot_slot; for target in ${boot_targets}; do run bootcmd_${target}; done
=>

#10 Re: 全志 SOC » buildroot-tiny200 (F1C100/200s) 开发包近期更新内容 * 已支持DVP摄像头 *,支持SPI NAND » 2020-10-28 21:18:11

@aodzip 大神,我的板子使用buildroot-tiny200编译的镜像,flash-mmc-all.sh 烧写到SD卡,然后插上SD卡(对应MMC0)上电,系统没有反应,必须插上USB_DEVICE线,系统才能启动,请问是什么原因啊?

页脚

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

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