Multi Source Translation Content

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Multi Source Translation Content

Discussions

Sort by:
为 i.mx8MQ 创建 Jailhouse 虚拟机监控器 Inmate cell 时出现问题 亲爱的先生, 正在尝试通过 Jailhouse 在 NXP i.MX 8MQ EVK 板中创建自定义(e-Call)Inmate linux 演示单元。 所有操作步骤均已添加到所附的 "NXP_Jailhouse_Ticket.txt "中。锉刀 面临的问题:- 我们面临编译问题, 如何编译 linux-inmate-demo.c文件并生成 .o和 .cell文件? 如何创建正确的 .bb文件,用于编译 linux-inmate-demo.c文件并生成 .o和 .cell文件并添加到最终图像中。? 请向我们提供您在创建自定义监狱囚犯牢房时有的任何应用笔记, 或者 是否有任何指向以前具有相同解决方案的恩智浦社区门票的链接? 还请纠正上述步骤并提供解决方案。 i.MX8ULP Re: Issue with Jailhouse hypervisor Inmate cell Creation for i.MX8MQ 关于如何设置网络以允许囚犯访问互联网,请参阅下文,您需要更新设置以使用 USB 网或以太网。 如何使用网络为第 2 版 Linux 设置网络 首次启动 linux 后 sysctl -w net.ipv4.ip_forward=1 sysctl -p /etc/sysctl.conf 启用根细胞后 iptables -A FORWARD -i eth1 -j ACCEPT iptables -A FORWARD -o eth1 -j ACCEPT iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE 第二次启动 linux 后 ifconfig eth1 或 2 192.168.1.4第 1 个 Linux 根单元 ifconfig eth0 192.168.1.5为第二个 Linux 囚犯牢房 "ip route add default via 192.168.1.4dev eth0" for the 2nd linux " ip route add 10.193.100.0/24通过 192.168.1.4dev eth0" 用于第二个 linux 现在,您可以"mount -t nfs 10.193.108.xx:/home/xxx/nfs/mnt" 在步骤 3 和 4 中,根据您的网络将 10.193.xx.xx 更新为您的网络 此致 Peng 开始标志。 Re: Issue with Jailhouse hypervisor Inmate cell Creation for i.MX8MQ 嗨,彭、 非常感谢你们的支持,我们可以将 "scp "从根单元复制到囚犯单元。 基本上,我们希望在囚犯手机上保留带有 MQTT 的电子呼叫应用程序。 我们可以共享从根节点到囚犯单元的读/写共享内存。此外,我们还可以按照您的建议,为 root/inmate 单元提供静态 IP。 现在,我们需要在囚犯牢房上建立互联网连接,以便将接收到的数据从根牢房传输到云端。 我们通过 USB 端口将 Quectel EC25 模块连接到恩智浦 i.MX8MQ 板。 根单元数据的 IFCONFIG: ” ifconfig eth0: flags=-28669 mtu 1500 ether 00:04:9f:05:a5:9c txqueuelen 1000(以太网) RX 数据包 0 字节 0 (0.0 B) RX 错误 0 丢失 0 超限 0 帧 0 TX 数据包 0 字节 0 (0.0 B) TX 错误 0 丢失 0 超出 0 载波 0 碰撞 0 eth1: flags=-28605 mtu 16384 inet 192.168.0.3 netmask 255.255.255.0 广播 192.168.0.255 inet6 fe80::88f0:a7ff:fe40:2407 prefixlen 64 scopeid 0x20 ether 8a:f0:a7:40:24:07 txqueuelen 1000(以太网) RX 数据包 41 字节 7030 (6.8 KiB) RX 错误 0 丢失 0 超限 0 帧 0 TX 数据包 71 字节 18812 (18.3 KiB) TX 错误 0 丢失 0 超出 0 载波 0 碰撞 0 lo: flags=73 mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1000(本地环回) RX 数据包 103 字节 9268 (9.0 KiB) RX 错误 0 丢失 0 超限 0 帧 0 TX 数据包 103 字节 9268 (9.0 KiB) TX 错误 0 丢失 0 超出 0 载波 0 碰撞 0 usb0: flags=-28605 mtu 1500 inet 192.168.225.39 净掩码 255.255.255.0 广播 192.168.225.255 inet6 2401:4900:4bb5:e7a7:609f:c3ff:fe2c:903b prefixlen 64 scopeid 0x0 inet6 fe80::609f:c3ff:fe2c:903b prefixlen 64 scopeid 0x20 ether 62:9f:c3:2c:90:3b txqueuelen 1000(以太网) RX 数据包 84 字节 7614 (7.4 KiB) RX 错误 0 丢失 0 超限 0 帧 0 TX 数据包 117 字节 13860 (13.5 KiB) TX 错误 0 丢失 0 超出 0 载波 0 碰撞 0 " 可以看到,互联网连接已在 ROOT 手机端建立。 以下是 PING 命令的输出结果 ” root@imx8mqevk:/home ping 8.8.8.8 PING 8.8.8 (8.8.8.8) 56 (84) 字节的数据。 来自 8.8.8.8 的 64 字节:icmp_seq=1 ttl=114 时间=193 毫秒 来自 8.8.8.8 的 64 字节:icmp_seq=2 ttl=114 时间=68.9毫秒 来自 8.8.8.8 的 64 字节:icmp_seq=3 ttl=114 时间=62.8毫秒 来自 8.8.8.8 的 64 字节:icmp_seq=4 ttl=114 时间=68.5 毫秒 来自 8.8.8.8 的 64 字节:icmp_seq=5 ttl=114 时间=66.5 毫秒 来自 8.8.8.8 的 64 字节:icmp_seq=6 ttl=114 时间=78.6 毫秒 来自 8.8.8.8 的 64 字节:icmp_seq=7 ttl=114 时间=71.0毫秒 ” 现在我在囚犯牢房遇到了网络问题,下面是 IFCONFIG 日志: ” root@imx8mqevk:~ ifconfig eth0 Link encap:Ethernet HWaddr 6E:58:98:59:01:A0 inet addr:192.168.0.4 Bcast:192.168.0.255 掩码:255.255.255.0 inet6 addr: fe80::6c58:98ff:fe59:1a0/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:16384 Metric:1 RX 数据包:184 错误:0 丢弃:0 超限:0 帧:0 TX 数据包:65 错误:0 丢弃:0 超限:0 载波:0 碰撞:0 txqueuelen:1000 RX 字节:78814 (76.9 KiB) TX 字节:14002 (13.6 KiB) lo Link encap:Local Loopback inet addr:127.0.0.1 掩码:255.0.0.0 inet6 地址:::1/128 范围:主机 UP LOOPBACK RUNNING MTU:65536 Metric:1 RX 数据包:22 错误:0 丢弃:0 超限:0 帧:0 TX 数据包:22 错误:0 丢弃:0 超限:0 载波:0 碰撞:0 txqueuelen:1000 RX 字节:3897 (3.8 KiB) TX 字节:3897 (3.8 KiB) ” 此外,我们还尝试在 ROOT 手机端进行 IP 转发: 允许囚犯牢房接入外部网络: 根细胞中 echo 1> /proc/sys/net/ipv4/ip_forward iptables -A FORWARD -i eth1 -o usb0 -j ACCEPT iptables -A FORWARD -i usb0 -o eth1 -j ACCEPT iptables -t nat -A POSTROUTING -o usb0 -j MASQUERADE ” 当我运行上述命令时,得到以下日志: ” root@imx8mqevk:/home iptables -t nat -A POSTROUTING -o usb0 -j MASQUERADE [ 1869.738194] audit: type=1325 audit(1755848821.593:11):table=nat 系列=2 entries=7 op=xt_replace pid=713 comm="iptables" root@imx8mqevk:/home [ 1869.749806] audit: type=1300 audit(1755848821.593:11):arch=c00000b7 syscall=208 success=yes exit=0 a0=4 a1=0 a2=40 a3=aaaafd66a400 items=0 ppid=607 pid=713 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=ttymxc0 ses=4294967295 comm="iptables" exe="/usr/sbin/xtables-legacy-multi" key=(null) [ 1869.779649] audit: type=1327 audit(1755848821.593:11):proctitle=69707461626C6573002D74006E6174002D4100504F5354524F5554494E47002D6F0075736230002D6A004D415351554552414445" ” 还将 Dmesg 日志放入根单元 ” [ 71.141601]创建了监狱牢房"ecall-linux-inmate-demo" [ 77.822386]IPv6:ADDRCONF(NETDEV_CHANGE):ETH1:链路就绪 [ 206.451703]audit: type=1325 audit(1755847158.198:4):table=nat 系列=2 个条目=0 op=xt_register pid=651 comm="iptables" [ 206.463131]audit: type=1300 audit(1755847158.198:4):arch=c00000b7 syscall=209 success=yes exit=0 a0=4 a1=0 a2=40 a3=ffffe78d01c0 items=0 ppid=607 pid=651 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=ttymxc0 ses=4294967295 comm="iptables" exe="/usr/sbin/xtables-legacy-multi" key=(null) [ 206.493176]audit: type=1327 audit(1755847158.198:4):proctitle=69707461626C6573002D74006E6174002D4100504F5354524F5554494E47002D6F0065746830002D6A004D415351554552414445 [ 206.508268]audit: type=1325 audit(1755847158.202:5):table=nat 系列=2 entries=5 op=xt_replace pid=651 comm="iptables" [ 206.519201]audit: type=1300 audit(1755847158.202:5):arch=c00000b7 syscall=208 success=yes exit=0 a0=4 a1=0 a2=40 a3=aaaabb51c230 items=0 ppid=607 pid=651 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=ttymxc0 ses=4294967295 comm="iptables" exe="/usr/sbin/xtables-legacy-multi" key=(null) [ 206.547353]audit: type=1327 audit(1755847158.202:5):proctitle=69707461626C6573002D74006E6174002D4100504F5354524F5554494E47002D6F0065746830002D6A004D415351554552414445 [ 217.506636]audit: type=1325 audit(1755847169.257:6):table=nat 系列=2 个条目=6 op=xt_replace pid=657 comm= " iptables " [ 217.517791]audit: type=1300 audit(1755847169.257:6):arch=c00000b7 syscall=208 success=yes exit=0 a0=4 a1=0 a2=40 a3=aaaaec783230 items=0 ppid=607 pid=657 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=ttymxc0 ses=4294967295 comm="iptables" exe="/usr/sbin/xtables-legacy-multi" key=(null) [ 217.547639]audit: type=1327 audit(1755847169.257:6):proctitle=69707461626C6573002D74006E6174002D4100504F5354524F5554494E47002D6F0075736230002D6A004D415351554552414445 [ 294.389911]audit: type=1325 audit(1755847246.146:7):table=filter 系列=2 entries=0 op=xt_register pid=659 comm="iptables" [ 294.401564]audit: type=1300 audit(1755847246.146:7):arch=c00000b7 syscall=209 success=yes exit=0 a0=4 a1=0 a2=40 a3=fffff5707410 items=0 ppid=607 pid=659 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=ttymxc0 ses=4294967295 comm="iptables" exe="/usr/sbin/xtables-legacy-multi" key=(null) [ 294.431369]audit: type=1327 audit(1755847246.146:7):proctitle=69707461626C6573002D4100464F5257415244002D690065746831002D6F0075736230002D6A00414343455054 [ 294.445250]audit: type=1325 audit(1755847246.150:8):table=filter 系列=2 entries=4 op=xt_replace pid=659 comm="iptables" [ 294.456430]audit: type=1300 audit(1755847246.150:8):arch=c00000b7 syscall=208 success=yes exit=0 a0=4 a1=0 a2=40 a3=aaaaeb8d3950 items=0 ppid=607 pid=659 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=ttymxc0 ses=4294967295 comm="iptables" exe="/usr/sbin/xtables-legacy-multi" key=(null) [ 294.484541]audit: type=1327 audit(1755847246.150:8):proctitle=69707461626C6573002D4100464F5257415244002D690065746831002D6F0075736230002D6A00414343455054 [ 314.598783]audit: type=1325 audit(1755847266.267:9):table=filter 系列=2 entries=5 op=xt_replace pid=662 comm="iptables" [ 314.610726]audit: type=1300 audit(1755847266.267:9):arch=c00000b7 syscall=208 success=yes exit=0 a0=4 a1=0 a2=40 a3=aaaac05eaac0 items=0 ppid=607 pid=662 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=ttymxc0 ses=4294967295 comm="iptables" exe="/usr/sbin/xtables-legacy-multi" key=(null) [ 314.640305]audit: type=1327 audit(1755847266.267:9):proctitle=69707461626C6573002D4100464F5257415244002D690075736230002D6F0065746831002D6A00414343455054 [ 849.488680]audit: type=1006 audit(1755847801.267:10):pid=671 uid=0 old-auid=4294967295 auid=0 tty=(none) old-ses=4294967295 ses=3 res=1 [ 849.501588]audit: type=1300 audit(1755847801.267:10):arch=c00000b7 syscall=64 success=yes exit=1 a0=3 a1=ffffc0aa76a0 a2=1 a3=ffff83653020 items=0 ppid=238 pid=671 auid=0uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=3 comm="crond" exe="/usr/sbin/crond" key=(null) [ 849.527425]audit: type=1327 audit(1755847801.267:10):proctitle=2F7573722F7362696E2F63726F6E64002D6E [ 1869.738194] audit: type=1325 audit(1755848821.593:11):table=nat 系列=2 entries=7 op=xt_replace pid=713 comm="iptables" [ 1869.749806] audit: type=1300 audit(1755848821.593:11):arch=c00000b7 syscall=208 success=yes exit=0 a0=4 a1=0 a2=40 a3=aaaafd66a400 items=0 ppid=607 pid=713 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=ttymxc0 ses=4294967295 comm="iptables" exe="/usr/sbin/xtables-legacy-multi" key=(null) [ 1869.779649] audit: type=1327 audit(1755848821.593:11):proctitle=69707461626C6573002D74006E6174002D4100504F5354524F5554494E47002D6F0075736230002D6A004D415351554552414445 " 您能帮助我们解决囚犯牢房的上述网络问题吗? Re: Issue with Jailhouse hypervisor Inmate cell Creation for i.MX8MQ 在 linux 中执行你的 “root” 或 “犯人” 将触发信号分段故障。 要在两个 linux 之间测试 ivshmem,可以按以下方法进行: 在根单元中: ivshmem-demo -d /dev/uio0 -t 2 在囚犯牢房中: ivshmem-demo -d /dev/uio0 -t 0 然后,你就会看到两个细胞之间的交流。 ivshmem-demo 的源代码位于 imx-jailhouse/tools/demos/ivshmem-demo.c 中。 关于如何在囚犯 Linux 启动后将文件复制到囚犯牢房、 在囚犯牢房: ifconfig eth0 192.168.0.4 在根单元中: ifconfig eth0 192.168.0.3 然后,你可以使用 scp 将文件从 root 复制到犯人。 也可以在根牢房配置 IP 转发,让囚犯访问外部网络。 Re: Issue with Jailhouse hypervisor Inmate cell Creation for i.MX8MQ 嗨,彭, 非常感谢你的回复,现在我们可以编译 cell.c 了。代码和生成的 .cell锉刀 " 自定义 ecall-inmate-linux-demo 单元创建成功,ecall-inmate-linux-demo 客户端启动并运行。 Linux主机 root imx8mqevk:~jailhouse 牢房列表 ID 名称 状态 已分配 CPU 故障 CPU 0 imx8mq 运行中 0-1 1 ecall-inmate-linux-demo 运行 2-3 ecall-inmate-linux-demo guest " 我们正在使用 /dev/uio0 设备节点进行通信。 尝试了一些 python 代码,根单元格的写入/发送成功。同时,也无法接收到任何关于 Linux 的演示。 之后,我们转入 C 语言编程代码,并附加了 "ivshmem_common.h"、'ivshmem_inmate.c'、'ivshmem_root.c',以及 Makefile。 使用以下命令生成二进制文件 源 /opt/fsl-imx-wayland/5.15-kirkstone/environment-setup-armv8a-参考发行版、系统开发套件。 export cross_compile=aarch64-参考发行版、系统开发套件。-linux-make kird=/home/automotive/yocto_imx_linux/版本/tmp/work-shared/imx/kernel-版本-Artifacts c= " aarch64-参考发行版、系统开发套件。-linux x-gcc--sysroot=$sdktargetsysRoot " arch=arm64 cross_compile=aarch64-参考发行版、系统开发套件。-Linux-aarch64-参考发行版、系统开发套件。-linux-gcc--sysroot=/opt/fsl-imx-wayland/5.15-kirkstone/sysroots/armv8a-参考发行版、系统开发套件。-l inux-Wall-O2-o 根目录 ivshmem_root.c 我们在桌面端使用 imx8mq 工具链和上述命令进行编译。 我们想将生成的二进制文件复制到 Linux 囚犯演示单元。 我们已成功复制到根单元,但不知道在 Inmate Linux 演示单元上复制或编译的步骤? ,您能提供相同的操作方法吗? 我指的是恩智浦文档 "UG10163",名称为 "iMX_Linux_user_guide_LF6.12.20_2.0.0"。 我需要一些有效的示例代码和用户指南来使用这个 Linux 演示囚犯牢房,因此从根单元传输(一些捆绑的数据,例如 JSON 或字符串/二进制)数据,反之亦然,从 Linux Inmate 演示单元接收。 谢谢, Sumit Re: Issue with Jailhouse hypervisor Inmate cell Creation for i.MX8MQ 所以,我的理解是,你遇到了投诉问题。 恩智浦有一个仓库:https://github.com/nxp-imx/imx-jailhouse 我不明白你为什么要尝试版本单元文件。仅使用make即可版本监狱和所有单元文件非常简单。即使你使用的是 Simense 仓库,该文档也说: make [KDIR=/path/to/kernel/objects] 还有我版本所有内容的命令: . /opt/fsl-imx-internal-xwayland/6.12-styhead/environment-setup-armv8a-参考发行版、系统开发套件。-linux 导出 cross_compile=aarch64-参考发行版、系统开发套件。-Linux- 取消设置 CFLAGS unset LDFLAGS make kdir=$HOME/linux/linux-LTS-NXP CC= " aarch64-poky-linux-gcc--sysroot=$sdktargetsysroot " arch=arm64 cross_compile=aarch64-POKY-LINUX-LINUX-GCC arch=arm6 Re: Issue with Jailhouse hypervisor Inmate cell Creation for i.MX8MQ 亲爱的 PENG、 非常感谢你们的建议。 我们仍面临一些问题,详情如下: 创建 .cell 的流程文件(Jailhouse Inmate 二进制文件)、SDK 编译命令: 工具链环境设置: 来源 /opt/fsl-imx-wayland/5.15-kirkstone/environment-setup-armv8a-参考发行版、系统开发套件。-linux PATH bash:/opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/bin: /opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-kirkstone/sysroots/x86_64-kirkstone/sysroots/sbin: /opt/fs l-imx-wayland/5.15-kirkstone/sysroots/x86_64-kirkstone/sysrox86_64-pokysdk-linux/bin: /opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/sbin: /opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/bin/.../x86_64-pokysdk-linux/bin: /opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-pokysdk-linux/bin/aarch64-pokysdk-linux: /opt/fsl-imx-wayland/5.15-kirkstone/sysroots/x86_64-pokysdk-linux/bin/aarch64-pokysdk-linux/bin/apoky-linux-musl: /home/automotive/.local/bin: /home/automotive/bin: /usr/local/sbin: /usr/bin: /usr/bin: /bin: /bin: /usr/bin: /bin: /usr/bin: /usr/bin: /bin: /usr/bin: /usr/bin: /usr/bin: /bin: /usr/bin: /usr/bin: /usr/bin: /bin: /usr/bin: /usr/bin: /usr/bin: /bin: /usr/b-c-i/HOME/Automotive/Jailhouse/Hypervisor/include-i/home/Automotive/Jailhouse/Hypervisor/arch/ arm64/include-i 汽车/监狱/include-nostdlib-nostartfiles-ffreestanding ecall-inux-demo.c-o ecall-inux-demo.c-o ecall-inumate-inmate-inmate-inmate-inmate-inmat 注意:-Jailhouse 头文件不是工具链的一部分,因此我们从 Seimens 的 Jailhouse 文件夹中单独下载(github 版本)。我们使用头文件 inmate-linux-demo.cell 进行编译。 我们没有对 .c锉刀 第 1 步:链接 .o 生成平面 ELF aarch64-poky-linux-ld\-ttext=0x0\-nostdlib\-o ecall-inux-demo.elf\ ecall-inux-demo.elf\ ecall-inumate-linux-demo.o -ttext=0x0 放置 .text 地址为 0x0 的部分,用于平面二进制布局。 -nostdlib阻止链接标准 C 库(队友不需要它)。 第 2 步:将 ELF 转换为原始二进制 .cell aarch64-poky-linux-objcopy\-O 二进制\ ecall-inimate-linux-demo.elf\ ecall-inumate-linux-demo.cell 验证结果:文件 ecall-inumate-linux -demo.cell 验证结果:文件 ecall-inux-demo. 打印信息: ecall-inmate-linux-demo.cell: data 删除默认的 imx8mq.cell 和 imx8mq-linux-demo.cell 生成 "imx8mq.cell 和 imx8mq-linux-demo.cell文件被推送到目标文件夹:"/usr/share/jailhouse/cells 之后,使用生成的 imx8mq.cell 启用 Jailhouse,并面临以下错误 / jailhouse enable /usr/share/jailhouse/cells/imx8mq.cell [ 2533.385877] jailhouse:不是系统配置 JAILHOUSE_ENABLE:无效参数 请提供指导,如果可能的话,请提供一些用户指南/应用笔记或 Makefile/Proper GCC 命令来解决问题。 附上 makefile(它包含所有命令,如上所述) 编译,制 作 aarch64-poky-linux-gcc-nostdlib-nostartfiles-ffreestanding-i/home/automotive/Jailhouse/Hypervisor/include-i-i/home/jailhouse/Hypervisor/include-i-home/automotive/Jailhouse/Hypervisor/include-i-home/automotive/Jailhouse/Hyp-imx8mq.o aarch64-poky-linux-ld-ttext=0x0-nostdlib-o imx8mq.elf imx8mq.elf imx8mq.elf imx8mq.o aarch64-poky-linux-ld: 警告 :找不到入口符号 _start;默认为 0000000000000000 aarch64-poky-linux-objcopy -O 二进制 imx8mq.elf imx8mq.cell 它生成了 .elf.cell 和 .o. 使用以下命令验证文件格式: 文件 imx8mq.elf imx8mq.elf:ELF 64 位 LSB 可执行文件,ARM aarch64,版本 1 (SYSV),静态链接,未删除文件 imx8mq.o imx8mq.o:ELF 64 位 LSB 可重定位,ARM aarch64,版本 1 (SYSV),未删除 文件 imx8mq.cell imx8mq.cell:数据 感谢您的支持。 苏米特 Re: Issue with Jailhouse hypervisor Inmate cell Creation for i.MX8MQ BTW: 这是不对的 "敲击 export pythonpath=/HOME/automotive/yocto_imx_linux/版本/tmp/work/x86_64-linux/jailhouse-native/0.12-r0/image/USR/Share/Jailhouse/Tools export c_include_path=/HOME/Automotive/yocto_imx_linux/版本/tmp/work/x86_64-linux/jailhouse-native/0.12-r0/image/USR/Include/Jailhouse      /home/automotive/yocto_imx_linux/版本/tmp/work/x86_64-linux/jailhouse-native/0.12-r0/image/usr/bin/jailhouse-cell-linux \      /home/automotive/yocto_imx_linux/版本/tmp/work/armv8a-参考发行版、系统开发套件。-linux/jailhouse-ecall/1.0-r0/ecall-inmate-linux-demo.c \ -o ecall-inmate-linux-demo.cell 单元格是由 GCC 编译出来的,而不是 jailhouse-cell-linux 编译出来的。 Re: Issue with Jailhouse hypervisor Inmate cell Creation for i.MX8MQ 我对 Yocto 的东西知之甚少。只需分享我的版本命令即可: . /opt/fsl-imx-internal-xwayland/6.12-styhead/environment-setup-armv8a-参考发行版、系统开发套件。-linux make kdir=$HOME/linux/linux-LTS-NXP CC= " aarch64-poky-linux-gcc--sysroot=$sdktargetsysroot " arch=arm64 cross_compile=aarch64-POKY-LINUX-V=1 然后将版本牢房。 5.10 也应类似。 也请分享您编译出来的单元格文件,让我看看 jailhouse-cell-linux 为什么会在单元格上报错。 Re: Issue with Jailhouse hypervisor Inmate cell Creation for i.MX8MQ 亲爱的彭凡 感谢您就 i.MX 8MQ 上 Jailhouse 的 IVSHMEM 内存区域提供的宝贵指导,您在回复中提供了有关状态表、RW 部分和输入/输出部分的信息。我们已经将你的建议纳入了我们的牢房配置,但是当我们尝试在i.MX 8MQ EVK板上使用Yocto 5.15 Kirkstone(Linux 5.15.71-2.2.0)创建自定义的E-Call囚犯单元时,仍然面临持续的编译错误。以下是该问题的详细摘要、我们为解决该问题所做的努力以及目前的状况。如果您能提供任何具体的参考、应用笔记或进一步的指导,以帮助我们解决这个问题,我们将不胜感激。 问题摘要 我们正在尝试编译一个自定义的 E-Call 囚犯单元配置(最初基于 `imx8mq-linux-demo.c`、现在使用简化的 "ecall-inmate-linux-demo.c"),使用 "jailhouse-cell-linux "工具。在 "jailhouse-ecall.bb "的 "do_compile "任务中编译失败配方出现以下错误: " 错误:jailhouse-ecall-1.0-r0do_compile:执行错误('/home/automotive/yocto_imx_linux/版本/tmp/work/armv8a-参考发行版、系统开发套件。-linux/jailhouse-ecall/1.0-r0/temp/run.do_compile.225085 ',1,无,无)日志数据如下:调试:执行 shell 函数 do_compile 不是单元配置:/home/automotive/yocto_im_imbild x_linux/版本/tmp/work/armv8a-参考发行版、系统开发套件。-linux/jailhouse-ecall/1.0-r0/imx8mq-linux-demo.c 警告:从 shell 命令中退出代码 1。 错误:任务(/home/automotive/yocto_imx_linux/sources/meta-ecall/recipes-jailhouse/jailhouse-cells/jailhouse-cells/jailhouse-call/jailhouse-cells/jailhouse-call.bb: " 该错误表明 `jailhouse-cell-linux` 无法识别单元配置文件。尽管多次尝试解决,但问题依然存在。 尝试解决的详细信息根据社区反馈和反复试验, 我们对Yocto配方、细胞配置和环境进行了多次更新。以下是主要工作的摘要: 1.初始设置和错误: - 以 `jailhouse-ecall.bb` 开始使用 `imx8mq-linux-demo.c`.和 `jailhouse-native.bb`基于西门子 Jailhouse fork (`git://github.com/siemens/jailhouse.git;branch=master;SRCREV=e57d1eff`)。 - 遇到与缺少`pyjailhouse`模块和不正确的`jailhouse-cell-linux`命令语法有关的错误(例如,将`-I`误解为`CELLCONFIG`)。 2。配方更新: -jailhouse-native.bb: -最初缺少标题安装(`jailhouse/types.h`,jailhouse/cell-config.h`)。更新为包含: " bitbake install -d${D}${includedir} /jailhouse cp -r${S}/include/jailhouse/*.h${D}${includedir} /jailhouse/ " - 切换到 NXP Jailhouse fork (`git://source.codeaurora.org/external/imx/imx-jailhouse.git;branch=imx_5.4.47_2.2.0;SRCREV=8bbe203`),与 `jailhouse_0.12.bb` 看齐,以兼容 i.MX 8MQ。 - 确保 `pyjailhouse_0.12.bb` 与 `jailhouse_0.12.bb` 兼容。 - jailhouse-ecall.bb: - 更正了 "jailhouse-cell-linux "命令,删除了无效的"/dev/null "参数,并使用正确的语法: " bitbake ${STAGING_BINDIR_NATIVE} /jailhouse-cell-linux \ ${S} /ecall-inmate-linux-demo.c\ -o${S}/ecall-inmate-linux-demo.cell " - 更新了 'SRC_URI',以使用 `ecall-inmate-linux-demo.c` 而非 `imx8mq-linux-demo.c`,从而专注于 E-Call 用例。 - 添加了 'export C_INCLUDE_PATH' 和 'PYTHONPATH',以确保找到头文件和 Python 模块。 3.单元配置更新: - 基于 "imx8mq-linux-demo.c "简化了 "ecall-inmate-linux-demo.c"。以及您的 IVSHMEM 指南: - 状态表:0xbfdf0000`,4 KB,只读。 - RW 部分:`0xbfdf1000`,64 KB,读/写。 - 根输出:`0xbfdfa000`, 8 KB, 读/写。 - 根输入:0xbfdfc000`,8 KB,只读。 - 包括 UART1(`0x30860000`)、RAM(`0xc0000000`,256 MB)和通信区域(`0x80000000`)。 - 删除了复杂宏(如 `JAILHOUSE_SHMEM_NET_REGIONS`),以避免解析问题。 - 配置示例片段: " .c .mem_regions= { /* IVSHMEM 状态表 */ { .phys_start= 0xbfdf0000, .virt_start= 0xbfdf0000, .size= 0x1000, .flags= JAILHOUSE_MEM_READ | JAILHOUSE_MEM_ROOTSHARED, }, /* IVSHMEM RW 部分 */ { .phys_start= 0xbfdf1000, .virt_start= 0xbfdf1000, .size= 0x10000, .flags= JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE | JAILHOUSE_MEM_ROOTSHARED, }, /* IVSHMEM 根输出 */ { .phys_start= 0xbfdfa000, .virt_start= 0xbfdfa000, .size= 0x2000, .flags= JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE | JAILHOUSE_MEM_ROOTSHARED, }, /* IVSHMEM 根输入 */ { .phys_start= 0xbfdfc000, .virt_start= 0xbfdfc000, .size= 0x2000, .flags= jailhouse_mem_read | jailhouse_mem_rootshared, }, ... } " 4。依赖关系和层配置: -在 bblayers.conf 中添加了 `meta-ecall` 和 `meta-freescale`。 - 更新了 `local.conf`: "conf IMAGE_INSTALL:append =" jailhouse jailhouse-ecall python3" DISTRO_FEATURES:append =" jailhouse virtualization" " - 验证过的 `jailhouse_0.12.bb` 使用 NXP fork 进行目标部署。 - 确保 `python3-native`、`pyjailhouse` 和头文件安装在本地系统根 (`${STAGING_DIR_NATIVE}/usr/share/jailhouse/tools/pyjailhouse/`, `${STAGING_DIR_NATIVE}/usr/include/jailhouse/`)。 5。手动测试: -手动测试的 “jailhouse-cell-linux”:" bash export pythonpath=/HOME/automotive/yocto_imx_linux/版本/tmp/work/x86_64-Linux/jailhouse-native/jailhouse-native/jailhouse-native/jailhouse-native/jailhouse-native/jailhouse-native/jailhouse-native/0.12-r0/imx/imx/版本/tmp/work/x86_64-linux/Jailhouse-native/0.12-r0/image/usr/include/jailhouse /home/automotive/yocto_imx_linux/版本e/tmp/work/x86_64-linux/jailhouse-native/jailhouse-native/jailhouse-linux/版本e/tmp/work/x86_64-linux/jailhouse-native/imx_linux/ 版本/tmp/ work/armv8a-参考发行版、系统开发套件。-linux/jailhouse-ecall/1.0-r0/ecall/inmate-linux-demo.c\ -o ecall-inmate-linux-demo.cell " - 同样的错误:`Not a cell configuration`。 - 已验证系统根内容:存在`pyjailhouse`模块、头文件和`jailhouse-cell-linux`。 当前状态 - 尽管: - 错误 `Not a cell configuration` 仍然存在。 - 简化单元配置。 - 将 `jailhouse-native.bb` 与 NXP fork 对齐。 - 确保已安装头文件和 `pyjailhouse`。 -其他配方(“jailhouse-native”、“jailhouse”)成功编译,这表明问题特定于 “jailhouse-ecall.bb” 和单元配置解析。 问题和指导请求 1.错误可能是由于恩智浦 Jailhouse fork (`imx_5.4.47_2.2.0`)和我们的电池配置之间的版本不匹配造成的吗?这个分叉中对 “jailhouse-cell-linux” 有具体要求吗? 2。有没有关于使用 Yocto 5.15 Kirkstone 在 i.MX 8MQ 上创建自定义监狱囚室的应用笔记或用户指南?我们找不到该平台的详细文档。 3.jailhouse-cell-linux "在解析复杂配置(如 IVSHMEM 区域)时是否存在已知问题?我们应该进一步简化配置吗? 4。你能不能提供参考 `jailhouse-ecall.bb`为 i.MX 8MQ 编译 `.cell` 文件的配方或示例? 5。我们可能缺少 i.MX 8MQ 上的 Jailhouse 所需的特定的 U-启动 或内核配置吗? 6。如何解决自定义配方/bb层的监狱依赖关系问题? 附加文件(供参考) -`jailhouse-ecall.bb`:更新了电子呼叫手机的配方。 -`jailhouse-native.bb`: - `ecall-inmate-linux-demo.c`:简化了 IVSHMEM 区域的配置。 - imx8mq-linux-demo.c`:原始配置(供参考)。 -详细的编译日志(如果需要,请确认如何共享)。 我们迫切希望解决这个问题,以便继续部署 E-Call 囚犯单元和测试共享内存通信。如果对我们的方法有任何见解、引用或更正,我们将不胜感激。 感谢您的支持! 致以最崇高的敬意, Sumit 注:-如果需要帮助改进响应或生成详细日志,请告诉我! Re: Issue with Jailhouse hypervisor Inmate cell Creation for i.MX8MQ 您好,Bio_TICFSL, 在您的 github 链接中,我们找到了 5.15 Kirkstone 的一些链接: https://github.com/NXP/meta-nxp-harpoon/blob/imx-linux-kirkstone/recipes-extended/jailhouse/jailhouse_%25.bbappend https://github.com/NXP/meta-nxp-harpoon/tree/imx-linux-kirkstone 这对我们的恩智浦i.mx8MQ板有帮助吗? 谢谢、 苏米特 Re: Issue with Jailhouse hypervisor Inmate cell Creation for i.MX8MQ 让我给大家支几招: 1.Documentation/inter-cell-communication.md 描述了内存的排列方式。 每个单元的 ivshmem 都需要以下区域: - 用于保存状态表的只读区域,一般为一页大小 - 所有对等点都可读写的一个区域 - 每个对等点都有一个输出区域,仅其中一个可读写 2.至 i.MX8MQ /* 00:00.0 的 IVHSMEM 共享内存区域*/ { .phys_start= 0xbfdf0000, .virt_start= 0xbfdf0000, .size= 0x1000, .flags= JAILHOUSE_MEM_READ, ===> 这是状态表。 }, { .phys_start= 0xbfdf1000, .virt_start= 0xbfdf1000, .size= 0x9000, .flags= JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE , ===> 这是 RW 部分。您可以用它来进行交流。或者把这个放大。 }, { .phys_start= 0xbfdfa000, .virt_start= 0xbfdfa000, .size= 0x2000, .flags= JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE , ==> 这是根输入/输出 }, { .phys_start= 0xbfdfc000, .virt_start= 0xbfdfc000, .size= 0x2000, .flags= JAILHOUSE_MEM_READ, ==> 这是根目录输入 }, { .phys_start= 0xbfdfe000, .virt_start= 0xbfdfe000, .size= 0x2000, .flags= JAILHOUSE_MEM_READ, ==> 这是根目录输入信息 这与 imx8mq-inmate-linux.c 中的布局相似。 您可以配置 RW 和 INPUT/OUTPUT 部分,但不要触碰状态部分。 对于 INPUT/OUTPUT,如果定义了多个区域,则每个区域的大小应相同。 此致 Peng 开始标志。 Re: Issue with Jailhouse hypervisor Inmate cell Creation for i.MX8MQ 你好 MX8MQ 没有监狱,但是可以以 github 或 6.6.36 为基础的 MX8M 系列是同一个系列BSP。 此致 Re: Issue with Jailhouse hypervisor Inmate cell Creation for i.MX8MQ 你好,Bio_TICFSL 非常感谢你的快速回复。 由于我们使用的是 i.MX NXP 8MQ EVK 板 'i.MX 8MQuad',部件号为 " TDA6637 "。 目前,我已经闪存了 Linux Yocto 5.15 Kirkstone'5.15.71-2.2.0'。 但是在你回复 “ NXP Harpoon Jailhouse integration” 时,我们需要 “i.MX Linux Yocto Project 电路板支持包 6.6.36-2.1.0 Harpoon v3 版本”,。 对于 i.MX 8MQ 板它在 5.15 之前支持 Kirkstone Image,在你的 Harpoon 用户指南中 “UG10170” 和 Github 链接为 “https://github.com/NXP/meta-nxp-harpoon/tree/imx-linux-scarthgap” 在此版本中测试了以下板: 恩智浦 i.MX 8MMini LPDDR4 EVK (imx8mm-lpddr4-evk) 恩智浦 i.MX 8MNano LPDDR4 EVK (imx8mn-lpddr4-evk) 恩智浦 i.MX 8MPlus LPDDR4 EVK (imx8mp-lpddr4-evk) 更不用说了 i.MX 8MQ 了,你能否为我们的板提供具体的监狱解决方案,或者提出其他建造囚犯牢房的可能性? 非常感谢你们的支持。 谢谢, Sumit Re: Issue with Jailhouse hypervisor Inmate cell Creation for i.MX8MQ 你好 你可以通过bbappend的配方遵循与恩智浦鱼叉监狱整合类似的方法。 参见示例:meta-nxp-harpoon/配方-extended/jailhouse/jailhouse-imx_%.bbappend 在 imx-linux-scarthgap · nxp/ Me... 用户指南: https://www.nxp.com/docs/en/user-guide/Harpoon_USERS_GUIDE.pdf 此致 Re: Issue with Jailhouse hypervisor Inmate cell Creation for i.MX8MQ @Peng [email protected] 请就我们面临的自定义监牢创建问题(如上述票单中所述)提出一些解决方案? 感谢您的支持。 请与我们联系,了解任何需要的更多细节。
View full article
The best way to build a PCB first time right with KW47 (Automotive) or MCX W72 (IoT/Industrial) Please, find the important link to build a PCB using a KW4x or MCX W7x and all concerning the radio performances, low power and radio certification (CE/FCC/IC). matthieu_baudry_0-1768238081772.pngmatthieu_baudry_0-1768238081772.png “As RF behavior are dependent of PCB layout & manufacturing; PCB prototypes (based on NXP recommendations) will have to be fine-tuned to insure the expected qualified in RF is reached on the final productized platform.” KW47 product NXP web page:  https://www.nxp.com/products/KW47 MCXW72 product NXP web page: https://www.nxp.com/products/MCX-W72 Board pages:  KW47-EVK Evaluation Kit with Bluetooth® Low Energy 6.0 KW47-LOC Localization Reference Design using KW47 MCXW72-LOC Localization Board for MCX W72 Bluetooth Channel Sounding MCU FRDM-MCXW72 Development Board for MCX W72 Wireless MCU   in addition of the product webpages please refer to KW47 Knowledge Hub Do not use pre-production or production board prior to April 2026 KW47-LOC or MCXW72-LOC platform for Channel Sounding certification - contact NXP for further note NXP Channel Sounding PAGE        (Bluetooth ®  SiG Channel Sounding Technical Overview ) More Channel Sounding enablement Available on request to NXP  Channel Sounding Fundamentals for the KW47 and MCX W72[AN14865] Fundamental Steps to Design a Channel Sounding Board - Creating a Simple PCB without Diversity[AN14832] Fundamental Steps to Design a Complex Channel Sounding Board[AN14869]        Printed Channel Sounding Antennas for the KW47 and MCX W72[AN14779] HARDWARE KW47-MCXW72-EVK HW guideline: KW47 Hardware Design Guide[UG10127] MCX W72 Hardware Design Guide[UG10273] HVQFN48 package specification: SOT619-17(D)   pending release of SOT619-17(DD)   KW47-MCXW72-EVK User Manual  KW47-LOC Board User Manual[UM12114] KW47-EVK Board User Manual[UM12094] MCXW72-LOC Board User Manual[UM12113] FRDM-MCXW72 User Manual[UM12222] Minimum BoM (attached file)  DCDC management guide (AN13831) :  Power Management Hardware (nxp.com) - KW45 applicable for KW47 waiting release of KW47/MCXW72  Design-In check list: see attached file at the bottom of this article RF matching: S parameters (attached file) Available on request    How to handle coincell application on PCB:  Coin Cell Hardware Recommendations for Kinetis Bluetooth LE Applications[AN14664] KW47-MCXW72 module can also be handled in standalone:  How to run KW47-M2 standalone RF output power level: Please note it is expected that each final PCB platform, is refine with the right RF matching and filtering, to fit your market and region mandatory certification. For instance the +10dBm at pin level can be exceeded in some configuration. It is final PCB owner responsibility to build a system (incl. all Rf path loss) with the expected target power level fitting with Bluetooth SiG Core spec and European radio certification target. Then the Tx power has to be adjusted at application level.   UFL SMA CABLE: On EVK, to connect M10 module for RF trials a µFL to SMA cable is recommended:  CSH-SGFB-200-UFFR TE Connectivity / Linx Technologies | Mouser France On KW47-LOC or MCXW72-LOC to connect SMA specific connector has to be populated: TE Connectivity Ltd CONSMA021.062-G. Warning to solder SMA connector:  please insure the PCB edge is well cut and right smooth; if not please mill a bit with a sand paper. (risk is to get SMA core line not well soldered on PCB line) Also for higher Harmonics the µFL is not convenient as connector is limited above 6GHz (an SMA has to be soldered to control RF losses ) RF matching component tolerance: Please note, on NXP EVK, FRDM and LOCalization platform the RF matching components (Inductors, Capacitors) are using the HIGH tolerance Muratasets. During your RF board tuning you may need to use low tolerance Murata set to insure all RF limits are passing. Eg: GJM1555C1H3R3CB01D is +/-0.25pF tolerance where GJM1555C1H3R3BB01 with +/-0.1pF tolerance may be preferred Eg2: LQG15HS1N3S02D  is +/-0.3nH tolerance where LQG15HS1N3B02D   with +/-0.1nH tolerance may be preferred KW47 from KW45 hardware porting :  KW47 is pin to pin compatible with KW45. However from HW point of view, some components values will have to be adjusted like RF matching components values. Other components around KW4x are not foreseen as to change based on current silicon validation.  Please also note some new muxing is in place to get new features of KW47 on pins. For instance on KW47 a second Flex CAN is available. See attached file RADIO RF report:         AN14461: KW47-EVK RF System Evaluation Report for Bluetooth Low Energy Applications | NXP Semiconductors KW47-LOC RF System Evaluation Report for Bluetooth Low Energy Applications        AN14580: MCX W72 RF System Evaluation Report for Bluetooth and IEEE.802.15.4 Applications | NXP Semiconductors Radio co-existence:  Kinetis Wireless Family Products Bluetooth Low Energy Coexistence with Wi-Fi Application (nxp.com) pending release of KW47/MCXW72  Antenna:  Compact Planar Antennas for 2.4 GHz Communication Designs and Applications within NXP EVK Boards Printed Channel Sounding Antennas for the KW47 and MCX W72[AN14779] Return loss (S11) measurement: How to measure the return loss of your RF matching (S11) part of the RF report (AN13728) Loadpull: Loadpull Test Report for KW47[AN14696] SW tools for RF trials:     IoT Tool box (mobile application)     Connectivity test tool for connectivity products (part of the IoT toolbox)     DTM: How to use the HCI_bb on Kinetis family products a... - NXP Community https://community.nxp.com/t5/Wireless-Connectivity-Knowledge/BLE-HCI-Application-to-set-transmitter-... CRYSTAL   Recommended Crystal attached   Articles: KW47/MCX W72 32MHz & 32kHz Oscillation margins - NXP Community  32 kHz Crystal-less Mode on KW47[AN14884]   Please note for Channel Sounding feature with higher 10dBm transmit output, some specific care have to be taken adding to pass all harmonics on all Bluetooth Channels: see "32 MHz crystal harmonics design recommendations" chapter in "AN14826: KW47-LOC RF System Evaluation Report" where an extra inline inductor on Xtal path may be needed. LowPower      All power profiling tools are available in this NXP community web page:              KW35, KW38, KW45, KW47 & MCX W71, MCX W72 & MCX W23 Power Profile Tools (including Localization)      Bluetooth LE power profile estimator Tool               KW45_WK47_MCXW71_MCXW72_BLE_power_profile_calculator vx.x.xls              AN14554 Kinetis KW47 & MCX W72 Bluetooth LE Power profile analysis release.pdf      802.15.4 Matter & Zigbee power profile estimator Tool               MCX W7x 802.15.4 Matter ICD SIT LIT & ZED Power profile vx.x.xls               AN MCX W72 802.15.4 Matter and Zigbee Power profile analysis.pdf      CCC Channel Sounding BLE power profile estimator Tool               KW47 Digital Key CCC CS Power Estimator tool vx.x.xls               AN14628_AN14628_KW47_CCC_CS_Power_Profile_estimator tool_release.pdf CERTIFICATION RF full certification of KW47/MCXW72  available on board product pages KW47 and MCXW72 are Bluetooth 6.x channel Sounding certified!
View full article
i.MX Yocto Project: bitbake を使用して Freescale Yocto イメージをビルドするにはどうすればよいですか? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 1. Freescaleのgithubリポジトリ から、最後の bitbake コマンドを除くすべての手順に従います 2. フリースケールがサポートするイメージは、 meta-fsl-demos/recipes-fsl/images フォルダにあります。 3. 標準の Freescale イメージをベイク処理します ビルド$ bitbake fsl-image-gui 4. 生成された Linux イメージは、いくつかの形式でパッケージ化されています。 .sdcard1つのファイルにすべてのシステム(u-boot + uImage + rootfs)が含まれているため、SDカードに直接書き込むことができます build$ sudo dd if = tmp / deploy / images / fsl-image-gui-imx6qsabresd.sdcard of = / dev / sdX b = 4M メモ: 建物の問題が発生した場合は、このリンクをクリックしてください 起動の問題が発生した場合は、以下を確認してください: 1. ボードのDIPスイッチが正しく設定されている 2.ベーキングする前に正しいマシンを選択しました 問題が解決しない場合は、コミュニティに報告してください Yocto Project Re: i.MX Yocto Project: bitbake を使用してフリースケールの Yocto イメージをどのようにビルドできますか? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> ウルトラライトボード用のlibsubはどこにありますか? Re: i.MX Yocto Project: bitbake を使用してフリースケールの Yocto イメージをどのようにビルドできますか? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> リンク。 Re: i.MX Yocto Project: bitbake を使用してフリースケールの Yocto イメージをどのようにビルドできますか? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> それは便利です。ありがとうございます。これらの各画像のどこかに説明がありますか? Re: i.MX Yocto Project: bitbake を使用してフリースケールの Yocto イメージをどのようにビルドできますか? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 私はこれに少し慣れていませんが、この指示はまだ有効ですか? 私は指示に従いましたが、 "build $ bitbake fsl-image-gui"ステップに到達すると、 しばらく処理してから次の処理が行われます。 エラー: 何も 'fsl-image-gui' を提供しません。接戦: FSL -イメージ-マルチメディア 私は今走っています ビルド$ bitbake fsl-image-multimedia Re: i.MX Yocto Project: bitbake を使用してフリースケールの Yocto イメージをどのようにビルドできますか? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> すみませんが、ちゃんと理解できませんでした。 あなたは成功しましたか? Re: i.MX Yocto Project: bitbake を使用してフリースケールの Yocto イメージをどのようにビルドできますか? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> GITが本当にプロキシスクリプトを使用しているかどうかを確認しようとします。たぶん、straceか何かを使用してデバッグします。 私はプロキシユーザーではないので、あまり助けにはなりませんが、それについてopenembedded-usersメーリングリストで尋ねることができるかもしれませんか? Re: i.MX Yocto Project: bitbake を使用してフリースケールの Yocto イメージをどのようにビルドできますか? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 私はあなたが 'socat'ユーティリティを欠いていると思います。 $: sudo apt-get インストール socat Re: i.MX Yocto Project: bitbake を使用してフリースケールの Yocto イメージをどのようにビルドできますか? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> よくわかりません。Yocto Projectメーリングリストでこの質問をしてください。 Re: i.MX Yocto Project: bitbake を使用してフリースケールの Yocto イメージをどのようにビルドできますか? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> Flexcan のカーネルサポートを追加するにはどうすればいいですか? すべてのボード FlexCAN
View full article
P2020-MSC8156AMCRD: P2020-MSC8156 AdvancedMC™ Reference Design Block Diagram Features Block Diagram Board Design Resources Block Diagram The NXP® P2020-MSC8156 AdvancedMC™ (AMC) reference design is a multi-standard baseband development platform for the next generation of wireless standards such as LTE, WiMAX, WCDMA and TD-SCDMA. This AMC platform integrates the QorIQ® P2020 processor with its MSC8156 DSP A P2020 and MSC8156 mezzanine card provide the system building blocks to enable rapid prototyping systems Ideal for developing solutions for the next generation of wireless standards Features Key P2020-MSC8156 AMC Reference Design Features: Single width, full height AMC form factor QorIQ ®  P2020 processor Dual e500v2 cores at 1.2 GHz 1 GB of DDR2 (SOCDIMM) TCP/IP acceleration eSDHC USB MSC8156 DSP Six SC3850 cores, built on StarCore ®  technology, at 1 GHz each Multi Accelerator Platform Engine for Baseband (MAPLE-B) Programmable Turbo and Viterbi decoder Two banks of 512 MB 64-bit DDR3-800 Block Diagram Board Design Resources Legacy Designs
View full article
车辆动力学:通过 IGBT 栅极驱动集成驱动器的进步简化高压/大电流逆变器 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 本课程将对高压 (HV) 电力进行深入的系统分析,我们将回顾 MCU、GDIC 和 IGBT 如何单独运行以及作为一个系统运行。我们将讨论 EV 和 HEV 电力系统和组件,以实现高效、安全的 HV 电机驱动。使用 NXP 新型 HV IGBT GDIC、GD3100 和 Fuji GEN 7 IGBT 模块的系统框图和示波器屏幕截图,我们将考虑如何实现更小、更高效和更低成本的 HV 逆变器设计。我们将审查 SPI 接口可编程性,该可编程性使任何 IGBT 都能进行调整以实现最高效率、热设计考虑、布局考虑、功率预算评估、上电排序、管理短路故障、温度监控和高级功能达到系统 ASIL D 级和 ISO26262 认证。 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 本课程将对高压 (HV) 电力进行深入的系统分析,我们将回顾 MCU、GDIC 和 IGBT 如何单独运行以及作为一个系统运行。我们将讨论 EV 和 HEV 电力系统和组件,以实现高效、安全的 HV 电机驱动。使用 NXP 新型 HV IGBT GDIC、GD3100 和 Fuji GEN 7 IGBT 模块的系统框图和示波器屏幕截图,我们将考虑如何实现更小、更高效和更低成本的 HV 逆变器设计。我们将审查 SPI 接口可编程性,该可编程性使任何 IGBT 都能进行调整以实现最高效率、热设计考虑、布局考虑、功率预算评估、上电排序、管理短路故障、温度监控和高级功能达到系统 ASIL D 级和 ISO26262 认证。
View full article
INS-N1981 Wireless MCU Overview As the Smart Home starts to gather momentum, a number of competing Wireless Communication standards are fighting for dominance. With ZigBee® now becoming dominant in the low-power networking market, there is no surprise that two new low power technology Thread and Bluetooth® Low Energy with the new Mesh capability are both trying to enter this market to get a piece of the cake. Moreover competing IoT platforms from the Thread Group (Google/Nest), Allseen Alliance (Qualcomm), Apple's Homekit, the Open Interconnect Consortium (Intel) and many others are creating even more confusion. So in this confusing array of Wireless Communication standards and Iot platforms, what are the main features of each and what does it means for NXP? This session will provide an overview of these Wireless connectivity standards and IoT platforms, their capabilities, and their implication for NXP IoT. Watch Video Presentation As the Smart Home starts to gather momentum, a number of competing Wireless Communication standards are fighting for dominance. With ZigBee® now becoming dominant in the low-power networking market, there is no surprise that two new low power technology Thread and Bluetooth® Low Energy with the new Mesh capability are both trying to enter this market to get a piece of the cake. Moreover competing IoT platforms from the Thread Group (Google/Nest), Allseen Alliance (Qualcomm), Apple's Homekit, the Open Interconnect Consortium (Intel) and many others are creating even more confusion. So in this confusing array of Wireless Communication standards and Iot platforms, what are the main features of each and what does it means for NXP? This session will provide an overview of these Wireless connectivity standards and IoT platforms, their capabilities, and their implication for NXP IoT. Watch Video Presentation Insight & Innovation
View full article
INS-N1981 ワイヤレスMCUの概要 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> スマートホームが勢いを増し始めると、多くの競合する無線通信規格が覇権を争っています。ZigBee®が低電力ネットワーク市場で支配的になりつつある今、新しいMesh機能を備えた2つの新しい低電力技術であるThreadとBluetooth® Low Energyが、どちらもこの市場に参入しようとしていることは驚くことではありません。さらに、Thread Group(Google/Nest)、Allseen Alliance(Qualcomm)、AppleのHomekit、Open Interconnect Consortium(Intel)、その他多くの競合するIoTプラットフォームが、さらに混乱を招いています。では、この紛らわしい一連の無線通信規格とIoTプラットフォームでは、それぞれの主な機能は何であり、NXPにとって何を意味するのでしょうか。このセッションでは、これらのワイヤレス接続規格とIoTプラットフォームの概要、それらの機能、およびNXP IoTへの影響について説明します。 ビデオプレゼンテーションを見る <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> スマートホームが勢いを増し始めると、多くの競合する無線通信規格が覇権を争っています。ZigBee®が低電力ネットワーク市場で支配的になりつつある今、新しいMesh機能を備えた2つの新しい低電力技術であるThreadとBluetooth® Low Energyが、どちらもこの市場に参入しようとしていることは驚くことではありません。さらに、Thread Group(Google/Nest)、Allseen Alliance(Qualcomm)、AppleのHomekit、Open Interconnect Consortium(Intel)、その他多くの競合するIoTプラットフォームが、さらに混乱を招いています。では、この紛らわしい一連の無線通信規格とIoTプラットフォームでは、それぞれの主な機能は何であり、NXPにとって何を意味するのでしょうか。このセッションでは、これらのワイヤレス接続規格とIoTプラットフォームの概要、それらの機能、およびNXP IoTへの影響について説明します。 ビデオプレゼンテーションを見る インサイト&イノベーション
View full article
FIR滤波器套件 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 本内容最初由 Steve Sabram 贡献给 lpcware.com 该示例项目使用 LPC4350 演示板和 ARM CMSIS DSP 库实现了声学范围、有限无限响应 (FIR) 滤波器。科幻“电击枪”的声音资源从演示板的耳机插孔中播放出来。该声音样本非常适合演示,因为它在声学带中具有许多低频、中频和高频成分。您可以通过触摸演示板上的电容式触摸按钮来播放声音资源,如演示板 LCD 上显示的菜单所示。最好使用耳机或耳塞聆听声音。四个按钮分别播放相同的声音资源 不同之处: 1) Raw – 未处理的声音按照其格式播放(采样率为 44.1 kHz、16 位样本和单声道)。 2) 低通——通过低通巴特沃斯滤波器滤波,截止频率为 5 kHz,类似于普通模拟电话的带宽。播放时,请注意高音部分被移除,类似 通过电话听到的声音。 3) 高通——通过高通巴特沃斯滤波器滤波,低频截止频率为 8 kHz。请注意,由于仅播放高音谐波成分,因此音量较低。 4) 后向掩码——声音资源样本以相反的顺序播放。“Zap!”现在变成了“Zoup!”数字滤波器是使用广受欢迎的公共领域工具 WinFilter ( http://www.winfilter.20m.com/ ) 设计的。 伴随这个例子。随着 NXP 推出这款免费 DSP 设计工具,我希望它的作者能够扩展其功能。 用户内容
View full article
LPC177x_8x u-boot端口 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 该项目解释了如何使用 LPC177x_8x 设备为平台构建和部署 u-boot。要构建 u-boot,您需要运行 Linux 操作系统的系统、适用于 Linux 操作系统的最新 CodeSourcery GNU 工具、u-boot 源代码以及适用于 LPC1788 的 u-boot 补丁。 已实现的功能 -------------------------------------------------------------------------------- 支持带有 32 位 DRAM(32MB)的 EA1788 主板 支持EA1788板的NAND FLASH 支持LPC177x_8x内部FLASH 以太网支持 有限的 MPU 支持 u-boot 已知问题 -------------------------------------------------------------------------------- 问题:“重置”命令导致电路板崩溃 解决方法:改用“cmreset”命令 问题:“boot”命令导致主板崩溃 解决方法:使用环境变量和 go 命令编写脚本 问题:bootvx 命令导致主板崩溃 解决方法:无,但没有理由使用此命令 未实现的功能 -------------------------------------------------------------------------------- FLASH“保护”命令和功能未实现(易于实现) 未实现中断/NVIC 支持(易于实现) 可能的改进 -------------------------------------------------------------------------------- Systick 可以代替 LPC1788 匹配定时器 重定位代码已被“绕过”,并且未正确实施 针对设备特定 IRQ 的宏文件,即需要包含弱链接 在启动文件中(特定于架构的设备覆盖) 有一个基本的 MPU 驱动程序,似乎可以工作,但可以改进 以太网驱动程序和 PHY 设置是“特定于板的”,但可以移动 到驱动程序区域,可以使用通用 PHY 支持 u-boot 启动操作概述 -------------------------------------------------------------------------------- 以下是 u-boot 如何在 LPC1788 上启动的概述。 - LPC1788 启动 ROM 将控制权转移到内部 FLASH 中的 u-boot 代码 每个 CM3 启动过程的地址 0x0 - u-boot 代码首先设置 MPU - 引脚复用、时钟和 DRAM 均已初始化 - 代码和数据从 FLASH 迁移到 DRAM - DRAM 中的 BSS 段被清除 - 控制权转移到 DRAM 中的 u-boot 代码 - 调用 u-boot board_init_f() 进行初始 u-boot 设置 - board_init_r() 用于稍后的 u-boot 设置 - u-boot 在 DRAM 之外正常运行 移植文件的位置 -------------------------------------------------------------------------------- arch/arm/cpu/cortex-m3 - Cortex M3 特定文件(mpu、启动等) arch/arm/cpu/cortex-m3/lpc1788 - LPC1788 特定文件(计时器、串行等) arch/arm/include/asm/arch-cortex-m3 - Cortex M3 头文件 arch/arm/include/asm/arch-lpc17xx - LPC177x_8x 特定的头文件 board/nxp - 使用 NXP 设备的电路板专用区域 board/nxp/ea1788 - EA1788 板特定文件(设置、nand 等) include/configs/ea1788.h - EA1788 板特定配置文件
View full article
FTF-IND-F1348 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 本课程基于 FRDM-K22F 开发板和多功能新型 Arduino 兼容 Shield,讨论如何实现:使用 Kinetis K2 和 LS Research 预认证的 Wi-Fi(TiWi-CW)和 BLE(SaBLE-x)无线模块的物联网应用。使用 TiWiConnect LIFT 软件协议流式传输到云端(大大简化了软件开发)。使用与 Freescale Freedom 板连接的第三方 Pmod 兼容(I2C 和 SPI)板进行传感器和 I/O 扩展。使用加速软件开发和预认证无线模块,加快您的物联网产品的上市时间。 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 本课程基于 FRDM-K22F 开发板和多功能新型 Arduino 兼容 Shield,讨论如何实现:使用 Kinetis K2 和 LS Research 预认证的 Wi-Fi(TiWi-CW)和 BLE(SaBLE-x)无线模块的物联网应用。使用 TiWiConnect LIFT 软件协议流式传输到云端(大大简化了软件开发)。使用与 Freescale Freedom 板连接的第三方 Pmod 兼容(I2C 和 SPI)板进行传感器和 I/O 扩展。使用加速软件开发和预认证无线模块,加快您的物联网产品的上市时间。
View full article
DAC PDB DMA Vybrid The attached project shows a configuration for the DAC and its functionality is explained in the below points: The PDB triggers the next DAC conversion. The DAC features an internal buffer (DAC_DATx) that contains that data to be converted. The DAC data to be converted is determined by  an internal pointer. This internal pointer increases or moves to the next element in the buffer on every PDB trigger The DAC uses the Data Buffer as normal mode. This means that the buffer works as a circular buffer. When the internal pointer reaches some point in the internal buffer, the DMA is triggered and it transfers the new data from an iRAM buffer to the DAC internal buffer. In this specific example the DMA treats the source as a circular buffer, because the source buffer size is 512 bytes but the destination (DAC_DATx) buffer is 8 bytes. The below figure represents the configuration of the example: The frequency of each output sample is determined by the source frequency of the PDB and the DACINT value. Sample_Output_Frequency =  Source_Frequency/ [(PDB_MULT * PDB_PRESCALER) * (DACINT + 1)] In the attached example the Bus Clock = 66MHz., PDB_MULT = 1 ,  PDB_PRESCALER = 128, DACINT = 63 For the 256 elements to convert the frequency of the output signal is 31.47Hz. (Sine Wave) VF6xx
View full article
フリースケール・カップ・ワールドワイド・ファイナル2015トレーニング・ハイライトをご覧ください <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> トレーニング・セッションについては、フリースケール・カップ・ワールドワイド・ファイナル2015のハイライト・ビデオをご覧ください。クレジット:Fraunhofer IIS (マイビデオで視聴) フリースケール・カップの内容
View full article
S32K344 - Six-step commutation control S32K344 - Six-step commutation control These examples demonstrate a a 3-phase Brushless DC (BLDC) motor control drive using a Six-step commutation control with Hall position sensor and without any position sensor (sensorless). This design serves as an example of motor control design using NXP S32K3 automotive family. tomasfedor_0-1707467166083.png Examples were designed on S32K344 Brushless Direct Current and Permanent Magnet Synchronous Motor Control Development Kit.  tomasfedor_4-1707405434276.png C-project based examples are part of MCSPTE1AK344 Development Kit Application Software. An innovative drivers set, Real-Time Drivers (RTD),are used to configure and control the MCU. It complies with Automotive-SPICE, ISO 26262, ISO 9001 and IATF 16949. Production-ready Automotive Math and Motor Control Library set provides essential building blocks for algorithm. FreeMASTER is used as useful run-time debugging tool. Application software contains:  MCSPTE1AK344_BLDC_6Step_hall_ll-. Hall sensor-based example. Detailed description of the example can be found in attachment to this article MCSPTE1AK344 - 6-step hall.pdf. MCSPTE1AK344_BLDC_6Step_sensorless_ll – Sensorless based example. Detailed description of the example can be found in attachment to this article MCSPTE1AK344_- 6-step sensorless.pdf. MATLAB Simulink based project (Motor Control BLDC Example - s32k344_mc_bldc_ebt) is build using Model-Based Design Toolbox (MBDT) and can be downloaded from NXP Model-Based Design Toolbox for S32K3xx - version 1.4.0 or newer releases.
View full article
通用更新工具 (UUU) <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 开始使用适用于 i.MX 系列的 UUU 工具。新型固件下载工具“通用更新工具”概述,该工具已取代原有制造工具。 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 开始使用适用于 i.MX 系列的 UUU 工具。新型固件下载工具“通用更新工具”概述,该工具已取代原有制造工具。 i.MX 应用处理器
View full article
NFC Reader Library Migration to FRDM-MCXN947 Introduction. This document provides a guide on how to use the NFC frontend PN5190 with the FRDM-MCXN947 and using the latest existing version of the NFC Reader Library. The hardware required to follow this guide is: FRDM-MCXN947 development board as host MCU. PNEV5190BP (based on PN5190) as the NFC transceiver Software Setup. MCXN947 SDK version: 26.06.00 NFCReaderLibrary version: 07.16.00 PN5190 FW version: 0x20D MCUxpresso IDE version: 25.6 Hardware connections. The PNEV5190 comes with a Kinetis K82F as a host MCU to drive the PN5190 Since the goal is to drive PN5190 from the MCXN947 via SPI, we need to prepare the PNEV5190 for it: Power up board correctly Enable external SPI pins Disable K82F interface with PN5190 Power up and jumper configuration To power up the board correctly: – Powering it up over USB does not provide enough current. It will be powered with an external power supply of 7.5V over connector J17. Put jumper on following pins: – J9 2-3: External power supply – J8: VBATPWR supplied with VBAT=3.3 V – J12: VBAT supplied with 3.3 V Remove jumpers on following pins: – J22, J23: open SDA signals for K82F – J19: RTS push-button bypass for K82F – J3, J4, J5, J6: pull down jumpers for NFC module signals Set GPIO and SPI voltage to 3.3 V: supplying 3.3 V to VDDIO and the μC supply: – Remove short circuit on R19 – Place short circuit on R20 For any additional configuration, please see PNEV5190B evaluation board quick start guide. Location of the changes mentioned above can be seen in the following image: Habib_MS_0-1781132345846.png Routing NFC module communication pins to JP1 To enable the pins on JP1 for communication, we must enable bus switch U10 and disable bus switch U12 in the NFC Host Interface. These switches enable or disable the connections from K82 to PN5190 SPI pins, and expose the SPI interface to an external host. Remove short on R5 to disable communication routing to K82F. Place short on R7 to enable communication routing to JP1 pins. Habib_MS_2-1781132571269.png For FRDM-MCXN947 side, no modifications are necessary.  The pins used are available in Header J1 and J2. Which are shown in the following table.   Name MCXN947 PN5190 SCK J2.12 JP1.1 MOSI J2.8 JP1.2 MISO J2.10 JP1.3 SSEL J2.6 JP1.4 IRQ J1.16 JP1.5 RESET J2.2 JP6.1 GND J2.14 JP1.10 SUCCESS J2.17* FAIL J2.15* DWL J2.13* * Pins that need to be configured for library compatibility but are not used and do not need to be connected. Software Changes This section describes the software changes required to run the “NfcrdlibEx1_DiscoveryLoop” example from the NFC Reader Library which consists in a detection loop that displays in a terminal information (like UID, SAK, and Product Type for MIFARE product-based cards) about any tag detected by the PN5190. Please download the NFC Reader Library for PN5190 from NFC Reader Library | NXP Semiconductors. To begin with the migration, we first need to create a project with the FRDM-MCXN947 SDK (v26.06.00), for this purpose download and install the FRDM-MCXN947 SDK from the SDK Builder. Importing NFC Reader Library Click on “File” from upper tab menu and “Import…”. In the Import wizard, select “Existing Projects into Workspace”. In the “Select root directory” search the directory where the downloaded library is located and click on Finish (do not check the “Copy projects into workspace” option). Habib_MS_0-1781133143312.png Note: If the K82 SDK is not installed an error message will appear, please click on cancel. Habib_MS_0-1782234443148.png Creating base project 1. In the Quick Start panel click on “import SDK example(s)…” in the MCUXpresso IDE. 2. Select “frdmmcxn947” and click on next. Habib_MS_1-1781133200020.png 3. Select the SDK example “hello_world_cm33_core0” and click on finish. Habib_MS_2-1781133254045.png 4.Now we will add the required drivers for migration, which are SPI and CTIMER drivers. . Click on properties-> SDK Management-> Manage SDK Components. Habib_MS_3-1781133444305.png 5. Search in the filter bar “ctimer” and “lpspi” and check their boxes to add them and click on OK. Habib_MS_5-1781133510047.png Habib_MS_6-1781133576098.png Add the source code Discovery Loop Example From the imported example NfcrdlibEx1_DiscoveryLoop_mcux of the NFC Reader Library, find and copy the following files (included in src folder): NfcrdlibEx1_EmvcoProfile.c, phApp_Helper.c, phApp_Init.c, phApp_PN5190_Init.c; and paste them into the source folder inside the created base project. Additionally, delete the file hello_world .c created by the project. Habib_MS_0-1781134009079.png             Habib_MS_1-1781134021054.png Additionally, we need to add the file “NfcrdlibEx1_DiscoveryLoop.c” which is the main source file of the project, to do this right-click on the “source” folder of our project and then put the cursor on “New” and select “File”. Habib_MS_2-1781134090137.png In the tab that will open, write the name of the file (NfcrdlibEx1_DiscoveryLoop.c) and then, click on “Finish”. Habib_MS_3-1781134114470.png Finally, in the created file copy and paste all the code inside the original source file located in the library example. Habib_MS_4-1781134170782.png Habib_MS_5-1781134196935.png Link the NFC Reader Library elements To make the required software changes, we need to link the DAL, NxpNfcRdLib, phOsal and intfs folders into the base project, to do this: 1. In the Project Explorer, right click on the project and place your cursor on New and click on Folder. 2. In the New Folder tab, click on “Advanced >>” and select “Link to alternate location (Linked Folder)” and on “Browse…”. Habib_MS_6-1781134337471.png 3. Browse into the path where the library was extracted, choose the NxpNfcRdLib folder and click on Finish. Habib_MS_7-1781134383646.png 4. Do the same procedure for “Platform/DAL”, “Examples/NfcrdlibEx1_DiscoveryLoop/intfs” and “RTOS/phOsal” folders. If you have the folder in the same project explorer, the included folder will not appear, but you can see it when you open the window to add another folder, as shown in the following figure. Habib_MS_8-1781134451238.png But if the included folders are not in the Project Explorer, the Project should look like this: Habib_MS_9-1781134500816.png Once this is done, we will need to delete the “KinetisSDK” folder located in “DAL > src” to avoid multiple definition issues. Habib_MS_10-1781134521814.png Define FRDM-MCXN947 SDK preprocessor symbol We need to do some changes to the compiler preprocessor configuration. 1. Right click on the project in the Project Explorer and click on “Properties… Habib_MS_0-1781134734232.png 2. In the properties tab, go to “C/C++ Build > Settings > MCU C Compiler > Preprocessor”. The symbols are related with the FRDM board, but we need to add the following symbols related with the NFC Reader Library: PH_OSAL_NULLOS PHDRIVER_FRDMMCXN947_PN5190_BOARD NXPBUILD_CUSTOMER_HEADER_INCLUDED PHDRIVER_MCXN947_SPI_POLLING Habib_MS_1-1781134774044.png Click on the “Add...” button at the top right corner of the “Defined symbols (-D)” menu and enter each symbol mentioned before. Habib_MS_0-1782235762579.png These symbols are added so the preprocessor knows which header files to include at build time. PHDRIVER_FRDMMCXN947_PN5190_BOARD will help include the BoardSelection.h header, the file that is going to define addresses for registers and peripherals of MCXN947. PH_OSAL_NULLOS will include headers related to non-OS operation, meaning that the project will work without any operative system (at the end of this guide you will find the steps to add FreeRTOS support). NXPBUILD_CUSTOMER_HEADER_INCLUDED will add headers to add and select the NFC reader and host that will be used in the project. PHDRIVER_MCXN947_SPI_POLLING if is defined the example will perform SPI communication by polling method, and if not, will be perform through non-blocking transfers. 3. Once added, click on “Apply and Close”, "Rebuild Index" and then to “Yes” to save the changes. Modifying the Driver Abstraction Layer (DAL) The added linked folder DAL will contain the important changes to be able to use the MCXN947 as host device since it will contain all the changes regarding SPI, timer and GPIO configurations required by the library to work properly. Board_FRDM_MCXN947_PN5190.h We need to create a header file that will contain important macros used by the library that are related to the host specific SPI, timer and GPIO peripherals, as well as interrupt vectors and priorities, clock sources and addresses. This file is required to be inside the “boards” folder which is inside DAL. Please add the header file as the file created NfcrdlibEx1_DiscoveryLoop.c but replacing .c to .h: Habib_MS_1-1782236163267.png Habib_MS_0-1781196980059.png The file should be named as shown in the picture above. Inside this file, some important macros related to the SPI peripheral and the important pins to be handled (IRQ, Chip Select, Reset) are defined. Habib_MS_1-1781196999826.png Spoiler (Highlight to read) #ifndef DAL_BOARDS_BOARD_FRDM_MCXN947_PN5190_H_ #define DAL_BOARDS_BOARD_FRDM_MCXN947_PN5190_H_ #define GPIO_PORT 0 #define GPIO_PORT1 1 /****************************************************************** * LPSPI clock configuration ******************************************************************/ /*Clock Frequency for SPI Flexcomm 1*/ #define SPI_CLOCK_FREQ (CLOCK_GetLPFlexCommClkFreq(1u)) #define SPI_MASTER_CLOCK_FREQ SPI_CLOCK_FREQ /****************************************************************** * Board Pin/Gpio configurations ******************************************************************/ #define PHDRIVER_PIN_RESET ((GPIO_PORT << 8) | 28) /**< Reset pin, Pin28, PIO0_28 */ #define PHDRIVER_PIN_IRQ ((GPIO_PORT << 8) | 31) /**< IRQ pin, Pin10, PIO0_10 */ /* For 5190 busy is same as IRQ */ #define PHDRIVER_PIN_BUSY ((GPIO_PORT << 8) | 31) /**< IRQ pin, Pin31, PIO0_31 */ #define PHDRIVER_PIN_DWL ((GPIO_PORT << 8) | 19) /**< Download pin, Pin19, PIO0_19*/ /* These pins are used for EMVCo Interoperability test status indication, * not for the generic Reader Library implementation. */ #define PHDRIVER_PIN_SUCCESS ((GPIO_PORT1 << 8) | 0) /**< GPIO, Port 1, Pin0 */ #define PHDRIVER_PIN_FAIL ((GPIO_PORT1 << 8) | 1) /**< GPIO, Port 1, Pin1 */ /****************************************************************** * PIN Pull-Up/Pull-Down configurations. ******************************************************************/ #define PHDRIVER_PIN_RESET_PULL_CFG PH_DRIVER_PULL_UP #define PHDRIVER_PIN_IRQ_PULL_CFG PH_DRIVER_PULL_DOWN #define PHDRIVER_PIN_WKUP_PULL_CFG PH_DRIVER_PULL_UP #define PHDRIVER_PIN_CLK_PULL_CFG PH_DRIVER_PULL_UP #define PHDRIVER_PIN_DWL_PULL_CFG PH_DRIVER_PULL_UP #define PHDRIVER_PIN_NSS_PULL_CFG PH_DRIVER_PULL_UP #define PHDRIVER_PIN_BUSY_PULL_CFG PH_DRIVER_PULL_UP #ifndef DAL_BOARDS_BOARD_FRDM_MCXN947_PN5190_H_ #define DAL_BOARDS_BOARD_FRDM_MCXN947_PN5190_H_ #define GPIO_PORT 0 #define GPIO_PORT1 1 /****************************************************************** * LPSPI clock configuration ******************************************************************/ /*Clock Frequency for SPI Flexcomm 1*/ #define SPI_CLOCK_FREQ (CLOCK_GetLPFlexCommClkFreq(1u)) #define SPI_MASTER_CLOCK_FREQ SPI_CLOCK_FREQ /****************************************************************** * Board Pin/Gpio configurations ******************************************************************/ #define PHDRIVER_PIN_RESET ((GPIO_PORT << 😎 | 28) /**< Reset pin, Pin28, PIO0_28 */ #define PHDRIVER_PIN_IRQ ((GPIO_PORT << 😎 | 31) /**< IRQ pin, Pin10, PIO0_10 */ /* For 5190 busy is same as IRQ */ #define PHDRIVER_PIN_BUSY ((GPIO_PORT << 😎 | 31) /**< IRQ pin, Pin31, PIO0_31 */ #define PHDRIVER_PIN_DWL ((GPIO_PORT << 😎 | 19) /**< Download pin, Pin19, PIO0_19*/ /* These pins are used for EMVCo Interoperability test status indication, * not for the generic Reader Library implementation. */ #define PHDRIVER_PIN_SUCCESS ((GPIO_PORT1 << 😎 | 0) /**< GPIO, Port 1, Pin0 */ #define PHDRIVER_PIN_FAIL ((GPIO_PORT1 << 😎 | 1) /**< GPIO, Port 1, Pin1 */ /****************************************************************** * PIN Pull-Up/Pull-Down configurations. ******************************************************************/ #define PHDRIVER_PIN_RESET_PULL_CFG PH_DRIVER_PULL_UP #define PHDRIVER_PIN_IRQ_PULL_CFG PH_DRIVER_PULL_DOWN #define PHDRIVER_PIN_WKUP_PULL_CFG PH_DRIVER_PULL_UP #define PHDRIVER_PIN_CLK_PULL_CFG PH_DRIVER_PULL_UP #define PHDRIVER_PIN_DWL_PULL_CFG PH_DRIVER_PULL_UP #define PHDRIVER_PIN_NSS_PULL_CFG PH_DRIVER_PULL_UP #define PHDRIVER_PIN_BUSY_PULL_CFG PH_DRIVER_PULL_UP We define the macros as well for the interrupt vector of MCXN947, its priority, handler and trigger type. Habib_MS_0-1781198808350.png Spoiler (Highlight to read) /****************************************************************** * IRQ PIN NVIC settings ******************************************************************/ #define EINT_IRQn GPIO00_IRQn /*Adding interrupt vector A of GPIO*/ #define EINT_PRIORITY 7 /*Default interrupt priority for GPIO*/ #define CLIF_IRQHandler GPIO00_IRQHandler /*Interrupt handler for vector A*/ #define PIN_IRQ_TRIGGER_TYPE PH_DRIVER_INTERRUPT_RISINGEDGE /*Rising edge Trigger*/ /****************************************************************** * IRQ PIN NVIC settings ******************************************************************/ #define EINT_IRQn GPIO00_IRQn /*Adding interrupt vector A of GPIO*/ #define EINT_PRIORITY 7 /*Default interrupt priority for GPIO*/ #define CLIF_IRQHandler GPIO00_IRQHandler /*Interrupt handler for vector A*/ #define PIN_IRQ_TRIGGER_TYPE PH_DRIVER_INTERRUPT_RISINGEDGE /*Rising edge Trigger*/ As well as some macros for pin logic levels. Habib_MS_1-1781198875355.png Spoiler (Highlight to read) /***************************************************************** * Front End Reset logic level settings ****************************************************************/ #define PH_DRIVER_SET_HIGH 1 /**< Logic High. */ #define PH_DRIVER_SET_LOW 0 /**< Logic Low. */ #define RESET_POWERDOWN_LEVEL PH_DRIVER_SET_LOW #define RESET_POWERUP_LEVEL PH_DRIVER_SET_HIGH /***************************************************************** * Front End Reset logic level settings ****************************************************************/ #define PH_DRIVER_SET_HIGH 1 /**< Logic High. */ #define PH_DRIVER_SET_LOW 0 /**< Logic Low. */ #define RESET_POWERDOWN_LEVEL PH_DRIVER_SET_LOW #define RESET_POWERUP_LEVEL PH_DRIVER_SET_HIGH Finally, we define macros for the base address of CTIMER and SPI peripherals, clock frequencies, interrupt vectors and related pins. Habib_MS_2-1781198913604.png Spoiler (Highlight to read) /***************************************************************** * SPI Configuration ****************************************************************/ #define PHDRIVER_MCXN947_SPI_MASTER LPSPI1 #define PHDRIVER_MCXN947_SPI_DATA_RATE 5000000U #define PHDRIVER_MCXN947_SPI_CLK_SRC SPI_MASTER_CLOCK_FREQ #define PHDRIVER_MCXN947_SPI_IRQ LP_FLEXCOMM1_IRQn #define SPI_IRQ_PRIORITY 6 /*SPI interrupt priority*/ #define PHDRIVER_PIN_SSEL 27U/* Chip Select, Pin6, SPI */ #define PHDRIVER_PIN_SCK 25U/* SPI clock, Pin7, SPI */ #define PHDRIVER_PIN_MISO 26U/* MISO, Pin8, SPI */ #define PHDRIVER_PIN_MOSI 24U/* MOSI, Pin9, SPI */ #define PHDRIVER_FC1_SPI_DIV kCLOCK_DivFlexcom1Clk #define PHDRIVER_FC1_SPI_CLK kFRO12M_to_FLEXCOMM1 /*Clock to attach to Flexcomm1*/ /***************************************************************** * Timer Configuration ****************************************************************/ #define PH_DRIVER_SDK_CTIMER CTIMER0 /*CTIMER0 base*/ #define PH_DRIVER_SDK_CTIMER_CLK kCLOCK_DivCtimer0Clk/*CTIMER0 clock*/ #define PH_DRIVER_SDK_CTIMER_NVIC CTIMER0_IRQn /*Interrupt vector*/ #define PH_DRIVER_SDK_CTIMER_PRIORITY 4 #define PH_DRIVER_SDK_CTIMER_CLK_FREQ CLOCK_GetCTimerClkFreq(0U) /*CTIMER0 Clock frequency*/ #endif /* DAL_BOARDS_BOARD_FRDM_MCXN947_PN5190_H_ */ /***************************************************************** * SPI Configuration ****************************************************************/ #define PHDRIVER_MCXN947_SPI_MASTER LPSPI1 #define PHDRIVER_MCXN947_SPI_DATA_RATE 5000000U #define PHDRIVER_MCXN947_SPI_CLK_SRC SPI_MASTER_CLOCK_FREQ #define PHDRIVER_MCXN947_SPI_IRQ LP_FLEXCOMM1_IRQn #define SPI_IRQ_PRIORITY 6 /*SPI interrupt priority*/ #define PHDRIVER_PIN_SSEL 27U/* Chip Select, Pin6, SPI */ #define PHDRIVER_PIN_SCK 25U/* SPI clock, Pin7, SPI */ #define PHDRIVER_PIN_MISO 26U/* MISO, Pin8, SPI */ #define PHDRIVER_PIN_MOSI 24U/* MOSI, Pin9, SPI */ #define PHDRIVER_FC1_SPI_DIV kCLOCK_DivFlexcom1Clk #define PHDRIVER_FC1_SPI_CLK kFRO12M_to_FLEXCOMM1 /*Clock to attach to Flexcomm1*/ /***************************************************************** * Timer Configuration ****************************************************************/ #define PH_DRIVER_SDK_CTIMER CTIMER0 /*CTIMER0 base*/ #define PH_DRIVER_SDK_CTIMER_CLK kCLOCK_DivCtimer0Clk/*CTIMER0 clock*/ #define PH_DRIVER_SDK_CTIMER_NVIC CTIMER0_IRQn /*Interrupt vector*/ #define PH_DRIVER_SDK_CTIMER_PRIORITY 4 #define PH_DRIVER_SDK_CTIMER_CLK_FREQ CLOCK_GetCTimerClkFreq(0U) /*CTIMER0 Clock frequency*/ #endif /* DAL_BOARDS_BOARD_FRDM_MCXN947_PN5190_H_ */ MCXN947 SPI and SDK files Now, inside DAL > src folder we will create a folder named “MCXN947” that will contain 2 source files: phbalReg_Mcxn947Spi.c phDriver_Mcxn947SDK.c Habib_MS_3-1781198965225.png Inside these source files we will modify the functions from the source files of other board hosts with the specific configurations of MCXN947 peripheral drivers, such as SPI, timers, GPIOs and interrupt handlers. This is done based on SDK examples such as “ctimer_match_interrupt_example_cm33_core0” and “lpspi_polling_b2b_transfer_master_cm33_core0”. phbalReg_Mcxn947Spi.c: In this file we first need to include the necessary files and include the headers and callbacks to ensure the correct functionality: Habib_MS_4-1781199007051.png Spoiler (Highlight to read) #include "phDriver.h" #include #include "BoardSelection.h" #include #include #include #define PHBAL_REG_MCXN947_SPI_ID 0x0FU /**< ID for MCXN947 SPI BAL component */ #define RX_BUFFER_SIZE_MAX 272U /* Receive Buffer size while exchange */ #ifndef PHDRIVER_MCXN947_SPI_POLLING lpspi_master_handle_t g_masterHandle; /* LPSPI user callback */ void LPSPI_MasterUserCallback(LPSPI_Type *base, lpspi_master_handle_t *handle, status_t status, void *userData); #endif static void phbalReg_Mcxn947SpiConfig(void); #ifndef PHDRIVER_MCXN947_SPI_POLLING volatile bool isTransferCompleted = false; void LPSPI_MasterUserCallback(LPSPI_Type *base, lpspi_master_handle_t *handle, status_t status, void *userData) { if (status == kStatus_Success) { __NOP(); } isTransferCompleted = true; } #endif #include "phDriver.h" #include #include "BoardSelection.h" #include #include #include #define PHBAL_REG_MCXN947_SPI_ID 0x0FU /**< ID for MCXN947 SPI BAL component */ #define RX_BUFFER_SIZE_MAX 272U /* Receive Buffer size while exchange */ #ifndef PHDRIVER_MCXN947_SPI_POLLING lpspi_master_handle_t g_masterHandle; /* LPSPI user callback */ void LPSPI_MasterUserCallback(LPSPI_Type *base, lpspi_master_handle_t *handle, status_t status, void *userData); #endif static void phbalReg_Mcxn947SpiConfig(void); #ifndef PHDRIVER_MCXN947_SPI_POLLING volatile bool isTransferCompleted = false; void LPSPI_MasterUserCallback(LPSPI_Type *base, lpspi_master_handle_t *handle, status_t status, void *userData) { if (status == kStatus_Success) { __NOP(); } isTransferCompleted = true; } #endif After, we will define the phbalReg_Init function, which will be used by the library to initialize the SPI peripheral in this case, and it is defined as follows: Habib_MS_5-1781199067774.png Spoiler (Highlight to read) phStatus_t phbalReg_Init( void * pDataParams, uint16_t wSizeOfDataParams) { lpspi_master_config_t userConfig; uint32_t srcFreq = 0; if((pDataParams == NULL) || (sizeof(phbalReg_Type_t) != wSizeOfDataParams)) { return (PH_DRIVER_ERROR | PH_COMP_DRIVER); } ((phbalReg_Type_t *)pDataParams)->wId = PH_COMP_DRIVER | PHBAL_REG_MCXN947_SPI_ID; ((phbalReg_Type_t *)pDataParams)->bBalType = PHBAL_REG_TYPE_SPI; /*Initialize Flexcomm1 clock*/ /* attach FRO 12M to FLEXCOMM1 */ CLOCK_SetClkDiv(PHDRIVER_FC1_SPI_DIV, 1u); CLOCK_AttachClk(PHDRIVER_FC1_SPI_CLK); /*Configure SPI pins*/ phbalReg_Mcxn947SpiConfig(); /*SPI configuration*/ LPSPI_MasterGetDefaultConfig(&userConfig); userConfig.baudRate = PHDRIVER_MCXN947_SPI_DATA_RATE; srcFreq = SPI_MASTER_CLOCK_FREQ; userConfig.whichPcs = (lpspi_which_pcs_t)kLPSPI_Pcs0; userConfig.pcsActiveHighOrLow = (lpspi_pcs_polarity_config_t)kLPSPI_PcsActiveLow; userConfig.pcsToSckDelayInNanoSec = 1000000000U / (userConfig.baudRate * 1U); userConfig.lastSckToPcsDelayInNanoSec = 1000000000U / (userConfig.baudRate * 1U); userConfig.betweenTransferDelayInNanoSec = 1000000000U / (userConfig.baudRate * 1U); /*Initialize SPI*/ #ifdef PHDRIVER_MCXN947_SPI_POLLING LPSPI_MasterInit(PHDRIVER_MCXN947_SPI_MASTER, &userConfig, srcFreq); #else LPSPI_MasterInit(PHDRIVER_MCXN947_SPI_MASTER, &userConfig, srcFreq); LPSPI_MasterTransferCreateHandle(PHDRIVER_MCXN947_SPI_MASTER, &g_masterHandle, LPSPI_MasterUserCallback, NULL); #endif return PH_DRIVER_SUCCESS; } phStatus_t phbalReg_Init( void * pDataParams, uint16_t wSizeOfDataParams) { lpspi_master_config_t userConfig; uint32_t srcFreq = 0; if((pDataParams == NULL) || (sizeof(phbalReg_Type_t) != wSizeOfDataParams)) { return (PH_DRIVER_ERROR | PH_COMP_DRIVER); } ((phbalReg_Type_t *)pDataParams)->wId = PH_COMP_DRIVER | PHBAL_REG_MCXN947_SPI_ID; ((phbalReg_Type_t *)pDataParams)->bBalType = PHBAL_REG_TYPE_SPI; /*Initialize Flexcomm1 clock*/ /* attach FRO 12M to FLEXCOMM1 */ CLOCK_SetClkDiv(PHDRIVER_FC1_SPI_DIV, 1u); CLOCK_AttachClk(PHDRIVER_FC1_SPI_CLK); /*Configure SPI pins*/ phbalReg_Mcxn947SpiConfig(); /*SPI configuration*/ LPSPI_MasterGetDefaultConfig(&userConfig); userConfig.baudRate = PHDRIVER_MCXN947_SPI_DATA_RATE; srcFreq = SPI_MASTER_CLOCK_FREQ; userConfig.whichPcs = (lpspi_which_pcs_t)kLPSPI_Pcs0; userConfig.pcsActiveHighOrLow = (lpspi_pcs_polarity_config_t)kLPSPI_PcsActiveLow; userConfig.pcsToSckDelayInNanoSec = 1000000000U / (userConfig.baudRate * 1U); userConfig.lastSckToPcsDelayInNanoSec = 1000000000U / (userConfig.baudRate * 1U); userConfig.betweenTransferDelayInNanoSec = 1000000000U / (userConfig.baudRate * 1U); /*Initialize SPI*/ #ifdef PHDRIVER_MCXN947_SPI_POLLING LPSPI_MasterInit(PHDRIVER_MCXN947_SPI_MASTER, &userConfig, srcFreq); #else LPSPI_MasterInit(PHDRIVER_MCXN947_SPI_MASTER, &userConfig, srcFreq); LPSPI_MasterTransferCreateHandle(PHDRIVER_MCXN947_SPI_MASTER, &g_masterHandle, LPSPI_MasterUserCallback, NULL); #endif return PH_DRIVER_SUCCESS; } We have to define the phbalReg_Exchange function as well, which is used for communicating via SPI with the PN5190. Habib_MS_0-1781200864120.png Habib_MS_1-1781200889109.png Spoiler (Highlight to read) phStatus_t phbalReg_Exchange( void * pDataParams, uint16_t wOption, uint8_t * pTxBuffer, uint16_t wTxLength, uint16_t wRxBufSize, uint8_t * pRxBuffer, uint16_t * pRxLength ) { phStatus_t status = PH_DRIVER_SUCCESS; uint8_t * pRxBuf; status_t lpspiStatus; lpspi_transfer_t g_masterXfer; uint8_t g_dummyBuffer[RX_BUFFER_SIZE_MAX]; if(pRxBuffer == NULL) { pRxBuf = g_dummyBuffer; } else { pRxBuf = pRxBuffer; } if(pTxBuffer == NULL) { wTxLength = wRxBufSize; g_dummyBuffer[0] = 0xFF; pTxBuffer = g_dummyBuffer; } memset(&g_masterXfer, 0, sizeof(lpspi_transfer_t)); /* Set up the transfer */ g_masterXfer.txData = pTxBuffer; g_masterXfer.rxData = pRxBuf; g_masterXfer.dataSize = wTxLength; g_masterXfer.configFlags = kLPSPI_MasterPcs0 | kLPSPI_MasterPcsContinuous | kLPSPI_MasterByteSwap; /* Start transfer */ #ifdef PHDRIVER_MCXN947_SPI_POLLING lpspiStatus = LPSPI_MasterTransferBlocking(PHDRIVER_MCXN947_SPI_MASTER, &g_masterXfer); #else lpspiStatus = LPSPI_MasterTransferNonBlocking(PHDRIVER_MCXN947_SPI_MASTER, &g_masterHandle, &g_masterXfer); /* Wait transfer complete */ while (!isTransferCompleted) { } #endif if (lpspiStatus != kStatus_Success) { return (PH_DRIVER_FAILURE | PH_COMP_DRIVER); } if (pRxLength != NULL) { *pRxLength = wTxLength; } #ifndef PHDRIVER_MCXN947_SPI_POLLING SDK_DelayAtLeastUs(300U, BOARD_BOOTCLOCKPLL150M_CORE_CLOCK); #endif return status; } phStatus_t phbalReg_Exchange( void * pDataParams, uint16_t wOption, uint8_t * pTxBuffer, uint16_t wTxLength, uint16_t wRxBufSize, uint8_t * pRxBuffer, uint16_t * pRxLength ) { phStatus_t status = PH_DRIVER_SUCCESS; uint8_t * pRxBuf; status_t lpspiStatus; lpspi_transfer_t g_masterXfer; uint8_t g_dummyBuffer[RX_BUFFER_SIZE_MAX]; if(pRxBuffer == NULL) { pRxBuf = g_dummyBuffer; } else { pRxBuf = pRxBuffer; } if(pTxBuffer == NULL) { wTxLength = wRxBufSize; g_dummyBuffer[0] = 0xFF; pTxBuffer = g_dummyBuffer; } memset(&g_masterXfer, 0, sizeof(lpspi_transfer_t)); /* Set up the transfer */ g_masterXfer.txData = pTxBuffer; g_masterXfer.rxData = pRxBuf; g_masterXfer.dataSize = wTxLength; g_masterXfer.configFlags = kLPSPI_MasterPcs0 | kLPSPI_MasterPcsContinuous | kLPSPI_MasterByteSwap; /* Start transfer */ #ifdef PHDRIVER_MCXN947_SPI_POLLING lpspiStatus = LPSPI_MasterTransferBlocking(PHDRIVER_MCXN947_SPI_MASTER, &g_masterXfer); #else lpspiStatus = LPSPI_MasterTransferNonBlocking(PHDRIVER_MCXN947_SPI_MASTER, &g_masterHandle, &g_masterXfer); /* Wait transfer complete */ while (!isTransferCompleted) { } #endif if (lpspiStatus != kStatus_Success) { return (PH_DRIVER_FAILURE | PH_COMP_DRIVER); } if (pRxLength != NULL) { *pRxLength = wTxLength; } #ifndef PHDRIVER_MCXN947_SPI_POLLING SDK_DelayAtLeastUs(300U, BOARD_BOOTCLOCKPLL150M_CORE_CLOCK); #endif return status; } Finally, we will define the phbalReg_Mcxn947SpiConfig function, which is called by phbalReg_Init to configure the SPI pins on the MCXN947: Habib_MS_2-1781200981954.png Spoiler (Highlight to read) static void phbalReg_Mcxn947SpiConfig(void) { const port_pin_config_t port0_24_pinB6_config = { kPORT_PullUp, kPORT_LowPullResistor, kPORT_SlowSlewRate, kPORT_PassiveFilterDisable, kPORT_OpenDrainDisable, kPORT_LowDriveStrength, /* Pin is configured as FC1_P0 */ kPORT_MuxAlt2, kPORT_InputBufferEnable, kPORT_InputNormal, kPORT_UnlockRegister}; /* PORT0_24 (pin B6) is configured as SPI_MOSI */ PORT_SetPinConfig(PORT0, 24U, &port0_24_pinB6_config); const port_pin_config_t port0_25_pinA6_config = {kPORT_PullUp, kPORT_LowPullResistor, kPORT_SlowSlewRate, kPORT_PassiveFilterDisable, kPORT_OpenDrainDisable, kPORT_LowDriveStrength, /* Pin is configured as FC1_P1 */ kPORT_MuxAlt2, kPORT_InputBufferEnable, kPORT_InputNormal, kPORT_UnlockRegister}; /* PORT0_25 (pin A6) is configured as SPI_SCK */ PORT_SetPinConfig(PORT0, 25U, &port0_25_pinA6_config); const port_pin_config_t port0_26_pinF10_config = {kPORT_PullUp, kPORT_LowPullResistor, kPORT_SlowSlewRate, kPORT_PassiveFilterDisable, kPORT_OpenDrainDisable, kPORT_LowDriveStrength, /* Pin is configured as FC1_P2 */ kPORT_MuxAlt2, kPORT_InputBufferEnable, kPORT_InputNormal, kPORT_UnlockRegister}; /* PORT0_26 (pin F10) is configured as SPI_MISO */ PORT_SetPinConfig(PORT0, 26U, &port0_26_pinF10_config); const port_pin_config_t port0_27_pinE10_config = {kPORT_PullUp, kPORT_LowPullResistor, kPORT_SlowSlewRate, kPORT_PassiveFilterDisable, kPORT_OpenDrainDisable, kPORT_LowDriveStrength, /* Pin is configured as FC1_P3 */ kPORT_MuxAlt2, kPORT_InputBufferEnable, kPORT_InputNormal, kPORT_UnlockRegister}; /* PORT0_27 (pin E10) is configured as SPI_CS */ PORT_SetPinConfig(PORT0, 27U, &port0_27_pinE10_config); } static void phbalReg_Mcxn947SpiConfig(void) { const port_pin_config_t port0_24_pinB6_config = { kPORT_PullUp, kPORT_LowPullResistor, kPORT_SlowSlewRate, kPORT_PassiveFilterDisable, kPORT_OpenDrainDisable, kPORT_LowDriveStrength, /* Pin is configured as FC1_P0 */ kPORT_MuxAlt2, kPORT_InputBufferEnable, kPORT_InputNormal, kPORT_UnlockRegister}; /* PORT0_24 (pin B6) is configured as SPI_MOSI */ PORT_SetPinConfig(PORT0, 24U, &port0_24_pinB6_config); const port_pin_config_t port0_25_pinA6_config = {kPORT_PullUp, kPORT_LowPullResistor, kPORT_SlowSlewRate, kPORT_PassiveFilterDisable, kPORT_OpenDrainDisable, kPORT_LowDriveStrength, /* Pin is configured as FC1_P1 */ kPORT_MuxAlt2, kPORT_InputBufferEnable, kPORT_InputNormal, kPORT_UnlockRegister}; /* PORT0_25 (pin A6) is configured as SPI_SCK */ PORT_SetPinConfig(PORT0, 25U, &port0_25_pinA6_config); const port_pin_config_t port0_26_pinF10_config = {kPORT_PullUp, kPORT_LowPullResistor, kPORT_SlowSlewRate, kPORT_PassiveFilterDisable, kPORT_OpenDrainDisable, kPORT_LowDriveStrength, /* Pin is configured as FC1_P2 */ kPORT_MuxAlt2, kPORT_InputBufferEnable, kPORT_InputNormal, kPORT_UnlockRegister}; /* PORT0_26 (pin F10) is configured as SPI_MISO */ PORT_SetPinConfig(PORT0, 26U, &port0_26_pinF10_config); const port_pin_config_t port0_27_pinE10_config = {kPORT_PullUp, kPORT_LowPullResistor, kPORT_SlowSlewRate, kPORT_PassiveFilterDisable, kPORT_OpenDrainDisable, kPORT_LowDriveStrength, /* Pin is configured as FC1_P3 */ kPORT_MuxAlt2, kPORT_InputBufferEnable, kPORT_InputNormal, kPORT_UnlockRegister}; /* PORT0_27 (pin E10) is configured as SPI_CS */ PORT_SetPinConfig(PORT0, 27U, &port0_27_pinE10_config); } phDriver_Mcxn947SDK.c: In this file we will have the following definitions and includes that describe relevant characteristics of the ctimer (configuration structures, interrupt handlers and maximum count value), and of the GPIO port: Habib_MS_3-1781201256179.png Spoiler (Highlight to read) #include "phDriver.h" #include "BoardSelection.h" #include "fsl_device_registers.h" #include #include /* *********************************************************************************************************** * Internal Definitions * ********************************************************************************************************** */ #define MCXN947_TIMER_MAX_32BIT 0xFFFFFFFFU #define CTIMER_HANDLER CTIMER0_IRQHandler /* *********************************************************************************************************** * * Type Definitions *********************************************************************************************************** */ volatile bool ctimerIsrFlag = false; /* *********************************************************************************************************** * Global and Static Variables * * Match Configuration for CTIMER Channel 0*/ static ctimer_match_config_t matchConfig0; /* Total Size: NNNbytes * ********************************************************************************************************** */ /* Array initializer of GPIO peripheral base pointers */ static const GPIO_Type *pGpiosBaseAddr[] = GPIO_BASE_PTRS; static pphDriver_TimerCallBck_t pCTimerCallBack; static volatile uint8_t dwTimerExp; static const gpio_interrupt_config_t aInterruptTypes[] = {kGPIO_InterruptLogicZero, /* Unused. */ kGPIO_InterruptLogicZero, kGPIO_InterruptLogicOne, kGPIO_InterruptRisingEdge, kGPIO_InterruptFallingEdge, kGPIO_InterruptEitherEdge, }; /* *********************************************************************************************************** * Private Functions Prototypes * ********************************************************************************************************** */ static void phDriver_CTimerIsrCallBack(void); #include "phDriver.h" #include "BoardSelection.h" #include "fsl_device_registers.h" #include #include /* *********************************************************************************************************** * Internal Definitions * ********************************************************************************************************** */ #define MCXN947_TIMER_MAX_32BIT 0xFFFFFFFFU #define CTIMER_HANDLER CTIMER0_IRQHandler /* *********************************************************************************************************** * * Type Definitions *********************************************************************************************************** */ volatile bool ctimerIsrFlag = false; /* *********************************************************************************************************** * Global and Static Variables * * Match Configuration for CTIMER Channel 0*/ static ctimer_match_config_t matchConfig0; /* Total Size: NNNbytes * ********************************************************************************************************** */ /* Array initializer of GPIO peripheral base pointers */ static const GPIO_Type *pGpiosBaseAddr[] = GPIO_BASE_PTRS; static pphDriver_TimerCallBck_t pCTimerCallBack; static volatile uint8_t dwTimerExp; static const gpio_interrupt_config_t aInterruptTypes[] = {kGPIO_InterruptLogicZero, /* Unused. */ kGPIO_InterruptLogicZero, kGPIO_InterruptLogicOne, kGPIO_InterruptRisingEdge, kGPIO_InterruptFallingEdge, kGPIO_InterruptEitherEdge, }; /* *********************************************************************************************************** * Private Functions Prototypes * ********************************************************************************************************** */ static void phDriver_CTimerIsrCallBack(void); We will define the following functions to initialize and stop the timer, and to enable timer interruptions and its callback: Habib_MS_4-1781201344846.png Habib_MS_5-1781201376952.png Spoiler (Highlight to read) phStatus_t phDriver_TimerStart(phDriver_Timer_Unit_t eTimerUnit, uint32_t dwTimePeriod, pphDriver_TimerCallBck_t pTimerCallBack) { uint64_t qwTimerCnt; uint32_t dwTimerFreq; dwTimerFreq = PH_DRIVER_SDK_CTIMER_CLK_FREQ; qwTimerCnt = dwTimerFreq; qwTimerCnt = (qwTimerCnt / eTimerUnit); qwTimerCnt = (dwTimePeriod * qwTimerCnt); /* 32-bit timers. */ if(qwTimerCnt > (uint64_t)MCXN947_TIMER_MAX_32BIT) { return PH_DRIVER_ERROR | PH_COMP_DRIVER; } if(pTimerCallBack == NULL) /* Timer Start is blocking call. */ { dwTimerExp = 0; pCTimerCallBack = phDriver_CTimerIsrCallBack; } else /* Call the Timer callback. */ { pCTimerCallBack = pTimerCallBack; } /*Configure & start CTIMER*/ /*Ctimer config structure*/ ctimer_config_t config; /*Timer mode, init*/ CTIMER_GetDefaultConfig(&config); CTIMER_Init(PH_DRIVER_SDK_CTIMER, &config); CTIMER_EnableInterrupts(PH_DRIVER_SDK_CTIMER, kCTIMER_Match0InterruptEnable|kCTIMER_Capture0InterruptEnable); /* Configuration match 0 */ matchConfig0.enableCounterReset = true; matchConfig0.enableCounterStop = false; matchConfig0.matchValue = (uint32_t)qwTimerCnt; matchConfig0.outControl = kCTIMER_Output_NoAction; matchConfig0.outPinInitState = false; matchConfig0.enableInterrupt = true; EnableIRQ(PH_DRIVER_SDK_CTIMER_NVIC); NVIC_SetPriority(PH_DRIVER_SDK_CTIMER_NVIC, PH_DRIVER_SDK_CTIMER_PRIORITY); /*Setup Match*/ CTIMER_SetupMatch(PH_DRIVER_SDK_CTIMER, kCTIMER_Match_0, &matchConfig0); /*Start*/ CTIMER_StartTimer(PH_DRIVER_SDK_CTIMER); while (true) { /* Check whether an interrupt occurred */ if (true == ctimerIsrFlag && dwTimerExp) { /* Clear interrupt flag*/ ctimerIsrFlag = false; break; } } return PH_DRIVER_SUCCESS; } phStatus_t phDriver_TimerStart(phDriver_Timer_Unit_t eTimerUnit, uint32_t dwTimePeriod, pphDriver_TimerCallBck_t pTimerCallBack) { uint64_t qwTimerCnt; uint32_t dwTimerFreq; dwTimerFreq = PH_DRIVER_SDK_CTIMER_CLK_FREQ; qwTimerCnt = dwTimerFreq; qwTimerCnt = (qwTimerCnt / eTimerUnit); qwTimerCnt = (dwTimePeriod * qwTimerCnt); /* 32-bit timers. */ if(qwTimerCnt > (uint64_t)MCXN947_TIMER_MAX_32BIT) { return PH_DRIVER_ERROR | PH_COMP_DRIVER; } if(pTimerCallBack == NULL) /* Timer Start is blocking call. */ { dwTimerExp = 0; pCTimerCallBack = phDriver_CTimerIsrCallBack; } else /* Call the Timer callback. */ { pCTimerCallBack = pTimerCallBack; } /*Configure & start CTIMER*/ /*Ctimer config structure*/ ctimer_config_t config; /*Timer mode, init*/ CTIMER_GetDefaultConfig(&config); CTIMER_Init(PH_DRIVER_SDK_CTIMER, &config); CTIMER_EnableInterrupts(PH_DRIVER_SDK_CTIMER, kCTIMER_Match0InterruptEnable|kCTIMER_Capture0InterruptEnable); /* Configuration match 0 */ matchConfig0.enableCounterReset = true; matchConfig0.enableCounterStop = false; matchConfig0.matchValue = (uint32_t)qwTimerCnt; matchConfig0.outControl = kCTIMER_Output_NoAction; matchConfig0.outPinInitState = false; matchConfig0.enableInterrupt = true; EnableIRQ(PH_DRIVER_SDK_CTIMER_NVIC); NVIC_SetPriority(PH_DRIVER_SDK_CTIMER_NVIC, PH_DRIVER_SDK_CTIMER_PRIORITY); /*Setup Match*/ CTIMER_SetupMatch(PH_DRIVER_SDK_CTIMER, kCTIMER_Match_0, &matchConfig0); /*Start*/ CTIMER_StartTimer(PH_DRIVER_SDK_CTIMER); while (true) { /* Check whether an interrupt occurred */ if (true == ctimerIsrFlag && dwTimerExp) { /* Clear interrupt flag*/ ctimerIsrFlag = false; break; } } return PH_DRIVER_SUCCESS; } Habib_MS_7-1781201652469.png Spoiler (Highlight to read) phStatus_t phDriver_TimerStop(void) { /*Stop timer & disable interrupts*/ CTIMER_StopTimer(PH_DRIVER_SDK_CTIMER); CTIMER_DisableInterrupts(PH_DRIVER_SDK_CTIMER, kCTIMER_Match0InterruptEnable|kCTIMER_Capture0InterruptEnable); /* Disable at the NVIC */ DisableIRQ(PH_DRIVER_SDK_CTIMER_NVIC); return PH_DRIVER_SUCCESS; } phStatus_t phDriver_TimerStop(void) { /*Stop timer & disable interrupts*/ CTIMER_StopTimer(PH_DRIVER_SDK_CTIMER); CTIMER_DisableInterrupts(PH_DRIVER_SDK_CTIMER, kCTIMER_Match0InterruptEnable|kCTIMER_Capture0InterruptEnable); /* Disable at the NVIC */ DisableIRQ(PH_DRIVER_SDK_CTIMER_NVIC); return PH_DRIVER_SUCCESS; } We will also have definitions for the functions that configure and handle GPIOs of the MCXN947 and enable interruptions. Habib_MS_0-1781201935240.png Spoiler (Highlight to read) phStatus_t phDriver_PinConfig(uint32_t dwPinNumber, phDriver_Pin_Func_t ePinFunc, phDriver_Pin_Config_t *pPinConfig) { gpio_pin_config_t sGpioConfig; uint8_t bPinNum; uint8_t bPortGpio; if((ePinFunc == PH_DRIVER_PINFUNC_BIDIR) || (pPinConfig == NULL)) { return PH_DRIVER_ERROR | PH_COMP_DRIVER; } /* Extract the Pin, Gpio, Port details from dwPinNumber */ bPinNum = (uint8_t)(dwPinNumber & 0xFF); bPortGpio = (uint8_t)((dwPinNumber & 0xFF00)>>8); sGpioConfig.pinDirection = (ePinFunc == PH_DRIVER_PINFUNC_OUTPUT) ? kGPIO_DigitalOutput:kGPIO_DigitalInput; sGpioConfig.outputLogic = pPinConfig->bOutputLogic; if(ePinFunc == PH_DRIVER_PINFUNC_INTERRUPT) { gpio_interrupt_config_t intConfig = aInterruptTypes[(uint8_t)pPinConfig->eInterruptConfig]; GPIO_GpioClearInterruptFlags((GPIO_Type *)pGpiosBaseAddr[GPIO_PORT], bPinNum); GPIO_SetPinInterruptConfig((GPIO_Type *)pGpiosBaseAddr[GPIO_PORT], bPinNum, intConfig); EnableIRQ(EINT_IRQn); GPIO_PinInit((GPIO_Type *)pGpiosBaseAddr[GPIO_PORT],bPinNum,&sGpioConfig); } else { GPIO_PinInit((GPIO_Type *)pGpiosBaseAddr[GPIO_PORT],bPinNum,&sGpioConfig); } return PH_DRIVER_SUCCESS; } phStatus_t phDriver_PinConfig(uint32_t dwPinNumber, phDriver_Pin_Func_t ePinFunc, phDriver_Pin_Config_t *pPinConfig) { gpio_pin_config_t sGpioConfig; uint8_t bPinNum; uint8_t bPortGpio; if((ePinFunc == PH_DRIVER_PINFUNC_BIDIR) || (pPinConfig == NULL)) { return PH_DRIVER_ERROR | PH_COMP_DRIVER; } /* Extract the Pin, Gpio, Port details from dwPinNumber */ bPinNum = (uint8_t)(dwPinNumber & 0xFF); bPortGpio = (uint8_t)((dwPinNumber & 0xFF00)>>8); sGpioConfig.pinDirection = (ePinFunc == PH_DRIVER_PINFUNC_OUTPUT) ? kGPIO_DigitalOutput:kGPIO_DigitalInput; sGpioConfig.outputLogic = pPinConfig->bOutputLogic; if(ePinFunc == PH_DRIVER_PINFUNC_INTERRUPT) { gpio_interrupt_config_t intConfig = aInterruptTypes[(uint8_t)pPinConfig->eInterruptConfig]; GPIO_GpioClearInterruptFlags((GPIO_Type *)pGpiosBaseAddr[GPIO_PORT], bPinNum); GPIO_SetPinInterruptConfig((GPIO_Type *)pGpiosBaseAddr[GPIO_PORT], bPinNum, intConfig); EnableIRQ(EINT_IRQn); GPIO_PinInit((GPIO_Type *)pGpiosBaseAddr[GPIO_PORT],bPinNum,&sGpioConfig); } else { GPIO_PinInit((GPIO_Type *)pGpiosBaseAddr[GPIO_PORT],bPinNum,&sGpioConfig); } return PH_DRIVER_SUCCESS; } Habib_MS_1-1781202317214.png Spoiler (Highlight to read) uint8_t phDriver_PinRead(uint32_t dwPinNumber, phDriver_Pin_Func_t ePinFunc) { uint8_t bValue; uint32_t intStatus; uint8_t bGpioNum; uint8_t bPinNum; /* Extract the Pin, Gpio details from dwPinNumber */ bPinNum = (uint8_t)(dwPinNumber & 0xFF); bGpioNum = (uint8_t)((dwPinNumber & 0xFF00)>>8); if(ePinFunc == PH_DRIVER_PINFUNC_INTERRUPT) { /*Get value of pin interrupt status*/ intStatus = GPIO_PinGetInterruptFlag((GPIO_Type *)pGpiosBaseAddr[GPIO_PORT], bPinNum); bValue = intStatus ? 1:0; } else { /*Read pin value*/ bValue = (uint8_t)GPIO_PinRead((GPIO_Type *)pGpiosBaseAddr[GPIO_PORT], bPinNum); } return bValue; } uint8_t phDriver_PinRead(uint32_t dwPinNumber, phDriver_Pin_Func_t ePinFunc) { uint8_t bValue; uint32_t intStatus; uint8_t bGpioNum; uint8_t bPinNum; /* Extract the Pin, Gpio details from dwPinNumber */ bPinNum = (uint8_t)(dwPinNumber & 0xFF); bGpioNum = (uint8_t)((dwPinNumber & 0xFF00)>>8); if(ePinFunc == PH_DRIVER_PINFUNC_INTERRUPT) { /*Get value of pin interrupt status*/ intStatus = GPIO_PinGetInterruptFlag((GPIO_Type *)pGpiosBaseAddr[GPIO_PORT], bPinNum); bValue = intStatus ? 1:0; } else { /*Read pin value*/ bValue = (uint8_t)GPIO_PinRead((GPIO_Type *)pGpiosBaseAddr[GPIO_PORT], bPinNum); } return bValue; } Habib_MS_3-1781202436423.png Spoiler (Highlight to read) void phDriver_PinWrite(uint32_t dwPinNumber, uint8_t bValue) { uint8_t bGpioNum; uint8_t bPinNum; /* Extract the Pin, Gpio details from dwPinNumber */ bPinNum = (uint8_t)(dwPinNumber & 0xFF); bGpioNum = (uint8_t)((dwPinNumber & 0xFF00)>>8); GPIO_PinWrite((GPIO_Type *)pGpiosBaseAddr[GPIO_PORT], bPinNum, bValue); } void phDriver_PinClearIntStatus(uint32_t dwPinNumber) { uint8_t bGpioNum; uint8_t bPinNum; /* Extract the Pin, Gpio details from dwPinNumber */ bPinNum = (uint8_t)(dwPinNumber & 0xFF); bGpioNum = (uint8_t)((dwPinNumber & 0xFF00)>>8); /*Clear interrupt flag*/ GPIO_GpioClearInterruptFlags((GPIO_Type *)pGpiosBaseAddr[GPIO_PORT], (1U << bPinNum)); } void phDriver_PinWrite(uint32_t dwPinNumber, uint8_t bValue) { uint8_t bGpioNum; uint8_t bPinNum; /* Extract the Pin, Gpio details from dwPinNumber */ bPinNum = (uint8_t)(dwPinNumber & 0xFF); bGpioNum = (uint8_t)((dwPinNumber & 0xFF00)>>8); GPIO_PinWrite((GPIO_Type *)pGpiosBaseAddr[GPIO_PORT], bPinNum, bValue); } void phDriver_PinClearIntStatus(uint32_t dwPinNumber) { uint8_t bGpioNum; uint8_t bPinNum; /* Extract the Pin, Gpio details from dwPinNumber */ bPinNum = (uint8_t)(dwPinNumber & 0xFF); bGpioNum = (uint8_t)((dwPinNumber & 0xFF00)>>8); /*Clear interrupt flag*/ GPIO_GpioClearInterruptFlags((GPIO_Type *)pGpiosBaseAddr[GPIO_PORT], (1U << bPinNum)); } It is also necessary to add functions required for the library to function correctly. Habib_MS_4-1781202506101.png Spoiler (Highlight to read) void phDriver_EnterCriticalSection(void) { NVIC_DisableIRQ(EINT_IRQn); } void phDriver_ExitCriticalSection(void) { NVIC_EnableIRQ(EINT_IRQn); } phStatus_t phDriver_IRQPinRead(uint32_t dwPinNumber) { phStatus_t bGpioVal = false; bGpioVal = phDriver_PinRead(dwPinNumber, PH_DRIVER_PINFUNC_INPUT); return bGpioVal; } phStatus_t phDriver_IRQPinPoll(uint32_t dwPinNumber, phDriver_Pin_Func_t ePinFunc, phDriver_Interrupt_Config_t eInterruptType) { uint8_t bGpioState = 0; if ((eInterruptType != PH_DRIVER_INTERRUPT_RISINGEDGE) && (eInterruptType != PH_DRIVER_INTERRUPT_FALLINGEDGE)) { return PH_DRIVER_ERROR | PH_COMP_DRIVER; } if (eInterruptType == PH_DRIVER_INTERRUPT_FALLINGEDGE) { bGpioState = 1; } while(phDriver_PinRead(dwPinNumber, ePinFunc) == bGpioState); return PH_DRIVER_SUCCESS; } void phDriver_EnterCriticalSection(void) { NVIC_DisableIRQ(EINT_IRQn); } void phDriver_ExitCriticalSection(void) { NVIC_EnableIRQ(EINT_IRQn); } phStatus_t phDriver_IRQPinRead(uint32_t dwPinNumber) { phStatus_t bGpioVal = false; bGpioVal = phDriver_PinRead(dwPinNumber, PH_DRIVER_PINFUNC_INPUT); return bGpioVal; } phStatus_t phDriver_IRQPinPoll(uint32_t dwPinNumber, phDriver_Pin_Func_t ePinFunc, phDriver_Interrupt_Config_t eInterruptType) { uint8_t bGpioState = 0; if ((eInterruptType != PH_DRIVER_INTERRUPT_RISINGEDGE) && (eInterruptType != PH_DRIVER_INTERRUPT_FALLINGEDGE)) { return PH_DRIVER_ERROR | PH_COMP_DRIVER; } if (eInterruptType == PH_DRIVER_INTERRUPT_FALLINGEDGE) { bGpioState = 1; } while(phDriver_PinRead(dwPinNumber, ePinFunc) == bGpioState); return PH_DRIVER_SUCCESS; } Finally, here, we will have the definition of the timer interrupt handler and ISR callback. Habib_MS_5-1781202601491.png Spoiler (Highlight to read) void CTIMER0_IRQHandler(void) { /* Clear interrupt flag.*/ CTIMER_ClearStatusFlags(PH_DRIVER_SDK_CTIMER, kCTIMER_Match0Flag|kCTIMER_Capture0Flag); /* Single shot timer. Stop it. */ CTIMER_StopTimer(PH_DRIVER_SDK_CTIMER); CTIMER_DisableInterrupts(PH_DRIVER_SDK_CTIMER, kCTIMER_Match0InterruptEnable|kCTIMER_Capture0InterruptEnable); pCTimerCallBack(); ctimerIsrFlag = true; } static void phDriver_CTimerIsrCallBack(void) { dwTimerExp = 1; } void CTIMER0_IRQHandler(void) { /* Clear interrupt flag.*/ CTIMER_ClearStatusFlags(PH_DRIVER_SDK_CTIMER, kCTIMER_Match0Flag|kCTIMER_Capture0Flag); /* Single shot timer. Stop it. */ CTIMER_StopTimer(PH_DRIVER_SDK_CTIMER); CTIMER_DisableInterrupts(PH_DRIVER_SDK_CTIMER, kCTIMER_Match0InterruptEnable|kCTIMER_Capture0InterruptEnable); pCTimerCallBack(); ctimerIsrFlag = true; } static void phDriver_CTimerIsrCallBack(void) { dwTimerExp = 1; } With these additions, we have all the functions needed (based on the FRDM-MCXN947 SDK) by the library to communicate with the PN5190. BoardSelection.h In this header file, which is found at “DAL > cfg” we will add the definition set in the preprocessor settings to use the FRDM-MCXN947 board as host by adding the following lines to the file: Habib_MS_6-1781202691439.png Spoiler (Highlight to read) #ifdef PHDRIVER_FRDMMCXN947_PN5190_BOARD # include #endif #ifdef PHDRIVER_FRDMMCXN947_PN5190_BOARD # include #endif ph_NxpBuild_App.h In this header found at “intfs” folder, we will add our board support to use it with the PN5190 by adding the following change: Habib_MS_7-1781202815632.png Spoiler (Highlight to read) #if defined(PHDRIVER_LPC1769PN5190_BOARD) \ || defined(PHDRIVER_K82F_PNEV5190B_BOARD)\ || defined(PHDRIVER_FRDMMCXN947_PN5190_BOARD) # define NXPBUILD__PHHAL_HW_PN5190 #endif #if defined(PHDRIVER_LPC1769PN5190_BOARD) \ || defined(PHDRIVER_K82F_PNEV5190B_BOARD)\ || defined(PHDRIVER_FRDMMCXN947_PN5190_BOARD) # define NXPBUILD__PHHAL_HW_PN5190 #endif phApp_Init.h In this header located at “intfs” folder we will add the required include files for the initialization of our board and enable the correct debug interface. Habib_MS_8-1781202847396.png Spoiler (Highlight to read) /*Check for MCXN controller based boards*/ #if defined (PHDRIVER_FRDMMCXN947_PN5190_BOARD) #define PHDRIVER_FRDM_MCXN947 #endif #ifdef PHDRIVER_FRDM_MCXN947 #include #include #include #include #include #include #endif Please replace this line. /*Check for MCXN controller based boards*/ #if defined (PHDRIVER_FRDMMCXN947_PN5190_BOARD) #define PHDRIVER_FRDM_MCXN947 #endif #ifdef PHDRIVER_FRDM_MCXN947 #include #include #include #include #include #include #endif Please replace this line. Spoiler (Highlight to read) #if defined(PHDRIVER_KINETIS_K82)|| defined(PHDRIVER_FRDM_MCXN947)   #if defined(PHDRIVER_KINETIS_K82)|| defined(PHDRIVER_FRDM_MCXN947) phApp_Init.c Finally, in this source file we will add the initialization code for the MCXN947 to complement the initialization macros defined in the previous phApp_Init.h file modification. Here we will call functions to initialize clocks and UART pins. Habib_MS_0-1781205399694.png Spoiler (Highlight to read) #ifdef PHDRIVER_FRDM_MCXN947 #include "fsl_common.h" #include "pin_mux.h" #include "clock_config.h" #include "board.h" static void phApp_MCXN947_Init(void){ BOARD_InitBootPins(); BOARD_InitBootClocks(); BOARD_InitDebugConsole(); } #endif #ifdef PHDRIVER_FRDM_MCXN947 #include "fsl_common.h" #include "pin_mux.h" #include "clock_config.h" #include "board.h" static void phApp_MCXN947_Init(void){ BOARD_InitBootPins(); BOARD_InitBootClocks(); BOARD_InitDebugConsole(); } #endif Spoiler (Highlight to read) #elif defined(PHDRIVER_FRDM_MCXN947) phApp_MCXN947_Init(); #elif defined(PHDRIVER_FRDM_MCXN947) phApp_MCXN947_Init(); These functions are used to initialize the correspondent clocks of each peripheral such as CTIMER, the input pins multiplexor for selecting GPIO functionality and FLEXCOMM for SPI. In here we also set the GPIO functionality for pins P0_31 and P0_28 (IRQ and RESET), as well as UART3 for printing the tag information on the serial port connected to the computer. Additionally, we need to set the NVIC priority to ensure that interrupts can occur. Add the NVIC_SetPriority() function to phApp_Configure_IRQ(). Habib_MS_1-1781205512787.png Spoiler (Highlight to read) #ifdef PH_PLATFORM_HAS_ICFRONTEND #if !(defined(PH_OSAL_LINUX) && defined(NXPBUILD__PHHAL_HW_PN5190)) phDriver_Pin_Config_t pinCfg; NVIC_SetPriority(EINT_IRQn, EINT_PRIORITY); pinCfg.bOutputLogic = PH_DRIVER_SET_LOW; pinCfg.bPullSelect = PHDRIVER_PIN_IRQ_PULL_CFG; pinCfg.eInterruptConfig = PIN_IRQ_TRIGGER_TYPE; phDriver_PinConfig(PHDRIVER_PIN_IRQ, PH_DRIVER_PINFUNC_INTERRUPT, &pinCfg); #endif #ifdef PH_PLATFORM_HAS_ICFRONTEND #if !(defined(PH_OSAL_LINUX) && defined(NXPBUILD__PHHAL_HW_PN5190)) phDriver_Pin_Config_t pinCfg; NVIC_SetPriority(EINT_IRQn, EINT_PRIORITY); pinCfg.bOutputLogic = PH_DRIVER_SET_LOW; pinCfg.bPullSelect = PHDRIVER_PIN_IRQ_PULL_CFG; pinCfg.eInterruptConfig = PIN_IRQ_TRIGGER_TYPE; phDriver_PinConfig(PHDRIVER_PIN_IRQ, PH_DRIVER_PINFUNC_INTERRUPT, &pinCfg); #endif pin_mux.c Inside the function “BOARD_InitBootPins()” which is defined in board -> pin_mux.c file, the following initializations need to be added: Habib_MS_3-1781205793803.png Spoiler (Highlight to read) void BOARD_InitBootPins(void) { /* Use FRO HF clock for some of the Ctimers */ CLOCK_SetClkDiv(kCLOCK_DivCtimer0Clk, 1u); CLOCK_AttachClk(kFRO_HF_to_CTIMER0); CLOCK_EnableClock(kCLOCK_Gpio0); CLOCK_EnableClock(kCLOCK_Gpio1); BOARD_InitPins(); } void BOARD_InitBootPins(void) { /* Use FRO HF clock for some of the Ctimers */ CLOCK_SetClkDiv(kCLOCK_DivCtimer0Clk, 1u); CLOCK_AttachClk(kFRO_HF_to_CTIMER0); CLOCK_EnableClock(kCLOCK_Gpio0); CLOCK_EnableClock(kCLOCK_Gpio1); BOARD_InitPins(); } Additionally, within the “BOARD_InitPins()” function available in the same file, we will replace the initializations of the GPIO and UART pins. Habib_MS_4-1781205847058.png Habib_MS_5-1781205872354.png Habib_MS_6-1781205919494.png Spoiler (Highlight to read) void BOARD_InitPins(void) { /* Enables the clock for PORT0 controller: Enables clock */ CLOCK_EnableClock(kCLOCK_Port0); /* Enables the clock for PORT1: Enables clock */ CLOCK_EnableClock(kCLOCK_Port1); const port_pin_config_t port0_19_config = {/* Internal pull-up/down resistor is disabled */ kPORT_PullDisable, /* Low internal pull resistor value is selected. */ kPORT_LowPullResistor, /* Fast slew rate is configured */ kPORT_FastSlewRate, /* Passive input filter is disabled */ kPORT_PassiveFilterDisable, /* Open drain output is disabled */ kPORT_OpenDrainDisable, /* Low drive strength is configured */ kPORT_LowDriveStrength, /* Pin is configured as PIO0_10 */ kPORT_MuxAlt0, /* Digital input enabled */ kPORT_InputBufferEnable, /* Digital input is not inverted */ kPORT_InputNormal, /* Pin Control Register fields [15:0] are not locked */ kPORT_UnlockRegister}; /* PORT0_10 (pin B12) is configured as PIO0_10 */ PORT_SetPinConfig(PORT0, 19U, &port0_19_config); const port_pin_config_t port1_0_config = { kPORT_PullDisable, kPORT_LowPullResistor, kPORT_FastSlewRate, kPORT_PassiveFilterDisable, kPORT_OpenDrainDisable, kPORT_LowDriveStrength, /* Pin is configured as PIO0_10 */ kPORT_MuxAlt0, kPORT_InputBufferEnable, kPORT_InputNormal, kPORT_UnlockRegister}; /* PORT0_10 (pin B12) is configured as PIO0_10 */ PORT_SetPinConfig(PORT1, 0U, &port1_0_config); const port_pin_config_t port1_1_config = { kPORT_PullDisable, kPORT_LowPullResistor, kPORT_FastSlewRate, kPORT_PassiveFilterDisable, kPORT_OpenDrainDisable, kPORT_LowDriveStrength, /* Pin is configured as PIO0_10 */ kPORT_MuxAlt0, kPORT_InputBufferEnable, kPORT_InputNormal, kPORT_UnlockRegister}; /* PORT0_10 (pin B12) is configured as PIO0_10 */ PORT_SetPinConfig(PORT1, 1U, &port1_1_config); const port_pin_config_t port0_31_pinB12_config = { kPORT_PullDown, kPORT_LowPullResistor, kPORT_FastSlewRate, kPORT_PassiveFilterDisable, kPORT_OpenDrainDisable, kPORT_LowDriveStrength, /* Pin is configured as PIO0_10 */ kPORT_MuxAlt0, kPORT_InputBufferEnable, kPORT_InputNormal, kPORT_UnlockRegister}; /* PORT0_10 (pin B12) is configured as PIO0_10 */ PORT_SetPinConfig(PORT0, 31U, &port0_31_pinB12_config); const port_pin_config_t port0_28_config = { kPORT_PullDisable, kPORT_LowPullResistor, kPORT_FastSlewRate, kPORT_PassiveFilterDisable, kPORT_OpenDrainDisable, kPORT_LowDriveStrength, /* Pin is configured as PIO0_6 */ kPORT_MuxAlt0, kPORT_InputBufferEnable, kPORT_InputNormal, kPORT_UnlockRegister}; /* PORT0_6 (pin C14) is configured as PIO0_6 */ PORT_SetPinConfig(PORT0, 28U, &port0_28_config); const port_pin_config_t port0_2_pinB16_config = { .pullSelect = kPORT_PullDisable, .pullValueSelect = kPORT_LowPullResistor, .slewRate = kPORT_FastSlewRate, .passiveFilterEnable = kPORT_PassiveFilterDisable, .openDrainEnable = kPORT_OpenDrainDisable, .driveStrength = kPORT_HighDriveStrength, /* Pin is configured as SWO */ .mux = kPORT_MuxAlt1, .inputBuffer = kPORT_InputBufferEnable, .invertInput = kPORT_InputNormal, .lockRegister = kPORT_UnlockRegister}; /* PORT0_2 (pin B16) is configured as SWO */ PORT_SetPinConfig(PORT0, 2U, &port0_2_pinB16_config); const port_pin_config_t port1_8_pinA1_config = { .pullSelect = kPORT_PullUp, .pullValueSelect = kPORT_LowPullResistor, .slewRate = kPORT_FastSlewRate, .passiveFilterEnable = kPORT_PassiveFilterDisable, .openDrainEnable = kPORT_OpenDrainDisable, .driveStrength = kPORT_LowDriveStrength, /* Pin is configured as FC4_P0 */ .mux = kPORT_MuxAlt2, .inputBuffer = kPORT_InputBufferEnable, .invertInput = kPORT_InputNormal, .lockRegister = kPORT_UnlockRegister}; /* PORT1_8 (pin A1) is configured as FC4_P0 */ PORT_SetPinConfig(PORT1, 8U, &port1_8_pinA1_config); const port_pin_config_t port1_9_pinB1_config = { .pullSelect = kPORT_PullDisable, .pullValueSelect = kPORT_LowPullResistor, .slewRate = kPORT_FastSlewRate, .passiveFilterEnable = kPORT_PassiveFilterDisable, .openDrainEnable = kPORT_OpenDrainDisable, .driveStrength = kPORT_LowDriveStrength, /* Pin is configured as FC4_P1 */ .mux = kPORT_MuxAlt2, .inputBuffer = kPORT_InputBufferEnable, .invertInput = kPORT_InputNormal, .lockRegister = kPORT_UnlockRegister}; /* PORT1_9 (pin B1) is configured as FC4_P1 */ PORT_SetPinConfig(PORT1, 9U, &port1_9_pinB1_config); } void BOARD_InitPins(void) { /* Enables the clock for PORT0 controller: Enables clock */ CLOCK_EnableClock(kCLOCK_Port0); /* Enables the clock for PORT1: Enables clock */ CLOCK_EnableClock(kCLOCK_Port1); const port_pin_config_t port0_19_config = {/* Internal pull-up/down resistor is disabled */ kPORT_PullDisable, /* Low internal pull resistor value is selected. */ kPORT_LowPullResistor, /* Fast slew rate is configured */ kPORT_FastSlewRate, /* Passive input filter is disabled */ kPORT_PassiveFilterDisable, /* Open drain output is disabled */ kPORT_OpenDrainDisable, /* Low drive strength is configured */ kPORT_LowDriveStrength, /* Pin is configured as PIO0_10 */ kPORT_MuxAlt0, /* Digital input enabled */ kPORT_InputBufferEnable, /* Digital input is not inverted */ kPORT_InputNormal, /* Pin Control Register fields [15:0] are not locked */ kPORT_UnlockRegister}; /* PORT0_10 (pin B12) is configured as PIO0_10 */ PORT_SetPinConfig(PORT0, 19U, &port0_19_config); const port_pin_config_t port1_0_config = { kPORT_PullDisable, kPORT_LowPullResistor, kPORT_FastSlewRate, kPORT_PassiveFilterDisable, kPORT_OpenDrainDisable, kPORT_LowDriveStrength, /* Pin is configured as PIO0_10 */ kPORT_MuxAlt0, kPORT_InputBufferEnable, kPORT_InputNormal, kPORT_UnlockRegister}; /* PORT0_10 (pin B12) is configured as PIO0_10 */ PORT_SetPinConfig(PORT1, 0U, &port1_0_config); const port_pin_config_t port1_1_config = { kPORT_PullDisable, kPORT_LowPullResistor, kPORT_FastSlewRate, kPORT_PassiveFilterDisable, kPORT_OpenDrainDisable, kPORT_LowDriveStrength, /* Pin is configured as PIO0_10 */ kPORT_MuxAlt0, kPORT_InputBufferEnable, kPORT_InputNormal, kPORT_UnlockRegister}; /* PORT0_10 (pin B12) is configured as PIO0_10 */ PORT_SetPinConfig(PORT1, 1U, &port1_1_config); const port_pin_config_t port0_31_pinB12_config = { kPORT_PullDown, kPORT_LowPullResistor, kPORT_FastSlewRate, kPORT_PassiveFilterDisable, kPORT_OpenDrainDisable, kPORT_LowDriveStrength, /* Pin is configured as PIO0_10 */ kPORT_MuxAlt0, kPORT_InputBufferEnable, kPORT_InputNormal, kPORT_UnlockRegister}; /* PORT0_10 (pin B12) is configured as PIO0_10 */ PORT_SetPinConfig(PORT0, 31U, &port0_31_pinB12_config); const port_pin_config_t port0_28_config = { kPORT_PullDisable, kPORT_LowPullResistor, kPORT_FastSlewRate, kPORT_PassiveFilterDisable, kPORT_OpenDrainDisable, kPORT_LowDriveStrength, /* Pin is configured as PIO0_6 */ kPORT_MuxAlt0, kPORT_InputBufferEnable, kPORT_InputNormal, kPORT_UnlockRegister}; /* PORT0_6 (pin C14) is configured as PIO0_6 */ PORT_SetPinConfig(PORT0, 28U, &port0_28_config); const port_pin_config_t port0_2_pinB16_config = { .pullSelect = kPORT_PullDisable, .pullValueSelect = kPORT_LowPullResistor, .slewRate = kPORT_FastSlewRate, .passiveFilterEnable = kPORT_PassiveFilterDisable, .openDrainEnable = kPORT_OpenDrainDisable, .driveStrength = kPORT_HighDriveStrength, /* Pin is configured as SWO */ .mux = kPORT_MuxAlt1, .inputBuffer = kPORT_InputBufferEnable, .invertInput = kPORT_InputNormal, .lockRegister = kPORT_UnlockRegister}; /* PORT0_2 (pin B16) is configured as SWO */ PORT_SetPinConfig(PORT0, 2U, &port0_2_pinB16_config); const port_pin_config_t port1_8_pinA1_config = { .pullSelect = kPORT_PullUp, .pullValueSelect = kPORT_LowPullResistor, .slewRate = kPORT_FastSlewRate, .passiveFilterEnable = kPORT_PassiveFilterDisable, .openDrainEnable = kPORT_OpenDrainDisable, .driveStrength = kPORT_LowDriveStrength, /* Pin is configured as FC4_P0 */ .mux = kPORT_MuxAlt2, .inputBuffer = kPORT_InputBufferEnable, .invertInput = kPORT_InputNormal, .lockRegister = kPORT_UnlockRegister}; /* PORT1_8 (pin A1) is configured as FC4_P0 */ PORT_SetPinConfig(PORT1, 8U, &port1_8_pinA1_config); const port_pin_config_t port1_9_pinB1_config = { .pullSelect = kPORT_PullDisable, .pullValueSelect = kPORT_LowPullResistor, .slewRate = kPORT_FastSlewRate, .passiveFilterEnable = kPORT_PassiveFilterDisable, .openDrainEnable = kPORT_OpenDrainDisable, .driveStrength = kPORT_LowDriveStrength, /* Pin is configured as FC4_P1 */ .mux = kPORT_MuxAlt2, .inputBuffer = kPORT_InputBufferEnable, .invertInput = kPORT_InputNormal, .lockRegister = kPORT_UnlockRegister}; /* PORT1_9 (pin B1) is configured as FC4_P1 */ PORT_SetPinConfig(PORT1, 9U, &port1_9_pinB1_config); } At the same time, add the following includes to the file: Habib_MS_0-1781207973118.png Spoiler (Highlight to read) #include "fsl_common.h" #include "fsl_port.h" #include "board.h" #include "clock_config.h" #include "pin_mux.h" #include "fsl_common.h" #include "fsl_port.h" #include "board.h" #include "clock_config.h" #include "pin_mux.h" Adding include paths Since we are including header files into the project, we must specify which directories to search in order to find the required files. To do this: 1. Open project properties (right-click on project > Properties). 2.Click on the drop menu “C/C++ Build”, then “Settings”. 3.Click on “Includes” option. Habib_MS_1-1781208012765.png 4.Click on the “Add..” button at the top right corner of the “Include paths (-l)” menu. 5. Click on “Workspace…” Habib_MS_2-1781208068003.png 6. Add the following highlighted directories from FRDM-MCXN project: Habib_MS_3-1781208097487.png 7. Accept the changes and click on “Apply and Close”. Add “root folder” to source location 1.Open project properties. 2. Click on the drop menu “C/C++ General”, then “Paths and Symbols”. 3. Click on the “Source Location” tab. 4.Click on “Add Folder…” and add the “ ”. Habib_MS_4-1781208199983.png Delete phOsal files We must delete from the path “phOsal > src > NullOs > portable” the files: “phOsal_Port_CM3.c”,“phOsal_Port_PN76xx.c” and “phOsal_Port_PN74xxxx.c”. This has the purpose of avoiding any multiple definition errors when compiling the final project. Add _DSB and _ISB support As final modification step, please include in NxpNfcRdLib->comps->phhalHw->src->PN5190-> phhalHw_Pn5190_Int.c the  “cmsis_gcc.h” to support of _DSB and _ISB functions. Habib_MS_5-1781208264265.png Testing Final Project Without OS After making all the previous changes and modifications, the migration is now complete, and we can proceed to compile and flash the example to MCXN947. Please “clean” the project before building by right clicking on the project as follows: Habib_MS_6-1781208329457.png To run the project, we will need a serial terminal like Tera Term with the following settings: - 115200 baud rate. - 8 data bits. - No parity. - One stop bit, - No flow control. Once the program is flashed and the serial terminal configured, we can reset the board and power the PNEV5190BP. You should see an output similar to the following: Habib_MS_7-1781208358485.png Now if any NFC tag is close to the PNEV5190BP’s antenna, you should see the information displayed as shown in the image below: Habib_MS_8-1781208378570.png Adding FreeRTOS support This section presents the steps to follow to add FreeRTOS support to the current project with the possibility of easily choosing either to have OS support or not. 1. Open the “Manage SDK Components” in properties->SDK Management. Habib_MS_9-1781208421419.png 2. Search the FreeRTOS kernel component (NXP integration layer), heap 4 and add it to your project. Habib_MS_0-1785533111303.png Note: If this option does not appear, you will have to download the SDK with the FreeRTOS stack included. Adding porting-specific files to FreeRTOS folder We need to set the core-specific files which define core register addresses and the assembly instructions that integrate the FreeRTOS kernel functions. The core integrating the MCXN947 IC is the Cortex M33 with Trust Zone, therefore, the folder that we will use to add the port files will be from the folder “ARM_CM33_NTZ” as explained below: 1. Import the SDK example called “freertos_hello_cm33_core0”: Habib_MS_11-1781208505026.png 2. Inside this example, you will see the folder “GCC” from the path freertos>freertoskernel>portable>GCC, please copy and paste this folder into the same path of the project. Habib_MS_2-1785533633824.png Habib_MS_3-1785533645497.png Adding port-specific created folder to include path. Now we need to tell the compiler where to find the port-specific files we just added to the project, to accomplish this: 1. Open the project properties (right-click on project > Properties) and click on “C/C++ General” and on “Paths and symbols”. Habib_MS_14-1781208609258.png 2. Here we will click on “Add…” and then “Workspace”. In the new tab we will search the last folder of the path we created (freertos/freertoskernel/portable/GCC/ARM_CM33_NTZ/non-secure), select it and click on “OK” Habib_MS_1-1785533523574.png 3. Repeat this step in project > Properties > “C/C++ Build” >Settings >“Includes”. Habib_MS_16-1781208764822.png Changing OS preprocessor macro Finally, we just need to tell the compiler that we want to run the example with FreeRTOS, to do this: 1. Open the project properties (right-click on project > Properties) and click on “C/C++ Build”, then on “Settings” and on “Preprocessor”. Habib_MS_17-1781208849806.png 2. Now find the previous macro named “PH_OSAL_NULLOS”, double click on it and change it to “PH_OSAL_FREERTOS” Habib_MS_18-1781209097027.png 3. Click on “Apply and Close” and click on “Rebuild Index”. 4. To avoid multiple definition issues when we change between NULLOS and FREERTOS, we will discard the SysTickHandler for FREERTOS side located in port.c when the NULLOS macro is defined, as shown the following image: Habib_MS_0-1781896206808.png Spoiler (Highlight to read) #ifndef PH_OSAL_NULLOS void SysTick_Handler( void ) /* PRIVILEGED_FUNCTION */ { uint32_t ulPreviousMask; ulPreviousMask = portSET_INTERRUPT_MASK_FROM_ISR(); traceISR_ENTER(); { /* Increment the RTOS tick. */ if( xTaskIncrementTick() != pdFALSE ) { traceISR_EXIT_TO_SCHEDULER(); /* Pend a context switch. */ portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT; } else { traceISR_EXIT(); } } portCLEAR_INTERRUPT_MASK_FROM_ISR( ulPreviousMask ); } #endif #ifndef PH_OSAL_NULLOS void SysTick_Handler( void ) /* PRIVILEGED_FUNCTION */ { uint32_t ulPreviousMask; ulPreviousMask = portSET_INTERRUPT_MASK_FROM_ISR(); traceISR_ENTER(); { /* Increment the RTOS tick. */ if( xTaskIncrementTick() != pdFALSE ) { traceISR_EXIT_TO_SCHEDULER(); /* Pend a context switch. */ portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT; } else { traceISR_EXIT(); } } portCLEAR_INTERRUPT_MASK_FROM_ISR( ulPreviousMask ); } #endif 5. Finally, copy and paste the FreeRTOSConfig_Gen.h, FreeRTOSConfig.h and freertos_tasks_c_additions.h files from the freertos_hello example as shown the following image: Habib_MS_0-1785536616039.png Habib_MS_1-1785536639784.png Now you are able to build and debug following the chapter Testing Final Project Without OS but now with FreeRTOS. NFC Reader Library
View full article
Is Fatal Blackout Worth Trying in 2026 My Honest Fatal Blackout Review After Researching It Fatal Blackout is gaining major attention in 2026 as more families search for practical ways to prepare for power outages, grid failures, and emergency situations without relying on extreme survival tactics. Created by combat veteran Teddy Daniels, the program focuses on realistic blackout preparedness strategies using simple step-by-step guidance designed for everyday households. Check the official Fatal Blackout guide and latest details here: What makes Fatal Blackout stand out is its beginner-friendly approach. Rather than promoting expensive bunkers or extreme “doomsday prepper” tactics, the guide focuses on affordable preparedness methods like backup power planning, water storage, food security, EMP protection, and home readiness. Many people appreciate that the information is broken down into simple actions that can realistically be implemented over time. See how Fatal Blackout works and what’s included in the system: In 2026, concerns around grid instability, cyber attacks, inflation, and supply chain disruptions have pushed preparedness into the mainstream. Fatal Blackout taps into this growing interest by offering a structured survival roadmap for people who want to feel more prepared without completely changing their lifestyle. So, is Fatal Blackout worth trying? For people looking for a practical preparedness blueprint with a realistic focus, the program may provide useful insights and organization. However, like any survival system, its value depends entirely on whether users actually apply the strategies consistently in real life.   Re: Is Fatal Blackout Worth Trying in 2026 My Honest Fatal Blackout Review After Researching It Fatal Blackout has been attracting considerable attention in 2026 as more households look for realistic ways to prepare for emergencies such as power outages, grid disruptions, and unexpected crisis situations without adopting extreme survivalist methods. Created by combat veteran Teddy Daniels, the program is built around practical blackout preparedness strategies presented in a clear, step-by-step format intended for everyday families. Explore the official Fatal Blackout website and view the latest details here: One of the main reasons Fatal Blackout stands out is its beginner-friendly structure. Instead of encouraging expensive bunkers or intense “doomsday prepper” lifestyles, the guide emphasizes affordable and achievable preparedness steps. These include backup power planning, water storage solutions, food security basics, EMP awareness, and general home readiness measures. Users often value how the information is broken down into simple, manageable actions that can be implemented gradually over time. fatal blackout guide tips.png Discover how Fatal Blackout works and what the system includes:  In 2026, preparedness has become a mainstream topic due to growing concerns about grid reliability, cyber threats, rising living costs, and ongoing supply chain uncertainties. Fatal Blackout aligns with this shift by offering a structured framework that helps individuals and families feel more confident about handling potential disruptions while still maintaining a normal lifestyle. Yes, Fatal Blackout can be a useful option for those looking for a straightforward, well-structured preparedness guide focused on real-world scenarios. It offers clear direction and practical insights, and its value is best realized through consistent use of the strategies in everyday life, helping users gradually build stronger home readiness and preparedness confidence over time.
View full article
imx8ulp 功能域间外设数据共享 你好 我正在尝试了解i.MX 8ULP上的外设和跨功能域数据共享,尤其是在一个功能域处于低功耗状态时。 从参考手册中的图 6(i.MX 8ULP 架构图)中,我了解哪些外设与实时域 (RTD) 和应用域 (APD) 相关。不过,我想确认一下在以下情况下哪些是可能的,哪些是不可能的: 1) 在 APD 低功耗状态下,RTD 访问 APD 外设 如果 APD 处于非常低的功耗模式(例如,挂起到 RAM 或其他低功耗状态),是否支持 RTD 从 APD 自有外设访问数据? 如果可以,建议采用什么方法(共享内存、DMA 等)? 是否存在电源模式限制,即由于时钟/电源受限而无法访问 APD 外围设备? 同样,反过来也是可能的: 2) RTD 处于低功耗时,APD 可访问 RTD 外围设备 当 RTD 处于最低/低功耗状态时,APD 能否访问 RTD 所有外设的数据?如果是,建议采用什么方法? 3) RTD 和 DSP 功能域之间的外围设备/数据共享(在 RTD 内) 我们也很好奇这是如何适用于 RTD 中的 DSP 功能域的: RTD 和 DSP 之间的外设/数据共享处理方式是否与 RTD↔APD 共享类似,还是因为 DSP 位于 RTD 内部而有所不同? 在图 6 中,我们注意到从 DSP 功能域横杆到 RTD 横杆(有一条线表示连接)的连接上似乎缺少了 Sx 标签。这是文档错误吗? 该图似乎暗示数据只能在 RTD → DSP 之间流动,而不是在 DSP → RTD 之间流动,这似乎不是故意的。您能确认正确的访问方向吗? 4) APD 访问 DSP 功能域数据 最后,APD 如何访问 DSP 功能域生成的数据? APD 是通过横梁链(APD → RTD → DSP)访问 DSP 资源,还是有更直接/标准的机制? 谢谢! i.MX8ULP Re: imx8ulp peripheral data sharing between domains 你好@ meketok 希望你一切都好。 这个问题问得好。 你可以从 U-启动 看看 imx8ulp.dtsi ,看看通过 Per_Bridge1 可以访问该外围设备。 但在 Linux 环境中不建议这样做,因为通过桥接器从 APD(Cortex A)访问 M33 外设会产生"侧信道。"如果 Cortex A 崩溃,它可能会挂起 M33 的总线,从而违背硬件隔离的目的。 顺祝商祺! 萨拉斯 Re: imx8ulp peripheral data sharing between domains 大家好, ,这的确是一个有趣的话题。 1) 是否可以使用 rpmsg 驱动程序?它有哪些限制(即带宽、延迟)? 2) 支持此功能需要在 M33 上运行哪些确切的 M33 固件? 至少 i.MX 8ULP EVK 使用 I2C0 和 I2C1(与 RTD 功能域相关的总线)与传感器和其他外围设备通信。 Re: imx8ulp peripheral data sharing between domains 你好@Spal_13 希望你一切都好。 实际上,这些功能域有自己的外围设备,这些外围设备不是共享的。 请看参考手册的图 6. i.MX 8ULP 架构图: Manuel_Salas_0-1771276013951.png 您可以看到无法从非所有者的功能域访问外围设备。 以 APD 为参考: Manuel_Salas_1-1771276214694.png 您可以看到 APD 可以访问的 GPIO 包括 GPIOE、GPIOF 和 GPIOD(GPIOD 通过 LPAVD)。 您可以在imx8ulp.dtsi 中确认这一点: Manuel_Salas_2-1771276384563.png 顺祝商祺! 萨拉斯 Re: imx8ulp peripheral data sharing between domains @Manuel_Salas 你能解释一下你向 @Spal_13 展示的连接图中各个功能域的紫色 AXI 总线吗? 您能解释一下为什么 A35 内存映射中会出现 RTD 外设桥 0 和外设桥 1 吗? 您能解释一下为什么 APD 外设桥 3 和外设桥 4 会出现在 M33 内存映射中吗? 2.png 表 2. A35 系统内存图 4.png 表 5. CM33 内存映射 6.png Re: imx8ulp peripheral data sharing between domains @Manuel_Salas 能否请您解释一下这里的代码? u-boot 在 AP 功能域中运行并访问 RTD 功能域 i2c0。 端口(iomux)和 i2c0 模块。为什么? uboot-imx/板/freescale/imx8ulp_evk/imx8ulp_evk.c 位于 lf-6.12.3-1.0.0 · nxp-imx/uboot-imx · GitHub #define I2C_PAD_CTRL (PAD_CTL_ODE) static const iomux_cfg_t lpi2c0_pads[] = { IMX8ULP_PAD_PTA8__LPI2C0_SCL | MUX_PAD_CTRL(I2C_PAD_CTRL), IMX8ULP_PAD_PTA9__LPI2C0_SDA | MUX_PAD_CTRL(I2C_PAD_CTRL), }; #define TPM_PAD_CTRL (PAD_CTL_DSE) static const iomux_cfg_t tpm0_pads[] = { IMX8ULP_PAD_PTA3__TPM0_CH2 | MUX_PAD_CTRL(TPM_PAD_CTRL), }; void mipi_dsi_mux_panel(void) { int ret; struct gpio_desc desc; /* It is temp solution to directly access i2c, need change to rpmsg later */ /* enable lpi2c0 clock and iomux */ imx8ulp_iomux_setup_multiple_pads(lpi2c0_pads, ARRAY_SIZE(lpi2c0_pads)); writel(0xD2000000, 0x28091060);    RTD.png Re: imx8ulp peripheral data sharing between domains 我对这个问题也非常感兴趣。 1.@Spal_13的问题都与芯片有关,包括各种可能情况的问题。 2。恩智浦的电路板支持包 Linux只是可以在iMX8ULP芯片上运行的众多场景之一。恩智浦的软件设计就是这样。只是恩智浦的电路板支持包 Linux不这样做。只是恩智浦电路板支持包 Linux 的应用场景不涉及这一点。你无法根据当前的 BSP 场景来解释芯片的功能。 3.你对图 6(即 MX 8ULP 架构图)的理解与@meketok完全相反。meketok 的问题直接指向了相反的答案。坦率地说,我目前认为 meketok 是对的,而你错了。 4.请逐一回答@meketok的问题。 Re: imx8ulp peripheral data sharing between domains 你好,@Manuel_Salas、 基本 8ULP 架构假定两个内核可以协同使用,以实现最佳功效。 例如,APD 可能会进入睡眠/掉电模式,而 RTD 保持活动状态,从传感器采集数据,然后将其独立保存到缓冲区。只有在检测到用户干预(触摸、按钮、运动)时,APD 才会激活。 但是,当你说M33总线可能会被挂起时,就会出现严重的限制。那我们为什么需要这个 M33 核心呢? 如果可能存在这种挂起的情况,那么我们大家(恩智浦和社区)应共同研究解决方法,并且必须清楚地描述"危险的" 场景。 此外,imx8ulp EVK(假设黄金样本)演示了与 APD 的 RTD 连接外围设备的交互式工作: 1) 我们可以访问 I2C0 (RTD) 总线设备: root@imx8ulpevk:~# i2cget -f -y 0 0x60 0x00 root@imx8ulpevk:~# i2cget -f -y 0 0x6c 0xc1 root@imx8ulpevk:~# i2cget -f -y 0 0x6c 2 0x61 2)与 DTS 相对应: &i2c_rpbus_0 { #address-cells =<1> ; #size-cells =<0> ; status ="okay" ;   mpl3115@60 { // 高度计 兼容 ="FSL,MPL3115" ; reg =<0x60> ; };   ite_bridge: it6161@6c { // MIPI 转 HDMI 兼容 ="ite,it6161" ; reg =<0x6c> ;          }; };   3)我们还可以看到按下与 RTD 相连的按钮 SW7/8 (PTB13/12) 所产生的事件:   root@imx8ulpevk:~# evtest /dev/input/event0 输入驱动程序版本为 1.0.1 输入设备 ID:总线 0x19 供应商 0x0 产品 0x0 版本 0x0 输入设备名称:" rpmsg-keys " 支持的活动 事件类型 0 (EV_SYN) 事件类型 1 (EV_KEY) 事件代码 114(KEY_VOLUMEDOWN) 事件代码 115(KEY_VOLUMEUP) 属性: 测试...(中断退出) 事件:时间 1748573575.153335、类型 1(EV_KEY),代码 115(KEY_VOLUMEUP),值 1 事件:时间 1748573575.153335、-------------- SYN_REPORT ------------ 事件:时间 1748573575.332514、类型 1(EV_KEY),代码 115(KEY_VOLUMEUP),值 0 事件:时间 1748573575.332514、-------------- SYN_REPORT ------------ 事件:时间 1748573579.152752、类型 1(EV_KEY),代码 114(KEY_VOLUMEDOWN),值 1 事件:时间 1748573579.152752、-------------- SYN_REPORT ------------ 事件:时间 1748573579.309757、类型 1(EV_KEY),代码 114(KEY_VOLUMEDOWN),值 0 事件:时间 1748573579.309757、-------------- SYN_REPORT ------------   Re: imx8ulp peripheral data sharing between domains 你有答案了吗?
View full article
Creating SREC file for HAB bootable image generation I'm generating command line tools for flashing the application image to the NOR flash of the MIMXRT1170 (EVKB board). I know that the nxpimage tool helps create SREC format files from axf/elf files like this:  nxpimage utils binary-image convert -i "%AXF_FILE%" -f s19 -o "%SREC_FILE%"   But the SREC file generated is different from the SREC file that is created when using the MCUXpresso Secure Provisioning Tool in terms of the contents and addressing. When I use the MCUXpresso Secure Provisioning Tool to load an elf/axf file to create a bootable image, it adds the srec file and parsed dcd file in the source folder of the MCUXpresso Secure Provisioning Tool's workspace.  I would like to know how those srec and parsed dcd file is generated by the MCUXpresso Secure Provisioning Tool. Also checking if there is a way to extract the parsed DCD file from SREC/elf/axf file separately with any CLI tools?   I know that the MCUXpresso Secure Provisioning Tool can be invoked from CLI to automate the whole process, but we are trying to create a script that can flash the MCU with just the nxpimage and blhost tools.     Re: Creating SREC file for HAB bootable image generation Hi @tj787 , What can be seen here is the following command creates this output into specified “parsed-directory”: nxpimage.exe hab parse -f mimxrt1176 -o parsed-directory -b my-application-with-dcd.bin Kan_Li_0-1770780123329.png Hope that helps, Have a great day, Kan ------------------------------------------------------------------------------- Note: - If this post answers your question, please click the "Mark Correct" button. Thank you! - We are following threads for 7 weeks after the last post, later replies are ignored Please open a new thread and refer to the closed one, if you have a related question at a later point in time. -------------------------------------------------------------------------------
View full article
S32K376 VCU – How to implement SPI-based DIO (MSDI) in S32DS? I am working on an S32K376 VCU POC board where an MSDI device is connected over SPI. From the schematic, the following MSDI-related signals are used: schourasiya_0-1770014720752.png SPI signals: MSDI_CS, MSDI_SCLK, MSDI_MOSI, MSDI_MISO Control/status signals: MSDI_INTB, MSDI_WAKEB Analog / mux signal: MSDI_AMUX MSDI SGx / SPx pins used for digital inputs and outputs I want to implement this using MBDT (Simulink) with S32 Configuration Tools (S32CT), but I am not clear on the correct software approach. Specifically, I need guidance on: How to configure and use the SPI pins in S32CT so that they work with an external MSDI device How MSDI_INTB it MSDI_WAKEB should be configured (DIO vs ICU/EXTI) and handled in MBDT How MSDI digital inputs/outputs (SGx / SPx) are expected to be accessed in software Is there any MCAL support pattern? Or should this be implemented as custom SPI commands + application-level abstraction? How MSDI_AMUX should typically be handled (ADC path / usage expectation) I do not have a working reference or example showing this flow using MBDT + S32CT for S32K376/96 VCU & BMS Example POC project. Could you please suggest the recommended implementation approach (step-by-step or block-level) Re: S32K376 VCU – How to implement SPI-based DIO (MSDI) in S32DS? Hi @mariuslucianand  could you please comment on this? Thanks in advance. BR, Petr Re: S32K376 VCU – How to implement SPI-based DIO (MSDI) in S32DS? Hello everyone, Since no one replied, I tried multiple things on my end and found while working on the same VCU POC board using S32K396, where an external MSDI device is connected over LPSPI3. However, SPI initialization fails during runtime with a BusFault. Observed issue During execution of Lpspi_Ip_Init(), the code faults at: Base->CFGR1 = PhyUnitConfigPtr->Cfgr1; Debugger observation: schourasiya_0-1776852999802.png schourasiya_1-1776853010374.png Instance = 3 Base address = 0x40364000 The register reads: VERID = 53248 PARAM = 53249 CR = 53249 SR = 53249 Followed by: BusFault: imprecise data access error HardFault escalation: This happens on the register access to LPSPI3. Please help with: Which exact configuration/settings (refer to the attached) are incorrect? or What additional settings/MBDT Blockset are required to correctly access MSDI I/O pin data? schourasiya_2-1776853047143.png Re: S32K376 VCU – How to implement SPI-based DIO (MSDI) in S32DS? Hello, Please check the following article to get help regarding the configuration of the SPI peripheral to retrieve data from the MC33CD1030 IC: How to: MSDI MC33CD1030 on S32K396BMS-EVB using NXP MBDT  Note that the article is focused on the SPI configuration to send and receive data from the MC33CD1030 IC. For further information about the CD1030, please consult its datasheet. Best regards, Sorin Bancila
View full article
Kinara ARA-SDK 许可 恩智浦团队(以及所有熟悉 Ara-2 / Kinara 工具的人员)你们好、 我想了解为 Ara-2 (Kinara) 计算模块编译模型的正确许可/访问路径,尤其是现在 Kinara 已被恩智浦收购,而且恩智浦的公开资料描述了 SDK 与恩智浦软件生态系统的集成。 我的设置/目标 硬件Geniatech Ara-2 计算模块 SDK:Geniatech 提供的 Kinara Ara-2 SDK r1.3 使用情况:个人、非商业(研究/学习/测试) 模型目标:Qwen/Qwen2.5-7B-Instruct (GPTQ Int4) 目前有效的方法 我可以完成模式 1 流程,将模型转换为 ONNX。 我的结局是 model.onnx(小图形文件) 同一目录下的 model.onnx.data(大型外部张量数据/权重)。 什么失败了 模式 2(生成可部署 .dvm 的编译阶段)因 SDK 版本工具中的许可证签出/验证错误而失败。 据我所知,这将阻止生成 .dvm即使 ONNX 导出成功。 我的困惑 我没有 Kinara 许可证密钥。 Geniatech 的文档指出,必须通过 Kinara 获取 SDK 许可证密钥。 Kinara客户支持门户网站似乎拒绝使用常见的个人电子邮件功能域(例如gmail.com)进行注册,所以我无法在那里提交申请。 我为什么要在这里提问(恩智浦/Kinara 集成混淆) ,恩智浦的公开资料显示,Kinara 的 SDK 和模型工具正在集成到恩智浦的生态系统(包括 eIQ)中,Ara-2 现在作为恩智浦的产品提供,并提供相关的 "Ara 软件开发包 "下载。 然而,在实践中,这一点并不明确: 开发人员应在其中获取用于编译的许可证密钥,以及 现在是否支持 "Ara SDK / eIQ 集成 "路径。 问题 编译 ONNX → .dvm 是否需要许可证密钥使用 Ara-2 SDK 工具链(r1.3 / ARA-SDK),甚至用于个人/非商业用途? 如果是,个人/业余爱好者用户获得评估/开发者访问权限(尤其是在没有公司电子邮件域的情况下)的官方流程是什么? 有了现有的恩智浦账户,Ara-2 用户应该从哪里获取: “官方” Ara SDK 二进制文件/工具链(编译器),和/或 编译所需的许可机制? 如果编译需要许可证密钥,而许可证密钥又不容易获得,那么是否有任何预编译的 .dvm模型软件包(例如,用于 Qwen 7B/Qwen2.5恩智浦/Kinara/合作伙伴提供给 Ara-2 用户运行的 7B)? 如果恩智浦/Kinara 的相关人员能说明计划的路径(恩智浦门户网站与传统 Kinara 门户网站的对比,以及现在如何处理许可问题),那将大有帮助。 Re: Kinara ARA-SDK Licensing 我也有同样的问题!我拿到了设备,驱动程序。但没有 SDK,我猜也没有许可证(如果需要的话)。该设备只是静默地坐在我的联想 ThinkCentre Ultra neo 电脑里什么也没做。联想从未将其整合到 Windows 11 作为 NPU。我想至少用它来运行一些模型或进行学习。现在,它已经成为我电脑中一块完全闲置的硅片。我想,如果有更多的人开始使用这项技术,将有助于技术的普及。 Re: Kinara ARA-SDK Licensing @kratafila在我通过 Geniatech 获得 Linux SDK 软件包之前,我的硅片基本上也是闲置的。老实说,它仍然是未使用的硅,因为我无法让模型编译和运行。 值得一提的是,Geniatech(我的 Kinara Ara-2 M.2 模块的供应商)与我分享了这些 SDK/runtime 下载。它们以 Linux 为重点,我不确定它们是否适用于你的 ThinkCentre 中的 Ara-2 硬件(或者在 Windows 11 上提供帮助,里面有 Windows 二进制文件,但我在 Linux 软件方面取得了更大的成功),但是如果你能在 Linux 下测试/确认你的设备能正常运行,它们可能仍然有用: 1) 驱动程序/运行时间 + .dvm 示例型号(Geniatech"客户就绪" 捆绑): hxxps://mega[.]nz/file/nJcF0K5a#W-Ote-fp59hXoq4T0GGsaQmwGTRphWz0JATowyWjQpg 2) " 模型编译 " 文件夹 Geniatech 最初寄给我(注意:仅此一项就不包括编译器二进制文件): hxxps://mega[.]nz/file/KoclFQrJ#ifNOX7w2Y1qgLM6rnm7xPnUprwZZqhuRvelFG5p0MJQ 3) Geniatech 随后提供的完整 Ara-2 SDK 压缩包(此压缩包应包含实际的工具链/编译器,例如dvrun): hxxps: //文件 [.] geniatech [.] com/down-eng/bsp/kinara_sdk_20251120 [.] tar [.] bz2 如果你尝试了上述任何一种方法并取得了进展(即使只是安装了SDK并看到设备被识别),请在这里发回去,这不仅是为了我们,也是因为多个社区似乎对于 " 官方 " 的工作路径、SDK/许可的实际来源以及如何编译和运行其他模型存在更广泛的困惑。
View full article