搜索
bottom↓
回复: 7

UBOOT中添加自己的板子 有经验的朋友帮忙指点下

[复制链接]

出0入4汤圆

发表于 2020-7-16 12:58:05 | 显示全部楼层 |阅读模式
本帖最后由 billtian 于 2020-7-16 13:03 编辑

参考【正点原子】I.MX6U嵌入式Linux驱动开发指南V1.0-尝鲜版.pdf 尝试在UBOOT下添加自己的板子(手头只有一块飞凌的板子)
步骤记录如下
拷贝defconfig文件并将内容改为如下内容
/home/billtian/linux/uboot-imx-rel_imx_4.1.15_2.1.0_ga/configs# cp mx6ull_14x14_evk_nand_defconfig mx6ull_okmx6ul_defconfig
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6ull_okmx6ul_nand/imximage.cfg,SYS_BOOT_NAND"
CONFIG_ARM=y
CONFIG_ARCH_MX6=y
CONFIG_TARGET_MX6ULL_OKMX6UL=y
CONFIG_CMD_GPIO=y

添加开发板对应头文件
/home/billtian/linux/uboot-imx-rel_imx_4.1.15_2.1.0_ga/include/configs# cp mx6ullevk.h mx6ull_okmx6ul_nand.h
开头宏定义改为
#ifndef __MX6ULL_OKMX6UL_CONFIG_H
#define __MX6ULL_OKMX6UL_CONFIG_H

添加板级文件夹
/home/billtian/linux/uboot-imx-rel_imx_4.1.15_2.1.0_ga/board/freescale# cp mx6ullevk/ -r mx6ull_okmx6ul_nand
cd mx6ull_okmx6ul_nand/
mv mx6ullevk.c mx6ull_okmx6ul_nand.c

修改MakeFile
obj-y  := mx6ull_okmx6ul_nand.o

修改imximage.cfg文件
PLUGIN        board/freescale/mx6ull_okmx6ul_nand/plugin.bin 0x00907000

修改Kconfig为如下内容
if TARGET_MX6ULL_OKMX6UL

config SYS_BOARD
        default "mx6ull_okmx6ul_nand"

config SYS_VENDOR
        default "freescale"

config SYS_CONFIG_NAME
        default "mx6ull_okmx6ul_defconfig"

endif

修改MAINTAINERS文件
MX6ULL_OKMX6UL-C BOARD
M:        Peng Fan <peng.fan@nxp.com>
S:        Maintained
F:        board/freescale/mx6ull_okmx6ul_nand/
F:        include/configs/mx6ull_okmx6ul_nand.h
F:        configs/mx6ull_14x14_evk_defconfig

修改图形配置界面
arch/arm/armv7/mx6/Kconfig
207行加入以下内容
config TARGET_MX6ULL_OKMX6UL
        bool "Support mx6ull_okmx6ul_nand"
        select MX6UL
        select DM
        select DM_THERMAL
最后一行的endif前加入以下一行
source "board/freescale/mx6ull_okmx6ul_nand/Kconfig"


编写脚本
#!/bin/bash
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- distclean
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- mx6ull_okmx6ul_defconfig
make V=1 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j16

阿莫论坛20周年了!感谢大家的支持与爱护!!

一只鸟敢站在脆弱的枝条上歇脚,它依仗的不是枝条不会断,而是自己有翅膀,会飞。

出0入4汤圆

 楼主| 发表于 2020-7-16 12:59:01 | 显示全部楼层
本帖最后由 billtian 于 2020-7-16 13:03 编辑

运行脚本 错误信息如下
./okmx6ul.sh
  CLEAN   scripts/basic
  CLEAN   scripts/kconfig
  CLEAN   include/config include/generated
  CLEAN   .config include/config.h
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#
make -f ./Makefile silentoldconfig
make -f ./scripts/Makefile.build obj=scripts/basic
rm -f .tmp_quiet_recordmcount
make -f ./scripts/Makefile.build obj=scripts/kconfig silentoldconfig
mkdir -p include/config include/generated
scripts/kconfig/conf  --silentoldconfig Kconfig
make -f ./scripts/Makefile.autoconf || \
        { rm -f include/config/auto.conf; false; }
if [ -d arch/arm/mach-mx6/include/mach ]; then        \
        dest=../../mach-mx6/include/mach;                        \
else                                                                \
        dest=arch-mx6;                        \
fi;                                                                \
ln -fsn $dest arch/arm/include/asm/arch
set -e; : '  CHK     include/config.h'; mkdir -p include/;         (echo "/* Automatically generated - do not edit */"; for i in $(echo "IMX_CONFIG=board/freescale/mx6ull_okmx6ul_nand/imximage.cfg,SYS_BOOT_NAND" | sed 's/,/ /g'); do echo \#define CONFIG_$i | sed '/=/ {s/=/        /;q; } ; { s/$/        1/; }'; done; echo \#define CONFIG_BOARDDIR board/freescale/mx6ull_okmx6ul_nand; echo \#include \<config_defaults.h\>; echo \#include \<config_uncmd_spl.h\>; echo \#include \<configs/"mx6ull_okmx6ul_defconfig".h\>; echo \#include \<asm/config.h\>; echo \#include \<config_fallbacks.h\>;) < scripts/Makefile.autoconf > include/config.h.tmp; if [ -r include/config.h ] && cmp -s include/config.h include/config.h.tmp; then rm -f include/config.h.tmp; else : '  UPD     include/config.h'; mv -f include/config.h.tmp include/config.h; fi
  arm-linux-gnueabihf-gcc -x c -DDO_DEPS_ONLY -M -MP -Wall -Wstrict-prototypes -Wno-format-security -fno-builtin -ffreestanding -O2 -fno-stack-protector -fno-delete-null-pointer-checks -g -fstack-usage -Wno-format-nonliteral -Werror=date-time  -D__KERNEL__ -D__UBOOT__   -D__ARM__ -marm -mno-thumb-interwork  -mabi=aapcs-linux  -mword-relocations  -fno-pic  -mno-unaligned-access  -ffunction-sections -fdata-sections -fno-common -ffixed-r9  -msoft-float  -pipe -Iinclude  -I./arch/arm/include -include ./include/linux/kconfig.h  -nostdinc -isystem /usr/local/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.4/include -MQ include/config/auto.conf ./include/common.h > include/autoconf.mk.dep || { rm include/autoconf.mk.dep; false; }
  arm-linux-gnueabihf-gcc -E -Wall -Wstrict-prototypes -Wno-format-security -fno-builtin -ffreestanding -O2 -fno-stack-protector -fno-delete-null-pointer-checks -g -fstack-usage -Wno-format-nonliteral -Werror=date-time  -D__KERNEL__ -D__UBOOT__   -D__ARM__ -marm -mno-thumb-interwork  -mabi=aapcs-linux  -mword-relocations  -fno-pic  -mno-unaligned-access  -ffunction-sections -fdata-sections -fno-common -ffixed-r9  -msoft-float  -pipe -Iinclude  -I./arch/arm/include -include ./include/linux/kconfig.h  -nostdinc -isystem /usr/local/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.4/include  -DDO_DEPS_ONLY -dM ./include/common.h > include/autoconf.mk.tmp && { sed -n -f ./tools/scripts/define2mk.sed include/autoconf.mk.tmp | while read line; do if [ -n "" ] || ! grep -q "${line%=*}=" include/config/auto.conf; then echo "$line"; fi done > include/autoconf.mk; rm include/autoconf.mk.tmp; } || { rm include/autoconf.mk.tmp; false; }
In file included from ./include/common.h:18:0:
include/config.h:7:46: fatal error: configs/mx6ull_okmx6ul_defconfig.h: No such file or directory
#include <configs/mx6ull_okmx6ul_defconfig.h>
                                              ^
compilation terminated.
In file included from ./include/common.h:18:0:
include/config.h:7:46: fatal error: configs/mx6ull_okmx6ul_defconfig.h: No such file or directory
#include <configs/mx6ull_okmx6ul_defconfig.h>
                                              ^
compilation terminated.
scripts/Makefile.autoconf:50: recipe for target 'include/autoconf.mk.dep' failed
make[1]: *** [include/autoconf.mk.dep] Error 1
make[1]: *** Waiting for unfinished jobs....
scripts/Makefile.autoconf:75: recipe for target 'include/autoconf.mk' failed
make[1]: *** [include/autoconf.mk] Error 1
make: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/uboot.release'.  Stop.
root@ubuntu:/home/billtian/linux/uboot-imx-rel_imx_4.1.15_2.1.0_ga#

新手 错误可能比较低级 请大家指点

出16170入6148汤圆

发表于 2020-7-16 22:21:56 来自手机 | 显示全部楼层
你这样问问题,建议你标题加上“悬赏500元人民币”,或者有人会帮你。

我说:或者。


如果想不花钱,而且必定有人帮你,就要改变提问的方式,将问题提炼出来,最好控制在100字以内。

出0入4汤圆

 楼主| 发表于 2020-7-17 08:09:56 | 显示全部楼层
armok. 发表于 2020-7-16 22:21
你这样问问题,建议你标题加上“悬赏500元人民币”,或者有人会帮你。

我说:或者。

感谢老大提醒 问题比较初级  我再自己看看 如果问题解决 也把方法写出来供大家参考

出0入0汤圆

发表于 2020-7-17 10:26:58 | 显示全部楼层

  1. include/config.h:7:46: fatal error: configs/mx6ull_okmx6ul_defconfig.h: No such file or directory
  2. #include <configs/mx6ull_okmx6ul_defconfig.h>
复制代码


mx6ull_okmx6ul_defconfig.h 少了这个头文件

出0入4汤圆

 楼主| 发表于 2020-7-17 13:13:17 | 显示全部楼层
笑笑我笑了 发表于 2020-7-17 10:26
mx6ull_okmx6ul_defconfig.h 少了这个头文件

微信图片编辑_20200717131147.jpg
谢谢 发现这个问题了 上图中两个地方需保持一致
现在可以编译了 还有其他错误 bin文件未生产  继续检查中。。。

再次表示感谢!

出0入0汤圆

发表于 2020-7-21 23:43:02 | 显示全部楼层
跟帖mark一下

出0入4汤圆

 楼主| 发表于 2020-7-22 07:31:43 | 显示全部楼层
应该是芯片不对原因 芯片分为mx6ul(我的板子)与mx6ull(正点板子)  用mx6ul文件重新做1楼所有步骤

拷贝defconfig文件并将内容改为如下内容
/home/billtian/linux/uboot-imx-rel_imx_4.1.15_2.1.0_ga/configs# cp mx6ul_14x14_evk_nand_defconfig mx6ul_okmx6ul_defconfig
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6ul_okmx6ul_nand/imximage.cfg,SYS_BOOT_NAND"
CONFIG_ARM=y
CONFIG_ARCH_MX6=y
CONFIG_TARGET_MX6UL_OKMX6UL=y
CONFIG_CMD_GPIO=y

添加开发板对应头文件
/home/billtian/linux/uboot-imx-rel_imx_4.1.15_2.1.0_ga/include/configs# cp mx6ul_14x14_evk.h mx6ul_okmx6ul_nand.h
开头宏定义改为
#ifndef __MX6UL_OKMX6UL_CONFIG_H
#define __MX6UL_OKMX6UL_CONFIG_H
mv

添加板级文件夹
/home/billtian/linux/uboot-imx-rel_imx_4.1.15_2.1.0_ga/board/freescale# cp mx6ul_14x14_evk/ -r mx6ul_okmx6ul_nand
cd mx6ul_okmx6ul_nand/
mv mx6ul_14x14_evk.c mx6ul_okmx6ul_nand.c

修改MakeFile
obj-y  := mx6ul_okmx6ul_nand.o

修改imximage.cfg文件
PLUGIN        board/freescale/mx6ul_okmx6ul_nand/plugin.bin 0x00907000

修改Kconfig为如下内容
if TARGET_MX6UL_OKMX6UL

config SYS_BOARD
        default "mx6ul_okmx6ul_nand"
gedit
config SYS_VENDOR
        default "freescale"

config SYS_CONFIG_NAME
        default "mx6ul_okmx6ul_nand"

endif

修改MAINTAINERS文件
MX6UL_OKMX6UL BOARD
M:        Peng Fan <peng.fan@nxp.com>
S:        Maintained
F:        board/freescale/mx6ul_okmx6ul_nand/
F:        include/configs/mx6ul_okmx6ul_nand.h

修改图形配置界面
arch/arm/cpu/armv7/mx6/Kconfig
207行加入以下内容
config TARGET_MX6UL_OKMX6UL
        bool "Support mx6ull_okmx6ul_nand"
        select MX6UL
        select DM
        select DM_THERMAL
最后一行的endif前加入以下一行
source "board/freescale/mx6ul_okmx6ul_nand/Kconfig

编写脚本
#!/bin/bash
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- distclean
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- mx6ucd l_okmx6ul_defconfig
make V=1 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j16

可以编译 bin文件下载下去 串口有数据输出  
下一步是LCD显示
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-3-29 17:06

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

快速回复 返回顶部 返回列表