Multi Source Translation Content

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Multi Source Translation Content

讨论

排序依据:
i.MX RT700 eIQ Neutron NPU 实验室指南 这些实验室指南提供了分步说明,说明如何制作量化的 TensorFlow Lite 模型,并使用 e IQ Neutron SDK 中的中子转换工具将模型转换成在 i.MX RT700 设备上 的 eIQ Neutron NPU 上运行。适用于 i.MX RT700 的 eIQ Neutron NPU 实验指南 文档 重点介绍使用 eIQ Neutron SDK 中的中子转换器工具转换模型,然后将转换后的模型导入 eIQ mcuxPresso SDK 示例。有 VSCode、GCC 和 MCUXpresso IDE 实验室 。 这些实验室旨在在 i.MX RT700 EVK 上运行,但同样的概念也可以应用于 MCX N 主板,类似于 MCX N eIQ Neutron NP U 实验室。您还可以查阅《TFLM 入门指南》,了解如何使用自己的模型和数据进行推理。 此外,请务必查看AN14700 - i.MX RT700 eIQ Neutron NPU Enablement and Performance,其中详细介绍了 i.MX RT700 上的 eIQ Neutron N3-64 NPU。 --- 2026 年 4 月末更新,适用于 MCUXpresso SDK 26.03 和 eIQ Neutron SDK 3.1.0 实践培训
查看全文
eIQ Toolkit for MCU - Getting Started Labs The tools previously bundled as part of eIQ Toolkit are now released as standalone packages and eIQ Toolkit will no longer be updated after the eIQ Toolkit v1.17 in Q3 2025. Going forward the tools previously included in eIQ Toolkit can now be found at: eIQ Neutron SDK now contains the latest versions of the Neutron Compiler tool (previously called the Neutron Converter tool before Aug 2026) eIQ Time Series Studio can now be found in a standalone package eIQ Model Creator provides an option for vision based model creation eIQ AI Toolkit will provide model optimization functionality (Coming Soon) Netron provides TFLite model viewing functionality This article will remain up for existing users. --------- eIQ Toolkit enables machine learning development with an intuitive GUI (named eIQ Portal) and development workflow tools, along with command line host tool options as part of the eIQ ML software development environment. Developers can create, optimize, debug and export ML models, as well as import datasets and models, rapidly train and deploy neural network models and ML workloads. The eIQ Portal provides output TensorFlow Lite models that seamlessly feed into eIQ inference engines like TensorFlow Lite and TensorFlow Lite for Microcontrollers. Using a tool called Model Runner, eIQ Toolkit can also generate runtime insights to help optimize neural network architectures on i.MX RT and i.MX devices. These labs go over how to use eIQ Portal. It is recommended to do them in the following order: Data Import Lab Model Runner Lab The labs are written for using a FRDM-MCXN947 and i.MX RT1170-EVK, but other eIQ supported devices can be used as well.  MCX N i.MX RT1050 i.MX RT1060 i.MX RT1064 i.MX RT1160 i.MX RT1170 i.MX RT1180 i.MX RT500 i.MX RT600 For details on the Time Series Studio tool please see the Time Series Studio lab guides. For  i.MX RT
查看全文
Solyball Cooling Ace 专为现代生活而设计 当气温升高时,保持舒适的室内环境成为许多人的首要任务。无论是在家、办公室还是个人工作空间,过高的温度都会影响注意力、放松度和整体舒适度。Solyball 正是为此提供了一个便捷实用的解决方案。Solyball 的设计兼顾便携性、简洁性和现代生活方式,是一款小巧的降温设备,可帮助用户在各种室内环境中营造更舒适的氛围。 Solyball 最显著的特点之一 是其轻巧便携的设计。与笨重难搬或占用大量空间的大型制冷系统不同,Solyball 体积小巧,几乎可以完美融入任何房间。其便携性使用户能够轻松地将其从一个地方搬到另一个地方,从而满足全天候不同需求。无论您是在家办公、在客厅放松,还是准备享受一夜安眠,Solyball 都可以放置在任何您需要额外舒适感的地方。 Solyball 的多功能性 使其成为各种室内环境的理想之选。在卧室里,它有助于在温暖的夜晚营造更舒适的氛围。舒适的睡眠环境对整体健康至关重要,而小巧的降温设备可以提升您的睡眠体验。Solyball 尺寸适中,可轻松放置在床头柜或其他平面上,不会造成空间杂乱。 对于专业人士和远程办公人员来说, Solyball能帮助他们保持舒适的工作空间,从而显著提高工作效率。室内温度过高有时会影响专注力,难以集中精力完成工作。Solyball 提供了一种切实可行的提升工作舒适度的方法,帮助用户在一天中营造更加愉悦的工作环境。其小巧的体积使其可以方便地放置在办公桌或工作台上,而不会占用过多空间。 Solyball的便利性也体现在客厅和家庭共享空间中。这些区域通常是人们聚集的中心场所,他们会在这里看电视、阅读、社交或放松身心。将 Solyball 融入这些空间,用户可以在日常活动中享受更舒适的氛围。其现代外观确保它能与现代家居装饰自然融合。
查看全文
RT1176 LVGL + VGLITE:字体渲染错误 我正在尝试将 VGLITE 应用于我的代码中,该代码基于 RT1176 上的 LVGL。我正在运行演示基准测试。 当我设置时: #define LV_USE_DRAW_SW 1 #define LV_USE_DRAW_VGLITE 0 渲染效果很好。 当我启用 VGLITE 时 #define LV_USE_DRAW_SW 0 #define LV_USE_DRAW_VGLITE 1 字母被破坏了,它们看起来像是外星字体,即使在某些帧中它们被正确渲染。启用 VGLITE 后,演示程序会在场景 14 卡住。 我应该从哪里开始调查? Re: RT1176 LVGL + VGLITE: Bad font rendering 嘿@P3r3gr1nus ,我启用 vglite 时也遇到了同样的问题(文本渲染错误),请问您是否已经解决了这个问题? Re: RT1176 LVGL + VGLITE: Bad font rendering 你好@EdwinHz ,我发现问题与字符串中的字符数有关。我按顺序展示: 字符串 123 字符串 1234 字符串 12345 字符串 123456 字符串 1234567 字符串 12345678 字符串 123456789 字符串 1234567890 恰好从“String 12345”到“String 12345678”的字符串损坏了(字体异常),其他字符串都正常。该序列会重复出现,且行为是确定性的。当我将字体大小从lv_font_montserrat_14 更改为 lv_font_montserrat_12 时,也会出现同样的问题。 此时,了解 LVGL9 + VGLITE 是否已经过验证对我来说应该很有用。 Re: RT1176 LVGL + VGLITE: Bad font rendering 这里有一个关于这个问题的简短视频。似乎只影响文本。即使过了一会儿演示画面卡住了。 Re: RT1176 LVGL + VGLITE: Bad font rendering 你好@EdwinHz , 是的,如果我按照您的建议,在 conf.h 文件中禁用 VGLITE: LV_USE_DRAW_VGLITE 0 LV_USE_DRAW_SW 1 一切都很好。 然而,我的目标是启用 VGLITE GPU 加速。我使用了 demo_benckmark 作为参考,但最终目标将是我的应用程序。 此外,我没有使用 RGB888,而是使用了 LV_COLOR_DEPTH 16 缓冲区设置为 RGB565。 我忘了提一下,我的项目是基于 RT1176 的,我使用的是 FREERTOS。 你认为VGLITE有可能与LVGL一起使用吗? Re: RT1176 LVGL + VGLITE: Bad font rendering 嗨@P3r3gr1nus , 如“lvgl_examples_readme.md”中所述文件: “ GPU 和 PXP 不支持 8 位,请取消选中 `LV_USE_DRAW_VGLITE` 和 `LV_USE_PXP`。 在 Kconfig 中,或者像这样修改 mcux_config.h: ``` #define CONFIG_LV_USE_DRAW_VGLITE 0 #define CONFIG_LV_USE_PXP 0 #define CONFIG_LV_ATTRIBUTE_MEM_ALIGN_SIZE 1 #define CONFIG_LV_DRAW_SW_DRAW_UNIT_CNT 1 ” BR, 埃德温。 Re: RT1176 LVGL + VGLITE: Bad font rendering 你好@HasanIqbalKhan , 不,最后我禁用了 VGLITE。即使是成绩的提升也没有预期的那么好。
查看全文
Falcon Mode Enablement - iMX8MP_EVK Hi, I need to enable Falcon Mode on iMX8MP_EVK in the Yocto branch 6.12-walnascar. However, as per the AN14641 document, the meta-imx-fastboot layer is available only in the lf-6.6.36-2.1.0-secure branch. How can I port this layer to my walnascar branch and enable Falcon Mode? Please help here.. Re: Falcon Mode Enablement - iMX8MP_EVK Please use the following command. uuu -b emmc_all - .rootfs.wic For example: $ uuu -b emmc_all imx-boot-imx95evk-sd.bin-flash_all     core-image-minimal-imx95evk.rootfs.wic Re: Falcon Mode Enablement - iMX8MP_EVK Hi Tipingwang, Thanks for your reply. I am trying to enable Falcon mode and have followed the steps provided in AN14641, but I am getting stuck during the flashing process. As per the README, the flashing steps are mentioned as below (for eMMC): unzstd -[secure-boot]- .rootfs.wic.zst uuu -b emmc_all - .rootfs.wic uuu -b emmc My boot memory is eMMC. I attempted to flash the image using the following command: sudo ./uuu -d -v -b emmc_all imx-boot-imx8mpevk-sd.bin-flash_evk imx-image-core-imx8mpevk.rootfs-20260616051114.wic However, during execution, the flashing process fails with the following error: sudo ./uuu -d -v -b emmc_all imx-boot-imx8mpevk-sd.bin-flash_evk imx-image-core-imx8mpevk.rootfs-20260616051114.wic uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.5.243-5-g124d086   Build in config: Pctl Chip Vid Pid BcdVersion Serial_No ================================================== SDPS: MX8QXP 0x1fc9 0x012f [0x0002..0xffff] SDPS: MX8QM 0x1fc9 0x0129 [0x0002..0xffff] SDPS: MX8DXL 0x1fc9 0x0147 SDPS: MX28 0x15a2 0x004f SDPS: MX815 0x1fc9 0x013e SDPS: MX865 0x1fc9 0x0146 SDPS: MX8ULP 0x1fc9 0x014a SDPS: MX8ULP 0x1fc9 0x014b SDPS: MX93 0x1fc9 0x014e SDPS: MX91 0x1fc9 0x0159 SDPS: MX95 0x1fc9 0x015d SDPS: MX95 0x1fc9 0x015c SDPS: MX943 0x1fc9 0x0027 SDPS: MX952 0x1fc9 0x0028 SDP: MX7D 0x15a2 0x0076 SDP: MX6Q 0x15a2 0x0054 SDP: MX6D 0x15a2 0x0061 SDP: MX6SL 0x15a2 0x0063 SDP: MX6SX 0x15a2 0x0071 SDP: MX6UL 0x15a2 0x007d SDP: MX6ULL 0x15a2 0x0080 SDP: MX6SLL 0x1fc9 0x0128 SDP: MX7ULP 0x1fc9 0x0126 SDP: MXRT106X 0x1fc9 0x0135 SDP: MX8MM 0x1fc9 0x0134 SDP: MX8MQ 0x1fc9 0x012b SDPU: SPL 0x0525 0xb4a4 [0x0000..0x04ff] SDPV: SPL1 0x0525 0xb4a4 [0x0500..0x9998] SDPV: SPL1 0x1fc9 0x0151 [0x0500..0x9998] SDPU: SPL 0x0525 0xb4a4 [0x9999..0x9999] SDPU: SPL 0x3016 0x1001 [0x0000..0x04ff] SDPV: SPL1 0x3016 0x1001 [0x0500..0x9998] FBK: 0x066f 0x9afe FBK: 0x066f 0x9bff FBK: 0x1fc9 0x0153 FB: 0x0525 0xa4a5 FB: 0x18d1 0x0d02 FB: 0x3016 0x0001 FB: 0x1fc9 0x0152 FB: 0x0483 0x0afb FB: 0x1d6b 0x0104   Run built-in script:   uuu_version 1.4.149   # @_flash.bin            | bootloader, which can extract from wic image # @_image   [_flash.bin] | wic image burn to emmc.     # This command will be run when i.MX6/7 i.MX8MM, i.MX8MQ SDP: boot -f imx-boot-imx8mpevk-sd.bin-flash_evk -scanlimited 0x800000   # This command will be run when ROM support stream mode # i.MX8QXP, i.MX8QM SDPS: boot -scanterm -f imx-boot-imx8mpevk-sd.bin-flash_evk -scanlimited 0x800000   # These commands will be run when use SPL and will be skipped if no spl # SDPU will be deprecated. please use SDPV instead of SDPU # { SDPU: delay 1000 SDPU: write -f imx-boot-imx8mpevk-sd.bin-flash_evk -offset 0x57c00 SDPU: jump -scanlimited 0x800000 # }   # These commands will be run when use SPL and will be skipped if no spl # if (SPL support SDPV) # { SDPV: delay 1000 SDPV: write -f imx-boot-imx8mpevk-sd.bin-flash_evk -skipspl -scanterm -scanlimited 0x800000 SDPV: jump -scanlimited 0x800000 # }     FB: ucmd setenv fastboot_dev mmc FB: ucmd setenv mmcdev ${emmc_dev} FB: ucmd mmc dev ${emmc_dev} FB: flash -raw2sparse all imx-image-core-imx8mpevk.rootfs-20260616051114.wic FB: flash -scanterm -scanlimited 0x800000 bootloader imx-boot-imx8mpevk-sd.bin-flash_evk FB: ucmd if env exists emmc_ack; then ; else setenv emmc_ack 0; fi; FB: ucmd mmc partconf ${emmc_dev} ${emmc_ack} 1 0 FB: done     Wait for Known USB Device Appear... New USB Device Attached at 1:2-152E1000D9DE520A 1:2-152E1000D9DE520A>Start Cmd:SDPS: boot -scanterm -f imx-boot-imx8mpevk-sd.bin-flash_evk -scanlimited 0x800000 14%1:2-152E1000D9DE520A>Fail HID(W): LIBUSB_ERROR_TIMEOUT (-7)(20.07s) The detailed uuu logs are attached above for reference. Could you please guide me on the correct procedure to flash a Falcon-enabled OS into eMMC, or let me know if I am missing any required steps or configurations? Thanks in advance for your support. Re: Falcon Mode Enablement - iMX8MP_EVK Falcon Mode is not incompatible with Secure Boot BUT On lf-6.12.20-2.0.0-secure, you cannot enable Secure Boot together with Falcon Mode using the provided Yocto flow About 0001-imx8m-reset-ethernet-phy-in-spl.patch For i.MX8MP EVK → strongly recommended Not strictly required if you don't use Ethernet during early boot Re: Falcon Mode Enablement - iMX8MP_EVK Hi Yiping Wang, Thank you for your response. I have a couple of additional questions for clarification. According to the information provided, the branch lf-6.12.20-2.0.0-secure supports Falcon Mode v2, but Secure Boot is marked as not yet supported. Since Secure Boot is a requirement for my i.MX8MP platform, will Falcon Mode work correctly if I use this branch, or is Falcon Mode incompatible when Secure Boot is enabled? For the i.MX8MP EVK, do I need to apply the patch 0001-imx8m-reset-ethernet-phy-in-spl.patch, or is it optional depending on the use case? Re: Falcon Mode Enablement - iMX8MP_EVK You probably do not need to port the layer from lf-6.6.36-2.1.0-secure yourself. The public nxp-imx-support/meta-imx-fastboot - GitHub repository already shows a lf-6.12.20-2.0.0-secure branch. Please refer to README in https://github.com/nxp-imx-support/meta-imx-fastboot Re: Falcon Mode Enablement - iMX8MP_EVK Please help here, And i am using UUU to flash eMMC Re: Falcon Mode Enablement - iMX8MP_EVK As per this image i found in NXP forum it seems that flashing eMMC using the UUU tool may not be supported in this case. Could you please suggest the appropriate method to flash an eMMC device with a Falcon-enabled OS? In your previous reply, you suggested using the following command:   - .rootfs.wic> I tried this approach, but I encountered the same error again: Fail HID(W): LIBUSB_ERROR_TIMEOUT (-7) (20.07s) Could you please guide me on the correct flashing procedure or any alternative tools or steps required for flashing eMMC with Falcon mode enabled? Re: Falcon Mode Enablement - iMX8MP_EVK I verified the following commands on IMX95FRDM, there is no problem, please refer to my log. C:\Users\nxa22585>C:\Users\nxa22585\Downloads\i.mx95\uuu.exe -lsusb uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.5.243-0-g230f1b1 Connected Known USB Devices Path Chip Pro Vid Pid BcdVersion Serial_no ==================================================================== 2:4 MX95 SDPS: 0x1FC9 0x015D 0x0002 61F49AAB2DCB4DDF C:\Users\nxa22585>C:\Users\nxa22585\Downloads\i.mx95\uuu.exe -b emmc_all C:\Users\nxa22585\Downloads\i.mx95\imx-boot-imx95-15x15-lpddr4x-frdm-sd.bin-flash_all C:\Users\nxa22585\Downloads\i.mx95\core-image-minimal-imx8mnevk.rootfs.wic uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.5.243-0-g230f1b1 Success 1 Failure 0 1:2-61F49AAB 8/ 8 [Done ] FB: done 2:4-61F49AAB 3/ 3 [=================100%=================] SDPV: jump -scanlimited 0x800000 C:\Users\nxa22585> Re: Falcon Mode Enablement - iMX8MP_EVK Please help here i have stucked in this part Re: Falcon Mode Enablement - iMX8MP_EVK In previous reply you gave a reference command for IMX95FRDM is that falcon enabled?  Here you can find what i was done in Yocto - IMX8MP 1) meta-imx-fastboot - lf-6.12.20-2.0.0-secure - Github_Link 2) Added this meta to my source - Github_Link 3) And followed all the instruction gave by  AN14641 document. 4)Bitbake commands that i followed:  bitbake -c clean linux-imx && bitbake -c clean imx-boot && bitbake -c clean u-boot-imx && bitbake -c clean imx-atf && bitbake -c clean imx-image-core  bitbake -c compile linux-imx && bitbake -c compile imx-boot && bitbake -c compile u-boot-imx && bitbake -c compile imx-atf && bitbake -c compile imx-image-core bitbake linux-imx && bitbake imx-boot && bitbake u-boot-imx && bitbake imx-atf && bitbake imx-image-core 5)  CASE 1: sudo ./uuu -b emmc_all imx-image-core-imx8mpevk.rootfs-20260617095251.wic uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.5.243-5-g124d086 Success 0 Failure 0 1:2-152E1000 1/ 1 [=================100%=================] SDPS: boot -scanterm -f /home/smurugan8/YOCTO/LWT/image/imx-image-core-imx8mpevk.rootfs-20260617095251.wic -scanlimited 0x800000 CASE 2:  sudo ./uuu -b emmc_all imx-boot-imx8mpevk-sd.bin-flash_evk imx-image-core-imx8mpevk.rootfs-20260617095251.wic uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.5.243-5-g124d086 Success 0 Failure 1 1:2-152E1000 1/ 1 [HID(W): LIBUSB_ERROR_TIMEOUT (-7) ] SDPS: boot -scanterm -f imx-boot-imx8mpevk-sd.bin-flash_evk -scanlimited 0x800000 IMPORTANT : I NEED TO FLASH A FALCON ENABLED OS INTO eMMC  Re: Falcon Mode Enablement - iMX8MP_EVK Please note uuu is only used to program images to emmc, it doesn't check the content of your images. I suspect there is problem with your uuu command itself. Where did you download uuu? Please download the latest UUU from https://github.com/nxp-imx/mfgtools/releases Please download the Windows version UUU to do verification. Re: Falcon Mode Enablement - iMX8MP_EVK Hi yipingwan I also tried using the UUU tool on Windows, but I am seeing the same result—it still does not work for flashing eMMC.  I have attached the UUU -log. However, when I flash the same Falcon-enabled OS to an SD card, it boots and works correctly. This confirms that the image itself and the Falcon configuration are valid. My question is: Why am I unable to flash this Falcon-enabled image to eMMC, even though the same image works from SD? Is there any alternative or recommended method to flash a Falcon-enabled OS to eMMC, other than using UUU? Could you please advise on the supported or reliable procedure for flashing eMMC in this scenario? Re: Falcon Mode Enablement - iMX8MP_EVK Please help here. Re: Falcon Mode Enablement - iMX8MP_EVK Please execute the following command with your Windows version UUU and send the result to me to do more investigation. uuu.exe -b emmc_all imx-boot-imx8mpevk-sd.bin-flash_evk   imx-image-core-imx8mpevk.rootfs-20260617095251.wic Re: Falcon Mode Enablement - iMX8MP_EVK Please try the following command uuu.exe -b emmc_all  C:\Users\vvdn\Sanjiv\Falcon\imx-boot-imx8mpevk-sd.bin-flash_evk C:\Users\vvdn\Sanjiv\Falcon\imx-image-multimedia-imx8mpevk.rootfs-20260624074743.wic Then send the result to me again. Re: Falcon Mode Enablement - iMX8MP_EVK Here you can find the output, PS C:\Users\vvdn\Sanjiv\uuu_source-uuu_1.5.243\uuu-uuu_1.5.243\uuu> .\uuu.exe -b emmc_all C:\Users\vvdn\Sanjiv\Falcon\imx-boot-imx8mpevk-sd.bin-flash_evk C:\Users\vvdn\Sanjiv\Falcon\imx-image-multimedia-imx8mpevk.rootfs-20260624074743.wic uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.5.243-0-g230f1b1 Success 0 Failure 1 1:3-152E1000 1/ 1 [HID(W): LIBUSB_ERROR_TIMEOUT (-7) ] SDPS: boot -scanterm -f C:\Users\vvdn\Sanjiv\Falcon\imx-b... Re: Falcon Mode Enablement - iMX8MP_EVK I above you can find the log of UUU,  Command=> .\uuu.exe -b emmc C:\Users\vvdn\Sanjiv\Falcon\imx-boot-imx8mpevk-sd.bin-flash_evk C:\Users\vvdn\Sanjiv\Falcon\imx-image-multimedia-imx8mpevk.rootfs-20260624074743.wic But it is not working in eMMC , Same Image will work in SD Card Re: Falcon Mode Enablement - iMX8MP_EVK I verified on IMX8MP_EVK target board, there is no problem to program emmc, please refer to my following log. C:\Users\nxa22585>C:\Users\nxa22585\Downloads\i.mx95\uuu.exe -b emmc_all C:\Users\nxa22585\Downloads\i.mx95\imx-boot-imx8mpevk-sd.bin-flash_evk C:\Users\nxa22585\Downloads\i.mx95\core-image-minimal-imx8mnevk.rootfs.wic uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.5.243-0-g230f1b1 Success 1 Failure 0 2:4-0F0B9800 8/ 8 [Done ] FB: done C:\Users\nxa22585> Please extracted my image from the attached file, and only execute the following command. uuu.exe -b emmc imx-boot-imx8mpevk-sd.bin-flash_evk If it still fails, it seems there is problem with EMMC itself on your target board. You could use the following emmc command to check whether you could write something to emmc in u-boot. Usage: mmc read addr blk# cnt mmc write addr blk# cnt mmc erase blk# cnt Re: Falcon Mode Enablement - iMX8MP_EVK Please only try whether you can write a default boot image to emmc with UUU. Re: Falcon Mode Enablement - iMX8MP_EVK Yes, @yipingwang, When I include the meta-imx-fastboot layer in my build, the flashing process gets stuck. However, if I remove the meta-imx-fastboot layer, I am able to flash the image to eMMC successfully. Re: Falcon Mode Enablement - iMX8MP_EVK I have one question @yipingwang it is falcon enabled image Re: Falcon Mode Enablement - iMX8MP_EVK Please help here.. @yipingwang Re: Falcon Mode Enablement - iMX8MP_EVK Please send /home/smurugan8/YOCTO/LWT/image/falcon_mode/imx-boot-imx8mpevk-sd.bin-flash_evk to me. I will do verification on my target board. Re: Falcon Mode Enablement - iMX8MP_EVK Hi @Sanjiv_Mns  The meta-secure-boot Yocto layer is not implemented for the 6.12.20 BSP. Since the meta-imx-fastboot layer depends on the meta-secure-boot, the branch lf-6.12.20-2.0.0-secure does not implement secure boot. The 0001-imx8m-reset-ethernet-phy-in-spl.patch patch is mandatory if you need to use the Ethernet interfaces in Linux. It resets the PHYs, without which the Linux driver cannot initialize the interfaces. Re: Falcon Mode Enablement - iMX8MP_EVK Please find the attachment . Re: Falcon Mode Enablement - iMX8MP_EVK Hi @yipingwang , I have done the commands which you gave in previous reply, here you can find the command logs & Boot logs COMMAND LOGS: sudo ./uuu -b emmc_all /home/smurugan8/YOCTO/LWT/image/default/imx-boot-imx8mpevk-sd.bin-flash_evk /home/smurugan8/YOCTO/LWT/image/default/imx-image-multimedia-imx8mpevk.rootfs-20260622071640.wic uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.5.243-5-g124d086 Success 1 Failure 0 1:1-152E1000 8/ 8 [Done ] FB: done sudo ./uuu -b emmc /home/smurugan8/YOCTO/LWT/image/default/imx-boot-imx8mpevk-sd.bin-flash_evk /home/smurugan8/YOCTO/LWT/image/falcon_mode/imx-boot-imx8mpevk-sd.bin-flash_evk uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.5.243-5-g124d086 Success 1 Failure 0 1:1-152E1000 7/ 7 [Done ] FB: Done BOOT LOGS: U-Boot SPL 2025.04-g44898b9f3cfe-dirty (Sep 03 2025 - 09:56:50 +0000) DDRINFO: start DRAM init DDRINFO: DRAM rate 4000MTS DDRINFO:ddrphy calibration done DDRINFO: ddrmix config done SEC0: RNG instantiated Normal Boot Trying to boot from MMC2 spl_load_image_fat: error reading image kernel-atf-dtb.itb, err - -5 spl_load_image_fat: error reading image u-boot-atf.itb, err - -5 Error: -2 SPL: failed to boot from all boot devices ### ERROR ### Please RESET the board ### Re: Falcon Mode Enablement - iMX8MP_EVK Hi @Sanjiv_Mns  Falcon Mode images works on both SD and eMMC. To flash a Falcon image on eMMC/SD you need to: 1. Build the default bootloader. In a clean Yocto environment, run: bitbake imx-boot. Make sure the meta-imx-fastboot layer is not added at this step. This will generate the tmp/deploy/images/imx8mp-lpddr4-evk/imx-boot-imx8mp-lpddr4-evk-sd.bin-flash_evk default bootloader. 2. Build the falcon mode bootloader and the falcon mode image. Add the meta-imx-fastboot layer to your BBLAYERS. To compile the falcon mode bootloader, run: bitbake imx-boot This command will generate the tmp/deploy/images/imx8mp-lpddr4-evk/imx-boot-imx8mp-lpddr4-evk-sd.bin-flash_evk_dual_bootloader falcon bootloader. This bootloader contains only the SPL, without the U-Boot proper. When the meta-imx-fastboot layer is added, the *_dual_bootloader is generated. See layer.conf.   To compile the falcon mode image, run: bitbake imx-image-multimedia This will generate the tmp/deploy/images/imx8mp-lpddr4-evk/imx-image-multimedia-imx8mp-lpddr4-evk.rootfs.wic.zst image. 3. Use UUU to flash the image on the eMMC. UUU is the only tool available to flash images on the eMMC. uuu -b emmc_all imx-boot-imx8mp-lpddr4-evk-sd.bin-flash_evk imx-image-multimedia-imx8mp-lpddr4-evk.rootfs.wic.zst uuu -b emmc imx-boot-imx8mp-lpddr4-evk-sd.bin-flash_evk imx-boot-imx8mp-lpddr4-evk-sd.bin-flash_evk_dual_bootloader Re: Falcon Mode Enablement - iMX8MP_EVK Please remove bld-xwayland build folder to rebuild images. $ rm -rf bld-xwayland $ MACHINE=imx8mpevk DISTRO=fsl-imx-xwayland source ./imx-setup-release.sh -b bld-xwayland $ bitbake-layers add-layer ../sources/meta-imx-fastboot Please add the following line in bld-xwayland/conf/local.conf FALCON_KERNEL_BOOTARGS:mx8mp-generic-bsp = "console=ttymxc1,115200 root=/dev/mmcblk2p2 rootwait rw quiet" Then rebuild images: $ bitbake imx-boot $ bitbake core-image-minimal uuu.exe -b emmc_all imx-boot-imx8mpevk-sd.bin-flash_evk core-image-minimal-imx8mpevk.rootfs.wic uuu.exe -b emmc imx-boot-imx8mpevk-sd.bin-flash_evk imx-boot-imx8mpevk-sd.bin-flash_evk_falcon Please refer to my verification log: U-Boot SPL 2025.04-g9383f8387dc7-dirty (Jun 04 2025 - 09:48:20 +0000) DDRINFO: start DRAM init DDRINFO: DRAM rate 4000MTS DDRINFO:ddrphy calibration done DDRINFO: ddrmix config done SEC0: RNG instantiated Normal Boot Trying to boot from MMC2 Failed to find node!, err: -11! Failed to find node!, err: -11! NOTICE: Do not release JR0 to NS as it can be used by HAB NOTICE: BL31: v2.12.0(release):lf-6.12.20-2.0.0-dirty NOTICE: BL31: Built : 08:15:07, May 9 2025 [ 0.324123] imx8mp-ldb ldb-display-controller: Failed to create device link (0x180) with 32e90000.lcd-controller [ 0.395104] : mipi_csis_imx8mp_phy_reset, No remote pad found! [ 0.514210] imx8mp-ldb ldb-display-controller: Failed to create device link (0x180) with 1-004c [ 0.576883] imx8mp-ldb ldb-display-controller: Failed to create device link (0x180) with 1-004c [ 0.625848] ov5640 1-003c: ov5640_write_reg: error: reg=3008, val=42 [ 0.632862] ov5640 1-003c: ov5640_write_reg: error: reg=3103, val=11 [ 0.639669] ov5640 1-003c: ov5640_read_reg: error: reg=3108 [ 0.645268] ov5640 1-003c: failed to power on [ 0.661389] imx8mp-ldb ldb-display-controller: Failed to create device link (0x180) with phy-lvds [ 0.694937] [drm:drm_bridge_attach] *ERROR* failed to attach bridge /soc@0/bus@32c00000/mipi_dsi@32e60000 to encoder DSI-41: -19 [ 0.706570] imx_sec_dsim_drv 32e60000.mipi_dsi: Failed to attach bridge: 32e60000.mipi_dsi [ 0.714859] imx_sec_dsim_drv 32e60000.mipi_dsi: failed to bind sec dsim bridge: -19 NXP i.MX Release Distro 6.12-walnascar imx8mpevk ttymxc1 imx8mpevk login: root root@imx8mpevk:~# Re: Falcon Mode Enablement - iMX8MP_EVK Please use the following commands to program images to the target board with UUU. unzstd <image_name>-[secure-boot]-<machine_name>.rootfs.wic.zst uuu -b emmc_all <default_bootloader> <image_name>-<machine_name>.rootfs.wic uuu -b emmc <default_bootloader> <falcon_mode_bootloader>  The first parameter is the default bootloader, falcon mode bootloader is only specified in the second parameter of the second uuu command. Re: Falcon Mode Enablement - iMX8MP_EVK Hi @yipingwang & @elena_popa  Thank you so much for your support
查看全文
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: 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. 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). Note: If the K82 SDK is not installed an error message will appear, please click on cancel. 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. 3. Select the SDK example “hello_world_cm33_core0” and click on finish. 4.Now we will add the required drivers for migration, which are SPI and CTIMER drivers. . Click on properties-> SDK Management-> Manage SDK Components. 5. Search in the filter bar “ctimer” and “lpspi” and check their boxes to add them and click on OK. 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.              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”. In the tab that will open, write the name of the file (NfcrdlibEx1_DiscoveryLoop.c) and then, click on “Finish”. Finally, in the created file copy and paste all the code inside the original source file located in the library example. 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…”. 3. Browse into the path where the library was extracted, choose the NxpNfcRdLib folder and click on Finish. 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. But if the included folders are not in the Project Explorer, the Project should look like this: Once this is done, we will need to delete the “KinetisSDK” folder located in “DAL > src” to avoid multiple definition issues. 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… 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 Click on the “Add...” button at the top right corner of the “Defined symbols (-D)” menu and enter each symbol mentioned before. 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: 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. 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. 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. 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. 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 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: 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: 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. 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: 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: 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: 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; } 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. 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; } 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; } 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. 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. 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: 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: 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. 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. 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(). 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: 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. 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: 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. 4.Click on the “Add..” button at the top right corner of the “Include paths (-l)” menu. 5. Click on “Workspace…” 6. Add the following highlighted directories from FRDM-MCXN project: 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 “ ”. 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. 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: 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: Now if any NFC tag is close to the PNEV5190BP’s antenna, you should see the information displayed as shown in the image below: 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. 2. Search the FreeRTOS kernel component (NXP integration layer), heap 4 and add it to your project. 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”: 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. 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”. 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” 3. Repeat this step in project > Properties > “C/C++ Build” >Settings >“Includes”. 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”. 2. Now find the previous macro named “PH_OSAL_NULLOS”, double click on it and change it to “PH_OSAL_FREERTOS” 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: 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: Now you are able to build and debug following the chapter Testing Final Project Without OS but now with FreeRTOS. NFC Reader Library
查看全文
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/许可的实际来源以及如何编译和运行其他模型存在更广泛的困惑。
查看全文
S32DS FOR ARM cannot be downloaded. S32DS software download is rejected, want to know the specific reasons and ways to deal with, I am a personal user without a company, the development board is the network to buy learning to use. The web page prompts the following: Our records indicate that you have previously requested an Evaluation version for this product. If you would like to purchase the full product please visit us at NXP or contact your sales representative . Note If you would like to extend your evaluation period please open a If you would like to extend your evaluation period please open a Service Request . Disabled creation of service requests Since we are unable to associate your email address with a company, you are not eligible to create a new service request on the Service Request Portal page. Please use your company email address to log in to the NXP website and submit a service request or submit your question via the NXP Technical Forum.   Re: S32DS FOR ARM 无法下载 Hi,  which version of S32DS do you like to download? 
查看全文
PCIe:i.MX 95:分配多个 MSI IRQ 向量 您好, 我们在基于 i.MX95 的系统上使用 ATH12K Wi-Fi 模块,通过 PCIe2 实例连接。 在基于 linux-imx lf-6.12.y 的内核上,这个设置失败了,而在基于 lf-6.6.y 的内核上,它却能正常工作。 内核驱动程序成功请求并接收了 16 个 MSI 中断。但是,它随后无法启动 Wi-Fi 模块: [ 5.888139] ath12k_pci 0001:01:00.0:添加到 iommu 组 5 [ 5.888506] ath12k_pci 0001:01:00.0:BAR 0 [mem 0xa10000000-0xa101fffff 64bit]: assigned [ 5.888553] ath12k_pci 0001:01:00.0:启用设备 (0000-> 0002) [5.889315] ath12k_pci 0001:01:00.0:MSI 向量:16 [ 5.889334] ath12k_pci 0001:01:00.0:硬件名称: wcn7850 hw2.0 [ 6.475718] ath12k_pci 0001:01:00.0:chip_id 0x2 chip_family 0x4 board_id 0xff soc_id 0x40170200 [ 6.475743] ath12k_pci 0001:01:00.0:fw_version 0x110cffff fw_build_timestamp 2025-06-25 09:26 fw_build_id QC_IMAGE_VERSION_STRING=WLAN.HMT.1.1.c5-00302-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.115823.3 [ 7.647106] ath12k_pci 0001:01:00.0:无法接收控制响应完成,轮询... [8.675241] ath12k_pci 0001:01:00.0:服务连接超时 [ 8.681002] ath12k_pci 0001:01:00.0:连接 HTT 失败: -110 [ 8.692180] ath12k_pci 0001:01:00.0:未能启动核心:-110 在使用不同的 PCIe 设备的内核邮件列表 [1] 上进行了相关讨论,但尚未确定我们系统的有效配置。 最好的办法是什么? 感谢您的支持。 最大值 [1]https://lore.kernel.org/all/1819305.VLH7GnMWUR@steina-w/ Re: PCIe: i.MX 95: Allocate Multiple MSI IRQ Vectors 你好 i,MX95 还处于早期阶段,某些配置还没有设计出来。然而,您的 i.MX95(带 ATH12K,通过 PCIe2)在下列情况下出现故障 lf-6.12.y 但可在 lf-6.6.y 上运行提示新内核的 PCIe 或 Wi-Fi 堆栈存在回归或驱动程序交互变化,可能涉及 ATH12K 的 PCIe 电源管理单元 (ASPM)、MSI 映射或 PCIe 特定 PCIe 端点异常,通常可通过内核补丁或在较新内核的启动参数中禁用 ASPM 来解决;检查 dmesg 中是否有 PCIe 错误,比较设备树,并在 NXP/Linux 内核邮件列表中查找相关提交。  以下是潜在原因和故障排除步骤的详细介绍: 1.检查内核日志 (dmesg) 查找 PCIe 错误: 在失败的 lf-6.12.y 内核的 dmesg 中搜索"PCI","MSI","ATH12K","Error","Firmware", 或"Timeout" 消息。 固件加载:验证是否正确加载了 ath12k 固件,以及初始化过程中是否出现任何错误。  2。PCIe 电源管理单元 (ASPM) 常见问题:较新的内核通常默认启用主动状态电源管理 (ASPM),这可能会导致嵌入式系统上的 ATH12K 等 PCIe 设备出现问题,尤其是较旧的固件/硬件。 尝试禁用 ASPM:将 p cie_aspm=off 添加到内核启动参数(例如,在 U-Boot 或 GRUB 中),然后再次测试。  3.Devicetree/DTB 的差异 比较 DTB: 生成并比较两个内核(.dtb 文件)中使用的设备树 Blob (DTB)。 查看 p ci2 的 PCIe 节点的变化,尤其是与中断、功率域或兼容性特性相关的变化。  4.内核驱动程序/固件回归 特定提交: lf-6.12.y 中的 ATH12K 驱动程序 ( ath12k)、 mac80211 或核心 PCIe/ARM 代码可能引入了一项破坏设置 的更改。 搜索邮件列表:查看 Linux 内核邮件列表 (LKML) 和恩智浦列表,了解相关补丁或有关 ath12k 、 i.MX95 和较新内核(6.12 以上)的讨论。  5.微星处理 中断重映射:在接收中断的同时,处理中断的方式(MSI-X 与 MSI、中断重映射)可能会发生微妙的变化。 检查 proc/interrupts 中的中断:查看不同内核的中断分布或计数是否不同。  6.固件 Blob 固件版本:确保为 ATH12K 使用正确的固件,并与较新内核的驱动程序兼容。有时,更新的驱动程序需要更新的固件。  总之,从 dmesg 开始,尝试禁用 ASPM;这些是导致嵌入式平台上较新内核出现 PCIe Wi-Fi 故障的最常见原因   此致 Re: PCIe: i.MX 95: Allocate Multiple MSI IRQ Vectors 虽然这些建议是调试问题的好指导,但我找不到解决方案,也就是说,并非所有的 MSI IRQ 向量都触发了驱动程序中的 IRQ 例程。 最后,我改变了 ath12k 驱动程序,只请求一个 MSI IRQ,从而解决了这个问题。 请注意,当前的 Linux 主版本不存在这个问题。 此致 最大值
查看全文
McuPGOOD_POLARITYControl Configuration Error Reported When EB Updates RTD 7.0.0_QLP03 This McuPGOOD_POLARITYControl configuration item is not found under this path Re: EB更新RTD 7.0.0_QLP03时报告McuPGOOD_POLARITYControl配置错误 Hi@WeiCh I'm not sure if you can download it, you can try it, if not, contact your agent or FAE for evaluation access. https://www.nxp.com/design/design-center/software/automotive-software-and-tools/real-time-drivers-rtd:AUTOMOTIVE-RTD Re: EB更新RTD 7.0.0_QLP03时报告McuPGOOD_POLARITYControl配置错误 Where can I download 30.0.0?Will 30.0.0 open a 29.0.0 project? Re: EB更新RTD 7.0.0_QLP03时报告McuPGOOD_POLARITYControl配置错误 Hi@WeiCh I see that the version of EB Tresos that this version adapts to should be 30.0.0, not the version you are using. Re: EB更新RTD 7.0.0_QLP03时报告McuPGOOD_POLARITYControl配置错误 Hi@WeiCh In the download screen there is this hint that you have to change the suffix Re: EB更新RTD 7.0.0_QLP03时报告McuPGOOD_POLARITYControl配置错误 It's already working, thanks! Re: EB更新RTD 7.0.0_QLP03时报告McuPGOOD_POLARITYControl配置错误 This is the 30.0.0 interface, which still doesn't seem to have this configuration item. Re: EB更新RTD 7.0.0_QLP03时报告McuPGOOD_POLARITYControl配置错误 Hi@WeiCh The style of your interface is not right, the style of the new version is totally different from the old one. Re: EB更新RTD 7.0.0_QLP03时报告McuPGOOD_POLARITYControl配置错误 There seems to be a bit of a problem, running setup prompts that there is no installer, you can unzip EBtresosStudio_EBtresosStudio.zip and open the app directly, but the app interface is still old: Re: EB更新RTD 7.0.0_QLP03时报告McuPGOOD_POLARITYControl配置错误 Hi@WeiCh Okay, you're welcome.
查看全文
Installing SDK for NHS3152 fails Hello, I am trying to develop the firmware for a NHS3152TEMOADK board. I have MCUXpresso 25.6.136. When trying to install the SDK (release_mra2_12_6_nhs3152.zip) I get the following error message shown in the attached picture. Please suggest a solution. Mo Re: Installing SDK for NHS3152 fails Hello @MoAbdol  Please select the below button and import the project should be working. Does not need install SDK.
查看全文
Linux 中的 SJA1105,通过 PHY 接口连接所有 5 个端口? 您好, 我正在开发一个基于 SMARC 格式计算机模块的项目,该模块配备了 Rockchip RK3399 CPU。在同一块主板上,我们有一个 SJA1105 开关。CPU 运行 Linux (5.4),使用 NET_DSA_SJA1105 驱动程序。 我们的 CPU 需要通过以太网与其他设备通信,因此 CPU 需要连接到交换机。 在 SJA1105 数据表和 Linux 内核设备树示例中,主机 CPU 始终作为固定链路直接通过 XMiI 连接到交换机。(https://www.kernel.org/doc/Documentation/devicetree/bindings/net/dsa/sja1105.txt) 我们无法做到这一点,因为我们的 SMARC 模块只能提供来自 RK3399 以太网集成 PHY 的引脚输出,我们无法直接物理访问 CPU 上的 xMII 接口,无论我们多么希望这样做。 在 SJA1105 数据表中也有如下说明: " 请注意,只有当系统必须支持 AVB 操作或其他网桥管理协议(如 STP/RSTP)时,才需要与主机处理器建立以太网连接。如果不需要此类操作,所有端口都可用于数据流量。" 由于我们不需要 AVB 或 STP/RSTP,而且我们也无法访问 CPU xMII 接口,因此我们决定将交换机用作一个普通的 5 端口交换机,每个端口都有 PHY 接口。4 个端口,PHY 实际连接到真正的 RJ45 连接器,另一个端口将 PHY 硬接入电路板中,连接到我们从 SMARC 板上的 CPU 获得的 PHY。这将为我们提供一个看起来像这样的 Linux 设备树: (仅显示与 SJA1105 相关的部分,粘贴到此处时缩进也变拧了) &spi2 { status ="okay"; #address-cells =<1>; #size-cells =<0> ; num-cs =<2>; cs-gpios =<& gpio2 RK_PB4 GPIO_ACTIVE_LOW>,<& gpio1 RK_PA3 GPIO_ACTIVE_LOW> ; sja1105_1: sja1105@1 { status ="okay"; reg =<1>; #address-cells =<1>; #size-cells =<0>; clocks =<& ethswitch_osc>; compatible ="nxp,sja1105t"; spi-max-frequency =<25000000> ; fsl,spi-cs-sck-delay =<1000> ; fsl,spi-sck-cs-delay =<1000> ;spi-cpha;pinctrl-names = " 默认 ";pinctrl-0 = < & et hswitch_pins >;reset-gpios = < & gpio4 RK_PC5 GPIO_ACTIVE_HIGH >; 端口 { #address-cells<1> =; #size-cells =;-cells =<0> 0; port@0 { /* 隐含"sja1105,role-mac;" */ label ="eth0"; phy-handle =<& rmii_phy0>; phy-mode ="rmii"; reg =<0>; }; port@1 { /* 隐含"sja1105,role-mac;" */ label ="lan1"; phy-handle =<& rmii_phy1>; phy-mode ="rmii"; reg =<1>; }; port@2 { /* 隐含"sja1105,role-mac;" */ label ="lan2"; phy-handle =<& rmii_phy2>; phy-mode ="rmii"; reg =<2>; }; port@3 { /* 隐含"sja1105,role-mac;" */ phy-handle =<& rmii_phy3> ; label ="lan3"; phy-mode ="rmii"; reg =<3>; }; port@4 { /* Imlicit"sja1105,role-mac;" */ phy-handle =<& rmii_phy4>; label ="lan4"; phy-mode ="rmii"; reg =<4>; }; }; }; }; 这个 devicetree 是有效的,可以编译,但在探测过程中 NET_DSA_SJA1105 却失败了,因为它找不到 HOST CPU 端口(因为我们没有指定)。该错误来自 net/dsa/dsa2.c*dsa_tree_find_first_cpu(struct dsa_switch_tree *dst),因此它并不是驱动程序的 sja1105 部分所特有的,而是 Linux 分布式交换架构中更深层次的部分。 在所有 devicetree 示例中,总有一个端口配置为主机 CPU,通过 xMII 与固定链路连接,例如像这样: port@4 { /* 连接到 eth2 的内部端口 */ ethernet =<& enet2>; phy-mode ="rgmii"; reg =<4>; /* 隐含"sja1105,role-phy;" */ fixed-link { speed =<1000>; full-duplex; }; }; 如果我尝试修改我的设备树以使端口看起来更像这样: 端口 { #address-cells =<1>; #size-cells =<0>; port@0 { /* 隐含"sja1105,role-phy;" */ ethernet =<& gmac>; phy-mode ="rmii"; reg =<0>; fixed-link { speed =<100>; full-duplex; }; }; port@1 { /* 隐含"sja1105,role-mac;" */ label ="lan1"; phy-handle =<& rmii_phy1>; phy-mode ="rmii"; reg =<1>; }; port@2 { /* 隐含"sja1105,role-mac;" */ label ="lan2"; phy-handle =<& rmii_phy2>; phy-mode ="rmii"; reg =<2>; }; port@3 { /* 隐含"sja1105,role-mac;" */ phy-handle =<& rmii_phy3> ; label ="lan3"; phy-mode ="rmii"; reg =<3>; }; port@4 { /* Imlicit"sja1105,role-mac;" */ phy-handle =<& rmii_phy4>; label ="lan4"; phy-mode ="rmii"; reg =<4>; }; }; 然后,驱动程序感到满意,成功地进行了探测并设置了 SJA1105 交换机。端口 1-4 可以工作 ,但端口 0(CPU 通过 PHY 连接)当然不能工作,因为它现在被配置为 xMII 直接连接,而实际上我们在 SJA1105 和主机 CPU 之间有一个 PHY。 这是否是 DSA SJA1105 Linux 驱动程序的限制,即必须始终通过 xMII 配置固定链路?我能否以某种方式直接从设备树中配置我根本不希望有专用的 cpu 主机端口,而是只有 5 个普通端口(其中一个恰好是通过 PHY 连接到 CPU...)或者我能否将 CPU 主机端口配置为固定链路,但明确指定那里实际上也有 PHY,而不是 XMiI 接口?我已经尝试了几十种组合,但仍然没有找到任何配置方法,使其能够与我们本应非常简单的设置配合使用。我是不是漏掉了什么非常简单的东西?有什么好办法吗?还是 Linux DSA SJA1105 驱动程序无法做到这一点? 祝好 Re: SJA1105 in Linux, all 5 ports through PHY interfaces? @kalamata @Sabeur你能解决这个问题吗?我在使用 Toradex imx8mp SoM 时也遇到了类似的情况。 Re: SJA1105 in Linux, all 5 ports through PHY interfaces? @kalamata @Sabeur你找到解决这个问题的办法了吗?我也遇到了类似的问题,但使用的是 Toradex Verdin IMx8mp SoM。 Re: SJA1105 in Linux, all 5 ports through PHY interfaces? 你好、 我看到 端口 0 的 phy-mode 和 phy-handle: port@0 { /* 隐含"sja1105,role-mac;" */ ethernet =<& gmac>; label ="eth0"; phy-handle =<& rmii_phy0>; phy-mode ="rmii"; reg =<0>; }; 设备树应该是这样的。 此外,gmac 节点应包含 &gmac { phy-handle =<& rmii_gmac_phy>; phy-mode ="rmii"; }; 顺祝商祺! Sabeur Re: SJA1105 in Linux, all 5 ports through PHY interfaces? 你好,卡拉马塔 、 感谢您提供的详细信息。 所以我的假设是正确的。 您应该能够为连接的 MAC 接口指定 phy-handle 和 phy 模式。它是经过虚拟测试的,这意味着 MAC-> PHY->---<-PHY <-5.3 内核版本的 MAC。(参见 0e27921816ad99f78140e0e0c61ddf2bc515cc7e22)。 因此 ,这是在设备树中描述这种硬件连接的正确方法。 Regards, Sabeur Re: SJA1105 in Linux, all 5 ports through PHY interfaces? 你好,Sabeur, 感谢您的答复! 在您的设置中,上述数据路径可行吗? 是的,我们使用的正是这种设置:(CPU)Mac - Phy - Phy - Switch Mac (见附件) Rockchip RK3399 CPU 是否具有内部 PHY? 是的,它有一个内部 PHY,我们只能使用这个内部 PHY,因为它是从 CPU 所在的研华 ROM-5780 SMARC 模块中唯一输出的,所以即使我们想直接使用 CPU MAC 接口也不行。 我们的设置与 SJA1105 数据表建议的典型设置有何不同,请参阅附图。 我们有一款采用 SMARC 格式封装的研华 ROM-5780 片上计算机模块(即瑞芯微 RK3399 CPU)。Rockchip RK3399 集成了 PHY 接口,我们可以通过 SMARC 模块上的输出引脚访问该接口。我们无法实际访问 RK3399 以太网控制器的 MAC 引脚,因为它们不是通过 SMARC 模块输出的,所以我们只能使用 RK3399 PHY 接口。因此,在我们打算连接 CPU 的 SJA1105 的第 5 个端口上,我们有一个 PHY 控制器(就像在第 1-4 个端口上一样),该 PHY 控制器与 RK3399 CPU 的 PHY 控制器永久连接。 Kalamata Re: SJA1105 in Linux, all 5 ports through PHY interfaces? 您好, 理论上是可行的,但由于预期的设置是直接链接,因此我无法立即投入使用。 可以工作的数据路径是Mac - Phy - Phy - Switch Mac。 在这种情况下,您需要修改 DSA 内核,并为 CPU Mac 和 Switch Mac 指定 Phy 句柄和 Phy 模式。 现在的问题是:上述数据路径在您的设置中可行吗?Rockchip RK3399 CPU 有内置 PHY 吗? 致以最崇高的敬意, Sabeur Re: SJA1105 in Linux, all 5 ports through PHY interfaces? 可以实现 PHY 对 PHY 的背靠背连接。您必须使用 phy-handle 属性。您还可以绕过自动协商,在 devicetree 绑定中使用"fixed-link" 属性设置固定速度。如果出现问题,并怀疑 devicetree 配置正确,请检查控制路径接口(SPI/I2C/MDIO)。
查看全文
S32K314 LPSPI - 在 DMA 下出现异常 CS toogle 你好@DanNguyenDuy 如下图所示,在 LPSPI DMA 模式下发生了意外的 CS 切换。 帧大小为 8 位,默认配置下 DMA 传输大小为一个字节。SPI 波特率为 10 Mbps。 绿色信号代表 CS,在使用 " Keep " 选项时,CS 应在传输过程中保持钳位状态。然而,它却意外地发生了切换。在中断模式下,CS 保持钳位状态。此外,使用基于 GPIO 的 CS 而不是 PCS,在不切换的情况下也能正常工作。 这种现象在波特率较高时比在波特率较低时出现得更频繁,这表明原因可能是 SPI 端 TX 欠运行。 我试着启用散点采集模式和调整 SPI 时序,但都没有解决问题。 我认为,默认 DMA 配置可能不具备处理高速 LPSPI 传输的能力。 请问如何解决 CS 意外切换的问题? 谢谢。 BRs, Alex Yang RTD Re: S32K314 LPSPI - Unexpected CS toogle under DMA @DanNguyenDuy 我共享 Mobis 的 arxml 文件。 热电阻版本为 4.0.0_HF04(适用于HKMC) Re: S32K314 LPSPI - Unexpected CS toogle under DMA @DanNguyenDuy 我分享 Mobis 的 LPSPI DMA 配置屏幕截图。在捕获的图像上,使用的频道名称是 Vsp。 Re: S32K314 LPSPI - Unexpected CS toogle under DMA 你好@alexyang、 你使用了哪个软件包版本? 能否将您的示例或配置文件(.xdm 或 .arxml文件)? 顺祝商祺! 丹 Re: S32K314 LPSPI - Unexpected CS toogle under DMA 你好@alexyang、 1.我查看了配置,没有发现任何问题。 2.因为我没有 S32K314,所以我在 S32K344 上检查了这个问题,我这边没有发现这个问题(传输过程中 PCS 保持低电平)。 3.能否检查调用前后 LPSPI2_TCR 寄存器的值 Spi_AsyncTransmit() 函数? 如果在发送过程中的任何时候 TCR[CONT] = 0,则 PCS 引脚将被置为高电平。 否则,当 LPSPI 从 TX FIFO 空数据移位时,可能会出现此问题,因为在 FIFO 空之前,DMA 没有将数据传输到 TX FIFO。这种情况将触发信号 PCS,因为 LPSPI 会检测到终端传输信号,这看起来像是设计限制。 顺祝商祺! 丹 Re: S32K314 LPSPI - Unexpected CS toogle under DMA 你好@DanNguyenDuy CS 切换的原因似乎是 TX FIFO 空了,因为 TX 水印降低了 CS 切换率。 不过,这一改动并没有完全解决 CS 切换问题。在 TX 水印的基础上,您还有什么其他建议可以完全防止 CS 切换? 此外,如果TX watermark = 0 是 Lpspi_ErrataHandle() 函数之后的意外动作,您是否有计划进行修正?Autoever 希望得到 NXP 对 TX 水印处理的确认,并在需要修正时得到 NXP 的补丁计划。 谢谢。 BRs, Alex Yang Re: S32K314 LPSPI - Unexpected CS toogle under DMA 你好@alexyang..、 在联系 RTD 团队之前,我希望他们尝试两种测试方案: 情况 1:在 Lpspi_ErrataHandle() 函数之后设置 Dma 优先级中断为最高,且 TX watermark = RX watermark = 3。 场景 2:场景 1 + 禁用 RX DMA 并通过轮询方法接收数据。 顺祝商祺! 丹 Re: S32K314 LPSPI - Unexpected CS toogle under DMA @DanNguyenDuy TCR[CONT] 已设置,因此这不是 CS 意外切换的原因。 我对 LPSPI 的 TX 水印有疑虑,据我估计,这可能是 TX FIFO 空的原因。 在 Lpspi_Ip_Init 中将 TX 水印设置为 2,如下所示。 但是,ERR_IPV_LPSPIV2_0001 的 Lpspi_ErrataHandle(Base,State)将其设置为 0,据我估计,这是意料之外的操作。 因此,在我的审查中,ERR_IPV_LPSPIV2_0001 解决方法意外地使 TX 水印为 0。另一位客户 Autoever 也报告了这一情况。 在 Autoever 报告中,发生了 SPI TX 欠运行,Autoever 发现 Lpspi_TransmitTxInit 清除了 TX 水印。因此,Autoever 通过添加"Base->FCR = LPSPI_FCR_TXWATER((uint32)LPSPI_IP_FIFO_SIZE_U8-(uint32)2u);" ,将 TX 水印返回到 2,从而减少了 TX 欠运行。 您如何看待 TX 水印?TX 水印为 0 是否会导致 DMA 意外切换 CS? Re: S32K314 LPSPI - Unexpected CS toogle under DMA 你好@alexyang、 在我看来,TX 水印等于 0 会导致此问题。我建议你在测试时提高 Dma 中断的优先级,并在 Lpspi_ErrataHandle() 函数 后添加一条语句,将 TX 水印修改为 3(最大值) 。 顺祝商祺! 丹
查看全文
spi example code Hello, I am studying the spi example code provided by NXP in a project called 'Spi_Transfer_S32K312'. I want to know what each function means in the code, can I know the location of the header file? Re: spi example code Hi @mingimin  The header files are located under RTD → include within the project directory. Additionally, I recommend reviewing the S32K3/S32M27x SPI Driver Integration Manual and the User Manual included with the RTDs. These documents provide detailed information about the driver, including its limitations, hardware and software requirements, usage guidelines, and configuration instructions. They are helpful for a deeper understanding of the driver's behavior and capabilities. You can find these resources, for example, at the following path: C:\NXP\S32DS.3.5\S32DS\software\PlatformSDK_S32K3\RTD\Spi_TS_T40D34M50I0R0\doc Please note that the exact path may vary depending on the S32DS version and your installation directory. BR, VaneB
查看全文
Drivers configuration for the S32K3XX Hello, I would like to ask, S32K3XX series chip new construction projects, in the use of drivers, each driver (1 corresponding to the position of each driver type) corresponding to the configuration interface in each configuration (3 shown in the position), there is no documentation or tutorials to explain? In the actual engineering application, I can rely on what information to configure, I set up each time is to look at the name of the setup item to guess its function, and decided to be configured into what, I feel the lack of official basis, so I feel that each of my settings is very no certainty and basis. Re: S32K3XX的drivers配置 Hi@Aaron_LL The following sections of AN13435 have some descriptions of the components And you can find a lot of training tutorials for configuring these peripherals in the official website. https://www.nxp.com/products/S32K3
查看全文
使用 8x DPDMUX 加载静态 DPL 失败 嗨,社区、 成功使用动态创建 DPDMUX 和 DPNI,并通过以下命令生成 DPL: 8x ls-addni --fs-entries=8 --num-queues=8 -n source /usr/local/dpdk/dpaa2/dynamic_dpl.sh ... 8x restool dpdmux create 8x restool dprc connect dprc.1 --endpoint1= .n.0/1/2 --endpoint2= / /dpni.k> restool dprc generate-dpl dprc.1> dpl-8-dpdmux.dts 使用 dpl-8-dpdmux.dtb(由 dtc 工具生成)更新静态 DPL,以便 uboot 启动 MC 布局。 错误显示为 "吹": [E, mem_mng_get_phys_mem:655] 主内存。管理器内存分配失败 [E, mem_mng_get_phys_mem:658] Required size 0x000040000 alignment 0x000000100 exceeds available memory for partition ID 7 [E, init_bman_bp:399, DPDMUX] ID[6] - dpbp_allocate_buffers(),分配 dpbp 缓冲区失败 [E, init_infrastructure:3750, DPDMUX] swlib_init_bman_bp :-12 [E, dpdmux_init:4487, DPDMUX] init_infrastructure : -12 [E, mem_mng_get_phys_mem:655] MAJOR mem.管理器内存分配失败 [E, mem_mng_get_phys_mem:658] Required size 0x000040000 alignment 0x000000100 exceeds available memory for partition ID 7 [E, init_bman_bp:399, DPDMUX] ID[7] - dpbp_allocate_buffers(), 分配 dpbp 缓冲区失败 [E, init_infrastructure:3750, DPDMUX] swlib_init_bman_bp :-12 [E, dpdmux_init:4487, DPDMUX] init_infrastructure : -12 [E, resman_is_link_permitted:6375, RESMAN] Object wasn't found [E, linkman_probe_cb:205] No common ancestor - Failed to connect dpdmux@6 and dpmac@9 [E, subnode_process:155] Probing module 'connection' return error code -1.继续 dpl 处理... [E, resman_is_link_permitted:6375, RESMAN] 对象未找到 [E, linkman_probe_cb:205] 没有共同祖先 - 连接 dpdmux@6 和 dpni@15 失败 [E, subnode_process:155] 探测模块 'connection' 返回错误代码 -1.继续 dpl 处理... [E, resman_is_link_permitted:6375, RESMAN] Object wasn't found [E, linkman_probe_cb:205] No common ancestor - Failed to connect dpdmux@6 and dpni@7 [E, subnode_process:155] Probing module 'connection' return error code -1.继续 dpl 处理... [E, resman_is_link_permitted:6375, RESMAN] 对象未找到 [E, linkman_probe_cb:205] 没有共同祖先 - 连接 dpdmux@7 和 dpmac@10 失败 [E, subnode_process:155] 探测模块 'connection' 返回错误代码 -1.继续 dpl 处理... [E, resman_is_link_permitted:6375, RESMAN] 对象未找到 [E, linkman_probe_cb:205] 没有共同祖先 - 连接 dpdmux@7 和 dpni@16 失败 [E, subnode_process:155] 探测模块 'connection' 返回错误代码 -1.继续 dpl 处理... [E, resman_is_link_permitted:6375, RESMAN] 对象未找到 [E, linkman_probe_cb:205] 没有共同祖先 - 连接 dpdmux@7 和 dpni@8 失败 [E, subnode_process:155] 探测模块 'connection' 返回错误代码 -1.继续 dpl 处理... [E, dpl_process:527] 解析 "连接 "时出错。跳过处理 DPL 的其余部分。 [E, main:198] DPL 处理失败;继续... 静态 DPL 在支持与动态方式相同的布局方面是否有任何限制? QorIQ LS2 设备 Re: Failed to load static DPL with 8x DPDMUX 你好 yipingwang, 在动态创建布局时使用"--max-dmat-entries "不会改变 "restool dprc generate-dpl dprc.1 "的最终 dts。 因此,我尝试在 .dts 中添加以下元素 "mem-size "和"max-dmat-entries" 。手动 dpdmux@0 { 兼容 ="FSL,DPDMUX" ; options ="DPDMUX_OPT_CLS_MASK_SUPPORT","DPDMUX_OPT_AUTO_MAX_FRAME_LEN" ; method ="DPDMUX_METHOD_CUSTOM" ; manip ="DPDMUX_MANIP_NONE" ; num_ifs =<0x2> ; mem-size =<0x100>; // 这是我手动添加的 max-dmat-entries =<0x8>; // 这是我手动添加的 }; 遗憾的是,这并没有解决问题,MC 调试器中显示的错误信息还是一样。 还请检查随附的我的 dpl。 Re: Failed to load static DPL with 8x DPDMUX 请尝试以下方法是否可行。 创建 DPDMUX 时,请指定"--max-dmat-entries=8" 以减少资源分配。 -max-dmat-entries= DPDMUX 地址表的最大条目数。默认为 64。 如果问题仍然存在,请共享创建 DPDMUX 和生成 DPL 文件的整个控制台日志。 此外,您使用的是哪种处理器? Re: Failed to load static DPL with 8x DPDMUX 您好, 通过更正 DPL 参数名称,我设法解决了这个问题。
查看全文
EB Tresos 29.0 问题 我使用离线激活功能激活了 EBtresos 29.0,但遇到了以下问题:处理响应时出现错误(50019、41200、10246)。如何解决这个问题?在尝试了很多次都没有成功后,我别无选择,只能使用离线激活。 Re: EB Tresos 29.0 Issue 你好 我不确定您采取了哪些步骤,但以下是 EB 提供的激活指南: 请参阅本章: 5.1.3.离线激活单个用户或评估许可证 如果您能提供更多细节,也许我能帮上忙。 顺祝商祺! Peter Re: EB Tresos 29.0 Issue @petervlna 您好,我使用的激活代码是B25C-AEBB-4319-BAB1(有效期至 06/30/2026),来自恩智浦官方网站。生成脱机激活文件 activation.xml 时显示了一个 失败。多次尝试后,activation.xml 文件仍显示为 失败.如何解决这个问题?非常感谢您的帮助。该软件是 EB Client License Administrator 1.5.1。 我还尝试用我的电脑生成激活请求文件,但用我同事的恩智浦账户生成的 activation.xml 文件仍显示为失败。 你是中国人吗?我们以后能用中文交流吗? Re: EB Tresos 29.0 Issue 你好 我刚刚测试了有效期到年底的新代码,激活成功。 您将在一天左右的时间内在恩智浦 SW 账户中找到它。 顺祝商祺! Peter Re: EB Tresos 29.0 Issue 你好 你是中国人吗?我们以后能用中文交流吗? 否。 点击这里查看。免费许可证库似乎已经枯竭: https://community.nxp.com/t5/S32K/EB-activation-failed/td-p/2252930 顺祝商祺! Peter Re: EB Tresos 29.0 Issue 你好 以下是 flexera 管理员给我的官方答复: 更新正在进行中。它已转交给有权更新它的人。 如果要进行严肃的开发,我建议从 EB 购买永久许可证。否则,您就必须在这种情况下等待评估许可证的更新。 顺祝商祺! Peter Re: EB Tresos 29.0 Issue 您好,感谢您的回复。不过,截至目前,恩智浦官方网站上的许可证尚未更新。新许可证何时启用? Re: EB Tresos 29.0 Issue 你好 这太奇怪了。我已再次通知管理员更新代码。 我会推动它。 我还注意到有新的 EB tresos v 30。 顺祝商祺! Peter Re: EB Tresos 29.0 Issue 您好,我已经等了三天,但激活码今天仍未更新。激活码何时提供? Re: EB Tresos 29.0 Issue 您好, 代码现已在恩智浦 SW 账户中更新。 顺祝商祺! Peter
查看全文
串行线调试的乐趣与游戏 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 我为我的 LPC1517 项目重新铺设了电路板,以移动 SWD 插座。数据和时钟直接传输,但 0V 电压则绕到一个小型(1 瓦)降压稳压器的后面。如果我想从麦克风前置放大器中获得 -130dBV/√Hz 的信号,我不会使用这种 PCB 跟踪技术,但对于具有 1V 抗噪能力的数字信号来说,速度并不快,我想应该没问题--但是没有--出现了大量 ACK、Flash 写入失败之类的错误。 我剪断了轨道,换上了一条沿着数据和时钟轨道走向的导线,然后就成功了。 因此,SWD 就像是 SPI 的半双工版本,MOSI 和 MISO 复用到一个引脚上,运行频率为 1MHz;所以重要的时间是时钟转换。其他都不重要。因此,可能有三种情况会妨碍它的工作:边沿过快导致接地反弹,边沿过慢导致抖动,或者目标阻抗过高导致干扰进入。因此,我尝试了几种方法--220pF 跨时钟到地、1k 下拉和 10k 串联阻抗--1k 似乎最有希望,但没有真正成功。 LPCXpresso 崩溃了 - 我强行退出,然后重新启动。 然后一切正常 所以,我比以往任何时候都更加困惑。 同一批的另一块板容易出错,但是如果我的示波器接地夹连接到电路 0V,则可以正常工作。 我听您说过,这意味着电路应正确接地,但电路 0V 与电源接地相连,而示波器却没有。 另一个令人困惑的问题是,从提交闪存写入" 时出现的"目标错误显示"system rejected access at location x"; 但我遇到的所有错误中,位置 x 都在 RAM 中。 不同的电路在机柜中与开关电源相邻时不会连接。把它从柜子里拿出来,就可以正常使用了。 我觉得这一切都很令人费解,因为我一直使用 SPI,速度是它的十倍,而且没有过多考虑 PCB 跟踪问题。如果效果这么差,我的 LED 显示器就会像启动器失灵的荧光灯管一样闪烁。 有人有什么想法吗? LPC13XX lpc15xx LPC800 Re: Fun and games with Serial Wire Debug 我花了三天时间确信这是硬件故障,直到我意识到我在初始化代码中翻转了两个引脚。突然之间,传感器数据变得有感知了,但是在我玩 Slope Game 时为了放松而发生迷你崩溃之前,情况并非如此。 Re: Fun and games with Serial Wire Debug 有趣的是,即使是微小的 PCB 布线选择也会导致重大问题,尤其是像 SWD 这样的敏感信号。这让我想起了大米纯度分数的不可预测性--有时,看似简单的事情会呈现出意想不到的复杂性! Re: Fun and games with Serial Wire Debug > 有人有什么想法吗? 我会尝试降低 SWD 时钟频率,看看效果如何。 我建议是一个数量级,即 100 千赫或更低。 这样调试并不有趣,但可以证明一点。 Re: Fun and games with Serial Wire Debug 我创建了一个名为 Debug 的单例和一个始终位于顶部的基本文本框。我现在可以不打印,而是 Debug.output(text) 因此,在我测试时,它就会出现在游戏中。当你只有一台监测时,有时,几乎每时每刻都会让事情变得容易得多。 模拟人生 4》满意度积分作弊器最近派上了大用场,当时调试任何东西的唯一方法就是实时更新我的视网膜所观察到的确切坐标,而使用 print() 会很麻烦,而且会激怒戈多。"减少文字印刷量" 此外,它还能实时捕捉仅出现的问题,而无需密切关注 Godot 输出日志。 Re: Fun and games with Serial Wire Debug <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 不太确定你期望我在参考手册中找到什么,而我在帖子中还没有提到过。在 LPC15xx 手册的三页中,除了连接图和两个引脚都有上拉功能外,几乎没有其他内容。它甚至没有说明 SWCLK 只是输入,而 SWDIO 是双向的。我的大部分信息来自ARM关于该主题的白皮书。 至少我很高兴恩智浦不再建议在 SWCLK 上使用下拉电阻(pullDOWN)了--那会严重破坏抗噪能力,尤其是在您碰巧获得与内部上拉电阻相同的电阻时。 无论如何,我进一步进行了实验,并在SWCLK输入中添加了施密特触发信号。我尝试了 74LVC1G17 和一对 74HC14 的栅极。结果令人震惊。在我追踪不太好的板上,错误率从65%下降到零。100 次尝试中没有一次编程失败(1G17 和 HC14 没有区别) 然后,我将导线延长到标准的 150 毫米以外。在 LPC-LINK 和 targert 之间的 1 米引线上没有出现过任何故障。3 米处仍未出现故障。除此之外,无缓冲 SWDIO 线路上电缆的体电容也成了问题,误差逐渐增大。 下一步是在使用高噪声开关电源的电路上进行试验! 磁滞似乎可以解决问题,PIO0_18 引脚也有一个磁滞选项,但我敢打赌,在 SWD 操作期间,它不会打开。但我想知道,如果我在软件中设置了 IOCON 寄存器的第 5 位,那么在下一次编程时,迟滞功能是否仍会开启? 想尝试的人请注意:您的 SWCLK 输入(74LVC1G17 的输入)现在需要一个下拉电阻。我用的是 3.3kΩ。这个值并不重要,因为连接太短,不能被视为传输线,所以从技术上讲,它不是"终端" 。 Re: Fun and games with Serial Wire Debug <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 你好 IanBenton、 为了提供尽可能快的支持,我想请你参考参考手册中的串行线调试章节 查看详情。 祝你愉快 TIC   ----------------------------------------------------------------------------------------------------------------------- 注:如果本帖回答了您的问题,请点击正确答案按钮。Thank you! -----------------------------------------------------------------------------------------------------------------------
查看全文
MaaxBoard (NXP i.MX93) で GPIO およびタイマー ピンを構成し、pinmux 設定を有効にする方法は? 私は MaaxBoard (NXP i.MX93 プロセッサベース) を使用していますが、次のユースCASEの pinmux とピン構成の設定について支援が必要です。 トリガー ピン (出力) として GPIO ピンが 1 つ必要です。 1 つのピンをタイマー入力 (TPM 入力キャプチャまたは PWM) 用に構成する必要があります。 問題は次の通りです: GPIO ピンが読み取り/書き込み操作に正しく応答しません。 pinmux 構成が欠落しているか間違っているか、デバイス ツリーが適切に更新されていないと思われます。 以下の点についてご協力いただけますでしょうか? MaaxBoard のピン配置とリファレンス マニュアルで GPIO とタイマーの正しいピン名とパッドを見つけるにはどうすればよいでしょうか? 必要なピン多重化を有効にするには、デバイス ツリー (.dts) にどのような変更を加える必要がありますか。 GPIOピンを出力用に設定し、ユーザー空間からの読み取り/書き込みを許可する タイマーピンを入力キャプチャまたはPWM用に設定する MaaxBoard で GPIO が正しく動作しない原因となる一般的な問題はありますか? 1 つの GPIO を読み取りと書き込み用に設定する方法の例はありますか?そのために、pin_mux.c や app.h など、何を更新する必要がありますか? i.MX93 #マックスボード MCX C Re: How to configure GPIO and Timer pins on MaaxBoard (NXP i.MX93) and enable pinmux settings ? こんにちは、Manjunathb MaaxBoard は Element14 によって製造およびサポートされています。所有者に問い合わせて、BSP とボードに関する詳しい情報を入手することをお勧めします。 MaaXBoard OSM93 - element14 コミュニティ MaaXBoardハードウェアデザイン - element14コミュニティ    i.MX 93 EVK 用の NXP MCUXpresso SDK も参照できます。 SDKは以下からダウンロードできます。 MCUXpresso SDK Builder パッケージ内には TPM と GPIO / タイマーのデモが含まれています。 よろしくお願いします。 ダニエル よろしくお願いします。 ダニエル Re: How to configure GPIO and Timer pins on MaaxBoard (NXP i.MX93) and enable pinmux settings ? -> ここで参考のためにコードを添付しました。1 つの GPIO を構成して読み取りおよび書き込み操作を実行するだけで、コードを次のように更新しました。   /* * 著作権 (c) 2015、Freescale Semiconductor, Inc. * 著作権 2016-2017 NXP * 無断転載を禁じます。 * * SPDXライセンス識別子: BSD-3条項 */ #include "board.h" #include "fsl_debug_console.h" #include "fsl_rgpio.h" #include "app.h" /**************************************************************************************** * 定義 **********************************************************************************/ /**************************************************************************************** * プロトタイプ **********************************************************************************/ /*! * @briefしばらく遅延します。 */ void遅延( void ); /**************************************************************************************** * 変数 **********************************************************************************/ /**************************************************************************************** * コード **********************************************************************************/ /*! * @briefメイン関数 */ int main( void ) { /*[手動で]-> GPIO入力のinit構造体を定義する*/ rgpio_pin_config_t 入力構成 = {         kRGPIO_デジタル入力、         0 , }; /* ボードピン、クロック、デバッグコンソールの初期化 */ BOARD_InitHardware(); /* 端末にメモを印刷します。*/     PRINTF ( "\r\n GPIO は状態の読み取りを開始します.....\r\n" ); /* 出力 LED GPIO を初期化します。*/ RGPIO_PinInit( BOARD_LED_RGPIO 、 BOARD_LED_RGPIO_PIN 、 &input_config);     一方( 1 )     {         uint32_t val = RGPIO_PinRead( BOARD_LED_RGPIO 、 BOARD_LED_RGPIO_PIN );         PRINTF ( "GPIO%d の現在の値は : %d\r\n" , BOARD_LED_RGPIO_PIN ,val); SDK_DelayAtLeastUs( 500000U , SystemCoreClock);    } } ######################################################## /* * 著作権 2022 NXP * * SPDXライセンス識別子: BSD-3条項 */ /******************************************************************************************************************************** * このファイルは、MCUXpresso Config Tools によって生成されました。このファイルに対して手動で行われた編集 * それぞれの MCUXpresso Config Tools を使用してこのファイルを更新すると、上書きされます。 ******************************************************************************************************************************/ /* * 以下のテキストはツールの設定として使用されます ************************************* !!グローバル情報 製品: Pins v12.0 プロセッサ: MIMX9352xxxxM パッケージID: MIMX9352DVVXM mcu_data: ksdk2_0 プロセッサバージョン: 0.12.3 * このコメントを変更する際は注意してください - これはツールの YAML 設定です *********** */ #include "pin_mux.h" /* 関数 ************************************************************************************************************ * * 関数名: BOARD_InitBootPins * 説明: 初期化関数を呼び出します。 * * 終わり ****************************************************************************************************************/ BOARD_InitBootPins を無効にします( void ) { BOARD_InitPins(); } /* * 以下のテキストはツールの設定として使用されます ************************************* ボード初期ピン: - オプション: {callFromInitBoot: 'true', coreID: cm33} - ピンリスト: - {pin_num: F20、ペリフェラル: LPUART2、信号: lpuart_rx、pin_signal: UART2_RXD、HYS: DISABLED、FSEL1: SlOW_SLEW_RATE、DSE: NO_DRIVE} - {pin_num: F21、ペリフェラル: LPUART2、信号: lpuart_tx、pin_signal: UART2_TXD、HYS: 無効、PD: 無効、FSEL1: SlOW_SLEW_RATE} - {pin_num: L17、ペリフェラル: GPIO2、信号: 'gpio_io, 04'、ピン信号: GPIO_IO04、HYS: 無効} * このコメントを変更する際は注意してください - これはツールの YAML 設定です *********** */ /* 関数 ************************************************************************************************************ * * 関数名: BOARD_InitPins * 説明: ピンのルーティングとオプションでピンの電気機能を構成します。 * * 終わり ****************************************************************************************************************/ void BOARD_InitPins( void ) { /*!< コアに割り当てられた関数: undefined[cm33] */     // IOMUXC_SetPinMux(IOMUXC_PAD_GPIO_IO04__GPIO2_IO04, 0U); IOMUXC_SetPinMux( IOMUXC_PAD_UART2_RXD__LPUART2_RX 、 0U ); IOMUXC_SetPinMux( IOMUXC_PAD_UART2_TXD__LPUART2_TX 、 0U ); /* 手動で追加 (開始)*/ IOMUXC_SetPinMux( IOMUXC_PAD_GPIO_IO13__GPIO2_IO13 , 0U ); IOMUXC_SetPinConfig( IOMUXC_PAD_GPIO_IO13__GPIO2_IO13 、 /* 手動で追加 (終了)*/     // IOMUXC_SetPinConfig(IOMUXC_PAD_GPIO_IO04__GPIO2_IO04,     // IOMUXC_PAD_PD_MASK); IOMUXC_SetPinConfig( IOMUXC_PAD_UART2_RXD__LPUART2_RX 、                         IOMUXC_PAD_PD_MASK ); IOMUXC_SetPinConfig( IOMUXC_PAD_UART2_TXD__LPUART2_TX 、                         IOMUXC_PAD_DSE ( 15U )); } /******************************************************************************************************************************** * 終了 ******************************************************************************************************************************/ /* * 著作権 2022 NXP * * SPDXライセンス識別子: BSD-3条項 */ #ifndef _APP_H_ #define _APP_H_ /**************************************************************************************** * 定義 **********************************************************************************/ /* ${macro:start} */ #BOARD_LED_RGPIOを定義します          GPIO2 #BOARD_LED_RGPIO_PINを定義します      13U #DEFINE EXAMPLE_RGPIO_CLOCK_ROOT kCLOCK_Root_BusWakeup #DEFINE EXAMPLE_RGPIO_CLOCK_GATE kCLOCK_Gpio2 /* ${macro:end} */ /**************************************************************************************** * プロトタイプ **********************************************************************************/ /* ${prototype:start} */ BOARD_InitHardware をvoidにします。 /* ${prototype:end} */ #endif /* _APP_H_ */
查看全文
如何在定制 MIMXRT1176AVM8A 板 上运行恩智浦 SDK 示例 我有一块带有 MIMXRT1176AVM8A 处理器的定制板(与 MIMXRT1170-EVK 不同)。我想运行 SDK 示例,但在必要的修改方面需要指导。 我的硬件设置 微控制器:MIMXRT1176AVM8A(与 EVK 不同)。 外部闪存:S25FL128L(QSPI,16 MB)(与 EVK 的 W25Q512NWEIQ 不同)。 同步动态随机存取存储器(SDRAM):W9812G6KB-6J (32 MB) *(与 EVK 的 W9825G6KH-5I 不同)。 其他更改:用于 LED 和 UART 引脚等的不同 GPIO 我需要什么帮助? Flex-SPI NOR 闪存设置: 既然我使用的是 S25FL128L(不是华邦),我该如何更新 flex SPI 或配置 C 文件才能正常启动? 同步动态随机存取存储器(SDRAM) 初始化: EVK 使用不同的同步动态随机存取存储器(SDRAM) 芯片。我应该如何调整 DCD 设置? 调试技巧 将 SDK 示例移植到自定义板时常见的陷阱有哪些? 请求: 谁能分享一下: 改编 SDK 示例的分步说明? 自定义 Flex SPI/同步动态随机存取存储器(SDRAM) 设置的示例配置? 提前感谢! Re: How to Run NXP SDK Examples on Custom MIMXRT1176AVM8A Board 只要频率不超过 800MHz,就没有问题。 BR, Omar Re: How to Run NXP SDK Examples on Custom MIMXRT1176AVM8A Board MIMXRT1176AVM8A 的 Cortex-M7 内核工作频率为 800 MHz。MIMXRT1176DVMAA(EVK 的处理器)的主频为 1 GHz。 Re: How to Run NXP SDK Examples on Custom MIMXRT1176AVM8A Board 不,它是相同的元器件,但包装不同。 BR, Omar Re: How to Run NXP SDK Examples on Custom MIMXRT1176AVM8A Board 由于 EVK 使用的是 MIMXRT1176DVMAA 处理器,如果我使用 MIMXRT1176AVM8A 处理器的 EVK 示例,会有问题吗? Re: How to Run NXP SDK Examples on Custom MIMXRT1176AVM8A Board 请参阅此文档:如何为 FLEXSPI 或非 闪存启用调试\ 本文件包含使用其他闪存时可进行调试的指南。 更详细的文档可能对您有所帮助:i.MX RT FLEXSPI 启动指南-恩智浦社区 关于同步动态随机存取存储器(SDRAM),建议参考 SDK 示例来配置内存,DCD 使用相同的同步动态随机存取存储器(SDRAM)配置,因此它是在启动时加载的。这里有一些关于如何配置同步动态随机存取存储器(SDRAM) 参数的示例:已解决:双 16 位同步动态随机存取存储器(SDRAM) (W9812G6KH) 的 MIMXRT1176 SEMC 配置-恩智浦社区 致以最崇高的敬意, Omar
查看全文