Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页
    1. Home
    2. BedRock
    3. Best
    • Profile
    • Following 4
    • Followers 6
    • my integral 3736
    • Topics 30
    • Posts 311
    • Best 23
    • Groups 0

    Best posts made by BedRock

    • Reply: 关于ubuntu18.04下的编辑环境配置

      vscode的跳转需要C/C++扩展开启 IntelliSense 功能,该功能会根据工程进行深度的函数及变量的搜索,将其存储为索引文件,存储在内存中。
      !所以:Vscode的跳转要流畅需要占用比较大的运行内存空间。你可以尝试使用 资源管理器查看一下 进程的资源占用情况。

      它还带有代码提示功能。

      内存不够的兄弟 可以转 隔壁 Source Insight 来实现对应功能。

      关于其配置,你可以在网上找到大多例程,同时你可以参考:扩展中的参考配置来进行你工作空间的配置。
      99de43cf-3a2c-4b89-b275-a1a6c15416ff-image.png

      总的来说,适合自己的才是最好的,如果你愿意折腾,愿意自己调教自己的开发环境,愿意在这上面花时间,你还是会收获一个自己满意的开发环境的☺

      posted in XR系列-无线互联
      BedRock
      BedRock
    • Linux 调试工具推荐

      前言

      我们做开发的过程中难免会遇到各种各样问题,Windows中有强大的调试工具和软件仿真软件等等..Linux中的调试工具却有着举足轻重的地位,和更为丰富的功能.下面我们一一展开:

      1. 设备始终接口时钟树

      sys/kernel/debug/clk/clk_summary

      2.引脚接口

      sys/kernel/debug/pinctrl/pinctrl-maps

      3.CPU外设用电情况

      sys/kernel/debug/regulater/regulator_summary

      4.中断控制器

      proc/interrputs

      5.内核loge打印

      demesg

      6.进程查看

      top 查看cpu 内存使用情况
      cpu_monitor 系统资源监控

      7.带宽资源

      mtop 抓取当前ddr带宽使用情况

      8.二进制转换源码工具

      add2line 可以转换当前二进制对应的源码位置

      9.反汇编工具

      objdump 可以直接将可执行程序反转为汇编

      10.用户空间跟踪工具

      starce 可以查看当前进程空间的跟踪,什么进程在干什么,占了多少资源.
      ioctr占了多少带宽,执行消耗了多少资源.

      当然还有很多很多其他的工具,有需要的时候再看😊

      posted in Linux
      BedRock
      BedRock
    • 【加精】在Ubuntu21.04中编译Tina SDKV1.01 版本 踩坑记录

      前言

      本人使用Ubuntu21.04,是在Ubuntu18.04 使用系统升级的方法升级,并非直接安装Ubuntu21.04 系统镜像。希望参考该帖开发者注意。


      安装环境提醒

      再Ubuntu更新软件包同时,个人不推荐使用清华源,可能会出现一些软件包安装找不到的问题(因为我之前就是),后面改为阿里源,然后就没有出现过软件包依赖的相关问题。切换软件源请自行百度参考帖子。


      安装过程踩坑记录

      参考全志官方文档:https://d1.docs.allwinnertech.com/study/study_2getsdk/

      1、安装软件包问题

      sudo apt-get install build-essential subversion git-core libncurses5-dev zlib1g-dev gawk flex quilt libssl-dev xsltproc libxml-parser-perl mercurial bzr ecj cvs unzip lib32z1 lib32z1-dev lib32stdc++6 libstdc++6 -y
      

      在软件包安装的时候 建议取消后面 -y 选项 ,先看一下有没有自动卸载一些包 如果有建议取消安装,然后一个一个包安装。
      如果出现软件包找不到的情况,请自行使用Tab补齐命令查看可以安装的包,并选择何时的包进行安装。
      针对于32位的软件包

      sudo apt-get install libc6:i386 libstdc++6:i386 lib32ncurses5 lib32z1
      

      更有可能出现找不到的情况,依然使用Tab补齐命令,查看当前可以安装的包,并选择何时的包进行安装。

      2、编译问题

      依然参考官方文档:https://d1.docs.allwinnertech.com/study/study_4compile/


      source 环境变量如果有错,请检查文件夹权限,将文件夹权限由root用户更改为普通用户。
      如果还有问题,请根据具体信息对照 envsetup.sh文件中的 envsetup函数。一一落实执行过程。


      3、make过程中遇到的问题

      问题一

      报错提示没有记录,查看报错提示,可以定位到 两处文件,修改其源码为:

      #gdbusmessage.c文件,路径为:./out/d1-nezha/compile_dir/target/host/glib-2.50.1/gio/gdbusmessage.c
      gdbusmessage.c:2698:30:
            if (signature_str)
            tupled_signature_str = g_strdup_printf ("(%s)", signature_str);
      
      #这个文件路径还请自行查找
      dbusauth.c 1298
            if (line == NULL)
                  goto out;
                debug_print ("SERVER: WaitingForBegin, read '%s'", line);
      

      问题二

      rm: cannot remove '/home/jie/allwinner/tina-d1-open/tmp/info/.overrides-packageinfo-1859194': Permission denied
      make[3]: *** No rule to make target '/home/jie/allwinner/tina-d1-open/tmp/info/.files-packageinfo-1861882'.  Stop.
      cat: /home/jie/allwinner/tina-d1-open/tmp/info/.files-packageinfo-1861882: No such file or directory
      cat: /home/jie/allwinner/tina-d1-open/tmp/info/.overrides-packageinfo-1861882: No such file or directory
      rm: cannot remove '/home/jie/allwinner/tina-d1-open/tmp/info/.files-packageinfo.stamp.4ecc855bd5022757c3b7544e2dfb29c7': Permission denied
      touch: cannot touch '/home/jie/allwinner/tina-d1-open/tmp/info/.files-packageinfo.stamp.d41d8cd98f00b204e9800998ecf8427e': Permission denied
      touch: cannot touch '/home/jie/allwinner/tina-d1-open/tmp/info/.files-packageinfo.stamp': Permission denied
      make[2]: *** [build/scan.mk:84: /home/jie/allwinner/tina-d1-open/tmp/info/.files-packageinfo.stamp] Error 1
      make[1]: *** [/home/jie/allwinner/tina-d1-open/build/toplevel.mk:84: prepare-tmpinfo] Error 2
      make: *** [/home/jie/allwinner/tina-d1-open/build/toplevel.mk:304:world] 错误 2
      [2]+  已完成               $T/tools/build/buildserver --path $T
      
      #### make failed to build some targets (1 seconds) ####
      
      

      这个主要是文件夹及文件权限问题,给这几个文件及它的文件夹777权限。
      基本是 tmp文件夹的相关属性。

      问题三

      strerror-sym.c:47:9: error: 'errnos_msgstr' undeclared (first use in this function)
        return errnos_msgstr + errnos_msgidx[idx];
               ^~~~~~~~~~~~~
      strerror-sym.c:47:9: note: each undeclared identifier is reported only once for eac                                                                                                                        h function it appears in
      strerror-sym.c:47:25: error: 'errnos_msgidx' undeclared (first use in this function                                                                                                                           )
        return errnos_msgstr + errnos_msgidx[idx];
                               ^~~~~~~~~~~~~
      make[7]: *** [Makefile:946: gpg_error-strerror-sym.o] Error 1
      
      

      通过查找文件定位
      ./out/d1-nezha/compile_dir/target/libgpg-error-1.27/src/errnos-sym.h 这个文件为空
      编译不通过 , 相关变量没有定义
      感谢全志官方群大佬的鼎力相助发了我一手头文件
      这是缺少头文件中的内容

      /* Output of mkstrtable.awk.  DO NOT EDIT.  */
      
      /* errnos.in - List of system error values.
         Copyright (C) 2003, 2004 g10 Code GmbH
      
         This file is part of libgpg-error.
      
         libgpg-error is free software; you can redistribute it and/or
         modify it under the terms of the GNU Lesser General Public License
         as published by the Free Software Foundation; either version 2.1 of
         the License, or (at your option) any later version.
      
         libgpg-error is distributed in the hope that it will be useful, but
         WITHOUT ANY WARRANTY; without even the implied warranty of
         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
         Lesser General Public License for more details.
      
         You should have received a copy of the GNU Lesser General Public
         License along with libgpg-error; if not, write to the Free
         Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
         02111-1307, USA.  */
      
      
      
      /* The purpose of this complex string table is to produce
         optimal code with a minimum of relocations.  */
      
      static const char errnos_msgstr[] =
        "GPG_ERR_E2BIG" "\0"
        "GPG_ERR_EACCES" "\0"
        "GPG_ERR_EADDRINUSE" "\0"
        "GPG_ERR_EADDRNOTAVAIL" "\0"
        "GPG_ERR_EADV" "\0"
        "GPG_ERR_EAFNOSUPPORT" "\0"
        "GPG_ERR_EAGAIN" "\0"
        "GPG_ERR_EALREADY" "\0"
        "GPG_ERR_EAUTH" "\0"
        "GPG_ERR_EBACKGROUND" "\0"
        "GPG_ERR_EBADE" "\0"
        "GPG_ERR_EBADF" "\0"
        "GPG_ERR_EBADFD" "\0"
        "GPG_ERR_EBADMSG" "\0"
        "GPG_ERR_EBADR" "\0"
        "GPG_ERR_EBADRPC" "\0"
        "GPG_ERR_EBADRQC" "\0"
        "GPG_ERR_EBADSLT" "\0"
        "GPG_ERR_EBFONT" "\0"
        "GPG_ERR_EBUSY" "\0"
        "GPG_ERR_ECANCELED" "\0"
        "GPG_ERR_ECHILD" "\0"
        "GPG_ERR_ECHRNG" "\0"
        "GPG_ERR_ECOMM" "\0"
        "GPG_ERR_ECONNABORTED" "\0"
        "GPG_ERR_ECONNREFUSED" "\0"
        "GPG_ERR_ECONNRESET" "\0"
        "GPG_ERR_ED" "\0"
        "GPG_ERR_EDEADLK" "\0"
        "GPG_ERR_EDEADLOCK" "\0"
        "GPG_ERR_EDESTADDRREQ" "\0"
        "GPG_ERR_EDIED" "\0"
        "GPG_ERR_EDOM" "\0"
        "GPG_ERR_EDOTDOT" "\0"
        "GPG_ERR_EDQUOT" "\0"
        "GPG_ERR_EEXIST" "\0"
        "GPG_ERR_EFAULT" "\0"
        "GPG_ERR_EFBIG" "\0"
        "GPG_ERR_EFTYPE" "\0"
        "GPG_ERR_EGRATUITOUS" "\0"
        "GPG_ERR_EGREGIOUS" "\0"
        "GPG_ERR_EHOSTDOWN" "\0"
        "GPG_ERR_EHOSTUNREACH" "\0"
        "GPG_ERR_EIDRM" "\0"
        "GPG_ERR_EIEIO" "\0"
        "GPG_ERR_EILSEQ" "\0"
        "GPG_ERR_EINPROGRESS" "\0"
        "GPG_ERR_EINTR" "\0"
        "GPG_ERR_EINVAL" "\0"
        "GPG_ERR_EIO" "\0"
        "GPG_ERR_EISCONN" "\0"
        "GPG_ERR_EISDIR" "\0"
        "GPG_ERR_EISNAM" "\0"
        "GPG_ERR_EL2HLT" "\0"
        "GPG_ERR_EL2NSYNC" "\0"
        "GPG_ERR_EL3HLT" "\0"
        "GPG_ERR_EL3RST" "\0"
        "GPG_ERR_ELIBACC" "\0"
        "GPG_ERR_ELIBBAD" "\0"
        "GPG_ERR_ELIBEXEC" "\0"
        "GPG_ERR_ELIBMAX" "\0"
        "GPG_ERR_ELIBSCN" "\0"
        "GPG_ERR_ELNRNG" "\0"
        "GPG_ERR_ELOOP" "\0"
        "GPG_ERR_EMEDIUMTYPE" "\0"
        "GPG_ERR_EMFILE" "\0"
        "GPG_ERR_EMLINK" "\0"
        "GPG_ERR_EMSGSIZE" "\0"
        "GPG_ERR_EMULTIHOP" "\0"
        "GPG_ERR_ENAMETOOLONG" "\0"
        "GPG_ERR_ENAVAIL" "\0"
        "GPG_ERR_ENEEDAUTH" "\0"
        "GPG_ERR_ENETDOWN" "\0"
        "GPG_ERR_ENETRESET" "\0"
        "GPG_ERR_ENETUNREACH" "\0"
        "GPG_ERR_ENFILE" "\0"
        "GPG_ERR_ENOANO" "\0"
        "GPG_ERR_ENOBUFS" "\0"
        "GPG_ERR_ENOCSI" "\0"
        "GPG_ERR_ENODATA" "\0"
        "GPG_ERR_ENODEV" "\0"
        "GPG_ERR_ENOENT" "\0"
        "GPG_ERR_ENOEXEC" "\0"
        "GPG_ERR_ENOLCK" "\0"
        "GPG_ERR_ENOLINK" "\0"
        "GPG_ERR_ENOMEDIUM" "\0"
        "GPG_ERR_ENOMEM" "\0"
        "GPG_ERR_ENOMSG" "\0"
        "GPG_ERR_ENONET" "\0"
        "GPG_ERR_ENOPKG" "\0"
        "GPG_ERR_ENOPROTOOPT" "\0"
        "GPG_ERR_ENOSPC" "\0"
        "GPG_ERR_ENOSR" "\0"
        "GPG_ERR_ENOSTR" "\0"
        "GPG_ERR_ENOSYS" "\0"
        "GPG_ERR_ENOTBLK" "\0"
        "GPG_ERR_ENOTCONN" "\0"
        "GPG_ERR_ENOTDIR" "\0"
        "GPG_ERR_ENOTEMPTY" "\0"
        "GPG_ERR_ENOTNAM" "\0"
        "GPG_ERR_ENOTSOCK" "\0"
        "GPG_ERR_ENOTSUP" "\0"
        "GPG_ERR_ENOTTY" "\0"
        "GPG_ERR_ENOTUNIQ" "\0"
        "GPG_ERR_ENXIO" "\0"
        "GPG_ERR_EOPNOTSUPP" "\0"
        "GPG_ERR_EOVERFLOW" "\0"
        "GPG_ERR_EPERM" "\0"
        "GPG_ERR_EPFNOSUPPORT" "\0"
        "GPG_ERR_EPIPE" "\0"
        "GPG_ERR_EPROCLIM" "\0"
        "GPG_ERR_EPROCUNAVAIL" "\0"
        "GPG_ERR_EPROGMISMATCH" "\0"
        "GPG_ERR_EPROGUNAVAIL" "\0"
        "GPG_ERR_EPROTO" "\0"
        "GPG_ERR_EPROTONOSUPPORT" "\0"
        "GPG_ERR_EPROTOTYPE" "\0"
        "GPG_ERR_ERANGE" "\0"
        "GPG_ERR_EREMCHG" "\0"
        "GPG_ERR_EREMOTE" "\0"
        "GPG_ERR_EREMOTEIO" "\0"
        "GPG_ERR_ERESTART" "\0"
        "GPG_ERR_EROFS" "\0"
        "GPG_ERR_ERPCMISMATCH" "\0"
        "GPG_ERR_ESHUTDOWN" "\0"
        "GPG_ERR_ESOCKTNOSUPPORT" "\0"
        "GPG_ERR_ESPIPE" "\0"
        "GPG_ERR_ESRCH" "\0"
        "GPG_ERR_ESRMNT" "\0"
        "GPG_ERR_ESTALE" "\0"
        "GPG_ERR_ESTRPIPE" "\0"
        "GPG_ERR_ETIME" "\0"
        "GPG_ERR_ETIMEDOUT" "\0"
        "GPG_ERR_ETOOMANYREFS" "\0"
        "GPG_ERR_ETXTBSY" "\0"
        "GPG_ERR_EUCLEAN" "\0"
        "GPG_ERR_EUNATCH" "\0"
        "GPG_ERR_EUSERS" "\0"
        "GPG_ERR_EWOULDBLOCK" "\0"
        "GPG_ERR_EXDEV" "\0"
        "GPG_ERR_EXFULL";
      
      static const int errnos_msgidx[] =
        {
          0,
          14,
          29,
          48,
          70,
          83,
          104,
          119,
          136,
          150,
          170,
          184,
          198,
          213,
          229,
          243,
          259,
          275,
          291,
          306,
          320,
          338,
          353,
          368,
          382,
          403,
          424,
          443,
          454,
          470,
          488,
          509,
          523,
          536,
          552,
          567,
          582,
          597,
          611,
          626,
          646,
          664,
          682,
          703,
          717,
          731,
          746,
          766,
          780,
          795,
          807,
          823,
          838,
          853,
          868,
          885,
          900,
          915,
          931,
          947,
          964,
          980,
          996,
          1011,
          1025,
          1045,
          1060,
          1075,
          1092,
          1110,
          1131,
          1147,
          1165,
          1182,
          1200,
          1220,
          1235,
          1250,
          1266,
          1281,
          1297,
          1312,
          1327,
          1343,
          1358,
          1374,
          1392,
          1407,
          1422,
          1437,
          1452,
          1472,
          1487,
          1501,
          1516,
          1531,
          1547,
          1564,
          1580,
          1598,
          1614,
          1631,
          1647,
          1662,
          1679,
          1693,
          1712,
          1730,
          1744,
          1765,
          1779,
          1796,
          1817,
          1839,
          1860,
          1875,
          1899,
          1918,
          1933,
          1949,
          1965,
          1983,
          2000,
          2014,
          2035,
          2053,
          2077,
          2092,
          2106,
          2121,
          2136,
          2153,
          2167,
          2185,
          2206,
          2222,
          2238,
          2254,
          2269,
          2289,
          2303,
      
        };
      
      static GPG_ERR_INLINE int
      errnos_msgidxof (int code)
      {
        return (0 ? 0
        : ((code >= 0) && (code <= 140)) ? (code - 0)
        : -1);
      }
      

      谨此,更改之后,D1 SDK 编译通过。 非常感谢官方群 大佬们的帮助!

      #### make completed successfully (15:51 (mm:ss)) ####
      

      嘻嘻!

      posted in D1系列-RISC-V
      BedRock
      BedRock
    • Reply: 全志开发板GPIO名命规范(全系列通用)

      25de9826-0347-4056-980b-c499a050dc35-lADPD1zaxxBjznrNAtDNBQA_1280_720.jpg
      点个灯 😂 😂 😂

      posted in D1系列-RISC-V
      BedRock
      BedRock
    • 又一款开源显示框架GUI-lite,在D1上试试效果

      项目开源链接:

      https://gitee.com/idea4good/GuiLite
      大道至簡 - 4千行/仅头文件/全平台GUI库

      sample仓库

      https://gitee.com/idea4good/GuiLiteSamples/tree/master/

      记录

      项目使用Cmake构建,可以直接指定交叉编译链进行编译,实测在cmakelists中指定交叉编译链找不到路径,索性不管直接指定CC CXX环境变量,然后直接进行编译,跑一下 widgets 例程
      e6ff2e16-2f9e-4c85-a10c-64fca76d5e99-lADPDh0cQobjtu3NC9DND8A_4032_3024.jpg

      posted in D1系列-RISC-V
      BedRock
      BedRock
    • Reply: 串口日志输出如何保存到文件?

      @wanglang 😳 😳 草草写一下

      while true

      dmesg -c > filename_<time>
      sleep()

      10次后,打包压缩一次

      posted in 编译和烧写问题专区
      BedRock
      BedRock
    • LVGL测试中相关参数之位置样式

      位置样式调整

      lv_obj_align(canvas_bottom_menu, NULL, LV_ALIGN_IN_TOP_MID, 0, 605);   
      //后面两个参数为x y 的偏置   x向右方向偏置  y向下偏置
      
      样式应用有点特别  
      lv_obj_add_style(canvas_bottom_menu, LV_BTN_PART_MAIN, &style_bottom_menu);
      

      样式列表参数

      lv_style_t lv_style_scr;
      lv_style_t lv_style_transp;
      lv_style_t lv_style_transp_fit;
      lv_style_t lv_style_transp_tight;
      lv_style_t lv_style_plain;
      lv_style_t lv_style_plain_color;
      lv_style_t lv_style_pretty;
      lv_style_t lv_style_pretty_color;
      lv_style_t lv_style_btn_rel;
      lv_style_t lv_style_btn_pr;
      lv_style_t lv_style_btn_tgl_rel;
      lv_style_t lv_style_btn_tgl_pr;
      lv_style_t lv_style_btn_ina;
      

      位置参数

      /** Object alignment. */
      enum {
          LV_ALIGN_CENTER = 0,
          LV_ALIGN_IN_TOP_LEFT,
          LV_ALIGN_IN_TOP_MID,
          LV_ALIGN_IN_TOP_RIGHT,
          LV_ALIGN_IN_BOTTOM_LEFT,
          LV_ALIGN_IN_BOTTOM_MID,
          LV_ALIGN_IN_BOTTOM_RIGHT,
          LV_ALIGN_IN_LEFT_MID,
          LV_ALIGN_IN_RIGHT_MID,
          
          LV_ALIGN_OUT_TOP_LEFT,
          LV_ALIGN_OUT_TOP_MID,
          LV_ALIGN_OUT_TOP_RIGHT,
          LV_ALIGN_OUT_BOTTOM_LEFT,
          LV_ALIGN_OUT_BOTTOM_MID,
          LV_ALIGN_OUT_BOTTOM_RIGHT,
          LV_ALIGN_OUT_LEFT_TOP,
          LV_ALIGN_OUT_LEFT_MID,
          LV_ALIGN_OUT_LEFT_BOTTOM,
          LV_ALIGN_OUT_RIGHT_TOP,
          LV_ALIGN_OUT_RIGHT_MID,
          LV_ALIGN_OUT_RIGHT_BOTTOM,
      };
      typedef uint8_t lv_align_t;
      

      位置参考
      3e1c6c11-9232-4857-9db3-12004329fce3-image.png

      posted in 其它全志芯片讨论区
      BedRock
      BedRock
    • 关于哪吒不同版本编译链的问题

      之前已经知道使用 平头哥的新版编译器在编译文件的时候在哪吒上跑会出现 GLIBC_2.29 not define 的错误.
      此处借鉴 nihui 在编译 ncnn 时的写法~加上

      -static    #全部链接成静态
      

      就能在Tina中运行啦.
      根据"有限的情报"新版编译器应该比旧的编译器优化的情况好一些.但是看运行情况发现,新版的编译链在哪吒上的执行效率更低 是怎么回事呢?🙄 🙄 🙄

      posted in D1系列-RISC-V
      BedRock
      BedRock
    • Reply: 【DIY教程】D1哪吒开发板移植wifi6模组AW869B

      哈哈哈哈哈哈 躺好等更新

      posted in D1系列-RISC-V
      BedRock
      BedRock
    • Reply: Ubuntu20.04编译D1报错:debug_print ("SERVER: WaitingForBegin, read '%s'", line)

      有的https://bbs.aw-ol.com/topic/102/ 查看这个帖,以及下面的评论哦

      posted in D1系列-RISC-V
      BedRock
      BedRock
    • 用用D1上的GPIO(封装好的函数)

      由于最近要使用GPIO,所以今天就把玩了一下D1的GPIO,在使用的时候需要注意,GPIO是否可用,有没有被其他模块使用,可以下载原理图进行查看,本着扩展IO肯定没模块用的心理,就直接上扩展IO了。

      话不多说直接上代码,晚点发GitHub。

      #ifndef MOTOR_H
      #define MOTOR_H
      
      
      #include <stdio.h>
      #include <stdlib.h>
      #include <unistd.h>
      #include <sys/types.h>    
      #include <sys/stat.h>    
      #include <fcntl.h>
      
      #define GPIO_PATH "/sys/class/gpio/gpio%d/value"
      #define GPIO_FUNCTION_PATH "/sys/class/gpio/gpio%d/direction"
      
      
      static int GPIO_Point_IN1_fd;
      static int GPIO_Point_IN2_fd;
      static int GPIO_Point_IN3_fd;
      static int GPIO_Point_IN4_fd;
      
      
      static unsigned char phasecw[4] = {0x08, 0x04, 0x02, 0x01};
      
      
      //
      
      #define GPIO_Point_IN1 2021
      #define GPIO_Point_IN2 2022
      #define GPIO_Point_IN3 2023
      #define GPIO_Point_IN4 2024
      
      #define GPIO_WRITEPIN(Point,value) (write(Point,value,1))
      
      #define delay_ms(x)  (usleep(x*1000))
      
      #define GPIO_Point_IN1_Set write(GPIO_Point_IN1_fd, "1", 1)
      #define GPIO_Point_IN2_Set write(GPIO_Point_IN2_fd, "1", 1)
      #define GPIO_Point_IN3_Set write(GPIO_Point_IN3_fd, "1", 1)
      #define GPIO_Point_IN4_Set write(GPIO_Point_IN4_fd, "1", 1)
      
      #define GPIO_Point_IN1_ReSet write(GPIO_Point_IN1_fd, "0", 1)
      #define GPIO_Point_IN2_ReSet write(GPIO_Point_IN2_fd, "0", 1)
      #define GPIO_Point_IN3_ReSet write(GPIO_Point_IN3_fd, "0", 1)
      #define GPIO_Point_IN4_ReSet write(GPIO_Point_IN4_fd, "0", 1)
      
      
      
      int Motor_Init();
      
      void GPIO_WrietPin(int GPIO_Point,int GPIO_Value);
      void MotorCW( void );
      #endif
      
      
      #include "Motor.h"
      
      static int export_fd, direction_fd, gpiovalue_fd;
      
      static int Motor_GPIO_Init();
      static int Motor_GPIO_Function();
      static int Motor_GPIO_File_FOK();
      
      
      
      int Motor_Init(){
          //1、检查文件是否存在 4 个 GPIO 都需要检查.
          if(-1 == Motor_GPIO_File_FOK()){
              printf("Motor_GPIO_File creat Faild\n");
              return -1;
          }
          //2、设置IO功能为 out 
          if(-1 == Motor_GPIO_Function()){
              printf("Motor_GPIO_Function set Faild \n");
              return -1;
          }
          //2、IO file open return fd*
          if(-1 == Motor_GPIO_Init()){
              printf("Motor_GPIO_File Open Faild \n");
              return -1;
          }
          return 1;
      }
      void MotorCW( void )
      {
          unsigned char i;
          unsigned char temp = 0;
          for( i = 0; i < 4; i++ )
          {
              temp = phasecw[i];
      
              // LD = ( temp >> 3 ) & 0x01;							//取bit4的值
              // LC = ( temp >> 2 ) & 0x01;
              // LB = ( temp >> 1 ) & 0x01;
              // LA = ( temp >> 0 ) & 0x01;							//取bit0的值
              GPIO_WrietPin(GPIO_Point_IN1, ( temp >> 3 ) & 0x01);
              GPIO_WrietPin(GPIO_Point_IN2, ( temp >> 2 ) & 0x01);
              GPIO_WrietPin(GPIO_Point_IN3, ( temp >> 1 ) & 0x01);
              GPIO_WrietPin(GPIO_Point_IN4, ( temp >> 0 ) & 0x01);
      
              delay_ms(2); 										
          }
      }
      
      void GPIO_WrietPin(int GPIO_Point,int GPIO_Value){
          if(!(GPIO_Value == 0 || GPIO_Value == 1)){
              printf("GPIO_Value Faild %d \n",GPIO_Value);
              return -1;
          }
          switch(GPIO_Point){
              case GPIO_Point_IN1:
                  //GPIO_WRITEPIN(GPIO_Point_IN1_fd,GPIO_Value);
                  if(GPIO_Value) GPIO_Point_IN1_Set;
                  else GPIO_Point_IN1_ReSet;
                  break;
              case GPIO_Point_IN2:
                  //GPIO_WRITEPIN(GPIO_Point_IN2_fd,GPIO_Value);
                  if(GPIO_Value) GPIO_Point_IN2_Set;
                  else GPIO_Point_IN2_ReSet;
                  break;
              case GPIO_Point_IN3:
                  //GPIO_WRITEPIN(GPIO_Point_IN3_fd,GPIO_Value);
                  if(GPIO_Value) GPIO_Point_IN3_Set;
                  else GPIO_Point_IN3_ReSet;
                  break;
              case GPIO_Point_IN4:
                  //GPIO_WRITEPIN(GPIO_Point_IN4_fd,GPIO_Value);
                  if(GPIO_Value) GPIO_Point_IN4_Set;
                  else GPIO_Point_IN4_ReSet;
                  break;
              default:
                  break;
          }
      
      }
      
      static int Motor_GPIO_File_FOK(){
      
          char gpio_file_path[40] = {0}; 
          char gpio_Point_File_Num[4] = {0};
      
          sprintf(gpio_file_path,GPIO_PATH,GPIO_Point_IN1);
          sprintf(gpio_Point_File_Num,"%d",GPIO_Point_IN1);
          if(access(gpio_file_path,F_OK)){
              printf("GPIO [%d] not find creat it \n ",GPIO_Point_IN1);
      
              export_fd = open("/sys/class/gpio/export", O_WRONLY);
              if(-1 == export_fd)
              {
                      printf("[%s]:[%d] open gpio export file error\r\n", __FUNCTION__, __LINE__);
                      return -1;
              }
              if(-1 == write(export_fd, gpio_Point_File_Num, 4))
              {
                      printf("write file operation error\r\n");
                      return -1;
              }
              close(export_fd);
          }
      
          sprintf(gpio_file_path,GPIO_PATH,GPIO_Point_IN2);
          sprintf(gpio_Point_File_Num,"%d",GPIO_Point_IN2);
          if(access(gpio_file_path,F_OK)){
              printf("GPIO [%d] not find creat it \n ",GPIO_Point_IN2);
      
              export_fd = open("/sys/class/gpio/export", O_WRONLY);
              if(-1 == export_fd)
              {
                      printf("[%s]:[%d] open gpio export file error\r\n", __FUNCTION__, __LINE__);
                      return -1;
              }
              if(-1 == write(export_fd, gpio_Point_File_Num, 4))
              {
                      printf("write file operation error\r\n");
                      return -1;
              }
              close(export_fd);
          }
      
          sprintf(gpio_file_path,GPIO_PATH,GPIO_Point_IN3);
          sprintf(gpio_Point_File_Num,"%d",GPIO_Point_IN3);
          if(access(gpio_file_path,F_OK)){
              printf("GPIO [%d] not find creat it \n ",GPIO_Point_IN3);
      
              export_fd = open("/sys/class/gpio/export", O_WRONLY);
              if(-1 == export_fd)
              {
                      printf("[%s]:[%d] open gpio export file error\r\n", __FUNCTION__, __LINE__);
                      return -1;
              }
              if(-1 == write(export_fd, gpio_Point_File_Num, 4))
              {
                      printf("write file operation error\r\n");
                      return -1;
              }
              close(export_fd);
          }
      
          sprintf(gpio_file_path,GPIO_PATH,GPIO_Point_IN4);
          sprintf(gpio_Point_File_Num,"%d",GPIO_Point_IN4);
          if(access(gpio_file_path,F_OK)){
              printf("GPIO [%d] not find creat it \n ",GPIO_Point_IN4);
      
              export_fd = open("/sys/class/gpio/export", O_WRONLY);
              if(-1 == export_fd)
              {
                      printf("[%s]:[%d] open gpio export file error\r\n", __FUNCTION__, __LINE__);
                      return -1;
              }
              if(-1 == write(export_fd, gpio_Point_File_Num, 4))
              {
                      printf("write file operation error\r\n");
                      return -1;
              }
              close(export_fd);
          }
          return 1;
      }
      
      
      static int Motor_GPIO_Function(){
          char GPIO_Function_Path[40] = {0};
          sprintf(GPIO_Function_Path,GPIO_FUNCTION_PATH,GPIO_Point_IN1);
          direction_fd = open(GPIO_Function_Path, O_WRONLY);
          if(-1 == direction_fd)
          {
              printf("[%s]:[%d] open gpio direction file error\r\n", __FUNCTION__, __LINE__);
              
              return -1;
          }
          if(-1 == write(direction_fd, "out", sizeof("out")))
          {
              printf("[%s]:[%d] write operation direction error\r\n", __FUNCTION__, __LINE__);
              close(direction_fd);
              return -1;
          }
          close(direction_fd);
      
           sprintf(GPIO_Function_Path,GPIO_FUNCTION_PATH,GPIO_Point_IN2);
          direction_fd = open(GPIO_Function_Path, O_WRONLY);
          if(-1 == direction_fd)
          {
              printf("[%s]:[%d] open gpio direction file error\r\n", __FUNCTION__, __LINE__);
              
              return -1;
          }
          if(-1 == write(direction_fd, "out", sizeof("out")))
          {
              printf("[%s]:[%d] write operation direction error\r\n", __FUNCTION__, __LINE__);
              close(direction_fd);
              return -1;
          }
          close(direction_fd);
      
           sprintf(GPIO_Function_Path,GPIO_FUNCTION_PATH,GPIO_Point_IN3);
          direction_fd = open(GPIO_Function_Path, O_WRONLY);
          if(-1 == direction_fd)
          {
              printf("[%s]:[%d] open gpio direction file error\r\n", __FUNCTION__, __LINE__);
              
              return -1;
          }
          if(-1 == write(direction_fd, "out", sizeof("out")))
          {
              printf("[%s]:[%d] write operation direction error\r\n", __FUNCTION__, __LINE__);
              close(direction_fd);
              return -1;
          }
          close(direction_fd);
      
           sprintf(GPIO_Function_Path,GPIO_FUNCTION_PATH,GPIO_Point_IN4);
          direction_fd = open(GPIO_Function_Path, O_WRONLY);
          if(-1 == direction_fd)
          {
              printf("[%s]:[%d] open gpio direction file error\r\n", __FUNCTION__, __LINE__);
              
              return -1;
          }
          if(-1 == write(direction_fd, "out", sizeof("out")))
          {
              printf("[%s]:[%d] write operation direction error\r\n", __FUNCTION__, __LINE__);
              close(direction_fd);
              return -1;
          }
          close(direction_fd);
      
          return 1;
      }
      // int GPIO_Point_IN1_fd;
      // int GPIO_Point_IN2_fd;
      // int GPIO_Point_IN3_fd;
      // int GPIO_Point_IN4_fd;
      static int Motor_GPIO_Init(){
      
          char gpio_file_path[40] = {0}; 
      
          sprintf(gpio_file_path,GPIO_PATH,GPIO_Point_IN1);
          GPIO_Point_IN1_fd = open(gpio_file_path, O_WRONLY);  //RDWR
          if(-1 == GPIO_Point_IN1_fd)
          {
              printf("[%s]:[%d]: open value file error\r\n", __FUNCTION__, __LINE__);
              return -1;
          }
      
          sprintf(gpio_file_path,GPIO_PATH,GPIO_Point_IN2);
          GPIO_Point_IN2_fd = open(gpio_file_path, O_WRONLY);  //RDWR
          if(-1 == GPIO_Point_IN2_fd)
          {
              printf("[%s]:[%d]: open value file error\r\n", __FUNCTION__, __LINE__);
              return -1;
          }
      
          sprintf(gpio_file_path,GPIO_PATH,GPIO_Point_IN3);
          GPIO_Point_IN3_fd = open(gpio_file_path, O_WRONLY);  //RDWR
          if(-1 == GPIO_Point_IN3_fd)
          {
              printf("[%s]:[%d]: open value file error\r\n", __FUNCTION__, __LINE__);
              return -1;
          }
      
          sprintf(gpio_file_path,GPIO_PATH,GPIO_Point_IN4);
          GPIO_Point_IN4_fd = open(gpio_file_path, O_WRONLY);  //RDWR
          if(-1 == GPIO_Point_IN4_fd)
          {
              printf("[%s]:[%d]: open value file error\r\n", __FUNCTION__, __LINE__);
              return -1;
          }
          return 1;
      }
      
      
      CC := riscv64-unknown-linux-gnu-gcc
      
      target = Motor
      
      LDFLAGS ?= -lm
      CFLAGS ?= -I .
      
      
      
      CSRCS += Motor.c
      MAINSRC  = ./main.c
      
      
      all : default
      
      
      OBJEXT ?= .o
      
      COBJS = $(CSRCS:.c=$(OBJEXT))
      MAINOBJ = $(MAINSRC:.c=$(OBJEXT))
      
      # SRCS =  $(CSRCS) $(MAINSRC)s
      %.o: %.c
      	@$(CC)  $(CFLAGS) -c $< -o $@
      	@echo "CC $<"
      
      default:  $(COBJS) $(MAINOBJ)
      	$(CC) -o $(target) $(MAINOBJ)  $(COBJS) $(LDFLAGS)
      	
      
      clean: 
      	rm -f $(target) $(AOBJS) $(COBJS) $(MAINOBJ)
      
      posted in D1系列-RISC-V
      BedRock
      BedRock
    • Reply: 在D1开发板上运行Dahdi和Asterisk IPPBX

      @xiaowen 在 在D1开发板上运行Dahdi和Asterisk IPPBX 中说:

      https://www.bilibili.com/video/BV1Rv411373f/

      虽然没看懂,但不影响我点赞😆

      posted in D1系列-RISC-V
      BedRock
      BedRock
    • Reply: 如何调用GPIO生成下降沿?

      根据帖https://bbs.aw-ol.com/topic/336/的图

      GPIO10 SOCNO 为 PB9 对应的 在Tina中的命名规范 PB0 为32 + 9 = 41

      所以需要向/sys/class/gpio/export 写入 41

      之后会生成 GPIO41 的文件夹

      检查/sys/class/gpio/gpio41/direction 是否为 out

      如果是,则可以给/sys/class/gpio/gpio41/value 写入 0 则为低电平

      posted in D1系列-RISC-V
      BedRock
      BedRock
    • Reply: 如何调用GPIO生成下降沿?

      @mgeekfb 查看原理图 GPIO10 的SOCNO 应该是 PP1
      d93e2c51-fef9-4090-bd76-494a35e3db91-image.png
      PIN10 才是 PB9 PB9 默认被用作 UART0 当然不可以打开了

      PP1 对应的编号为 GPIO2021 (因为 PPx 是用芯片扩展出来的 GPIO 默认从2020开始)

      posted in D1系列-RISC-V
      BedRock
      BedRock
    • littlevgl8 移植源码可在openwrt中添加编译

      littlevgl-8.tar.gz

      posted in D1系列-RISC-V
      BedRock
      BedRock
    • Reply: D1wifi连接异常

      用Tina系统可以试试这个指令连接 wifi

      wifi_connect_ap_test <ssid> <passwd>
      
      posted in D1系列-RISC-V
      BedRock
      BedRock
    • Reply: 【单板仅需99】D1哪吒计算条上线!为智能家居提供高性价比的RISC-V算力

      a081fe63-4ab1-4436-aa88-06215c1ca2bf-image.png
      从影子中看是一个方形核心板+帽子?

      posted in D1系列-RISC-V
      BedRock
      BedRock
    • Reply: 64M DDR2 的 D1s tina linux 运行 tplayerdemo 内存不足直接奔溃,求解决方案。

      tplaydemo有个剪裁的版本目前没有发布,F133平台目前确实跑不起来😂 😂

      posted in D1系列-RISC-V
      BedRock
      BedRock
    • 【DIY教程】用D1哪吒开发板做一个卡牌识别机,可以玩游戏王、狼人杀、三国杀、剧本杀

      前要

      卡牌游戏从诞生之初就因为其独特的玩法和相较其他类型的游戏在休闲程度上,在其方便快捷、操作简单、自动高效的特点,迅速火遍手机游戏市场,不同厂商根据其故事题材及剧情线可制作出各式各样的卡牌动画、玩法模式,让不同年龄段的玩家都能感受到自己喜欢的剧情及游戏风格在棋牌上演绎。而在茶前饭后,朋友聚会,火遍桌游的狼人杀、炉石传说等著名的卡牌游戏,也迅速占领手机游戏市场,而在线下,有着非常著名的一些玩法,如:万智牌、游戏王、口袋妖怪卡等。卡牌游戏其魅力不仅在玩法上的多样,更在集卡集英雄时的快乐。🤣 🤣 🤣
      百度词条之卡牌游戏
      为了在集卡过程中和桌游过程中,让玩家们不在看着单调静态的卡片只将目光聚焦于玩法,同时卡牌游戏本事所具有的故事线和故事背景也值得玩家们在桌游中聚焦。

      本项目,准备使用哪吒开发板+机器视觉+多媒体技术完成一个提升卡牌游戏桌游的趣味性的小玩意。😊 😊 😊

      小项目实现方式

      思维导图:
      游戏王卡牌桌游动效展示.png
      不知道看不看的清楚🤒 🤒
      看不清楚可以留言告诉我!😳 😳 非常感谢😀 😀

      项目进展

      拍照及摄影

      拍照使用V4L2框架,对摄像头输出数据进行保存即可拍照,拍照详情见D1官方文档:
      摄影期间踩了比较多的坑。下面我一一列举:

      1.原本以为照片的集合就是视频了,然后我就是用图片叠加写入的方式,将70帧图片写入一个文件,然后发现他并不是一个视频文件。并不能通过播放器打开。

      2.通过查找资料,发现视频文件是需要专门的编码格式文件。然后就摄像头输出文件进行编码。

      • 首先尝试了JPEG照片文件应该怎么编码,发现这个数据使用MJPEG高清编码会比较好,但是没有找到对应的实现方式。需要从github上找找。(此坑等填)😨 😨 😨

      • 在网上看到有关编码的教程都是针对YUV格式的编码。然后就尝试使用YUV图片,此处可能成功但没有使用响应的软件打开(我自己电脑的问题)没有验证。但时看文件是由大小的(然后我就假装可以了)

      • 然后就针对YUV格式进行编码,在网上找到了X264的编码库,已经成功移植到板子上,但是在这边软件实现上,仍然打不开编码的文件(失败了???? (又是一个坑)👴 👴 👴

      • 我突然想到我移植了Opencv,为何不通过Opencv直接保存视频呢?然后我就写了一个简单的Opencv的程序。在Tina中 使用Opencv 的Videocopter 打不开系统摄像头?? 他找不到摄像头???? 然后就找了几个方法 1. 修改摄像头初始化的参数.set()函数。没有成功!2. 可能是设备号的问题。通过遍历打开,可能的所有设备号。也没有成功! (然后Opencv就打不开摄像头,希望这块会的大佬可以看看是什么问题)。😮 😮 😮

      • 在我个人技术实在不能通过软件的方法来实现的时候,我终于还是选择了ffmeg,通过交叉编译,将ffmpeg移植进开发板中。使用ffmpeg指令终于可以进行录像。😵 😵

      使用FFmpeg会由如下几种问题,由于FFmpeg 默认已经编码加上哪吒算力有限,其编码速度为3fps~5fps,且在编码1000张图片后就会开始提示警告。可能是哪吒算力的问题吧?吧?🤒 🤒

      最后为了 训练集的准确性和效率,我没有选择使用ffmpeg,我自己写了一个demo,可以使用开发板上的按键进行控制拍照保存图片,每次拍一组准备。开始制作数据集,上面的坑慢慢填~!!!!👻 👻 👻

      YOLOV5框架

      已在yolov5官方下载源码,并下载了yolov5的官方模型,使用官方模型跑通了测试图片。

      数据集制作

      下载了ffmpeg源码并完成了编译。等摄影程序调试好对视频进行切帧制作训练数据集。

      模型训练

      待更新。。。。。

      posted in D1系列-RISC-V
      BedRock
      BedRock
    • Reply: 请问怎么把2D加速整合到Qt?

      @cloud_d1 我给你移植好的代码包。分别支持 makefile 构建和 cmake 构建
      littlevgl-8.tar.gz

      posted in D1系列-RISC-V
      BedRock
      BedRock
    • Reply: Tina镜像打包分区状态的异常(根文件系统占用满了???)

      这种情况是正常情况.😀 😀 😀
      因为Tina 打包工具 打包的root 目录 分区默认就是按照最大占用量进行打包的,为了确保固件的准确。

      原本的固件虽然看上去跟文件系统有空间,事实上通过 mount 来查看文件系统的挂载情况

      root@TinaLinux:/# mount
      /dev/root on /rom type squashfs (ro,noatime)
      devtmpfs on /dev type devtmpfs (rw,relatime,size=503920k,nr_inodes=125980,mode=755)
      proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
      sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
      tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
      /dev/by-name/UDISK on /overlay type ubifs (rw,relatime,assert=read-only,ubi=0,vol=8)
      overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)
      devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
      debugfs on /sys/kernel/debug type debugfs (rw,noatime)
      none on /sys/kernel/config type configfs (rw,relatime)
      adb on /dev/usb-ffs/adb type functionfs (rw,relatime)
      
      

      其中root 为固件打包分区,默认为全部占用的,而在刚开始看到的/目录,此时则挂载在/overlay目录,而/overlay目录则又是在/根目录中,是怎么回事呢?🤠 🤠 🤠

      我们再来测试一下

      使用dd if=/dev/zero of=test
      读取该节点数据写入 test 文件,of = 指定了文件名在当前文件夹下。
      等待写入一会。查看当前文件ls

      root@TinaLinux:/# ls
      base                       rom
      bin                        root
      dev                        sbin
      etc                        spec
      lib                        stress
      lib64xthead                sys
      mnt                        test
      overlay                    tmp
      proc                       usr
      rdinit                     var
      riscv64-unknown-linux-gnu  www
      
      

      根文件系统中多了 test 文件,他真的 在跟文件系统中吗?
      不是!!!!😁 😁 😁
      是不是觉得被忽悠了?别怕 我们再进到 overlay/upper/ 查看文件 ls ohhhhhhhhhh🕵 🕵 🕵 你发现了 Tina 系统跟文件的真谛!!!

      root@TinaLinux:/# cd overlay/upper/
      root@TinaLinux:/overlay/upper# ls
      etc   test
      
      

      总结:Tina打包默认会将rootfs即root目录全部打包完整,而系统剩余的容量会在overlay目录中,在最开始的固件,只是将overlay也映射到了跟文件系统中,铁汁们,后面更新的固件就不要被骗了哦👌 👌 结束

      posted in D1系列-RISC-V
      BedRock
      BedRock
    • 【Take Care】The differences between Nezha and Raspberry Pi

      The D1 Nehza and noticedthat despite the Nehza having connectors that appear identical to the Raspberry Pi, they actually are not 100% compatible.

      The GPIO header is mostly compatible. Some of the higher numbered pins are listed in the datasheet as NC, meaning that some GPIOI are lacking. Furthermore, some of the secondary peripheral functions seem different.
      The Display ribbon cable connector is not physically compatible. It is still a MIPI-DSI connection, but the pinout is different. A adapter will be needed to use it with the Raspberry Pi Display.
      The "Camera" ribbon cable connector is not compatible at all. On the Nehza it is not actually a camera connector, but instead analog and digital connections for a microphone breakout board. There is no MIPI-CSI capability on the connector (from what I can tell, the only MIPI-CSI connection shares pins with the RGMII connection, which is used for ethernet)
      The 3.5mm audio jack is not entirely compatible. There is not an analog video out connection, instead there is a microphone input.
      Be sure to check the schematics (I found them on the linux-sunix wiki), before trying to use any Raspberry Pi cessories to be sure you will not break anything.

      —Copied From Gabe R .Thank you for pointing out !

      哪吒D1开发板虽然多数引脚及外设接口看起来与树莓派相同,但使用的过程中仍然有需要注意的与树莓派不兼容的地方。

      1. MIPI接口屏幕不兼容,其中IO序列不兼容,如果需要使用树莓派屏幕,则需要外加转接板才能使用。
      2. GPIO名称不同,哪吒GPIO虽然有一个IO扩展芯片,但其芯片本身印出来的引脚比较少。使用时需要参考哪吒原理图避坑。
      3. 树莓派的相机接口位置的MIPI接口不为相机接口,不带mipi功能,此接口为麦克风与按键板扩展接口。
      4. 3.5MM耳机接口为音源输出与麦克风输入,无模拟视频AV信号输出。

      在使用树莓派的模块之前,一定要对照原理图检查确保其可用引脚相互不冲突,与功能正常,以保不会烧毁任何模块。

      • 转自开发者Gabe R ,感谢指出提醒 !
      posted in D1系列-RISC-V
      BedRock
      BedRock
    • Reply: 全志开发板GPIO名命规范(全系列通用)

      @mzh111 32*GPIO(x-A) + num
      32 * 2 + 1 = 65

      posted in D1系列-RISC-V
      BedRock
      BedRock
    • 1 / 1