Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

    v851s 在 eyesee-mpp 中添加一个hello_world sample 的流程

    V Series
    4
    17
    6105
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      chhjnavy LV 5 last edited by

      1. 为什么要在eyesee-mpp 中添加sample?
      1)保持整个openwrt 应用程序编写的完成性;
      2)eyesee-mpp 中包含了几乎所有全志视频音频模块的sample 以及 头文件,参考以及头文件调用起来非常方便,而且可以学习各种模块的使用流程;
      3)可以直接在make menuconfig 中管理应用程序,是否编译;
      4)不需要将交叉编译工具链放到外面,只要按照步骤添加好sample ,就可以直接mm -B 进行编译;

      2. 以hello_world为例创建sample

      路径:tina-v853-docker/platform/allwinner/eyesee-mpp/middleware/sun8iw21/sample

      在该路径下创建文件夹: sample_hello_world

      在该文件夹下创建三个文件:
      sample_hello_world.c

      #include <stdio.h>
      
      void main(void){
          printf("hello world!\n");
      }
      

      sample_hello_world.h

      #ifndef __SAMPLE_HELLO_WORLD_H__
      #define __SAMPLE_HELLO_WORLD_H__ 
      
      #ifdef __cplusplus
      extern "C"{
      #endif /* __cplusplus */
      
      //
      #ifdef __cplusplus
      }
      #endif /* __cplusplus */
      
      #endif
      

      readme.txt

      Author:navy
      Time: 2023-04-10
      Version:10.0.0.1
      
      sample_g2d 用来演示在 eyesee-mpp 中添加sample 的步骤
      

      注意养成良好的习惯:
      1)sample 名称和别的sample 保持一直:拥有sample_前缀;
      2).h 文件添加 #ifdef __cplusplus 可以兼容让c++ 调用;
      3)sample含有 readme.txt ,便于介绍sample用途以及更新情况;

      3. 在路径:tina-v853-docker/platform/allwinner/eyesee-mpp/middleware/sun8iw21/sample/ 下的 tina.mk 中添加 sample_hello_world 的链接编译规则

      ifeq ($(TARGET), sample_hello_world)
      SRCCS := sample_hello_world/sample_hello_world.c
      LOCAL_TARGET_BIN := sample_hello_world/sample_hello_world
      endif
      

      4. 在路径:tina-v853-docker/platform/allwinner/eyesee-mpp/middleware/sun8iw21/ 下的 tina.mk 中添加sample_hello_world make 规则

      ifeq ($(MPPCFG_SAMPLE_HELLO_WORLD),Y)
      	make -C sample -f tina.mk TARGET=sample_hello_world  all
      endif
      

      5. 在路径:tina-v853-docker/openwrt/package/allwinner/eyesee-mpp/middleware 下的Makefile 和 config.in 中添加配置文件(添加后就可以在make menuconfig 中看到选项sample_hello_world )

      config.in

      config mpp_sample_hello_world
      	bool "mpp sample hello_world"
      	depends on mpp_sample
      	help
      	  mpp sample hello_world.
      

      Makefile

      ifeq ($(CONFIG_mpp_sample_hello_world),y)
          MPPCFG_SAMPLE_HELLO_WORLD := Y
      else
          MPPCFG_SAMPLE_HELLO_WORLD := N
      endif
      export MPPCFG_SAMPLE_HELLO_WORLD
      

      6. 编译
      1)主目录下:

      make menuconfig
      

      Allwinner > eyesee-mpp > select mpp sample
      按空格选中【*】 mpp sample hello_world
      caf68ced-8bcc-45cf-b47b-8e085fbc0a1a-image.png

      2)两种编译方式:
      1)) 直接在主目录下make -j1 V=s (全部编译)
      2))到配置目录:tina-v853-docker/openwrt/package/allwinner/eyesee-mpp/middleware 下直接mm -B (只编译eyesee-mpp 下的sample)

      3)将会在路径:tina-v853-docker/platform/allwinner/eyesee-mpp/middleware/sun8iw21/sample/bin/ 下产生sample_hello_world 可执行文件,将其adb push 到开发板./sample_hello_world 执行即可

      C 1 Reply Last reply Reply Quote Share 1
      • C
        cavert121 LV 5 @chhjnavy last edited by

        @chhjnavy 在 v851s 在 eyesee-mpp 中添加一个hello_world sample 的流程 中说:

        :tina-v853-docker/platform/allwinner/eyesee-mpp/middleware/sun8iw21/sample

        大佬,我的源码目录tina-v853-docker/platform/allwinner/eyesee-mpp/middleware/sun8iw21/sample下没有bin这个文件夹,并且在tina-v853-docker/openwrt/package/allwinner/eyesee-mpp/middleware/中输入mm -B时报错:Could not open packet

        C 1 Reply Last reply Reply Quote Share 0
        • C
          cavert121 LV 5 @cavert121 last edited by

          @cavert121 配置 目录下输入mm -b 已经正常编译了,但编译完可执行文件在哪里?源码目录中没有大佬说的bin文件

          C 1 Reply Last reply Reply Quote Share 0
          • C
            chhjnavy LV 5 @cavert121 last edited by

            @cavert121 一般tina-v853-docker/platform/allwinner/eyesee-mpp/middleware/sun8iw21/sample 这个目录下都会有bin 文件,如果没有的话,那就是在当前sample_hello_world 目录下

            C 3 Replies Last reply Reply Quote Share 0
            • C
              cavert121 LV 5 @chhjnavy last edited by

              @chhjnavy 大佬,我源文件目录下,所有的sample文件中都没有bin文件,是不是我的eyesee-mpp包有问题?

              1 Reply Last reply Reply Quote Share 0
              • C
                cavert121 LV 5 @chhjnavy last edited by

                @chhjnavy 微信图片_20230412101931.jpg
                源文件中只有这几个文件,没有bin

                whycan C 2 Replies Last reply Reply Quote Share 0
                • whycan
                  whycan晕哥 LV 9 @cavert121 last edited by

                  @cavert121
                  https://gitee.com/GloomyGhost/Yuzukilizard/tree/master/Software/sunxi-mpp

                  C 1 Reply Last reply Reply Quote Share 0
                  • C
                    cavert121 LV 5 @chhjnavy last edited by

                    @chhjnavy 你的MPP包发一下呗?

                    1 Reply Last reply Reply Quote Share 0
                    • C
                      cavert121 LV 5 @whycan last edited by

                      @whycan 晕哥,在sample中cmake成功后,生在的目标可执行文件在哪里?微信图片_20230412135428.jpg

                      微信图片_20230412152622.jpg

                      WhycanService 1 Reply Last reply Reply Quote Share 0
                      • WhycanService
                        WhycanService LV 8 @cavert121 last edited by WhycanService

                        @cavert121
                        有没有看README编译?

                        1. 为什么你的路径在sample里?应该在顶目录里cmake

                        54ecd068-b709-479d-9012-6812bbdb9e8c-image.png

                        1. 没有配置交叉编译工具链,readme里写了

                        f117b7af-f8b1-490a-b46e-80344cebce40-image.png

                        1. 没有make,只生成了构建文件

                        be6d010e-707d-4f74-b1ab-0921f4419e94-image.png

                        正常输出:

                        76db102d-9ab1-438e-a2f5-3ed3f8cd777b-image.png

                        也能找到bin
                        ee8dcbaf-aafd-4085-b9a9-641ceb7de2b0-image.png

                        C 2 Replies Last reply Reply Quote Share 0
                        • C
                          cavert121 LV 5 @WhycanService last edited by

                          @whycanservice 微信图片_20230412164003.jpg

                          大哥,报 这个错是什么原因啊?

                          1 Reply Last reply Reply Quote Share 0
                          • C
                            cavert121 LV 5 @WhycanService last edited by

                            @whycanservice 已解决。

                            1 Reply Last reply Reply Quote Share 0
                            • C
                              cavert121 LV 5 last edited by

                              谢谢,非常感谢大佬

                              C 1 Reply Last reply Reply Quote Share 0
                              • C
                                chhjnavy LV 5 @cavert121 last edited by

                                This post is deleted!
                                1 Reply Last reply Reply Quote Share 0
                                • C
                                  chhjnavy LV 5 @cavert121 last edited by

                                  @cavert121 sample 下面没有bin文件夹吗

                                  C 1 Reply Last reply Reply Quote Share 0
                                  • C
                                    cavert121 LV 5 @chhjnavy last edited by

                                    @chhjnavy 确实没有,但是是在cmake和make后在build/sample/ 对应的每个sample中会生成可执行文件。
                                    微信图片_20230413104750.jpg

                                    C 1 Reply Last reply Reply Quote Share 0
                                    • C
                                      chhjnavy LV 5 @cavert121 last edited by

                                      @cavert121 对啊,我写的里面也有然你去源码目录下找

                                      1 Reply Last reply Reply Quote Share 0
                                      • 1 / 1
                                      • First post
                                        Last post

                                      Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

                                      行为准则 | 用户协议 | 隐私权政策