如何在Google Coral Dev中将bin加载到Cortex-M4 我尝试了什么?我观察到的东西问题 Linux内核支持 Linux DTS支持 Linux RPMsg支持使用remoteproc的CM4小精灵加载示例 Linux端rpmsg char驱动程序示例

如何解决如何在Google Coral Dev中将bin加载到Cortex-M4 我尝试了什么?我观察到的东西问题 Linux内核支持 Linux DTS支持 Linux RPMsg支持使用remoteproc的CM4小精灵加载示例 Linux端rpmsg char驱动程序示例

  • 当前,我正尝试从Google Coral开发中的u-boot将hello_world.bin加载到皮质m4

我尝试了什么?

  • 提出Coral开发目标
  • i.MX8MQ的
  • SDK
    • https://mcuxpresso.nxp.com/下载SDK
    • 对于处理器'MIMX8MQ6xxxJZ'(自动选择板-EVK-MIMX8MQ)
    • 为Cortex M4(基于TCM)构建hello_world.bin。在BOARD_InitBootPins
    • 中使用UART2
$ tar -xzf SDK_2.8.0_MIMX8MQ6xxxJZ.tar.gz
$ cd boards/evkmimx8mq/demo_apps/hello_world/armgcc
$ export ARMGCC_DIR=<path to>/gcc-arm-none-eabi-9-2020-q2-update/
$ export PATH=$PATH:<path to>/gcc-arm-none-eabi-9-2020-q2-update/bin
$ ./build_debug.sh 
$ ls debug/hello_world.bin 
  • 从u-boot加载hello_world.bin
    • 我已将垃圾箱放置在tftpboot位置。
Hit any key to stop autoboot:  0 
u-boot=> tftp 0x7e0000 192.168.0.33:/tftpboot/coral/boot/hello_world.bin
Using ethernet@30be0000 device
TFTP from server 192.168.0.33; our IP address is 192.168.0.133
Filename '/tftpboot/coral/boot/hello_world.bin'.
Load address: 0x7e0000
Loading: ####
         2.3 MiB/s
done
Bytes transferred = 16700 (413c hex)
u-boot=> bootaux 0x7e0000
## Starting auxiliary core at 0x007E0000 ...
  • 但是我在第二个终端ttyUSB1上看不到任何输出
  • 第二个终端上的预期输出应为Hello World

我观察到的东西

  • Coral-Dev-Board-baseboard-schematic.pdf
    • 根据底板框图,UART2/3通过转换器连接到MicroUSB
      • 但是UART1(ttymxc0)也可以在微型USB上使用
      • 内核引导后,微型USB上的UART3(ttymxc0)可用
    • 但是在内核启动后,我注意到UART3在第二个枚举端口上可用
    • 例如,
// On coral dev
root@wishful-zebra:~# ls -las /dev/ttymxc*
0 crw------- 1 mendel tty     207,16 Aug 20 03:45 /dev/ttymxc0
0 crw-rw---- 1 root   dialout 207,17 Aug 20 03:05 /dev/ttymxc1
0 crw-rw---- 1 root   dialout 207,18 Aug 20 03:40 /dev/ttymxc2

root@wishful-zebra:~# stty -echo raw speed 115200 < /dev/ttymxc2
115200
root@wishful-zebra:~# echo "test" > /dev/ttymxc2 

// prints 'test' on /dev/ttyUSB1 host side
Welcome to minicom 2.7.1

OPTIONS: I18n 
Compiled on Aug 13 2017,15:25:34.
Port /dev/ttyUSB1,23:55:15

Press CTRL-A Z for help on special keys

test

问题

  • 如何在Google Coral Dev上将固件加载到Cortex M4?
  • 要用于Google Coral Dev的哪个i.MX SDK端口?
  • 微型USB上有哪些UART?
  • Google Coral Dev中的Cortex M4使用哪个UART

解决方法

以下是启动imx8m M4并在其上运行TFLite Micro Hello World(输出正弦波)的说明: https://coral.googlesource.com/mcuxpresso_sdk/+/refs/heads/master/boards/evkmimx8mq/demo_apps/hello_world_tflite/

您需要同步项目存储库并重建linux-imx和uboot-imx。

通过USB连接串行端口时,枚举的第二个UART上将显示M4内核的输出。

,
  • 如上面接受的答案所述,我们可以使用mcuxpresso_sdk来为Coral Dev CM4构建bin / elf。
  • 此外,我想捕获细节以使用Coral存储库中的multicore_examplertos_example
  • 我还想在linux内核v4.14中对imx8mq的rpmsg / remoteproc支持上添加点,对imx8mq的必需补丁和dts支持。

FreeRTOS SDK示例-从u-boot引导CM4

    用于珊瑚开发的
  • SDK源
  • hello_world_tflite示例可以正常运行。
    • 为什么?在main.c中,调用BOARD_InitPins函数,该功能为CM4控制台(在pin_mux.c中)配置UART引脚
  • 此配置不适用于其他示例。因此,我将文件board.h,board.c,clock_config.c,clock_config.h,pin_mux.c,pin_mux.h从hello_world_tflite复制到其他示例项目。
  • 必须调用BOARD_InitPins()
  • rtos_examples/freertos_hello的示例
$ cd mcuxpresso_sdk/boards/evkmimx8mq/rtos_examples/freertos_hello/

// copy board files from hello_word_tflite example
$ cp -rf ../../demo_apps/hello_world_tflite/[pin_mux.* board.* clock_config.*] ./

// freertos_hello.c -> main -> BOARD_InitBootPins() -> BOARD_InitPins()
// Update pin_mux.c,BOARD_InitBootPins() call BOARD_InitPins()
void BOARD_InitBootPins(void)
  {
+   BOARD_InitPins();
  }

$ cd armgcc
//compile your project
// copy release/freertos_hello.bin to your SDcard/emmc/tftpboot location 
// I use tftp

u-boot=> tftp 0x7e0000 192.168.0.33:/tftpboot/coral/boot/freertos_hello.bin
u-boot=> bootaux 0x7e0000 

// Open other emulated console and verify output

从Linux Remoteproc加载CM4小精灵

Linux内核支持

Linux DTS支持

  • 这是我目前从arch/arm64/boot/dts/freescale/fsl-imx8mq-phanbell.dts发来的tst smip。 (在dts文件顶部添加)
/ {
  reserved-memory {
    #address-cells = <2>;
    #size-cells = <2>;
    ranges;

    m4_reserved: m4@0x80000000 {
      no-map;
      reg = <0 0x80000000 0 0x1000000>;
    };  
  };  
  imx8mq-cm4 {
         compatible    = "fsl,imx8mq-cm4";
         memory-region = <&m4_reserved>;
         syscon        = <&src>;
         clocks        = <&clk IMX8MQ_CLK_M4_ROOT>;
     };  
};
&rpmsg{
  /*  
   * 64K for one rpmsg instance:
   * --0xb8000000~0xb800ffff: pingpong
   */
  vdev-nums = <1>;
  reg = <0x0 0xb8000000 0x0 0x10000>;
  status = "okay";
};

&uart2{
    status="disabled";
};

&uart3{
    status="disabled";
};

Linux RPMsg支持

  • 我启用了imx rpmsg模块示例IMX_RPMSG_TTY and IMX_RPMSG_PINGPONG
  • 还启用了RPMSG_CHAR
  • 还可以在here中找到CM4应用程序侧rpmsg自述文件

  • 通过上面列出的对Linux内核和CM4 sdk应用示例的更改,我们可以使用remoteproc将elf加载到CM4,并使用pmsg_lite_str_echo_rtos示例在APU和M4之间进行通信

使用remoteproc的CM4小精灵加载示例

  • 使用remoteproc加载ddr构建hello_world.elf。 elf文件应位于珊瑚rootfs的/lib/firmware中。复制到各自的位置。
$ cd /path/to/mcuxpresso_sdk/...../hello_world/armgcc
$ ./build_ddr_release.sh 
$ sudo cp ddr_release/hello_world.elf (sdcard/emmc/nfs rootfs)/lib/firmware/

// load firmware using remoteproc
root@coraldev:~# echo hello_world_tflite.elf > /sys/class/remoteproc/remoteproc0/firmware 
root@coraldev:~# echo start > /sys/class/remoteproc/remoteproc0/state 


[  109.365150] remoteproc remoteproc0: powering up imx-rproc
[  109.372949] remoteproc remoteproc0: Booting fw image hello_world_tflite.elf,size 295228
[  109.381399] remoteproc remoteproc0: filesz 0x240 memsz 0x240
[  109.387196] remoteproc remoteproc0: da 0x80000000 mem 0x240
[  109.392959] remoteproc remoteproc0: filesz 0x1ee78 memsz 0x1ee78
[  109.399094] remoteproc remoteproc0: da 0x80000240 mem 0x1ee78
[  109.405366] remoteproc remoteproc0: filesz 0x6f4 memsz 0x6f4
[  109.411181] remoteproc remoteproc0: da 0x8001f0b8 mem 0x6f4
[  109.416945] remoteproc remoteproc0: filesz 0x0 memsz 0x3ba8
[  109.422638] remoteproc remoteproc0: da 0x8001f7c0 mem 0x3ba8
[  109.428501] remoteproc remoteproc0: remote processor imx-rproc is now up

  • 但是有时候我无法查看M4 UART控制台
  • 加载hello_world*以外的其他示例,我得到bad phdr da 0x80000000 mem 0x240。这我不确定如何解决
    • 也许dts mem reg应该更新
    • 也许正在等待对imx8mq remoteproc的官方支持
  • 但是基础学习和实验有效

Linux端rpmsg char驱动程序示例

  • 使用更新板初始化引脚编译multicore_examples/rpmsg_lite_str_echo_rtos/armgcc
  • 从u-boot加载垃圾箱
  • 在Linux启动后,将insmod imx_rpmsg_tty.ko(需要在menuconfig中启用)
// Load cm4 
u-boot=> tftp 0x7e0000 192.168.0.33:/tftpboot/coral/boot/rpmsg_lite_str_echo_rtos_imxcm4.bin
u-boot=> bootaux 0x7e0000 

// on linux side
root@coraldev:~# insmod /lib/modules/4.14.98+/kernel/drivers/rpmsg/imx_rpmsg_tty.ko 
root@coraldev:~# ls -las /dev/ttyRPMSG30 
     0 crw-rw----    1 root     dialout   235,0 Jan  1 04:52 /dev/ttyRPMSG30

root@coraldev:~# echo "hello from linux" > /dev/ttyRPMSG30 

// on CM4 console,other emulated ttyUSB1 
RPMSG String Echo FreeRTOS RTOS API Demo...

Nameservice sent,ready for incoming messages...
Get Message From Master Side : "hello world!" [len : 12]
Get Message From Master Side : "hello from linux" [len : 16]
Get New Line From Master Side

  • 我试图在这里更新我在珊瑚开发中使用CM4的所有尝试
  • 我仍然面临remoteproc的问题。
  • 我希望其中一些信息对在这篇文章中遇到绊脚石的人有所帮助

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-
参考1 参考2 解决方案 # 点击安装源 协议选择 http:// 路径填写 mirrors.aliyun.com/centos/8.3.2011/BaseOS/x86_64/os URL类型 软件库URL 其他路径 # 版本 7 mirrors.aliyun.com/centos/7/os/x86
报错1 [root@slave1 data_mocker]# kafka-console-consumer.sh --bootstrap-server slave1:9092 --topic topic_db [2023-12-19 18:31:12,770] WARN [Consumer clie
错误1 # 重写数据 hive (edu)&gt; insert overwrite table dwd_trade_cart_add_inc &gt; select data.id, &gt; data.user_id, &gt; data.course_id, &gt; date_format(
错误1 hive (edu)&gt; insert into huanhuan values(1,&#39;haoge&#39;); Query ID = root_20240110071417_fe1517ad-3607-41f4-bdcf-d00b98ac443e Total jobs = 1
报错1:执行到如下就不执行了,没有显示Successfully registered new MBean. [root@slave1 bin]# /usr/local/software/flume-1.9.0/bin/flume-ng agent -n a1 -c /usr/local/softwa
虚拟及没有启动任何服务器查看jps会显示jps,如果没有显示任何东西 [root@slave2 ~]# jps 9647 Jps 解决方案 # 进入/tmp查看 [root@slave1 dfs]# cd /tmp [root@slave1 tmp]# ll 总用量 48 drwxr-xr-x. 2
报错1 hive&gt; show databases; OK Failed with exception java.io.IOException:java.lang.RuntimeException: Error in configuring object Time taken: 0.474 se
报错1 [root@localhost ~]# vim -bash: vim: 未找到命令 安装vim yum -y install vim* # 查看是否安装成功 [root@hadoop01 hadoop]# rpm -qa |grep vim vim-X11-7.4.629-8.el7_9.x
修改hadoop配置 vi /usr/local/software/hadoop-2.9.2/etc/hadoop/yarn-site.xml # 添加如下 &lt;configuration&gt; &lt;property&gt; &lt;name&gt;yarn.nodemanager.res