Void ILI9488_CTC3.5_G22_Initial_Code(void)
{// VCI=2.8V 13-2-22
//************* Reset LCD Driver ****************//
LCD_nRESET = 1;
Delayms(1); // Delay 1ms
LCD_nRESET = 0;
Delayms(10); // Delay 10ms // This delay time is necessary
LCD_nRESET = 1;
Delayms(120); // Delay 120 ms
//************* Start Initial Sequence **********//
LCD_ILI9488_CMD(0xE0);
LCD_ILI9488_INDEX(0x00);
LCD_ILI9488_INDEX(0x04);
LCD_ILI9488_INDEX(0x0E);
LCD_ILI9488_INDEX(0x08);
LCD_ILI9488_INDEX(0x17);
LCD_ILI9488_INDEX(0x0A);
LCD_ILI9488_INDEX(0x40);
LCD_ILI9488_INDEX(0x79);
LCD_ILI9488_INDEX(0x4D);
LCD_ILI9488_INDEX(0x07);
LCD_ILI9488_INDEX(0x0E);
LCD_ILI9488_INDEX(0x0A);
LCD_ILI9488_INDEX(0x1A);
LCD_ILI9488_INDEX(0x1D);
LCD_ILI9488_INDEX(0x0F);
LCD_ILI9488_CMD(0xE1);
LCD_ILI9488_INDEX(0x00);
LCD_ILI9488_INDEX(0x1B);
LCD_ILI9488_INDEX(0x1F);
LCD_ILI9488_INDEX(0x02);
LCD_ILI9488_INDEX(0x10);
LCD_ILI9488_INDEX(0x05);
LCD_ILI9488_INDEX(0x32);
LCD_ILI9488_INDEX(0x34);
LCD_ILI9488_INDEX(0x43);
LCD_ILI9488_INDEX(0x02);
LCD_ILI9488_INDEX(0x0A);
LCD_ILI9488_INDEX(0x09);
LCD_ILI9488_INDEX(0x33);
LCD_ILI9488_INDEX(0x37);
LCD_ILI9488_INDEX(0x0F);
LCD_ILI9488_CMD(0xC0);
LCD_ILI9488_INDEX(0x18);
LCD_ILI9488_INDEX(0x16);
LCD_ILI9488_CMD(0xC1);
LCD_ILI9488_INDEX(0x41);
LCD_ILI9488_CMD(0xC5);
LCD_ILI9488_INDEX(0x00);
LCD_ILI9488_INDEX(0x22); //2b
LCD_ILI9488_INDEX(0x80);
LCD_ILI9488_CMD(0x36);
LCD_ILI9488_INDEX(0x08);
LCD_ILI9488_CMD(0x3A); Interface Mode Control
LCD_ILI9488_INDEX(0x66);
LCD_ILI9488_CMD(0XB0); //Interface Mode Control
LCD_ILI9488_INDEX(0x00);
LCD_ILI9488_CMD(0xB1); //Frame rate 70HZ
LCD_ILI9488_INDEX(0xB0);
LCD_ILI9488_CMD(0xB4);
LCD_ILI9488_INDEX(0x02);
LCD_ILI9488_CMD(0xB6); //RGB/MCU Interface Control
LCD_ILI9488_INDEX(0x02);
LCD_ILI9488_INDEX(0x22);
LCD_ILI9488_CMD(0xE9);
LCD_ILI9488_INDEX(0x00);
LCD_ILI9488_CMD(0XF7);
LCD_ILI9488_INDEX(0xA9);
LCD_ILI9488_INDEX(0x51);
LCD_ILI9488_INDEX(0x2C);
LCD_ILI9488_INDEX(0x82);
LCD_ILI9488_CMD(0x11);
Delayms(120);
LCD_ILI9488_CMD(0x29);
}
Void ILI9488_EnterSleep_Code(void)
{
LCD_ILI9488_CMD(0x28)
Delayms(10);
LCD_ILI9488_CMD(0x10);
Delayms(120);
}
Void ILI9488_ExitSleep_Code(void)
{
LCD_ILI9488_CMD(0x11);
Delayms(120);
LCD_ILI9488_CMD(0x29)
}
运行日志:
[0]HELLO! BOOT0 is starting!
[2]boot0 commit : 80628dcde5dc4ecdc757a9e782c58d7cf1abf959
[60]dram size =32
[62]Reg pull reg_val=0x00000000,read=0x00000010
[66]Succeed in reading toc file head.
[69]The size of toc is 00054000.
[127]Reg pull reg_val=0x00000000,read=0x00000010
[136]Ready to disable icache.
[138]Jump to secend Boot.
U-Boot 2014.07 (Jul 31 2018 - 14:59:26) Allwinner Technology
uboot commit : 6604446f7bddb8fe53f2b993100929f92a5f4d6e
i2c_init: by cpux
[I2C-DEBUG]:i2c_set_clock() 354
[I2C-ERROR]:twi_send_clk_9pulse() 136 SDA is still Stuck Low, failed.
i2c_init ok
[0.187]pmbus: ready
axp: get node[/soc/pmu0] error
axp_probe error
[0.193]PMU: cpux 408 Mhz,AXI=408 Mhz
PLL6=600 Mhz,AHB1=200 Mhz, APB1=100Mhz
key value = 4294967295, fel_key = [256,426]
DRAM: 32 MiB
Relocation Offset is: 01581000
axp: get node[/soc/pmu0] error
int sunxi_dma_init---
irq enable
workmode = 0,storage type = 3
[0.260]spinor: 0
flash size =0x8000 sectors
sunxi spinor is initing...int sunxi_dma_init---
irq enable
sunxi_dma_install_int ok
sunxi_dma_install_int ok
OK
spinor id:0x1840ef
spi_freq = 40000000
[0.278]sunxi flash init ok
spinor read: start 0x3e0, sector 0x20
used mbr [0], count = 8
spinor read: start 0x800, sector 0x200
env size is 256
env partition is too small!
can't enabled backup env functions
logo addr = 0x81f00000
spinor read: start 0x400, sector 0x400
sunxi_read_bootlogo: read bootlogo partition successful
do not find fastboot status flag
--------fastboot partitions--------
-total partitions:8-
-name- -start- -size-
bootlogo : 4000 80000
env : 84000 20000
boot : a4000 300000
rootfs : 3a4000 a00000
rootfs_data : da4000 80000
misc : e24000 10000
private : e34000 10000
UDISK : e44000 0
-----------------------------------
spinor read: start 0x7500, sector 0x4
disable nand error: FDT_ERR_BADPATH
disable nand error: FDT_ERR_BADPATH
## error: update_fdt_dram_para : FDT_ERR_NOTFOUND
PowerBus = 0( 2:vBus 3:acBus other: not exist)
no battery exist
sunxi_bmp_logo_display
Hit any key to stop autoboot: 0
spinor read: start 0x900, sector 0x40
spinor read: start 0x940, sector 0x13e1
## Booting kernel from Legacy Image at 80007fc0 ...
Image Name: ARM OpenWrt Linux-3.10.65
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2638096 Bytes = 2.5 MiB
Load Address: 80008000
Entry Point: 80008000
XIP Kernel Image ... OK
reserving fdt memory region: addr=81000000 size=10000
Using Device Tree in place at 81000000, end 8100f29f
Starting kernel ...
板子用的是荔枝派
修改教程是根据根据https://bbs.aw-ol.com/topic/1701/tina-linux-%E5%AD%98%E5%82%A8%E4%BB%8B%E8%B4%A8%E5%88%87%E6%8D%A2-emmc-spi-nand-spi-nor-sd-card-sd-nand/4?_=1668580535100
我修改串口配置了
sys_config.fex 文件
[target]
boot_clock = 408
storage_type = 3
burn_key = 0
[norflash]
size = 16
...
[uart_para]
uart_debug_port = 0
uart_debug_tx = port:PE1<5><1><default><default>
uart_debug_rx = port:PE0<5><1><default><default>
[uart0]
uart0_used = 1
uart0_port = 0
uart0_type = 2
uart0_tx = port:PE1<5><1><default><default>
uart0_rx = port:PE0<5><1><default><default>
...
[uart1]
uart1_used = 1
uart1_port = 1
uart1_type = 2
uart1_tx = port:PA2<5><1><default><default>
uart1_rx = port:PA3<5><1><default><default>
sys_partition_nor.fex文件
[partition_start]
[partition]
name = bootlogo
size = 1024
downloadfile = "bootlogo.fex"
user_type = 0x8000
[partition]
name = env
size = 256
downloadfile = "env.fex"
user_type = 0x8000
[partition]
name = boot
;size = 5120
size = 5600
downloadfile = "boot.fex"
user_type = 0x8000
[partition]
name = rootfs
;size = 1024
;size = 11520
size = 15648
downloadfile = "rootfs.fex"
user_type = 0x8000
[partition]
name = rootfs_data
size = 1024
user_type = 0x8000
;[partition]
; name = extend
; size = 8192
; downloadfile = "usr.fex"
; user_type = 0x8000
[partition]
name = misc
size = 128
user_type = 0x8000
[partition]
name = private
size = 128
user_type = 0x8000
[partition]
name = UDISK
user_type = 0x8100
别的文件没有修改
为啥我编译不了呢?
提示编译器版本不对
*** Target 'Product' uses ARM-Compiler 'V6.6' which is not available.
*** Please review the installed ARM Compiler Versions:
'Manage Project Items - Folders/Extensions' to manage ARM Compiler Versions.
'Options for Target - Target' to select an ARM Compiler Version for the target.
*** Rebuild aborted.
换编译器版本V5.06 update 7(build 960)
又提示
.\..\tinyusb\src\common/tusb_compiler.h(223): error: #35: #error directive: "Compiler attribute porting is required"
换工具链继续测试
根据 KEIL可以使用 GNU 工具链,但是只能使用指定那些工具链,不是所有的GNU工具链都可以用
还是无法编译
你们都是咋编译过的
修改了两个地方可以编译了,
第一、rtconfig.py文件中的第32行
PREFIX = 'arm-eabi-' 修改为 PREFIX = 'arm-none-eabi-'
第二、libc_errno.h文件中的第32行
#include <asm-generic/errno.h> 修改为 #include <errno.h>
编译成功
LINK rtthread.elf
arm-none-eabi-objcopy -O binary rtthread.elf rtthread.bin
arm-none-eabi-size rtthread.elf
text data bss dec hex filename
1717783 56628 6469356 8243767 7dca37 rtthread.elf
tools/mksunxi.exe rtthread.bin
bootloader size= 2200
The bootloader head has been fixed
scons: done building targets.
视觉℡ 说:为啥编译不过呢
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
scons: building associated VariantDir targets: build
CC build\applications\Apps\demo.o
Error in calling:
arm-eabi-gcc -o "build\applications\Apps\demo.o" -c -mcpu=arm926ej-s -ffunction-sections -fdata-sections -Wall -O2 -DHAVE_CCONFIG_H -DRT_USING_NEWLIB -I. -Iapplications -Iapplications\Apps -Ibootloader -Idrivers -Ilibcpu -Ipackage -Ipackage\infones -Ipackage\jpgdec -Ipackage\lvgl -Ipackage\lvgl\porting -Ipackage\lvgl\src -Ipackage\lvgl\src\lv_core -Ipackage\lvgl\src\lv_draw -Ipackage\lvgl\src\lv_font -Ipackage\lvgl\src\lv_hal -Ipackage\lvgl\src\lv_misc -Ipackage\lvgl\src\lv_objx -Ipackage\lvgl\src\lv_themes -Ipackage\vnes -ID:\RTT\BoloRTT-master\include -ID:\RTT\BoloRTT-master\components\dfs\include -ID:\RTT\BoloRTT-master\components\dfs\filesystems\devfs -ID:\RTT\BoloRTT-master\components\dfs\filesystems\elmfat -ID:\RTT\BoloRTT-master\components\dfs\filesystems\romfs -ID:\RTT\BoloRTT-master\components\drivers\include -ID:\RTT\BoloRTT-master\components\drivers\include -ID:\RTT\BoloRTT-master\components\drivers\include -ID:\RTT\BoloRTT-master\components\drivers\spi -ID:\RTT\BoloRTT-master\components\drivers\include -ID:\RTT\BoloRTT-master\components\drivers\spi\sfud\inc -ID:\RTT\BoloRTT-master\components\drivers\include -ID:\RTT\BoloRTT-master\components\drivers\usb\usbhost -ID:\RTT\BoloRTT-master\components\drivers\usb\usbhost\class -ID:\RTT\BoloRTT-master\components\drivers\usb\usbhost\core -ID:\RTT\BoloRTT-master\components\drivers\usb\usbhost\include -ID:\RTT\BoloRTT-master\components\drivers\include -ID:\RTT\BoloRTT-master\components\finsh -ID:\RTT\BoloRTT-master\components\libc\compilers\newlib -ID:\RTT\BoloRTT-master\components\libc\pthreads -ID:\RTT\BoloRTT-master\components\libc\time "applications\Apps\demo.c"
Exception: [Error 2] : No such file or directory
scons: *** [build\applications\Apps\demo.o] Error 2
scons: building terminated because of errors.是在bsp/f1c目录下运行scons么
是在这个目录编译的
为啥编译不过呢
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
scons: building associated VariantDir targets: build
CC build\applications\Apps\demo.o
Error in calling:
arm-eabi-gcc -o "build\applications\Apps\demo.o" -c -mcpu=arm926ej-s -ffunction-sections -fdata-sections -Wall -O2 -DHAVE_CCONFIG_H -DRT_USING_NEWLIB -I. -Iapplications -Iapplications\Apps -Ibootloader -Idrivers -Ilibcpu -Ipackage -Ipackage\infones -Ipackage\jpgdec -Ipackage\lvgl -Ipackage\lvgl\porting -Ipackage\lvgl\src -Ipackage\lvgl\src\lv_core -Ipackage\lvgl\src\lv_draw -Ipackage\lvgl\src\lv_font -Ipackage\lvgl\src\lv_hal -Ipackage\lvgl\src\lv_misc -Ipackage\lvgl\src\lv_objx -Ipackage\lvgl\src\lv_themes -Ipackage\vnes -ID:\RTT\BoloRTT-master\include -ID:\RTT\BoloRTT-master\components\dfs\include -ID:\RTT\BoloRTT-master\components\dfs\filesystems\devfs -ID:\RTT\BoloRTT-master\components\dfs\filesystems\elmfat -ID:\RTT\BoloRTT-master\components\dfs\filesystems\romfs -ID:\RTT\BoloRTT-master\components\drivers\include -ID:\RTT\BoloRTT-master\components\drivers\include -ID:\RTT\BoloRTT-master\components\drivers\include -ID:\RTT\BoloRTT-master\components\drivers\spi -ID:\RTT\BoloRTT-master\components\drivers\include -ID:\RTT\BoloRTT-master\components\drivers\spi\sfud\inc -ID:\RTT\BoloRTT-master\components\drivers\include -ID:\RTT\BoloRTT-master\components\drivers\usb\usbhost -ID:\RTT\BoloRTT-master\components\drivers\usb\usbhost\class -ID:\RTT\BoloRTT-master\components\drivers\usb\usbhost\core -ID:\RTT\BoloRTT-master\components\drivers\usb\usbhost\include -ID:\RTT\BoloRTT-master\components\drivers\include -ID:\RTT\BoloRTT-master\components\finsh -ID:\RTT\BoloRTT-master\components\libc\compilers\newlib -ID:\RTT\BoloRTT-master\components\libc\pthreads -ID:\RTT\BoloRTT-master\components\libc\time "applications\Apps\demo.c"
Exception: [Error 2] : No such file or directory
scons: *** [build\applications\Apps\demo.o] Error 2
scons: building terminated because of errors.
CH579介绍:
概述
CH579是集成BLE无线通讯的ARM内核32位微控制器。片上集成低功耗蓝牙BLE通讯模块、以太网控制器及收发器、全速USB主机和设备控制器及收发器、段式LCD驱动模块、ADC、触摸按键检测模块、RTC等丰富的外设资源。
芯片框图
特点
32位ARM Cortex-M0内核,最高40MHz系统主频
内置32K SRAM,250KB CodeFlash,2KB DataFlash, 4KB BootLoader,支持ICP、ISP和IAP,支持OTA无线升级
支持蓝牙BLE,兼容Bluetooth Low Energy 4.2规范
集成2.4GHz RF收发器和基带及链路控制,单端RF接口,无需外部电感,简化板级设计,提供协议栈和应用层API
支持3.3V和2.5V电源,范围2.1V~3.6V, 内置DC/DC转换,0dBm发送功率时电流6mA
多种低功耗模式:Idle,Halt,Sleep,Shutdown,内置电池电压低压监控,最低电流0.2uA
提供10M以太网接口,内置PHY
内嵌USB控制器和USB收发器,支持USB2.0全速和低速主机或设备,支持控制/批量/中断同步传输,支持USB type-C主从/电流检测
内置实时时钟RTC,支持定时和触发两种模式
提供段式LCD驱动接口,支持96点(24×4)LCD面板
提供14通道12位ADC模数转换器,支持14通道触摸按键
提供4组26位定时器,支持捕捉/采样,支持12路PWM输出
提供4组独立UART,兼容16C550,最高通讯波特率可达5Mbps
提供2组独立SPI,内置FIFO ,SPI0支持Master和Slave模式,支持DMA
提供 LED点阵屏接口:支持1/2/4路数据线
支持8位被动并口
内置温度传感器
提供40个GPIO,32个中断输入
内置AES-128加解密单元,芯片唯一ID
封装:QFN48_5X5、QFN28_4X4
官方提供的PCB 我稍微改了改,我要打样了,等我好消息
CH579M-R1.zip
我找到一个和这个差不多的液晶,控制器用的是OTA5182A
OTA5182A-ORISE.pdf
但是这玩意像素点排列不好控制颜色啊,
9.98投影工程(FPGAorCPLD联合STM32版)
9_98FPGAorCPLDSTM32.zip
https://whycan.cn/files/members/719/QQ20190426-1.jpg
为什么不用STM32直接驱动,还要加FPGA