首先根据LinjieGuo的帖子 https://whycan.com/t_7659.html 做移植.
1,从本贴 https://whycan.com/t_3958.html 下载[allwinner_tina_prj_v1.zip]
2.解压 [allwinner_tina_prj_v1.zip] ,到 rt-thread-gitee_master\bsp目录下。
3.修改main.c去掉uart2部分,注释掉//Sys_Servs_Init();//Services
4.打开ENV,转换目录到rt-thread-gitee_master\bsp目录下输入menuconfig。去掉SDIO支持,我不用SD卡.
5编译RTT,输入scons。得到未经修饰的rtthread.bin
6执行脚本文件,[flashtospi.bat],这个脚本用于修饰rtthread.bin,增加魔术头,并下载bin文件到flash中。
最近编辑记录 nice (2022-06-15 16:33:08)
离线
接入uart1接口,上电显示:
\ | /
- RT - Thread Operating System
/ | \ 4.1.1 build Jun 15 2022 09:23:43
2006 - 2022 Copyright by RT-Thread team
[32m[I/SFUD] Find a Winbond flash chip. Size is 8388608 bytes.[0m
[32m[I/SFUD] gd25qxx flash device is initialize success.[0m
[32m[I/SFUD] Probe SPI flash gd25qxx by SPI device spi00 success.[0m
Start...
periph_get_pll_clk:600000000
cpu_get_clk:408000000
ahb_get_clk:200000000
apb_get_clk:100000000
[Thread]GUIThread Created.
msh />
离线
1,更改LV的像素设置
2.更改drv_fb.c里的像素时钟设置
关于 :pixel_clock_hz
static void f1c100s_tcon_set_mode(lcd_cfg_Struct * pdat)
val = f1c100s_tcon_clk_get_rate() / pdat->pixel_clock_hz;
write32((uint32_t)&tcon->tcon0_dclk, (0xf << 28) | (val << 0));
struct f1c100s_tcon_reg_t * tcon = (struct f1c100s_tcon_reg_t *)F1C100S_TCON_BASE;
#define F1C100S_TCON_BASE (0x01c0c000)
离线
Allwinner_F1C200s_User_Manual_V1.1.pdf
最近编辑记录 nice (2022-06-16 16:32:43)
离线
uint32_t tcon0_dclk; /* 0x44 */
根据: write32((uint32_t)&tcon->tcon0_dclk, (0xf << 28) | (val << 0));
lclk_en:4'hf
DCLKDIV: dot clock divider
Tdclk = Tsclk * DCLKDIV
Note:
1.if dclk1&dclk2 used,5<DCLKDIV <96
2.if dclk only,DCLKDIV >=4 || DCLKDIV=2
f1c100s_tcon_clk_get_rate()
-> video_get_pll_clk()
-> PLL_VIDEO_CTRL_REG 0x0010 PLL_VIDEO Control Register 查看倍频情况.
这边是获取了,查一下,设置部分找到:
void rt_hw_board_init(void)
{
video_set_pll_clk(198000000);
最近编辑记录 nice (2022-06-16 17:03:22)
离线
感谢:达克罗德和staunchheart
请参考https://whycan.cn/t_2135.html
同时参考https://whycan.cn/t_3611.html
RTT下sys-clock.c
write32(F1C100S_CCU_BASE + CCU_PLL_VIDEO_CTRL,0x81004103);// 0x81004107);//
离线
找到频的dclk,对应pixel_clock_hz改之/
void sys_clock_init(void)
->write32(F1C100S_CCU_BASE + CCU_PLL_VIDEO_CTRL, 0x81003b03);
void rt_hw_board_init(void)
->video_set_pll_clk(360000000);//(198000000);
时钟输出=24000000*(0x3b+1)/(0x03+1)=360Mhz
drv_fb.c
->lcd_cfg_Struct lcd_cfg={
.pixel_clock_hz=60000000, //9210200,
最近编辑记录 nice (2022-06-17 10:29:25)
离线
.pixel_clock_hz=52M设置方法:
52*6=312M
时钟24*x/y=312M ->x/y=13
若y=4,x=52, -> 0x03 ,0x33 ->24000000*(0x33+1)/(0x03+1) ->0x81003303
离线
液晶屏幕抖动:
*.s
->
rtthread_startup()
->
rt_application_init()
->
main_thread_entry()
->
rt_components_init()
main()
rt_components_init()->
INIT_DEVICE_EXPORT(board_lcd_init);
|->INIT_EXPORT(fn, "3")
const char __rti_##fn##_name[] = #fn; \
RT_USED const struct rt_init_desc __rt_init_desc_##fn RT_SECTION(".rti_fn." level) = \
{ __rti_##fn##_name, fn};
const char __rti_board_lcd_init_name[] = "board_lcd_init";
RT_USED const struct rt_init_desc
__rt_init_desc_board_lcd_init RT_SECTION(".rti_fn." "3") =
{ __rti_board_lcd_init_name, board_lcd_init};
///*如果 line_per_pixel=16*/
// write32((uint32_t)&debe->layer0_attr1_ctrl+4*LayerNum, 0x05 << 8);
// write32((uint32_t)&debe->layer0_stride+4*LayerNum, pdat->width*16);
///*如果 line_per_pixel=18*/
write32((uint32_t)&debe->layer0_attr1_ctrl+4*LayerNum, 0x09 << 8);
write32((uint32_t)&debe->layer0_stride+4*LayerNum, pdat->width*32);
最近编辑记录 nice (2022-07-07 13:36:18)
离线
还不行,怎么回事,通过对比发现.clk_divider_set_rate中参数clk_divider_set_rate(0x01c2010c, 4, 0, true, /*24000000* /f1c100s_tcon_clk_get_rate(), 312000000);
千万另用24M,要用:f1c100s_tcon_clk_get_rate()
static void f1c100s_clk_debe_init(void)
{
clk_mux_set_parent(0x01c20104, 3, 24, 0);
clk_divider_set_rate(0x01c20104, 4, 0, true, f1c100s_tcon_clk_get_rate(), 312000000);
}
static void f1c100s_clk_defe_init(void)
{
clk_mux_set_parent(0x01c2010c, 3, 24, 0);
clk_divider_set_rate(0x01c2010c, 4, 0, true, f1c100s_tcon_clk_get_rate(), 312000000);
}
最近编辑记录 nice (2022-07-07 13:37:00)
离线
颜色反了, write32((uint32_t)&debe->layer0_attr1_ctrl+4*LayerNum, 0x09 << 8);改成
write32((uint32_t)&debe->layer0_attr1_ctrl+4*LayerNum, 0x09 << 8 | (1 << 2));
神奇lvgl还是反色,
运行一段时间图象抖动,加大# define LV_MEM_SIZE (64U * 1024U)
最近编辑记录 nice (2022-07-07 14:52:47)
离线
半屏原因,把下面代码中的(uint16_t*)改成(uint32_t*)
static void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p)
{
int32_t x;
int32_t y;
for(y = area->y1; y <= area->y2; y++) {
for(x = area->x1; x <= area->x2; x++) {
((uint32_t*)lcd_layer0.vram)[y*lcd_layer0.width+x]=color_p->full;
color_p++;
}
}
lv_disp_flush_ready(disp_drv);
}
离线
根据LinjieGuo的帖子 https://whycan.com/t_7659.html 做加上文件系统.
根据windoufu的帖子 https://whycan.com/t_6453.html 加上模拟u盘功能,
打包附件如下
rt_thread.7z
最近编辑记录 nice (2022-07-16 17:15:31)
离线
在u-boot中颜色反色了,方法\u-boot\arch\arm\include\asm\arch-sunxi\display.h
254行#define SUNXI_DE_BE_LAYER_ATTR1_FMT_XRGB8888 (0x09 << ))
改成#define SUNXI_DE_BE_LAYER_ATTR1_FMT_XRGB8888 ((0x09 << 8)| (1 << 2))
离线
请问RT-Thread studio集成开发环境里面可以用menuconfig修改配置吗
离线