你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

STM32MP1 Distribution Package一些总结

[复制链接]
STMCU小助手 发布时间:2022-10-3 22:00
1.必须的依赖包

  1. PC gt; sudo apt-get update
  2. PC gt; sudo apt-get install bison flex sed wget curl cvs subversion git-core coreutils unzip texi2html
  3. texinfo docbook-utils gawk python-pysqlite2 diffstat help2man make gcc build-essential g++ desktop-file-utils chrpath libxml2-utils xmlto docbook
  4. bsdmainutils iputils-ping cpio python-wand python-pycryptopp python-crypto
  5. PC gt; sudo apt-get install libsdl1.2-dev xterm corkscrew nfs-common nfs-kernel-server device-tree-compiler mercurial u-boot-tools libarchive-zip-perl
  6. PC gt; sudo apt-get install ncurses-dev bc linux-headers-generic gcc-multilib libncurses5-dev libncursesw5-dev lrzsz dos2unix lib32ncurses5 repo libssl-dev
复制代码

2.repo 获取源码

#repo init -u -b refs/tags/openstlinux-5.4-dunfell-mp1-20-06-24

  1. repo init -u  -b refs/tags/openstlinux-20-02-19
复制代码

fatal: Cannot get
fatal: error [Errno 101] Network is unreachable
解决方法:先单独克隆repo

  1. git clone
  2. mkdir .repo
  3. mv git-repo/ repo
  4. mv repo .repo
  5. repo sync -c -j8
复制代码

单独更新

  1. repo sync --force-sync layers/meta-openembedded/
  2. repo sync --force-sync layers/meta-openembedded/
  3. repo sync --force-sync layers/meta-st/meta-st-openstlinux/
  4. repo sync --force-sync layers/openembedded-core/
  5. repo sync --force-sync layers/openembedded-core/bitbake/
  6. repo sync
复制代码

源码获取完成,编译Distribution Package。
  1. PC gt; DISTRO=openstlinux-weston MACHINE=stm32mp1 source layers/meta-st/scripts/envsetup.sh
  2. PC gt; bitbake st-image-wseton    //编译镜像PC gt; bitbake st-image-weston  -c fetchall  //编译镜像
复制代码

4.bitbake常用的一些命令

  1. bitbake st-image-wseton -f //忽略某个包的错误,执行下去。可以减少编译等待时间。
  2. bitbake st-image-wseton -c fetchall  //-C用于执行特定命令,这里fetchall.
  3. bitbake -e linux-imx | grep ^SRC_URI=  //软件包下载地址
  4. bitbake -s | grep linux      //查找所有包并显示包含有linux名字的包
  5. bitbake -e linux-imx  | grep ^S=    //编译目录
  6. bitbake linux-imx -C compile   //编译内核和dtb,-C的C是大写
  7. bitbake opencv -c fetch
  8. bitbake opencv -c clean

  9. bitbake -k core-image-minimal
  10. bitbake xx-image -c listtasks
  11. bitbake -s | grep packagename
  12. bitbake -e xxx-image | grep ^SRC_URI=
  13. 查看软件依赖
  14. bitbake -g  packagename
复制代码
  1. bitbake -c clean -v u-boot
  2. bitbake -c cleanall     xx-image            #清除所有编译中间
  3. bitbake -c cleansstate   xx-image            #清除编译         
  4. 生成编译中的配置文件和类文件
  5. bitbake -e > mybuild.log

  6. bitbake -b 加上.bb文件的路径,即可以直接执行这个.bb文件
  7. #查找包的原路径
  8. bitbake -e linux-stm32mp | grep ^SRC_URI=
  9. #查找包的bblayer
  10. bitbake -e linux-stm32mp | grep ^S
复制代码

5.bitbake 命令续
  1. bitbake -e linux-stm32mp | grep ^S=
  2. S="/home/fdw/32mp1/openstlinux-200219/build-openstlinuxweston-stm32mp1/tmp-glibc/work/stm32mp1-ostl-linux-gnueabi/linux-stm32mp/4.19-r0/linux-4.19.94"
  3. bitbake -e m4projects-stm32mp1 | grep ^S=
  4. S="/home/fdw/32mp1/openstlinux-200219/build-openstlinuxweston-stm32mp1/tmp-glibc/work/stm32mp1-ostl-linux-gnueabi/m4projects-stm32mp1/1.2.0-r0/git

  5. bitbake -s | grep opencv
  6. PC gt;  find . -type f -iname "opencv*.bb"
  7. ./layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv_3.4.3.bb
复制代码

6.linux 内核实例
  1. PC gt; devtool modify virtual/kernel
  2. PC gt; ls workspace/sources/linux-stm32mp/

  3. Board gt; dmesg | grep -i cma
  4. PC gt;grep -i CONFIG_CMA_SIZE_MBYTES ./workspace/sources/linux-stm32mp/ -nr

  5. PC gt; bitbake virtual/kernel -c menuconfig
  6. PC gt; bitbake virtual/kernel -C compile

  7. $ bitbake -c menuconfig virtual/kernel
  8. $ bitbake -c compile -f -v virtual/kernel 单独编译内核
  9. $ bitbake -c compile_kernelmodules -f -v virtual/kernel 单独编译模块
  10. $ bitbake -c deploy -f -v virtual/kernel  然后部署编译输出镜像
复制代码
  1. #devtool build because the build makes compile,
  2. #compile_kernemodules and install commands
  3. Board gt; mount /dev/mmcblk0p4 /boot
  4. PC gt; scp <build dir>/../../*.dtb root@<board ip address>:/boot
  5. Board gt; cd /boot; sync; systemctl reboot

  6. vim workspace/sources/linux-stm32mp/arch/arm/boot/dts/stm32mp157a-dk1.dts
  7. bitbake virtual/kernel -C compile
复制代码
  1. PC gt; vim workspace/sources/linux-stm32mp/drivers/media/platform/vivid/vivid-core.c
  2. PC gt; bitbake virtual/kernel -C compile
  3. #Update the vivid kernel module on the board
  4. PC gt; devtool deploy-target -Ss linux-stm32mp  :/
  5. Board gt; /sbin/depmod -a
  6. Board gt; sync
  7. Board gt; modprobe vivid     
复制代码
  1. scp tmp-glibc/deploy/images/stm32mp1/stm32mp157*.dtb :/boot
  2. scp tmp-glibc/deploy/images/stm32mp1/uImage*:/boot
  3. rm -rf /home/fdw/.ssh/known_hosts
复制代码

6.uboot实例
  1. PC gt; devtool search u-boot*
  2. PC gt; devtool modify u-boot-stm32mp
  3. #cd <build dir>/workspace/sources/u-boot-stm32mp
  4. PC gt; devtool build u-boot-stm32mp
  5. PC gt; bitbake u-boot-stm32mp -c deploy
  6. #ums 0 mmc 0
  7. PC gt; dd if=u-boot-<board name>-trusted.stm32 of=/dev/sdc3 bs=1M conv=fdatasync
复制代码

7.tf-A实例
  1. PC gt; devtool search tf-a*
  2. PC gt; devtool modify tf-a-stm32mp
  3. #PC gt; cd <build dir>/workspace/sources/tf-a-stm32mp
  4. PC gt; vim ./plat/st/stm32mp1/bl2_io_storage.c
  5. PC gt; devtool build tf-a-stm32mp
  6. #bitbake tf-a-stm32mp
  7. PC gt; bitbake tf-a-stm32mp -c deploy
  8. PC gt; dd if=tf-a-<board name>-trusted.stm32 of=/dev/sdc1 bs=1M conv=fdatasync
复制代码

8.应用程序 “hello world”

  1. PC gt; mkdir hello_world_example
  2. PC gt; cd hello_world_example
  3. PC gt; vim hello_world_example.c
  4. PC gt; cd <build dir>
  5. #Add a new recipe to the workspace
  6. PC gt; devtool add myhelloworld hello_world_example/
  7. #Adapt recipe
  8. PC gt; devtool edit-recipe myhelloworld
  9. PC gt; devtool build myhelloworld
  10. PC gt; devtool deploy-target -s myhelloworld
复制代码

9.m4projects-stm32
  1. Board gt; cd <path_to_your_workspace>/build-<name_of_distro>

  2. Clean the m4projects build folder
  3. Board gt; bitbake m4projects-stm32mp1 -f -c cleanall

  4. Rebuild the recipe m4projects
  5. Board gt; bitbake m4projects-stm32mp1

  6. Rebuild the image
  7. Board gt; bitbake st-image-weston
复制代码

二.devtool的总结

  1. devtool modify tf-a-stm32mp
  2. bitbake tf-a-stm32mp

  3. devtool search u-boot*
  4. devtool modify u-boot-stm32mp
  5. bitbake u-boot-stm32mp

  6. devtool modify linux-stm32mp
  7. bitbake linux-stm32mp
复制代码
  1. NOTE: Starting bitbake server...
  2. usage: devtool [--basepath BASEPATH] [--bbpath BBPATH] [-d] [-q]
  3.                [--color COLOR] [-h]
  4.                <subcommand> ...

  5. OpenEmbedded development tool

  6. options:
  7.   --basepath BASEPATH  Base directory of SDK / build directory
  8.   --bbpath BBPATH      Explicitly specify the BBPATH, rather than getting it
  9.                        from the metadata
  10.   -d, --debug          Enable debug output
  11.   -q, --quiet          Print only errors
  12.   --color COLOR        Colorize output (where COLOR is auto, always, never)
  13.   -h, --help           show this help message and exit

  14. subcommands:
  15.   Beginning work on a recipe:
  16.     add                  Add a new recipe
  17.     modify               Modify the source for an existing recipe
  18.     upgrade              Upgrade an existing recipe
  19.   Getting information:
  20.     status               Show workspace status
  21.     search               Search available recipes
  22.   Working on a recipe in the workspace:
  23.     build                Build a recipe
  24.     rename               Rename a recipe file in the workspace
  25.     edit-recipe          Edit a recipe file in your workspace
  26.     find-recipe          Find a recipe file in your workspace
  27.     configure-help       Get help on configure script options
  28.     update-recipe        Apply changes from external source tree to recipe
  29.     reset                Remove a recipe from your workspace
  30.     finish               Finish working on a recipe in your workspace
  31.   Testing changes on target:
  32.     deploy-target        Deploy recipe output files to live target machine
  33.     undeploy-target      Undeploy recipe output files in live target machine
  34.     build-image          Build image including workspace recipe packages
  35.   Advanced:
  36.     create-workspace     Set up workspace in an alternative location
  37.     import               Import exported tar archive into workspace
  38.     extract              Extract the source for an existing recipe
  39.     sync                 Synchronize the source tree for an existing recipe
  40.     export               Export workspace into a tar archive
  41. Use devtool <subcommand> --help to get help on a specific command
复制代码


————————————————
版权声明:jacob杰克爸

收藏 评论0 发布时间:2022-10-3 22:00

举报

0个回答

所属标签

相似分享

官网相关资源

关于
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
意法半导体官网
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
官方最新发布
STM32N6 AI生态系统
STM32MCU,MPU高性能GUI
ST ACEPACK电源模块
意法半导体生物传感器
STM32Cube扩展软件包
关注我们
st-img 微信公众号
st-img 手机版