Navigation

    全志在线开发者论坛

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

    串口日志输出如何保存到文件?

    编译和烧写问题专区
    2
    5
    2505
    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.
    • W
      wanglang LV 5 last edited by wanglang

      在开发调试模式下,接上串口工具,上电后看到大量的启动日志输出到串口。但是生产量产后不需要这么做,因为串口需要要预留给子系统通信,所以需要较少的日志输出到串口。但是又想写入到日志文件存储到SD卡,请问这有什么方案实现吗?

      BedRock 1 Reply Last reply Reply Quote Share 0
      • BedRock
        BedRock LV 6 @wanglang last edited by

        @wanglang 一般用于debug的串口就是用来输出 系统日志,不建议做他用。

        内核日志写入SD卡,可以在应用层使用开机自启 shell脚本 自己定期进行备份。

        W 1 Reply Last reply Reply Quote Share 0
        • W
          wanglang LV 5 @BedRock last edited by wanglang

          @bedrock 这里的开机自启动脚本,是指监听串口输出写到指日志文件的方式吗?

          BedRock 1 Reply Last reply Reply Quote Share 0
          • BedRock
            BedRock LV 6 @wanglang last edited by

            @wanglang 😳 😳 草草写一下

            while true

            dmesg -c > filename_<time>
            sleep()

            10次后,打包压缩一次

            W 1 Reply Last reply Reply Quote Share 1
            • W
              wanglang LV 5 @BedRock last edited by

              @bedrock 原来是使用Linux内核命令收集日志,学到了!我还想着是否可以通过编译配置项设置呢😁

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

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

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