Multi Source Translation Content

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

Multi Source Translation Content

Discussions

Sort by:
NXP i.MX 8M Plus Linux Boot Issue – How to Troubleshoot U-Boot and Kernel Startup? Hi NXP Community, I'm looking for guidance on troubleshooting Linux boot issues on the NXP i.MX 8M Plus platform. What are the recommended steps to identify whether a boot failure is related to U-Boot configuration, the device tree, or kernel initialization? I'm particularly interested in understanding: Which UART debug logs should be checked first? How can I verify that the device tree matches the hardware configuration? What are the most common causes of kernel startup failures? Which NXP debugging resources are recommended for investigating boot problems? Any technical suggestions or documentation references would be appreciated. Thank you!
View full article
NXP i.MX 8M Plus Linuxブートの問題 – Uブートとカーネル起動のトラブルシューティング方法? こんにちは、NXPコミュニティの皆さん、 NXP i.MX 8M PlusプラットフォームでのLinuxブート問題のトラブルシューティングについてアドバイスを探しています。 ブート失敗の原因がU-Bootの設定、デバイスツリー、またはカーネルの初期化のいずれに関連しているかを特定するために推奨される手順は何ですか? 私が特に理解したいのは以下の点です。 最初に確認すべきUARTデバッグログはどれですか? デバイスツリーがハードウェア構成と一致しているかどうか、どうやって確認できますか? カーネル起動失敗の最も一般的な原因は何ですか? 起動時の問題を調査する際に推奨されるNXPのデバッグリソースは何ですか? 技術的な提案やドキュメントの参考資料があれば教えていただけると助かります。 ご回答をお待ちしています。
View full article
IDM 6.43 ビルド52 パッチ(アクティベーションキー付き)最新版 2027 インターネットダウンロードマネージャー(IDM)は、ファイルダウンロードを効率的に管理するために設計されたWindowsアプリケーションです。ブラウザ連携、ダウンロードスケジューリング、ファイル整理機能を提供し、ユーザーが大きなファイルや複数ダウンロードを扱うのに役立ちます。 IDMを入手 IDMは、ダウンロードタスクをより細かく制御し、サーバーがサポートした場合に中断された転送を再開できるWindowsユーザーに一般的に利用されています。 主な特長 ダウンロード高速化:サポートされている場合、分割ダウンロードを使用して転送効率を向上させます。 一時停止と再開: ユーザーがソースが再開をサポートしている間に中断されたダウンロードを継続できるようにします。 ブラウザ連携: IDM統合モジュールを介して、対応ブラウザで動作します。 ダウンロードスケジューラ:ダウンロードタスクの整理とスケジュール設定を支援します。 ファイル整理:ダウンロードしたファイルをフォーマットに基づいて自動的に分類します。 WindowsでIDMをセットアップする方法 IDMのインストーラーは、公式ウェブサイトから入手してください。 セットアップファイルを実行し、インストール手順に従ってください。 ブラウザでIDM統合モジュールを有効にしてください。 ダウンロード場所と接続設定を構成します。 ダウンロード権限のあるファイルを使用して、セットアップをテストしてください。 おわりに IDMは、大きなファイルを頻繁に扱うWindowsユーザーにとって実用的なダウンロードマネジメントユーティリティとして機能しています。スケジュール設定機能、ブラウザ連携機能、再開機能などを備えているため、日常的な作業に役立ちます。 コミュニティディスカッション: IDMのどの機能を最もよく利用していますか?また、最近のWindowsアップデートでブラウザとの連携に問題が発生したことはありますか? RF
View full article
Firmware Update for MCXN947 Using a USB Flash Drive and MCUboot Firmware Update for MCXN947 Using a USB Flash Drive and MCUboot 1. Background and Goal Devices in the field may not always have a stable network connection, and connecting a debugger may not be convenient. In this case, a simple and reliable offline firmware update method is useful. A USB drive is easy to carry and easy to use. Service staff only need to copy the update image to the USB drive to update the device on site, without a network connection or a debugger. This document describes a USB-drive firmware update method based on FRDM-MCXN947 and MCUboot. FRDM-MCXN947 works as a USB Host and uses MSD and FatFs to access the signed update image, update.bin, on the USB drive. The application writes the image to the MCUboot Secondary Slot. After reset, MCUboot validates the image, applies Flash Remap when needed, and starts the new firmware. 2. Basic Concepts and Update Flow The update application and MCUboot work together in this solution: Update application: accesses the USB drive, reads and checks the update file, and writes the candidate firmware to the Secondary Slot. MCUboot: validates the firmware images in Flash and selects the image to start based on the image state and version. 2.1 MSD: Accessing the USB Drive MSD means Mass Storage Device. A USB drive is a common USB mass-storage device. In this solution, FRDM-MCXN947 works in USB Host mode and the USB drive works in USB Device mode. After the USB drive is detected and enumerated, the application mounts the file system with FatFs and reads update.bin from the root directory of the USB drive. The project is based on the MCUXpresso SDK host_msd_fatfs example. The original USB Host, MSD, and FatFs functions are kept, and the MCUboot update flow is added: Detect and open update.bin. Check the MCUboot Image Header. Erase the Secondary Slot. Read the image in blocks and program it to Flash. Read back and verify the Flash data. Mark the new image as ReadyForTest. Reset the device and let MCUboot start the new image. 2.2 MCUboot: Image Validation and Boot Control MCUboot is the bootloader used in this solution. MCUboot does not access the USB drive directly. After reset, MCUboot checks the firmware images in the Primary Slot and Secondary Slot, and selects the image to start based on the image state and version. The update file used by MCUboot is not a plain application binary. It contains an MCUboot Image Header, version information, and validation data. When image signature checking is enabled, MCUboot also checks the image integrity and signature. Only a valid image can be started. On FRDM-MCXN947, this solution uses MCUboot Flash Remap. The new firmware is first written to the Secondary Slot. After reset, MCUboot validates the candidate image and changes the active Flash mapping. The update application does not need to copy the complete Secondary Slot to the Primary Slot. 2.3 Overall Update Flow During normal startup, MCUboot validates and starts the current valid image. To perform a firmware update, press SW2 during reset to enter USB MSD update mode. The application reads the signed update.bin from the USB flash drive and writes it to the Secondary Slot. After the image is programmed and verified, it is marked as ReadyForTest, and the system is reset. MCUboot validates the new image and starts it using Flash Remap. After the new firmware runs successfully, it is confirmed as Pereanent to complete the update. The latest project uses the following simple flow: 3. Implementation Steps and Detailed Configuration This section follows the actual project files and functions. The steps below can be used directly to check the project configuration. 3.1 Flash Layout and Boot Address Region Start address End address Use Primary Slot 0x00000000 0x000FFFFF Current logical boot image, 1 MB Secondary Slot 0x00100000 0x001FFFFF USB update candidate image, 1 MB MCUboot 0x01008000 0x0100FFFF Bank 1 IFR 0, 32 KB   The Secondary Slot address and size in the application project must match the Flash partition settings in MCUboot. If the Flash maps do not match, MCUboot may report that the Secondary image is not found even when update.bin was written correctly. 3.2 Place MCUboot in IFR and Configure ROM Boot MCUboot is located at 0x01008000. After reset, the device must first enter MCUboot in IFR, so CMPA BOOT_CFG.BOOT_SRC must be configured to boot from IFR. MCUXpresso Secure Provisioning Tool can be used to program MCUboot, CMPA, and the first Primary image. Before testing the USB update, confirm that the serial output shows that MCUboot starts and jumps to the Primary image: hello sbl. Bootloader Version 2.0.0 Primary slot: version=... Jumping to the image 3.3 Build the Update Application from host_msd_fatfs The update application is based on the MCUXpresso SDK host_msd_fatfs example. The original USB Host event callback, MSD handling, and FatFs mount flow are kept. The usb_msd_mcuboot_update.c module is added for the MCUboot update flow. The application also includes mcuboot_app_support.c/.h and the related Flash map settings so that bl_update_image_state() can be used. app.c: board initialization, SW2 check, and USB Host task control. host_msd_fatfs.c: calls USB_MsdMcubootUpdateRun() after the USB drive is ready and FatFs is mounted. usb_msd_mcuboot_update.c: handles update.bin, Flash erase/program/verify, and the update state. mcuboot_app_support.c: marks the candidate image ReadyForTest and confirms the new image as Permanent. 3.4 Use SW2 to Select Update Mode or Normal Mode SW2 on FRDM-MCXN947 is used to enter firmware update mode. In this project, a pressed SW2 is treated as a low level. The application reads the GPIO only once during startup.   3.5 Initialize USB Host and Wait for the USB Drive When SW2 is low, the application calls USB_HostApplicationInit() to set up the USB clock, USB Host stack, and interrupt. USB_HostTaskFn() and USB_HostMsdTask() then run in the main loop until the USB drive is enumerated and FatFs is mounted.   USB_HostEvent() passes Attach, EnumerationDone, and Detach events to USB_HostMsdEvent(). The update function is called only after the mass-storage device is ready and the file system can be accessed. 3.6 Open update.bin and Check the MCUboot Image Header The update file is 1:/update.bin in the root directory of the USB drive. The application opens the file in read-only mode, gets the file size, reads the first buffer, and copies the header into mcuboot_image_header_t. The header is checked before the Secondary Slot is erased. HeaderIsValid() checks the main items below: Magic must be 0x96F3B83D. This shows that the file is an MCUboot image, not a plain application binary that starts with a vector table. Header size must be 0x400, matching the header-size option used during signing. The file size and headerSize + imageSize must not exceed the 1 MB slot. 3.7 Erase the Secondary Slot After the header check passes, the mflash driver is initialized. The required erase length is calculated from the file size and rounded to the sector size. Erasing starts at 0x00100000 and must not touch the Primary Slot.   Before erasing, the code should also make sure that eraseLength does not exceed MCUBOOT_SLOT_SIZE. 3.8 Read, Program, and Verify the Image After erase, f_lseek(&file, 0U) moves the file pointer back to the beginning. The file is then read in blocks. Each block is padded to the mflash phrase size with 0xFF, programmed to the Secondary Slot, and read back for comparison. If a write or verify step fails, the update stops and goes to cleanup.   At the end, totalWritten must match fileSize. ReadyForTest is set only after the complete file is programmed and every block passes the read-back check. 3.9 Set ReadyForTest, Reset, and Confirm the New Image After the candidate image is programmed and verified, the application calls bl_update_image_state(0, kSwapType_ReadyForTest). This writes the required update state to the Secondary Slot trailer. The system then resets. MCUboot validates the candidate image and uses Flash Remap to start the new version when the image is accepted.   ReadyForTest means that the new image is allowed to boot for testing. If the new image is not confirmed, MCUboot can return to the old image on a later reset. After the new firmware starts and passes the required basic self-check, the application should mark the image as Permanent:   4. Operation and Verification 4.1 Create and Sign the Update Image update.bin used for the USB update must be an MCUboot signed image. Do not use the plain .bin file generated by the IDE directly. Open MCUXpresso Secure Provisioning Tool and select Tools > MCUboot > Sign Image to create an image that MCUboot can validate. Figure 1. Open the MCUboot Sign Image tool Figure 2. MCUboot image signing settings Input image: select the .bin file generated by the application project. Signing private key: select the ECDSA-P256 private key that matches the public key used by MCUboot. Set the image version, header-size = 0x400, and slot-size = 0x100000. The update image version should be higher than the current running version. For the USB OTA candidate image, do not use an image that has already been padded and confirmed for direct Flash programming. Rename the signed output image to update.bin and copy it to the root directory of the USB drive. 4.2 Initial Programming Before the first test, program MCUboot and the initial application image: Program MCUboot to IFR at 0x01008000. Program the signed initial application image to the Primary Slot at 0x00000000. Reset the board and confirm that MCUboot finds the Primary image and starts the application correctly. 4.3 Run the USB Firmware Update Build and sign the new application, rename the signed image to update.bin, and copy it to the root directory of the USB drive. Insert the USB drive into FRDM-MCXN947. Hold SW2 and reset the board to enter firmware update mode. Release SW2 after the update mode starts. Wait for the firmware update to complete. The application reads update.bin, writes and verifies the image in the Secondary Slot, marks it as ReadyForTest, and then resets the device. After reset, MCUboot validates the new image and starts the new firmware using Flash Remap. Check the serial output to confirm the new firmware version and that the image is marked as Permanent. Reset the board again and confirm that the new firmware still runs correctly. Expected Log Figure 3. Example log after the new image is started 5. Summary This solution combines offline firmware delivery from a USB drive with MCUboot boot management. The application reads a signed update image through USB Host MSD and FatFs, writes the complete image to the Secondary Slot, and resets the system. MCUboot then validates the image and selects the image to start. SW2 is used to enter update mode only when needed, so update.bin can remain on the USB drive without causing repeated updates. MCXN
View full article
MCXA: Controlling Flash Access Permissions with MBC MCXA: Controlling Flash Access Permissions with MBC 1.Why Is MBC Needed? In an MCXA application, the internal flash is usually divided into several functional regions, such as the bootloader, application, firmware update or secondary image, and user data regions. Each region has different access requirements. For example, the bootloader and application regions must allow code execution, while the firmware update region must allow a new firmware image to be written. Therefore, proper access control for each flash region is important. The Memory Block Checker (MBC) in MCXA devices provides hardware-based memory access control. Its purpose is not simply to protect the entire flash. Instead, it applies suitable access permissions to different flash regions based on the system security requirements and software design. This is especially useful in systems that use secure boot, a bootloader, MCUboot, or over-the-air firmware updates. 2.How MBC Controls Flash Access The basic idea of MBC flash access control is to divide the protected memory space into fixed-size memory blocks and assign an access control policy to each block. When the system accesses an address managed by MBC, MBC checks the memory block that contains the address and the access control policy assigned to that block. MBC then decides whether the read, write, or execute operation is allowed. MBC configuration mainly uses two register fields. GLBAC defines an access control policy, while MBACSEL assigns a GLBAC policy to a specific memory block. The following sections first describe GLBAC and then MBACSEL. 2.1 GLBAC: Defining an Access Control Policy Using MCXA153 as an example, MBC provides eight Global Access Control settings, from GLBAC0 to GLBAC7. Each GLBAC register defines a complete access control policy, including read, write, execute, and lock permissions. The Access Control Combinations table in the reference manual lists the permission settings for each GAC index. MBC Global Access Control (GLBAC) register: The access control combinations for GLBAC0 to GLBAC7 are shown below: GLBAC defines the access control policy itself. For example, GLBAC0 can allow read and write operations, block execute operations, and remain unlocked. GLBAC2 can allow read and execute operations, block write operations, and remain locked. The final permissions are determined by the access control fields and the LK bit in the GLBAC register. GLBAC only defines the available permissions. It does not specify which flash block uses those permissions. MBACSEL is used to assign a GLBAC policy to a specific flash block. 2.2 MBACSEL: Selecting a GLBAC Policy for a Memory Block The memory space managed by MBC is divided into fixed-size memory blocks. Each memory block has an MBACSEL (Memory Block Access Control Select) field that selects the GLBAC access control policy used by that block. MBC Memory Block Configuration Word register: MBACSEL is a 3-bit field used to select one of the eight access policies defined by GLBAC0 through GLBAC7. It does not directly define read, write, execute, or lock permissions. Instead, GLBAC defines the access permissions, and MBACSEL assigns the selected GLBAC policy to a specific memory block. For example, MBACSEL = 4 means that the memory block uses the access policy defined by GLBAC4. 2.3 Difference Between Locked and Unlocked The LK bit in a GLBAC register locks the access control configuration. For example, GLBAC4 and GLBAC2 can both allow read and execute operations and block write operations. However, GLBAC4 is unlocked, while GLBAC2 is locked. When GLBACr[LK] is set to 1, the related GLBAC register becomes read-only until the next reset. If MBACSEL for a memory block already points to that locked GLBAC, the MBACSEL setting for the block also remains locked until the next reset. Therefore, the read, write, and execute fields determine whether the related flash access is allowed. The LK bit determines whether the GLBAC policy and the MBACSEL setting that uses the policy can be changed by software during the current boot cycle. 3.Two Ways to Configure MBC 3.1 Method 1: Configure MBC Through CMPA The first method uses the flash access control fields in the Customer Manufacturing/Configuration Protected Area (CMPA) to configure MBC access policies. After a system reset, the boot ROM reads the CMPA settings and applies the related MBC access policies before starting the user application. Therefore, CMPA can be used to define the initial flash access permissions before the application starts. FLASH_ACL is an important part of this configuration. The FLASH_ACL settings should be selected based on the actual flash partition layout and the required access permissions for each region. This is the main difference from configuring MBC through application code, which takes effect after the application or bootloader starts. The MCUXpresso Secure Provisioning Tool (SEC) can be used to configure flash access control in CMPA. The following steps use MCXA153 as an example. Step 1: Open CMPA Configuration On the Build image page of the SEC Tool, click CMPA configuration to open the PFR Configuration window, as shown below. Step 2: Configure FLASH_ACL In the PFR Configuration window, open Flash access control. The available settings include FLASH_ACL_0_7, FLASH_ACL_8_15, and other FLASH_ACL fields. For example, FLASH_ACL_0_7 contains ACL_SEC_0 through ACL_SEC_7. Each ACL_SEC_x field sets the access control policy for the related flash sector. As shown in the figure, each ACL_SEC_x field can select a different access control type. These options match the MBC Global Access Control policies described earlier. MBACSEL selects the related GLBAC setting, and GLBAC defines the final read, write, execute, and lock permissions. Note: CMPA is an important device configuration area. Before programming CMPA, carefully check that FLASH_ACL matches the actual flash layout and the software access requirements. Pay special attention to the lock setting and the reversed-bit encoding. If a flash region required for boot or normal operation is configured as NO_ACCESS_LOCKED by mistake, the bootloader or application may no longer be able to access that region. A recovery method should also be kept available before CMPA is programmed, so that the device can be recovered if the configuration is incorrect. 3.2 Method 2: Configure MBC Through Application Code The second method configures MBC directly in the application code. The main difference from CMPA configuration is when the configuration is applied. After the bootloader or application starts, the software can configure the required flash access policy based on the system design and the current operating stage. Using the MCXA153 SDK as an example, the SystemInit() function in system_MCXA153.c in SDK version 26.06 includes MBC initialization code. Step 1: Use GLIKEY to enable write access to the MBC registers. Step 2: Configure GLBAC0. Configure GLBAC0 to allow flash read, write, and execute operations. Step 3: Configure the flash blocks to use GLBAC0. After this configuration is complete, the application can perform read, write, and execute operations on the related flash regions. The main advantage of configuring MBC through application code is flexibility. 4.Choosing Between CMPA and Application Code Both CMPA and application code can affect the MBC configuration. The suitable method depends on when the access policy must be applied. The two methods can be compared as follows: Comparison Item CMPA Application Code Configuration stage Boot stage Software run time Effective before application starts Yes No Main purpose Set the initial access policy Run-time access control Flexibility Lower Higher Related to software state Limited Can be adjusted based on the current software state Impact of an incorrect setting May directly prevent boot or memory access Usually easier to identify during software debugging CMPA is mainly used to set the initial flash access state during system startup. Application code can adjust the MBC configuration based on the needs of the current software stage. Therefore, the two methods are not mutually exclusive. They can be used separately or together, depending on the system design. When application code changes the MBC configuration at run time, the changes must be considered as part of the complete system security design. This includes which permissions software is allowed to change, when the changes are allowed, and whether the configuration must be locked again afterward. The implementation must follow the MBC and CMPA behavior of the target MCXA device and the security requirements of the product. The configuration examples in this article use MCXA153. 5.Summary MBC in MCXA devices provides hardware-based access control for internal flash. When designing a bootloader, secure boot flow, or firmware update system, it is important to understand the relationship between MBC, CMPA, and application code. This article uses MCXA153 to explain the two configuration methods. For an actual design, always follow the reference manual and SDK for the target device. Boot ROM|Booting | Flash MCXA
View full article
How to read shadow fuse by ELE API Background: The OCOTP_CTRL module is a hardware IP block that manages access to the eFuses. It provides read/write access to internal eFuses and it loads the eFuse values into shadow registers for normal software access.   In this article, Will explain how to read security-sensitive fuses that are not accessible via FSB (Fuse Status Block) on i.MX9x devices, by using the ELE "Read Shadow Fuse" command through the S3MU messaging interface.   Take the following “SJC_DISABLE” example as an illustration: As shown in the figure below, SJC_DISABLE corresponds to word57, with a hexadecimal value of 0x39. 1. Each message sent to ELE via S3MU starts with a 32-bit header, consisting of four fields: Tag (must be 0x17), Command (command ID), Size (message length in words, 1–255), and Ver (must be 0x06). The corresponding command for reading registers is 0xF3. 2. ELE's response also starts with a 32-bit header: Tag (must be 0xe1), Command (echoes the original command ID), Size (response length in words, 1–255), and Ver (must be 0x06). 3. Test: Reading the i.MX 93 SJC_DISSBLE Note: This API can be called only in OEM OPEN life cycles.
View full article
Configure i.MX8QM UART1 for DDR Stress Test Background: By default, the i.MX 8QM uses UART0 as the AP UART. However, some customers use UART1 as the AP UART when employing the DDR stress test tool. This article uses the i.MX8QM MEK as an example to provide a detailed guide on how to reconfigure the AP UART to UART1.   1. HW re-work: On the i.M8QM MEK board, UART1 is not directly connected to the FTDI chip associated with the "Micro USB Debug Interface" (J18). To use UART1, a hardware modification (HW re-work) is required. A hardware rework connects the MX8QM’s UART1 to the “FTDID_TX” and “FTDID_RX” ports of the FTDI chip. 1.1 : Ensure that no Bluetooth module is installed.                 1.2 : Connect BT_UART1_RX to U62.12; Connect BT_UART1_TX to U10.10; connect FTDID_TX to U62.5; connect FTDID_RX to U62.7              2. SW configure Edit the .ds script to add the UART1 port configuration at the end of the file.  Add the following line at the end of the .ds file: memory set  0x5C01042C 32   0x00000001   # UART1 port selection for AP UART  3. Test For the DDR stress test, please select the fourth COM port option, which corresponds to UART1. UART1 is connected to "FTDID_TX" and "FTDID_RX"—this maps to the fourth COM port.
View full article
[MCX A153] LPUART 入门指南(日语博客) 本文旨在为NXP产品新手工程师介绍MCX A153上的LPUART(低功耗通用异步收发器)的基本概念以及如何将其与MCUXpresso SDK配合使用。首先,我们将概述硬件,然后以FRDM-MCXA153开发板为基础,通过代码示例讲解如何使用MCUXpresso SDK API。 (阅读时间:20分钟) 1. LPUART 模块概述 LPUART 是一个用于实现异步串行通信的模块。接下来,我们将依次介绍它的主要特性。   异步通信(起始位/停止位) LPUART 不使用时钟线;它通过数据中包含的起始位和停止位来确定时序。由于它只需要两根线(TX 和 RX),因此被广泛用于轻松连接各种设备,例如与 PC 通信、连接传感器以及输出调试日志。 中断/DMA 支持 LPUART 采用了一种硬件自动辅助数据传输的机制,而非由 CPU 逐字节处理数据。它利用中断,仅在事件发生时才处理数据;并利用 DMA 技术,无需 CPU 干预即可在内存和数据之间进行传输。由于其设计充分考虑了 DMA 集成,即使在高速通信期间也能最大限度地降低 CPU 负载。 内置FIFO(缓冲区) LPUART 内部有一个用于发送和接收数据的缓冲区,也称为 FIFO(先进先出)。由于它可以临时存储数据,因此可以弥补通信速度与 CPU 或 DMA 处理速度之间的差异。与 DMA 结合使用时,更容易实现不间断的连续通信。 低功耗运行 它采用比标准UART更低的功耗设计,有时甚至在睡眠模式下也能继续运行。由于它与时钟控制紧密配合,因此特别适用于电池供电设备和物联网应用。 支持多实例 该MCU具有多个LPUART,允许多个设备同时通信。这使您可以为每个实例分配不同的角色,例如将调试和传感器通信分开。 2. 软件配置(MCUXpresso SDK) MCUXpresso SDK 提供了三种类型的驱动程序来处理 LPUART:轮询、中断和 eDMA。 在实际应用中,基于中断的通信足以满足小规模通信的需求,但高速、连续通信则通常使用 eDMA。对于不希望增加 CPU 负担的应用,从一开始就考虑使用 eDMA 进行设计可以最大限度地减少未来的修改。因此,本文将假设使用 DMA 进行讨论。 3. 先进先出(FIFO)和直接内存访问(DMA)的作用 要正确使用DMA,首先必须了解FIFO的工作原理。LPUART内部有一个FIFO(先进先出缓冲区),它的作用是临时保存发送的数据、临时存储接收到的数据,并吸收LPUART和DMA之间可能存在的速度差异。 在DMA集成中,接收端LPUART接收到的数据存储在RX FIFO中,当达到阈值时,DMA将数据从RX FIFO传输到内存。发送端DMA将数据从内存写入TX FIFO,LPUART依次从TX FIFO中读取并发送数据。这种机制允许硬件端进行连续数据传输,无需等待DMA传输完成,从而实现不间断的通信。 DMA 的工作原理可以描述如下: 当 LPUART 与 DMA 一起使用时,需要配置通道 MUX 以确定 LPUART 的 TX/RX 请求应该通过哪个 eDMA 通道进行路由。 MCX A153 没有像其他系列那样配备独立的 DMAMUX 外设。相反,eDMA 控制器的每个通道都内置了一个通道多路复用器(CHn_MUX 寄存器),用于选择要接受哪个外设功能的 DMA 请求源。SDK 使用 EDMA_SetChannelMux() API 为每个通道分配请求源(具体调用方法请参见第 4 章)。通道号不是固定的,可以根据应用程序的需要自由切换。 下图说明了外围功能侧的多个 DMA 请求源如何通过每个 eDMA 通道中内置的通道 MUX 选择器连接到通道主体。 在上图中,实线表示使用 EDMA_SetChannelMux 将 LPUART0 TX 分配给通道 0,LPUART0 RX 分配给通道 1 的示例。虚线表示可用的连接选项,通过在调用 API 时重写参数,可以更改其他分配,例如将 LPUART0 TX 分配给通道 2。 4. SDK驱动程序的基本流程 接下来,我们将以 MCUXpresso SDK 示例项目“lpuart_edma_transfer”为例,演示如何使用该驱动程序。 参考网址: 硬件要求 — MCUXpresso SDK 文档 mcuxsdk-examples/driver_examples/lpuart/edma_transfer/lpuart_edma_transfer.c 以下是同时使用 LPUART 和 DMA 的基本步骤: 启用时钟。 配置引脚多路复用器 初始化LPUART。 配置 eDMA 通道 MUX。 生成 DMA 句柄 开始发送/接收 下一个过程由回调函数控制。 接下来的章节中,我们将详细解释每个步骤,并提供代码片段。 4.1 时钟端口设置 首先,启用 LPUART 模块上的时钟。 CLOCK_EnableClock(kCLOCK_Lpuart0); 接下来,我们配置用于 TX 和 RX 的 MUX 引脚。 PORT_SetPinMux(PORTA, 1U, kPORT_MuxAlt2); // TX PORT_SetPinMux(PORTA, 2U, kPORT_MuxAlt2); // RX 除了 GND 之外,UART 的接线仅包含两根线:发送线和接收线。在 FRDM-MCXA153 电路图中,LPUART0 的 TXD 和 RXD 连接到 MCU-LINK 的虚拟 COM 口,通过 USB 将 MCU-LINK 连接到 PC,即可实现 UART 通信调试。 4.2 LPUART 初始化 初始化 LPUART 包括先获取默认设置,然后修改必要的项目。 lpuart_config_t config; LPUART_GetDefaultConfig(&config); config.baudRate_Bps = 115200; config.enableTx = true; config.enableRx = true; LPUART_Init(LPUART0, &config, CLOCK_GetFreq(kCLOCK_CoreSysClk)); 波特率取决于提供给 LPUART 的时钟频率,因此您需要在 CLOCK_GetFreq() 中传递正确的时钟源频率。根据需要启用 TX 和 RX。 4.3 eDMA通道复用器配置 在生成句柄之前,您需要使用 EDMA_SetChannelMux 指定要将 LPUART TX/RX 请求路由到的 eDMA 通道。如第 3 章所述,MCX A153 没有独立的 DMAMUX,此 API 会在每个通道的 CHn_MUX 寄存器中设置请求源。 /* LPUART0 TX を eDMA の任意チャネル(例: CH0)に割り当てる */ EDMA_SetChannelMux(DMA0, LPUART_TX_DMA_CHANNEL, kDma0RequestMuxLPUART0Tx); /* LPUART0 RX を eDMA の任意チャネル(例: CH1)に割り当てる */ EDMA_SetChannelMux(DMA0, LPUART_RX_DMA_CHANNEL, kDma0RequestMuxLPUART0Rx); 此处指定的通道号必须与生成后续 DMA 句柄时传递给 txEdmaHandle / rxEdmaHandle 通道号匹配。 4.4 DMA句柄生成 创建一个句柄来连接 LPUART 和 DMA,并在此处注册一个回调函数,以便在通信完成后调用。 lpuart_edma_handle_t g_lpuartEdmaHandle; LPUART_TransferCreateHandleEDMA(LPUART0, &g_lpuartEdmaHandle, lpuart_callback, userData, &txEdmaHandle, &rxEdmaHandle); 该句柄关联 LPUART 和 DMA TX/RX 通道,然后由后续的发送和接收 API 使用这些通道。 4.5 传输(DMA) 发送操作非常简单,只需调用 API,并将发送缓冲区和大小设置为 lpuart_transfer_t 。 lpuart_transfer_t xfer; xfer.data = txBuffer; xfer.dataSize = txSize; LPUART_TransferSendEDMA(LPUART0, &g_lpuartEdmaHandle, &xfer);   4.6 接收(DMA) 同样,接收也是通过在调用函数时指定接收缓冲区和大小来完成的。 lpuart_transfer_t xfer; xfer.data = rxBuffer; xfer.dataSize = rxSize; LPUART_TransferReceiveEDMA(LPUART0, &g_lpuartEdmaHandle, &xfer);   4.7 回调实现 通信完成后,应用程序会收到回调函数的通知。 void lpuart_callback(LPUART_Type *base, lpuart_edma_handle_t *handle, status_t status, void *userData) { if (status == kStatus_LPUART_TxIdle) { // 送信完了処理 } else if (status == kStatus_LPUART_RxIdle) { // 受信完了処理 } } kStatus_LPUART_TxIdle kStatus_LPUART_RxIdle 表示通过 DMA 传输完成, 表示通过 DMA 接收完成。如果要继续连续接收,可以在此回调函数中再次调用 LPUART_TransferReceiveEDMA() 以继续不间断接收。   4.8 关键设计要点 当实际将 LPUART 和 DMA 结合使用时,需要注意以下几个设计方面的考虑因素。 首先,我们来考虑传输大小。如果传输大小太小,中断次数会增加,降低 CPU 效率;如果传输大小太大,传输完成的延迟会很高。你需要根据应用程序的需求,同时考虑 FIFO 的大小,选择一个合适的传输大小。 接下来是接收缓冲区的设计。如果接收长度是预先确定的,则固定长度的缓冲区就足够了;但如果要连续接收长度不确定的数据,通常使用环形缓冲区。 最后,还有回调过程。回调不仅通知应用程序传输已完成,还会触发下一次DMA传输的重新配置。实现这一部分对于确保稳定连续的通信至关重要。 5. 常见问题   5.1 DMA 功能无法正常工作 可能的原因包括DMA时钟未启用、 EDMA_SetChannelMux 中指定的请求源与LPUART的TX/RX不匹配,或者传递给LPUART驱动程序的通道号与 EDMA_SetChannelMux 中设置的通道号不匹配。最快的解决方法是先启用时钟,然后检查通道MUX分配是否匹配。 5.2 数据丢失 常见问题包括 FIFO 溢出和传输大小设置与实际数据量不匹配。请检查 FIFO 阈值和 DMA 传输单元之间的关系。 5.3 高速通信导致的故障 随着波特率的提高,FIFO 欠载、缓冲器设计不足、波形质量下降和时钟错误等因素会变得尤为明显。因此,必须从硬件端信号质量和软件端缓冲器供电能力两方面来探究问题的根源。 6. 总结 LPUART 实际应用中最重要的是正确理解 FIFO 的作用,并考虑其与 DMA 的交互来设计数据缓冲区。牢记这些要点,即可实现低功耗、低 CPU 负载的稳定 UART 通信。 ========================= 我们目前无法回复此帖“评论”区的评论。由此给您带来的不便,我们深表歉意。如有任何疑问,请参阅“ NXP技术问题咨询 - 如何联系我们(日语博客) ”。(如果您已经是NXP的分销商或与NXP有合作关系,您可以直接联系您的代表。) 本文旨在为NXP产品新手工程师介绍MCX A153上的LPUART(低功耗通用异步收发器)的基本概念以及如何将其与MCUXpresso SDK配合使用。首先,我们将概述硬件,然后以FRDM-MCXA153开发板为基础,通过代码示例讲解如何使用MCUXpresso SDK API。 (阅读时间:20分钟) MCUXpresso SDK MCX 日本博客
View full article
[MCX A153] LPUART Introduction Guide (Japanese Blog) This article explains the basic concepts of LPUART ( Low Power Universal Asynchronous Receiver / Transmitter ) on the MCX A153 and how to use it with the MCUXpresso SDK, aimed at engineers who are new to NXP products. First, we will explain the hardware overview, and then, using the FRDM-MCXA153 board as a base, we will explain how to use the MCUXpresso SDK API with code snippets. (Reading time: 20 minutes) 1. LPUART Module Overview LPUART is a module for implementing asynchronous serial communication. Here, we will look at its key features in order.   Asynchronous communication (start bit/stop bit) LPUART does not use a clock line; instead, it determines timing using start and stop bits included in the data. Because it only requires two wires, TX and RX, it is widely used for easily connecting different devices, such as communicating with a PC, connecting to sensors, and outputting debug logs. Interrupt/DMA compatible LPUART features a mechanism where hardware automatically assists with data transfer, rather than the CPU processing data byte by byte. Using interrupts, the CPU only processes data when an event occurs, and using DMA, data can be transferred to and from memory without CPU intervention. Because it's designed with DMA integration in mind, CPU load can be minimized even during high-speed communication. Built-in FIFO (buffer) LPUART has an internal buffer for sending and receiving data, also known as a FIFO. Because it can temporarily store data, it can absorb the difference between the communication speed and the processing speed of the CPU or DMA. When combined with DMA, it makes it easier to achieve uninterrupted, continuous communication. Low power operation Designed to operate with lower power consumption than a standard UART, it can sometimes continue operating even while in sleep mode. Because it works closely with clock control, it is particularly useful for battery-powered devices and IoT applications. Supports multiple instances The MCU has multiple LPUARTs, allowing for simultaneous communication of multiple devices. This enables you to separate roles for each instance, such as separating debugging and sensor communication. 2. Software Configuration (MCUXpresso SDK) The MCUXpresso SDK provides three types of drivers for handling LPUART: polling, interrupt, and eDMA. In practical applications, interrupt-based communication is sufficient for small-scale communications, but eDMA is used for high-speed, continuous communications. For applications where you don't want to burden the CPU, designing with eDMA in mind from the start will minimize future changes. Therefore, this article will proceed on the assumption that DMA is being used. 3. The role of FIFO and DMA To use DMA correctly, it's essential to first understand how FIFOs work. LPUART has an internal FIFO (First-In First-Out buffer) that plays the role of temporarily holding transmitted data, temporarily storing received data, and absorbing the speed difference that occurs between LPUART and DMA. In DMA integration, on the receiving side, data received by the LPUART is stored in the RX FIFO, and when a threshold is reached, the DMA transfers the data from the RX FIFO to memory. On the transmitting side, the DMA writes data from memory to the TX FIFO, and the LPUART sequentially retrieves and transmits the data from the TX FIFO. This mechanism allows for continuous data transfer on the hardware side without waiting for the DMA transfer to complete, enabling continuous communication without interrupting throughput. The operation of DMA can be illustrated as follows: When using LPUART with DMA, you need to configure the channel MUX to determine which eDMA channel the LPUART's TX/RX requests should be routed through. In the MCX A153, there is no separate DMAMUX peripheral as seen in other families. Instead, each channel of the eDMA controller has a built-in channel MUX (CHn_MUX register) that selects which peripheral function's DMA request source it will accept. The SDK assigns request sources to each channel using the EDMA_SetChannelMux() API (the specific calling method is described in Chapter 4). The channel number is not fixed and can be freely switched depending on the application's use. The diagram below illustrates how multiple DMA request sources on the peripheral function side are connected to the channel body via a channel MUX selector built into each eDMA channel. In the diagram above, the solid lines show an example where LPUART0 TX is assigned to Channel 0 and LPUART0 RX to Channel 1 using EDMA_SetChannelMux . The dotted lines represent available connection options, and by rewriting the arguments when calling the API, it is possible to change other assignments, such as assigning LPUART0 TX to Channel 2. 4. Basic Flow of SDK Drivers Next, we will demonstrate how to use the driver using the MCUXpresso SDK sample project "lpuart_edma_transfer" as an example. Reference URL: Hardware requirements — MCUXpresso SDK Documentation mcuxsdk-examples/driver_examples/lpuart/edma_transfer/lpuart_edma_transfer.c The following seven steps are the basic steps when using LPUART and DMA together: Enable the clock. Configure pin MUX Initialize the LPUART. Configure the eDMA channel MUX. Generate a DMA handle Start sending/receiving The next process is controlled by the callback. In the following sections, we will explain each step in detail, including code snippets. 4.1 Clock Port Settings First, enable the clock on the LPUART module. CLOCK_EnableClock(kCLOCK_Lpuart0); Next, we configure the MUX pins used for TX and RX. PORT_SetPinMux(PORTA, 1U, kPORT_MuxAlt2); // TX PORT_SetPinMux(PORTA, 2U, kPORT_MuxAlt2); // RX Aside from GND, the UART wiring consists of only two wires: transmit and receive. In the FRDM-MCXA153 circuit diagram, the TXD and RXD of LPUART0 are connected to the MCU-LINK's Virtual COM, and by connecting the MCU-Link to a PC via USB, debugging via UART communication becomes possible. 4.2 LPUART initialization Initializing the LPUART involves first obtaining the default settings and then modifying the necessary items. lpuart_config_t config; LPUART_GetDefaultConfig(&config); config.baudRate_Bps = 115200; config.enableTx = true; config.enableRx = true; LPUART_Init(LPUART0, &config, CLOCK_GetFreq(kCLOCK_CoreSysClk)); The baud rate depends on the clock frequency supplied to the LPUART, so you need to pass the correct clock source frequency in CLOCK_GetFreq() . Enable TX and RX as needed. 4.3 eDMA Channel MUX Settings Before generating the handle, you specify with EDMA_SetChannelMux which eDMA channel to route the LPUART TX/RX requests to. As explained in Chapter 3, the MCX A153 does not have an independent DMAMUX, and this API sets the request source in the CHn_MUX register for each channel. /* LPUART0 TX を eDMA の任意チャネル(例: CH0)に割り当てる */ EDMA_SetChannelMux(DMA0, LPUART_TX_DMA_CHANNEL, kDma0RequestMuxLPUART0Tx); /* LPUART0 RX を eDMA の任意チャネル(例: CH1)に割り当てる */ EDMA_SetChannelMux(DMA0, LPUART_RX_DMA_CHANNEL, kDma0RequestMuxLPUART0Rx); The channel number specified here must match the channel number passed to txEdmaHandle / rxEdmaHandle when generating the subsequent DMA handle. 4.4 DMA Handle Generation A handle is created to link LPUART and DMA, and a callback function is registered here to be called when communication is complete. lpuart_edma_handle_t g_lpuartEdmaHandle; LPUART_TransferCreateHandleEDMA(LPUART0, &g_lpuartEdmaHandle, lpuart_callback, userData, &txEdmaHandle, &rxEdmaHandle); This handle associates the LPUART and DMA TX/RX channels, which are then used by subsequent transmit and receive APIs. 4.5 Transmission (DMA) Sending is as simple as calling the API with the send buffer and size set to lpuart_transfer_t . lpuart_transfer_t xfer; xfer.data = txBuffer; xfer.dataSize = txSize; LPUART_TransferSendEDMA(LPUART0, &g_lpuartEdmaHandle, &xfer);   4.6 Receiving (DMA) Similarly, receiving is also done by specifying the receive buffer and size when calling the function. lpuart_transfer_t xfer; xfer.data = rxBuffer; xfer.dataSize = rxSize; LPUART_TransferReceiveEDMA(LPUART0, &g_lpuartEdmaHandle, &xfer);   4.7 Callback Implementation The application is notified of the completion of the communication via a callback function. void lpuart_callback(LPUART_Type *base, lpuart_edma_handle_t *handle, status_t status, void *userData) { if (status == kStatus_LPUART_TxIdle) { // 送信完了処理 } else if (status == kStatus_LPUART_RxIdle) { // 受信完了処理 } } kStatus_LPUART_TxIdle kStatus_LPUART_RxIdle indicates completion of transmission via DMA, and indicates completion of reception via DMA. If you want to continue receiving continuously, you can call LPUART_TransferReceiveEDMA() again within this callback to continue receiving without interruption.   4.8 Key Design Points When actually using LPUART and DMA in combination, there are several design considerations that you should keep in mind. First, let's consider the transfer size . If the transfer size is too small, the number of interrupts will increase, reducing CPU efficiency. If it's too large, the latency until the transfer is complete will be high. You need to choose an appropriate value that matches the application's requirements while keeping the FIFO size in mind. Next is the design of the receive buffer . If the receive length is predetermined, a fixed-length buffer is sufficient, but if you are continuously receiving data of an unspecified length, it is common to use a ring buffer. Finally, there's the callback process . Callbacks not only notify the application that the transfer is complete, but they also trigger the reconfiguration of the next DMA transfer. Implementing this part is the most crucial for ensuring stable continuous communication. 5. Common problems   5.1 DMA is not working Possible causes include the DMA clock not being enabled, the request source specified in EDMA_SetChannelMux not matching the LPUART's TX/RX, or the channel number passed to the LPUART driver not matching the channel number set in EDMA_SetChannelMux . The quickest solution is to first enable the clock and check that the channel MUX assignments match. 5.2 Data Loss Typical issues include FIFO overruns and transfer size settings that don't match the actual data volume. Review the relationship between the FIFO threshold and the DMA transfer unit. 5.3 Failure due to high-speed communication As the baud rate increases, factors such as FIFO underrun, insufficient buffer design, degraded waveform quality, and clock errors become apparent. It is necessary to isolate the cause from both the hardware-side signal quality and the software-side buffer supply capability. 6. Summary The most important thing for effectively using LPUART in practice is to correctly understand the role of FIFO and design the data buffer in consideration of its interaction with DMA. By keeping these points in mind, you can achieve stable UART communication with low power consumption and low CPU load. ========================= We are currently unable to respond to comments left in the "Comment" section of this post. We apologize for the inconvenience, but please refer to " Technical Questions to NXP - How to Contact Us (Japanese Blog) " when making inquiries. (If you are already an NXP distributor or have a relationship with NXP, you may contact your representative directly.) This article explains the basic concepts of LPUART (Low Power Universal Asynchronous Receiver/Transmitter) on the MCX A153 and how to use it with the MCUXpresso SDK, aimed at engineers who are new to NXP products. First, we will explain the hardware overview, and then, using the FRDM-MCXA153 board as a base, we will explain how to use the MCUXpresso SDK API with code snippets. (Reading time: 20 minutes) MCUXpresso SDK MCX Japanese Blog
View full article
[MCX A153] LPUART入門ガイド(日本語ブログ) 本記事では、MCX A153 に搭載されている LPUART(Low Power Universal Asynchronous Receiver/Transmitter) の基本概念と、MCUXpresso SDK を用いた使用方法を、初めて NXP 製品を扱うエンジニア向けに解説します。まずハードウェアの概要を説明し、その後FRDM-MCXA153ボードをベースに、MCUXpresso SDK API の使い方をコードスニペットとともに説明します。 (読了:20分) 1. LPUART モジュール概要 LPUART は、非同期シリアル通信を実現するためのモジュールです。ここでは代表的な特徴を順に見ていきます。   非同期通信(スタートビット/ストップビット) LPUART はクロック線を使わず、データに含まれるスタートビットとストップビットでタイミングを判断します。配線が TX と RX の 2 本だけで済むため、PC との通信、センサーとの接続、デバッグログの出力など、異なる機器同士を簡単につなぐ用途に広く使われています。 割り込み/DMA対応 LPUART は、CPU が 1 バイトずつデータを処理するのではなく、ハードウェアが自動でデータ転送を補助する仕組みを備えています。割り込みを使えばイベント発生時にのみ CPU が処理を行い、DMA を使えば CPU を介さずにメモリとの間でデータを転送できます。DMA 連携を前提とした設計になっているため、高速な通信でも CPU 負荷を最小限に抑えることができます。 FIFO(バッファ)内蔵 LPUART は内部に送受信用のバッファ、いわゆる FIFO を持っています。データを一時的に蓄積できるため、通信速度と CPU や DMA の処理速度との差を吸収することができます。DMA と組み合わせることで、途切れのない連続通信が実現しやすくなります。 低消費電力動作 通常の UART よりも低消費電力で動作するよう設計されており、スリープ中でも動作を継続できるケースがあります。クロック制御と密接に連携しているため、バッテリー駆動の機器や IoT 用途で特に有用です。 複数インスタンス対応 MCU 内に LPUART を複数搭載しており、同時に複数の通信を行うことができます。デバッグ用途とセンサー通信用途を分けるなど、インスタンスごとに役割を切り分けて利用できます。 2. ソフトウェア構成(MCUXpresso SDK) MCUXpresso SDK では、LPUART を扱うドライバとしてポーリング、割り込み、eDMA の 3 種類が提供されています。 実務では、小規模な通信であれば割り込み方式で十分ですが、高速かつ連続的な通信を扱う場合は eDMA を利用します。CPU に負荷を与えたくないアプリケーションでは、最初から eDMA を使う前提で設計しておくと後々の変更が少なくて済みます。したがって、本記事では、DMAを使用する前提で話を進めます。 3. FIFO の役割と DMA DMA を正しく使うためには、まず FIFO の動作を理解することが重要です。LPUART は内部に FIFO(First-In First-Out バッファ)を持っており、送信データの一時保持、受信データの一時蓄積、そして LPUART と DMA の間に生じる速度差の吸収という役割を担っています。 DMA との連携では、受信側では LPUART が受け取ったデータが RX FIFO に蓄積され、しきい値に達したタイミングで DMA が RX FIFO からメモリへデータを転送します。送信側では、DMA がメモリから TX FIFO へデータを書き込み、LPUART が TX FIFO から順次取り出して送信します。こうした仕組みによって、DMA 転送の完了を待たずにハードウェア側で連続的にデータを受け渡すことができ、スループットを止めずに通信を継続できます。 DMA の動きを図解すると、以下のようになります。 LPUART を DMA で使う際には、LPUART の TX/RX 要求を eDMA のどのチャネルに流し込むかを決めるために、チャネル MUX の設定が必要になります。 MCX A153 では、他ファミリーで見られるような独立した DMAMUX ペリフェラルは存在せず、eDMA コントローラの各チャネルが内蔵するチャネル MUX(CHn_MUX レジスタ)で、どの周辺機能の DMA 要求ソースを受け付けるかを選択します。SDK からは EDMA_SetChannelMux() API を使ってチャネルごとに要求ソースを割り当てます(具体的な呼び出し方は 4 章で紹介します)。チャネル番号は固定ではなく、アプリケーションの用途に応じて自由に切り替えられます。 下図は、周辺機能側の多数の DMA 要求ソースが、eDMA 各チャネルに内蔵されたチャネル MUX セレクタを介してチャネル本体に接続される様子を示したものです。 上図では、 EDMA_SetChannelMux によって LPUART0 TX を Channel 0、LPUART0 RX を Channel 1 に割り当てた例を実線で示しています。点線は選択肢として存在する接続候補で、API 呼び出し時の引数を書き換えることで、たとえば LPUART0 TX を Channel 2 に割り当てるといった変更も可能です。 4. SDK ドライバの基本フロー 次に、MCUXpresso SDK のサンプルプロジェクト “lpuart_edma_transfer” を例に、ドライバの使用方法を紹介します。 参考URL: Hardware requirements — MCUXpresso SDK Documentation mcuxsdk-examples/driver_examples/lpuart/edma_transfer/lpuart_edma_transfer.c LPUART と DMA を組み合わせて使う際の基本ステップは、次の 7 つです。 クロックを有効化する ピン MUX を設定する LPUART を初期化する eDMA のチャネル MUX を設定する DMA ハンドルを生成する 送信/受信を開始する コールバックで次の処理を制御する 以降では、コードスニペットを交えながら、各ステップを具体的に説明していきます。 4.1 クロック・ポート設定 まず LPUART モジュールのクロックを有効化します。 CLOCK_EnableClock(kCLOCK_Lpuart0); 続いて、TX と RX に使用するピンの MUX を設定します。 PORT_SetPinMux(PORTA, 1U, kPORT_MuxAlt2); // TX PORT_SetPinMux(PORTA, 2U, kPORT_MuxAlt2); // RX GND を除くと、UART の配線は送信と受信の 2 本だけです。FRDM-MCXA153 の回路図では、LPUART0 の TXD と RXD が MCU-LINK の Virtual COM に接続されており、MCU-Link を PC と USB で接続することで、UART 通信を経由したデバッグが可能になります。 4.2 LPUART 初期化 LPUART の初期化は、まずデフォルト設定を取得してから必要な項目を変更する流れになります。 lpuart_config_t config; LPUART_GetDefaultConfig(&config); config.baudRate_Bps = 115200; config.enableTx = true; config.enableRx = true; LPUART_Init(LPUART0, &config, CLOCK_GetFreq(kCLOCK_CoreSysClk)); ボーレートは LPUART に供給されるクロック周波数に依存して決まるため、 CLOCK_GetFreq() で正しいクロックソースの周波数を渡す必要があります。TX と RX の有効化は、用途に応じて変更してください。 4.3 eDMA チャネル MUX 設定 ハンドルを生成する前に、LPUART の TX/RX 要求を eDMA のどのチャネルに流し込むかを EDMA_SetChannelMux で指定しておきます。3 章で説明したとおり、MCX A153 では独立 DMAMUX は存在せず、この API で各チャネルの CHn_MUX レジスタに要求ソースを設定します。 /* LPUART0 TX を eDMA の任意チャネル(例: CH0)に割り当てる */ EDMA_SetChannelMux(DMA0, LPUART_TX_DMA_CHANNEL, kDma0RequestMuxLPUART0Tx); /* LPUART0 RX を eDMA の任意チャネル(例: CH1)に割り当てる */ EDMA_SetChannelMux(DMA0, LPUART_RX_DMA_CHANNEL, kDma0RequestMuxLPUART0Rx); ここで指定するチャネル番号は、後続の DMA ハンドル生成時に txEdmaHandle / rxEdmaHandle に渡すチャネル番号と一致している必要があります。 4.4 DMA ハンドル生成 LPUART と DMA を結びつけるハンドルを生成し、通信完了時に呼び出されるコールバック関数をここで登録します。 lpuart_edma_handle_t g_lpuartEdmaHandle; LPUART_TransferCreateHandleEDMA(LPUART0, &g_lpuartEdmaHandle, lpuart_callback, userData, &txEdmaHandle, &rxEdmaHandle); このハンドルによって LPUART と DMA の TX/RX チャネルが関連付けられ、以降の送受信 API で利用されます。 4.5 送信(DMA) 送信は、送信バッファとサイズを lpuart_transfer_t に設定して API を呼び出すだけです。 lpuart_transfer_t xfer; xfer.data = txBuffer; xfer.dataSize = txSize; LPUART_TransferSendEDMA(LPUART0, &g_lpuartEdmaHandle, &xfer);   4.6 受信(DMA) 受信も同様に、受信バッファとサイズを指定して呼び出します。 lpuart_transfer_t xfer; xfer.data = rxBuffer; xfer.dataSize = rxSize; LPUART_TransferReceiveEDMA(LPUART0, &g_lpuartEdmaHandle, &xfer);   4.7 コールバック実装 コールバック関数を介して、通信の完了がアプリケーションに通知されます。 void lpuart_callback(LPUART_Type *base, lpuart_edma_handle_t *handle, status_t status, void *userData) { if (status == kStatus_LPUART_TxIdle) { // 送信完了処理 } else if (status == kStatus_LPUART_RxIdle) { // 受信完了処理 } } kStatus_LPUART_TxIdle は DMA による送信の完了、 kStatus_LPUART_RxIdle は DMA による受信の完了を示します。連続して受信を続けたい場合は、このコールバック内で再度 LPUART_TransferReceiveEDMA() を呼び出すことで、受信を途切れさせずに継続できます。   4.8 重要な設計ポイント 実際に LPUART と DMA を組み合わせて使う際には、いくつか押さえておきたい設計上の観点があります。 まず転送サイズです。1 回の転送サイズが小さすぎると割り込み回数が増えて CPU 効率が低下し、大きすぎると転送完了までのレイテンシが大きくなります。FIFO のサイズを意識しながら、アプリケーションの要求に合わせて適切な値を選ぶ必要があります。 次に受信バッファの設計です。受信長があらかじめ決まっている場合は固定長バッファで十分ですが、不定長のデータを受け続ける場合はリングバッファを用いるのが一般的です。 最後にコールバック処理です。コールバックは転送完了をアプリケーションに通知するだけでなく、次の DMA 転送を再設定するトリガーにもなります。連続通信を安定して回すうえで、ここの実装が最も重要な部分になります。 5. よくあるトラブル   5.1 DMA が動かない DMA クロックが有効化されていない、 EDMA_SetChannelMux で指定した要求ソースが LPUART の TX/RX と合っていない、あるいは LPUART ドライバに渡したチャネル番号と EDMA_SetChannelMux で設定したチャネル番号が一致していない、といった原因が考えられます。まずクロックの有効化と、チャネル MUX の割り当ての一致を確認するのが近道です。 5.2 データ欠落 FIFO のオーバーランや、転送サイズの設定が実際のデータ量に合っていないケースが典型的です。FIFO しきい値と DMA の転送単位の関係を見直してください。 5.3 高速通信で破綻 ボーレートを上げていくと、FIFO のアンダーラン、バッファ設計の不足、波形品質の低下、クロック誤差といった要因が顕在化してきます。ハードウェア側の信号品質と、ソフトウェア側のバッファ供給能力の両面から原因を切り分ける必要があります。 6. まとめ LPUART を実務で使いこなすうえで最も重要なのは、FIFO の役割を正しく理解し、DMA との連携を踏まえてデータバッファを設計することです。これらを押さえておけば、低消費電力かつ CPU 負荷の小さい、安定した UART 通信を実現することができます。 ========================= 本投稿の「Comment」欄にコメントをいただいても、現在返信に対応しておりません。 お手数をおかけしますが、お問い合わせの際には「NXPへの技術質問 - 問い合わせ方法 (日本語ブログ)」をご参照ください。 (既に弊社 NXP 代理店、もしくは NXP とお付き合いのある方は、直接担当者へご質問いただいてもかまいません。) 本記事では、MCX A153 に搭載されている LPUART(Low Power Universal Asynchronous Receiver/Transmitter) の基本概念と、MCUXpresso SDK を用いた使用方法を、初めて NXP 製品を扱うエンジニア向けに解説します。まずハードウェアの概要を説明し、その後FRDM-MCXA153ボードをベースに、MCUXpresso SDK API の使い方をコードスニペットとともに説明します。 (読了:20分) MCUXpresso SDK MCX 日本語ブログ
View full article
当没有回环连接时,Linux UART 驱动程序在 read() 期间会挂起(i.MX93 / Linux)。 NXP社区的各位朋友,大家好! 我正在使用基于 i.MX93 的嵌入式平台,运行 Linux 6.6.52,遇到了 UART 通信问题,希望您能帮忙调查一下。 问题描述 我用 C 语言实现了一个 UART 通信测试,它通过串口发送 256 字节的数据,然后读取这些数据以验证数据。 该测试使用物理环回连接(TX 连接到 RX,RTS 连接到 CTS)。当启用硬件流控制时,就会出现此问题。 我观察到了两种不同的行为: 环回连接成功: UART 成功接收到发送的 256 字节,测试通过。 环回连接断开:应用程序尝试读取 UART,但read()操作似乎挂起了。最终,我还观察到如下内核消息: /dev/sp1 HAS 0/256 BYTES IN RX BUFFER mmc1: Timeout waiting for hardware interrupt. mmc1: sdhci: ============ SDHCI REGISTER DUMP =========== ... 我知道 MMC 超时可能与 UART 问题无关,但它发生在相同的测试场景中,我想了解内核级别是否存在任何交互作用。 UART 配置 我使用以下命令打开串口设备: fd = open(port, O_RDWR | O_NOCTTY); 我将终端配置如下: opt->c_lflag = 0; opt->c_iflag = 0; opt->c_oflag = 0; memset(opt->c_cc, 0x00, sizeof(opt->c_cc)); opt->c_cc[VMIN] = 0; opt->c_cc[VTIME] = 0; tcsetattr(fd, TCSANOW, opt); fcntl(fd, F_SETFL, FNDELAY); 我还尝试过使用: O_NONBLOCK 并使用fcntl(fd, F_GETFL)验证文件描述符标志。 然而,这种行为依然没有改变。 读取操作 应用程序使用以下方式读取预期的 256 字节: i = read(path, rbuf, len); 当 UART 没有接收到任何数据时,就会出现此问题。 我的问题 Linux 6.6.52 中的 i.MX93 UART 驱动程序是否存在已知问题,导致在没有数据可用时read()函数阻塞或挂起? 该驱动程序是否存在与 UART 中断、RX FIFO 处理或 DMA 传输相关的已知问题? 是否有推荐的方法来配置 i.MX93 UART 驱动程序,以确保在没有数据可用时,非阻塞read()能够立即返回? UART 驱动程序问题是否有可能导致或发出触发信号内核日志中观察到的 MMC/SDHCI 超时消息? 是否有任何特定的内核配置、补丁或设备树设置需要我进行检查? 我非常感谢您能提供任何关于 i.MX93 UART 驱动程序中已知问题的建议、调试步骤或参考资料。 平台信息: SoC:NXP i.MX93 内核:Linux 6.6.52 UART 设备:/dev/sp1 应用程序:C 用户空间应用程序 通信测试:256 字节 TX/RX 物理环回测试 感谢您的时间和支持。 Re: Linux UART driver hangs during read() when no loopback connection is present (i.MX93 / Linux 嗨@Doni_D 目前没有证据表明这是 i.MX93 Linux 6.6.52 LPUART 驱动程序已知的冻结问题。 您可以尝试在打开设备时直接设置O_NONBLOCK非阻塞模式。 /dev/sp1不是 i.MX93 LPUART 的标准设备名称;标准名称通常是/dev/ttyLPx 。你修改过地图吗? RTS/CTS 断开连接后,无效的 CTS 信号将阻止 UART 继续传输。您可以尝试使用poll() 函数,并将超时时间设置为 1 秒;不要陷入无限循环。 请检查 DTS 中 RTS/CTS pinmux 、 uart-has-rtscts 、 dmas和dma-names是否配置正确。 您可以暂时删除 UART 节点中的DMA和DMA 名称,切换到 PIO/IRQ 模式进行比较。 此致, 志明
View full article
S32K388 GMAC0 Eth_43_GMAC driver transmitting help Hi, I'm using the following configuration: S32K388EVB-Q289 S32DS 3.6.8 RTD 7.0.1 As mentioned in a previous post, S32K388 GMAC0 Eth_43_GMAC driver not getting RX interrupt . I used the provided Eth_InternalLoopback_S32K388 example project as base, and modified it so that it can receive frames from my PC through a media converter. Now I'm trying to get the other way going, i.e. transmitting an ethernet frame from S32K388 eval board back to my PC. I am running wireshark on my PC to capture the frame. The frame that I'm trying to send is a broadcast frame with MAC address FF:FF:FF:FF:FF:FF. However, I was only able to get 1 frame on my PC in multiple tries, i.e. it is not consistent. @PavelL, can you kindly help again with this issue? Thanks. Re: S32K388 GMAC0 Eth_43_GMAC driver transmitting help Hello @James_Zhang_SE , I reviewed your project and found only a few minor configuration differences, none of which appear to affect Ethernet transmission.   Could you please clarify what you mean by receiving only one frame in multiple tries? For example, do you observe one frame after each complete power cycle of the board or only occasionally after several power cycles or debug sessions? Also, are you running the application continuously in the debugger or restarting it before each transmission attempt?   The application calls Eth_43_GMAC_Transmit() only once and then enters the infinite while (1) loop. Therefore, only one transmitted frame is expected per application run.   The inconsistent behavior may be caused by the Ethernet PHY link not being established when the transmission is requested. The frame is transmitted immediately after the GMAC controller is set to active mode, without checking the PHY link status. If the TJA1120 link is not yet up, the only transmitted frame may be lost.   Please try waiting until the PHY reports link-up before calling Eth_43_GMAC_ProvideTxBuffer() and Eth_43_GMAC_Transmit(). An example of reading the TJA1120 link status can be found in device.c, using bool get_device_link_status(uint8_t u8TrcvIdx);   This function is used by the S32K388_gptp_ds example included in SW32K3xx_M7_gPTP_1.1.0_CD01_D2602_DesignStudio_updatesite.zip, which is suitable for S32K3 RTD 7.0.1.   As a simple initial test, you can also add a sufficiently long delay before the transmission. If this makes the frame appear consistently, it would confirm that the issue is related to PHY link establishment. Best regards, Pavel Re: S32K388 GMAC0 Eth_43_GMAC driver transmitting help Hi Pavel, Thank you for the prompt response! I tried a couple of things today: I tested the same hardware setup using the TCP/IP stack example. With that example, everything works properly, and I am able to receive echo responses on my PC from the S32K388 evaluation board. In my application, I placed a breakpoint immediately after: Eth_43_GMAC_SetControllerMode(EthConf_EthCtrlConfig_EthCtrlConfig_0, ETH_MODE_ACTIVE); After reaching the breakpoint, I waited for a while and then manually continued with Eth_43_GMAC_ProvideTxBuffer(). Unfortunately, I still did not receive any transmitted frame on the PC side. Regarding the behavior I described previously, each time I test the application I power-cycle both the media converter and the evaluation board. I then use the embedded debugger to load the application and start execution. So far, I have observed two successful transmissions, but I have not been able to determine what was different in those two cases or why the frames were transmitted successfully. All of my other attempts, including the tests I performed today, have been unsuccessful. I really appreciate your help with this issue so far. I’m still trying to understand what might be causing this behavior, and I would greatly appreciate any further guidance or suggestions you may have. Re: S32K388 GMAC0 Eth_43_GMAC driver transmitting help Hello @James_Zhang_SE , Thank you for the detailed update. The fact that the TCP/IP stack example works correctly with the same hardware setup confirms that the basic hardware path, GMAC interface and Ethernet link are operational. I modified the main.c file of my internal loopback example to wait explicitly for link-up before transmitting the frame. I tested this implementation on my S32K388EVB-Q289 and after every power-up I can consistently see the transmitted frame in Wireshark. I also tested the following sequence: Disconnect the cable between GMAC0 and the media converter. Power up the S32K388 evaluation board and start the application. Reconnect the cable to the media converter. After reconnecting the cable, the application detects the link and the transmitted frame appears in Wireshark as expected. My hardware setup is: S32K388EVB-Q289 GMAC0 ↔ TE-1402 media converter configured for 1 Gbit/s and Follower mode ↔ USB-to-Ethernet adapter ↔ Dell laptop running Windows 11 I share my modified main.c, the corresponding .mex configuration file and mex_diff.html so that you can compare my configuration with yours more easily. Please replace the provided files as appropriate, run Update Code in S32 Design Studio and then rebuild the project before testing it. There may still be a configuration detail in my .mex file that is important for reliable transmission. Therefore, I recommend first testing the shared configuration without further modifications. If it works on your setup, you may then use mex_diff.html to identify the relevant difference between the two configurations. Best regards, Pavel Re: S32K388 GMAC0 Eth_43_GMAC driver transmitting help Hello @James_Zhang_SE , Can you see frames in Wireshark with cable connected before board power-up? I assume that hardware connection etc. is correct if lwIP example works on you board. In your case, I would suspect the "receiver" side: 1. Check if Wireshark runs in promiscuous mode: 2. Use another device to capture frames, e.g. laptop with Linux. I use S32G-VNP-RDB2 with Linux BSP or Demo EthernetAnalyzer FRDM-A-S32K344 RTD 7.0.1 to capture frames when I'm in doubt with Wireshark on windows. 3. Set the DST MAC in your frame to MAC address of your ethernet adapter. Best regards, Pavel Re: S32K388 GMAC0 Eth_43_GMAC driver transmitting help Hi Pavel, Today I have tested with the files you have shared. I replaced both files as is and debugged using the same procedure that you have mentioned. i.e. Disconnect the cable between GMAC0 and the media converter. Power up the S32K388 evaluation board and start the application. Reconnect the cable to the media converter. However, I'm still not seeing any frames being captured in the Wireshark. For both previously and after replacing the files, I'm able to hit the breakpoint in EthIf_TxConfirmation(). Can you think of any other factor/possible cause/difference in setup that might impact the frame transmission? I really appreciate your help with this issue. Re: S32K388 GMAC0 Eth_43_GMAC driver transmitting help Hi Pavel, After quite a bit of troubleshooting, I was finally able to narrow down the issue, although I still haven't determined the exact cause. I tried using a USB-to-Ethernet adapter and captured the traffic directly on that Ethernet interface. With this setup, I can now see the broadcast frames transmitted by the S32K388 in Wireshark. This confirms that the S32K388 is transmitting the frames successfully. Thank you very much for all your help and suggestions throughout this troubleshooting process. I really appreciate your support.
View full article
タイトル:FedEx通関手続きのための改訂版商業送り状の依頼 – NXP注文番号965756 こんにちは、NXPコミュニティの皆さん、 私は最近、NXP Directプログラムを通じてFRDM-MCXA156開発ボードを購入しました。 受取人住所の不一致のため、私の注文品は現在、通関手続きのためFedExによって保留されています。 FedExはNXPに対し、私の住所を訂正した改訂版の商業送り状を要求しました。 私の発送詳細: 注文番号:965756 - FedEx AWB: 526613217972 - 製品:FRDM-MCXA156開発ボード - 受取人: Venumadhav R 私は以前、インド工科大学マドラス校に所属していましたが、現在は同大学とは一切関係がありません。発送先の個人輸入としてクリアできるように、受取人住所から大学や機関の推薦状を削除してほしいです。 NXPサポートの方が、改訂商用請求書のリクエスト方法を教えていただけませんか? 遅延により滞納料が積み重なっているので、緊急のご支援をいただけるとありがたいです。 ご回答をお待ちしています。 MCXA
View full article
S32K388 GMAC0 Eth_43_GMACドライバ送信支援 こんにちは、 私は以下の設定を使用しています。 S32K388EVB-Q289 S32DS 3.6.8 RTD 7.0.1 以前の投稿で述べたように、GMAC0 Eth_43_GMACドライバ S32K388 RX割り込みを受け取れません。提供されたEth_InternalLoopback_S32K388例プロジェクトをベースにし、PCからメディアコンバーター経由でフレームを受け取れるように改良しました。 今は逆方向に進めようとしています。つまり、評価ボードからイーサネットフレームをPCに戻すというS32K388です。PC上でwiresharkを使ってフレームをキャプチャしています。送信しようとしているフレームは、MACアドレスFF:FF:FFのブロードキャストフレームです。しかし、PC上で複数回試みても1フレームしか受信できず、一貫性がありません。 @PavelL、この問題についてもう一度助けていただけませんか?ありがとう。 Re: S32K388 GMAC0 Eth_43_GMAC driver transmitting help こんにちは、 @James_Zhang_SE さん、 あなたのプロジェクトを確認したところ、いくつかの細かな設定の違いしか見つかりませんでしたが、イーサネット伝送には影響しないようです。   複数回の試行で1フレームしか受信できないというのはどういう意味でしょうか?例えば、ボードの電源投入サイクルが完了するたびに1フレームが観測されるのか、それとも複数回の電源投入サイクル後やデバッグセッション後に時折しか観測されないのか、といった点です。また、デバッガでアプリケーションを継続的に実行していますか?それとも送信のたびに再起動していますか?   アプリケーションはEth_43_GMAC_Transmit()を一度だけ呼び出し、その後無限ループに入ります 。したがって、アプリケーション実行ごとに送信フレームは1つだけです。   この不整合な挙動は、送信リクエスト時にイーサネットPHYリンクが確立されていないことが原因かもしれません。フレームはGMACコントローラがアクティブモードに設定された直後に送信され、PHYリンクの状態は確認されません。TJA1120リンクがまだ確立されていない場合、送信された唯一のフレームが失われる可能性があります。   PHYがリンクアップを報告するまで待ってから、Eth_43_GMAC_ProvideTxBuffer()と Eth_43_GMAC_Transmit()を呼んでください。TJA1120リンクの状態を読み取る例は、device.cでbool get_device_link_status(uint8_t u8TrcvIdx)を使って確認できます。   この関数は、 SW32K3xx_M7_gPTP_1.1.0_CD01_D2602_DesignStudio_updatesite.zipに含まれるS32K388_gptp_dsサンプルで使用されており、S32K3 RTD 7.0.1 に適しています。   簡単な初期テストとして、送信前に十分長い遅延を設けることもできます。これによりフレームが安定して表示されるようになれば、問題がPHYリンクの確立に関連していることが確認できるだろう。 よろしくお願いいたします。 パベル Re: S32K388 GMAC0 Eth_43_GMAC driver transmitting help こんにちは、パベルさん。 迅速なご対応ありがとうございます! 今日はいくつか試してみました。 TCP/IPスタックのサンプルを使用して、同じハードウェア構成でテストを行いました。その例では、すべて正常に動作し、S32K388評価ボードからPCでエコー応答を受け取ることができます。 私のアプリケーションでは、すぐにブレイクポイントを付けました: Eth_43_GMAC_SetControllerMode(EthConf_EthCtrlConfig_EthCtrlConfig_0, ETH_MODE_ACTIVE); ブレークポイントに到達した後、しばらく待ってから、Eth_43_GMAC_ProvideTxBuffer() を手動で実行して処理を続行しました。残念ながら、PC側では送信されたフレームをまだ受信していません。 先ほど説明した挙動についてですが、アプリケーションをテストするたびにメディアコンバーターと評価ボードの両方を電源サイクルしています。その後、組み込みデバッガを使ってアプリケーションを読み込み、実行を開始します。 これまでに 2回の成功した送信を観察しましたが、その2つのCASEで何が違ったのか、なぜフレームが成功したのかは判明できません。今日行ったテストを含め、これまでの試みはすべて失敗に終わった。 これまでのご協力に本当に感謝しています。この現象の原因をまだ解明しようとしているところです。何かご助言やご提案があれば、ぜひお聞かせください。 Re: S32K388 GMAC0 Eth_43_GMAC driver transmitting help こんにちは、 @James_Zhang_SE さん、 詳細なアップデートをありがとうございます。TCP/IPスタックの例が同じハードウェアセットアップで正しく動作していることは、基本的なハードウェアパス、GMACインターフェース、イーサネットリンクが正常に動作していることを裏付けています。 main.cを修正しましたフレームを送信する前に明示的にリンクアップを待つように、内部ループバックの例のファイル。この実装をS32K388EVB-Q289でテストしたところ、電源を入れるたびにWiresharkで送信フレームが一貫して確認できます。 以下の手順もテストしました。 GMAC0とメディアコンバーターの間のケーブルを外してください。 S32K388評価ボードを起動してアプリケーションを開始してください。 ケーブルをメディアコンバーターに再接続してください。 ケーブルを再接続すると、アプリケーションはリンクを検出し、送信されたフレームがWiresharkに期待通り表示されます。 私のハードウェア構成は以下のとおりです。 S32K388EVB-Q289 GMAC0 ↔ TE-1402メディアコンバータ(1 Gbit/sおよびフォロワーモード↔対応、USB to-イーサネットアダプター↔対応、Dell ノートPC、Windows 11搭載) 修正した main.c と対応する .mex ファイルを共有します。設定ファイルとmex_diff.htmlを用意して、私の設定とあなたの設定をより簡単に比較できるようにしてください。提供されたファイルを適切に置き換え、S32 Design StudioでUpdate Codeを実行し、テスト前にプロジェクトを再構築してください。 私の.mexファイルにはまだ設定の詳細が残っている可能性があります。信頼性の高い伝送に重要なファイル。したがって、まずは共有設定を一切変更せずにテストすることをお勧めします。お使いの環境で動作するのであれば、mex_diff.html を使用して、2 つの設定間の関連する差異を特定できます。 よろしくお願いいたします。 パベル Re: S32K388 GMAC0 Eth_43_GMAC driver transmitting help こんにちは、パベルさん。 本日、あなたが共有してくださったファイルを使ってテストを行いました。私は両方のファイルをそのまま置き換え、あなたが述べたのと同じ手順でデバッグを行いました。つまり GMAC0とメディアコンバーターの間のケーブルを外してください。 S32K388評価ボードを起動してアプリケーションを開始してください。 ケーブルをメディアコンバーターに再接続してください。 しかし、Wiresharkでフレームがキャプチャされている様子がまだ確認できません。ファイルの置き換え前と置き換え後の両方で、 EthIf_TxConfirmation() のブレークポイントに到達することができました。 フレームの伝送に影響を与える他の要因や原因、セットアップの違いを思い浮かべられますか?この件に関してご協力いただき、本当に感謝しています。 Re: S32K388 GMAC0 Eth_43_GMAC driver transmitting help こんにちは、 @James_Zhang_SE さん、 基板の電源を入れる前にケーブルがコネクテッドされた状態でWiresharkでフレームが見えますか? lwIPのサンプルがあなたのボードで動作するなら、ハードウェアの接続などは正しいと推測します。 あなたの場合は「レシーバ」側が考えられます: 1. Wiresharkがプロミスキャスモードで実行されているかどうかを確認します。 2. 別のデバイスを使用してフレームをキャプチャします。例:Linux搭載のノートPC。WindowsでWiresharkでフレームキャプチャに迷ったときは、S32G-VNP-RDB2とLinux BSPまたは Demo EthernetAnalyzer FRDM-A-S32K344 RTD 7.0.1を使ってフレームキャプチャを行っています。 3. フレーム内のDST MACアドレスをイーサネットアダプターのMACアドレスに設定します。 よろしくお願いいたします。 パベル Re: S32K388 GMAC0 Eth_43_GMAC driver transmitting help こんにちは、パベルさん。 かなりのトラブルシューティングを行った結果、ようやく問題点を絞り込むことができましたが、正確な原因はまだ特定できていません。 USBからイーサネットへのアダプターを使って、そのイーサネットインターフェース上で直接トラフィックをキャプチャしてみました。このセットアップで、WiresharkでS32K388が送信したブロードキャストフレームを見ることができます。 これは、S32K388がフレームを正常に送信していることを裏付けています。 今回のトラブルシューティングの過程を通して、皆様のご協力とご提案に心より感謝申し上げます。皆さんのサポートに本当に感謝しています。
View full article
S32K388 GMAC0 Eth_43_GMAC 驱动程序正在发送帮助信息 您好, 我使用的是以下配置: S32K388EVB-Q289 S32DS 3.6.8 RTD 7.0.1 如前文所述, S32K388 GMAC0 Eth_43_GMAC 驱动程序无法获取 RX 中断。我以提供的 Eth_InternalLoopback_S32K388 示例项目为基础,并对其进行了修改,使其可以通过媒体变流器从我的 PC 接收帧。 现在我尝试反向操作,也就是从 S32K388 评估板向我的电脑发送以太网帧。我在电脑上运行了 Wireshark 来捕获帧。我尝试发送的帧是 MAC 地址为 FF:FF:FF:FF:FF:FF 的广播帧。但是,我多次尝试后,电脑上只接收到一个帧,也就是说,接收结果并不稳定。 @PavelL ,您能否再次帮忙解决这个问题?谢谢。 Re: S32K388 GMAC0 Eth_43_GMAC driver transmitting help 你好@James_Zhang_SE , 我查看了您的项目,发现只有一些细微的配置差异,这些差异似乎都不会影响以太网传输。   请问您能否解释一下“多次尝试只收到一帧”是什么意思?例如,您是在板每次完整上电循环后都观察到一帧图像,还是仅在几次上电循环或调试会话后偶尔观察到一帧图像?另外,你是在调试器中持续运行应用程序,还是在每次传输尝试之前都重新启动它?   应用程序仅调用一次Eth_43_GMAC_Transmit()函数,然后进入无限循环while(1) 。因此,每次应用程序运行只会发送一个帧。   这种不一致的行为可能是由于在请求传输时以太网 PHY 链路尚未建立造成的。GMAC 控制器设置为运行模式后,帧会立即发送,而不会检查 PHY 链路状态。如果 TJA1120 链路尚未建立,则唯一传输的帧可能会丢失。   请尝试等待 PHY 报告链路已连接后再调用 Eth_43_GMAC_ProvideTxBuffer()和 Eth_43_GMAC_Transmit()函数。读取 TJA1120 链路状态的示例可以在 设备.c 文件中找到,使用 bool get_device_link_status(uint8_t u8TrcvIdx); 函数。   SW32K3xx_M7_gPTP_1.1.0_CD01_D2602_DesignStudio_updatesite.zip中包含的S32K388_gptp_ds示例使用了此功能,适用于 S32K3 RTD 7.0.1。   作为一个简单的初始测试,你也可以在传输之前添加足够长的延迟。如果这样能使帧始终显示,则可以确认问题与 PHY 链路建立有关。 顺祝商祺! 帕维尔 Re: S32K388 GMAC0 Eth_43_GMAC driver transmitting help 你好,帕维尔, 感谢您的及时回复! 我今天尝试了两件事: 我使用 TCP/IP 协议栈示例测试了相同的硬件配置。以该示例为例,一切运行正常,我能够从 S32K388 评估板在我的 PC 上收到回声响应。 在我的应用程序中,我在以下位置立即设置了一个断点: Eth_43_GMAC_SetControllerMode(EthConf_EthCtrlConfig_EthCtrlConfig_0, ETH_MODE_ACTIVE); 到达断点后,我等待了一会儿,然后手动继续执行 Eth_43_GMAC_ProvideTxBuffer()。遗憾的是,我在电脑端仍然没有收到任何传输帧。 关于我之前描述的行为,每次测试应用程序时,我都会重启媒体变流器和评估板。然后我使用嵌入式调试器加载应用程序并开始执行。 到目前为止,我已经观察到两次成功的传输,但我还没有能够确定这两种情况有什么不同,或者为什么帧能够成功传输。我之前的所有尝试,包括今天进行的测试,都失败了。 非常感谢您迄今为止在这个问题上提供的帮助。我仍在努力了解造成这种行为的原因,如果您能提供任何进一步的指导或建议,我将不胜感激。 Re: S32K388 GMAC0 Eth_43_GMAC driver transmitting help 你好@James_Zhang_SE , 感谢您提供的详细信息。TCP/IP 协议栈示例在相同的硬件配置下能够正常工作,这证实了基本硬件路径、GMAC 接口和以太网链路均运行正常。 我修改了 main.c 文件。我的内部环回示例文件,用于在传输帧之前显式等待链路建立。我在我的 S32K388EVB-Q289 上测试了这个实现,每次上电后,我都可以稳定地在 Wireshark 中看到传输的帧。 我还测试了以下序列: 断开 GMAC0 和媒体变流器之间的电缆。 给S32K388评估板通电并启动应用程序。 将电缆重新连接到媒体变流器。 重新连接电缆后,应用程序检测到了链路,并且传输的帧如预期出现在 Wireshark 中。 我的硬件配置如下: S32K388EVB-Q289 GMAC0 ↔ TE-1402 媒体变流器,配置为 1 Gbit/s 和跟随模式 ↔ USB 转以太网适配器 ↔ 运行 Windows 11 的戴尔笔记本电脑 我分享了我修改后的 main.c 文件以及对应的 .mex 文件。配置文件和 mex_diff.html 文件,以便您可以更轻松地将我的配置与您的配置进行比较。请根据需要替换提供的文件,在 S32 设计工作室中运行“更新代码”,然后在测试之前重新构建项目。 我的 .mex 文件中可能还存在一些配置细节。这是对可靠传输至关重要的文件。因此,我建议先测试共享配置,不要做任何修改。如果它在您的设置中有效,那么您可以使用 mex_diff.html 来识别两种配置之间的相关差异。 顺祝商祺! 帕维尔 Re: S32K388 GMAC0 Eth_43_GMAC driver transmitting help 你好,帕维尔, 今天我用你分享的文件进行了测试。我按照您提到的步骤替换了这两个文件,并进行了调试。IE。 断开 GMAC0 和媒体变流器之间的电缆。 给S32K388评估板通电并启动应用程序。 将电缆重新连接到媒体变流器。 但是,我仍然没有在 Wireshark 中看到任何捕获到的帧。无论是在替换文件之前还是之后,我都能在EthIf_TxConfirmation() 中触发断点。 您还能想到其他可能影响帧传输的因素/可能原因/设置差异吗?非常感谢您在这个问题上提供的帮助。 Re: S32K388 GMAC0 Eth_43_GMAC driver transmitting help 你好@James_Zhang_SE , 在板通电之前,连接电缆的情况下,您能否在 Wireshark 中看到帧? 如果 lwIP 示例在您的板子上可以运行,我假设硬件连接等都是正确的。 就你的情况而言,我怀疑是“接收方”的问题: 1. 检查 Wireshark 是否以混杂模式运行: 2. 使用其他设备捕获帧,例如:笔记本电脑,搭载Linux系统。当我在 Windows 上使用 Wireshark 时遇到问题,我会使用带有 Linux 电路板支持包。 的 S32G-VNP-RDB2 或Demo EthernetAnalyzer FRDM-A-S32K344 RTD 7.0.1 来捕获帧。 3. 将帧中的 DST MAC 设置为以太网适配器的 MAC 地址。 顺祝商祺! 帕维尔 Re: S32K388 GMAC0 Eth_43_GMAC driver transmitting help 你好,帕维尔, 经过一番排查,我终于缩小了问题的范围,虽然我仍然没有确定确切的原因。 我尝试使用 USB 转以太网适配器,并直接在该以太网接口上捕获流量。通过这种设置,我现在可以在 Wireshark 中看到 S32K388 发送的广播帧。 这证实了 S32K388 正在成功传输帧。 非常感谢您在故障排除过程中提供的所有帮助和建议。我非常感谢您的支持。
View full article
Linux UART driver hangs during read() when no loopback connection is present (i.MX93 / Linux Hello NXP Community, I am working with an i.MX93-based embedded platform running Linux 6.6.52, and I am experiencing an issue with UART communication that I would appreciate your help investigating. Problem description I have implemented a UART communication test in C that transmits 256 bytes through a serial port and then reads them back to verify the data. The test uses a physical loopback connection (TX connected to RX and RTS connected to CTS). The issue occurs when hardware flow control is enabled. I have observed two different behaviors: Loopback connected: The UART successfully receives the transmitted 256 bytes, and the test passes. Loopback disconnected: The application attempts to read the UART, but the read() operation appears to hang. Eventually, I also observe kernel messages such as: /dev/sp1 HAS 0/256 BYTES IN RX BUFFER mmc1: Timeout waiting for hardware interrupt. mmc1: sdhci: ============ SDHCI REGISTER DUMP =========== ... I understand that the MMC timeout may be unrelated to the UART issue, but it occurs during the same test scenario and I would like to understand whether there could be any interaction at the kernel level. UART configuration I open the serial device using: fd = open(port, O_RDWR | O_NOCTTY); I configure the terminal as follows: opt->c_lflag = 0; opt->c_iflag = 0; opt->c_oflag = 0; memset(opt->c_cc, 0x00, sizeof(opt->c_cc)); opt->c_cc[VMIN] = 0; opt->c_cc[VTIME] = 0; tcsetattr(fd, TCSANOW, opt); fcntl(fd, F_SETFL, FNDELAY); I have also tried using: O_NONBLOCK and verified the file descriptor flags using fcntl(fd, F_GETFL). However, the behavior remains unchanged. Read operation The application reads the expected 256 bytes using: i = read(path, rbuf, len); The issue occurs when no data is received from the UART. My questions Is there any known issue with the i.MX93 UART driver in Linux 6.6.52 that could cause read() to block or hang when no data is available? Are there any known issues involving UART interrupts, RX FIFO handling, or DMA transfers in this driver? Is there a recommended way to configure the i.MX93 UART driver to guarantee that a non-blocking read() returns immediately when no data is available? Could a UART driver issue potentially cause or trigger the MMC/SDHCI timeout messages observed in the kernel log? Are there any specific kernel configurations, patches, or device tree settings that I should verify? I would appreciate any suggestions, debugging steps, or references to known issues in the i.MX93 UART driver. Platform information: SoC: NXP i.MX93 Kernel: Linux 6.6.52 UART device: /dev/sp1 Application: C userspace application Communication test: 256-byte TX/RX physical loopback test Thank you for your time and support. Re: Linux UART driver hangs during read() when no loopback connection is present (i.MX93 / Linux Hi @Doni_D  There is currently no evidence to suggest that this is a known freeze issue with the i.MX93 Linux 6.6.52 LPUART driver. You can try setting the O_NONBLOCK non-blocking mode directly when opening the device. /dev/sp1 is not the standard device name for the i.MX93 LPUART; the standard name is usually /dev/ttyLPx. Have you modified the mapping? After RTS/CTS is disconnected, an invalid CTS signal will prevent the UART from continuing to transmit. You can try using poll() with a timeout of 1 second; do not wait in an infinite loop. Please check whether the RTS/CTS pinmux, uart-has-rtscts, dmas, and dma-names are configured correctly in DTS. You can temporarily delete the dmas and dma-names in the UART node to switch to PIO/IRQ mode for comparison. Best Regards, Zhiming
View full article
标题:关于联邦快递清关的修订版商业发票申请 – NXP 订单 965756 NXP社区的各位朋友,大家好! 我最近通过 NXP Direct Program 购买了一块 FRDM-MCXA156 开发板。 由于收件人地址不符,我的订单目前被联邦快递扣留进行清关。 FedEx 已要求 NXP 提供一份包含我更正后的住宅地址的修改后的商业发票。 我的发货详情: 订单号:965756 - FedEx 运单号:526613217972 产品:FRDM-MCXA156 开发板 收货人:Venumadhav R 我之前曾与印度理工学院马德拉斯分校有过联系,但目前已与该大学没有任何关系。我需要从收货人地址中删除大学/机构信息,以便该批货物可以作为个人进口货物清关。 NXP技术支持人员能否指导我如何申请修改后的商业发票? 由于延误,货物运输产生了滞期费,因此我需要尽快获得帮助。 谢谢! MCXA
View full article
i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue Hi Team, We are using a custom i.MX95 board with the OV5640 camera sensor and are facing an issue when the camera is connected to CSI1 on Android Automotive 16. The hardware design has already been validated: - CSI0 and CSI1 work correctly with Linux 6.18.20. - CSI0 and CSI1 also work correctly with Android 16 based on Linux 6.18.20. - The issue is observed only with Android Automotive 16 based on Linux 6.18.20. Observations: - CSI0 works without any issues. - CSI1 fails to start streaming. - We tested CSI1 independently. - We also disabled NEO ISP and tested with the ISI pipeline only, but the issue persists. Observed errors: LIBCAMERA: Failed to start streaming: Connection timed out LIBCAMERA: 'mxc_isi.0': Unable to set format on pad 0/0: Device or resource busy Log and media-ctl validation results are attached for reference. Has anyone encountered a similar CSI1 issue on i.MX95 EVK or Android Automotive 16? Any suggestions, fixes, patches, or confirmation of CSI1 validation on the EVK would be greatly appreciated. Thanks, Maruti Naik Evaluation Board Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue Hi, We have verified that the kernel DTS configuration is correct. The current Android Automotive 16 BSP is also based on Linux 6.18.20, and the same DTS configuration is working without any issues in the Linux 6.18.20 BSP. We have also successfully tested and validated the CSI1 with OV5640 camera in Android Automotive 15 BSP. Could you please confirm whether there are any restrictions or limitations on CSI1 camera support in the latest Android Automotive 16.0.0_2.1.0 BSP? Are any additional changes required to enable CSI1 camera support in this release? Kindly clarify. Regards, Maruti Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue I checked AAOS, which support csi0 as default, current bsp doesn't support mipi dsi/csi for camera, you should change the dts, camera configure, did you change anything? if yes, share the detailed your changed steps and code Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue Hi @joanxie Any update on this issue? Kindly share your findings or provide some technical guidance to help us resolve the CSI1 camera issue. Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue Dear @joanxie  Yes, our B0 board design is based on the NXP i.MX95 19x19 EVK. For your information, the same hardware is working with Linux 6.18.20 and Android 16 based on Linux 6.18.20. Both CSI0 and CSI1 (CSI-DSI combo) are working with dual OV5640 cameras. We are using Android Automotive 16.0.0_2.1.0 (based on 6.18.20_2.0.0 BSP), which uses the same kernel version and kernel configurations. However, with the Android Automotive 16.0.0_2.1.0 BSP, the OV5640 camera is working on CSI0, but the OV5640 camera on CSI1 (CSI-DSI combo) is not working. The logs have already been shared. We currently do not have an i.MX95 B0 EVK board available (we have an A1 EVK board), so we are unable to test this on the EVK. It would be helpful if you could test the CSI1 (CSI-DSI combo) with any supported camera on the NXP i.MX95 19x19 EVK B0 board using the latest Android Automotive 16 BSP and share your findings. Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue Hi Maruti did your board design based on imx95 evk board? if yes, did you reproduce this on nxp imx95 evk board? and what detailed auto android 16 bsp version? 1.1.0 or 1.3.0? B.R. Joan Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue I will double confirmed this from android auto team again, but they didn't say auto android 16 has any limitation before, based on your test result, it seems this issue is related to the auto android 16 Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue Hi, In our testing, on the Android Automotive 15 BSP, both CSI0 and CSI1 cameras worked correctly with both the Car image (EVS running on the M7 core) and the Car2 image (EVS running on the A55 core). On Android Automotive 16 BSP, with the Car image (EVS running on the M7 core), CSI0 works, but CSI1 does not. However, with the Car2 image (EVS running on the A55 core), both CSI0 and CSI1 work correctly. Could you please check if any background process in the Car image is accessing or holding CSI1, preventing the camera from working? Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue Dear @joanxie, I have one update regarding the CSI1 camera issue. With the Car2 image, both CSI0 and CSI1 cameras are working fine. However, with the Car image, we are still facing an issue getting the CSI1 camera working. Kindly help us investigate and resolve the CSI1 camera issue in the Car image. Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue Dear @joanxie, Thank you for your support. Could you please provide any workaround or patch to enable CSI1 (DSI-CSI combo) support for camera validation on Android Automotive 16.0.0_2.1.0? Your assistance would be highly appreciated. Best regards, Maruti Naik Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue Dear @joanxie We are currently using the Car image and are not focusing on EVS for now. Our requirement is to enable and validate the CSI1 camera directly through the Camera application. Kindly help us resolve the CSI1 camera issue Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue I don't think auto android team tested csi1 before, since the default is for csi0 only,  did you need EVS and Camera APK functions ? and did you use Car2 image type? Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue what do you mean car2 image? do you mean with  EVS in Arm Cortex-A core? since you tested on auto android 15 successfully, what do you test on auto android 15? do you mind sharing your patches to double check? Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue could you give me the two log files for car2 and car image? only for  csi1, and could you try  try to use the same CM7 FW version from AA15 to AA16.0 2.1.0?  Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue Hi, We were able to isolate the issue. It was caused by the rearview camera demo running on the M7 core in the CAR image. We have identified the code causing the CSI1 busy error and isolated it for now. We also confirmed that both cameras are working in the Camera app and evs_app with dual-camera support. Regards, Maruti Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue Hi Maruti, glad to hear this, so this issue is related M7 SDK version doesn't match current android? did you try the auto android 15 M7 firmware on the auto android 16?
View full article
LinuxのUARTドライバは、ループバック接続が存在しないとread()中にフリーズします(i.MX93 / Linux) こんにちは、NXPコミュニティの皆さん、 私はLinux 6.6.52を動かすi.MX93ベースの組み込みプラットフォームを扱っており、UART通信に問題が発生しており、調査のご協力をいただけるとありがたいです。 問題の説明 C言語でUART通信テストを実装しました。このテストでは、シリアルポート経由で256バイトを送信し、その後データを読み戻して検証します。 このテストでは物理的なループバック接続(TXはRXにコネクテッド、RTSはCTSにコネクテッド)が使用されます。この問題は、ハードウェアフロー制御が有効になっている場合に発生します。 私は2つの異なる行動を観察しました。 ループバックコネクテッド: UARTは送信された256バイトを正常に受信し、テストは合格します。 ループバック切断:アプリケーションがUARTを読み取ろうとしますが、read()操作が停止しているように見えます。最終的に、次のようなカーネルメッセージも観察できます。 /dev/sp1 HAS 0/256 BYTES IN RX BUFFER mmc1: Timeout waiting for hardware interrupt. mmc1: sdhci: ============ SDHCI REGISTER DUMP =========== ... MMCのタイムアウトはUARTの問題とは無関係かもしれませんが、同じテストシナリオで発生しており、カーネルレベルで何か相互作用があるかどうか知りたいです。 UART の設定 シリアルデバイスを開くには、以下の方法を使用します。 fd = open(port, O_RDWR | O_NOCTTY); 端末の設定は以下のとおりです。 opt->c_lflag = 0; opt->c_iflag = 0; opt->c_oflag = 0; memset(opt->c_cc, 0x00, sizeof(opt->c_cc)); opt->c_cc[VMIN] = 0; opt->c_cc[VTIME] = 0; tcsetattr(fd, TCSANOW, opt); fcntl(fd, F_SETFL, FNDELAY); また、以下の方法も試してみました。 O_NONBLOCK そして、 fcntl(fd, F_GETFL)を使用してファイルディスクリプタフラグを確認しました。 しかし、その行動は変わっていない。 読み込み動作 アプリケーションは以下を用いて期待される256バイトを読み込みます: i = read(path, rbuf, len); この問題は、UARTからデータが受信されない場合に発生します。 私の質問 Linux 6.6.52のi.MX93 UARTドライバに、データが利用できないときにread()がブロックされたりハングしたりする既知の問題はありますか? このドライバでUART割り込み、RX FIFO処理、DMA転送に関する既知の問題はありますか? i.MX93 UARTドライバを設定して、データが利用できないときに非ブロッキングな読み取り()が即座に戻ることを保証する方法はありますか? UARTドライバの問題がカーネルログで観察されたMMC/SDHCIのタイムアウトメッセージを引き起こしたりトリガーしたりする可能性はありますか? 確認すべき特定のカーネル設定、パッチ、またはデバイスツリー設定はありますか? i.MX93 UARTドライバの既知の問題点についてのご提案やデバッグ手順、参考文献があればぜひ教えてください。 プラットフォーム情報: SoC: NXP i.MX93 カーネル:Linux 6.6.52 UARTデバイス: /dev/sp1 アプリケーション:C ユーザースペースアプリケーション 通信テスト:256バイトのTX/RX物理ループバックテスト お時間をいただき、サポートありがとうございます。 Re: Linux UART driver hangs during read() when no loopback connection is present (i.MX93 / Linux こんにちは@Doni_D  現時点では、i.MX93 Linux 6.6.52 LPUARTドライバでこれが既知のフリーズ問題であるという証拠はありません。 デバイスを開けるときに直接、 ブロックしないO_NONBLOCK モードを設定するのも試してみてください。 /dev/sp1は i.MX93 LPUART の標準デバイス名ではありません。標準名は通常/dev/ttyLPxです。マッピングを変更しましたか? RTS/CTSが切断された後、無効なCTS信号によってUARTは送信を継続できなくなります。1秒のタイムアウトで poll() を使うこともできます。無限ループで待たないでください。 DTSでRTS/CTS pinmux 、 uart-has-rtscts 、 dmas 、およびdma-namesが正しく設定されているかどうかを確認してください。 比較のためにUARTノードの DMAS や DMA名 を一時的に削除してPIO/IRQモードに切り替えることができます。 よろしくお願いします、 志明
View full article
i.MX95 Android オートモーティブ 16 CSI1 Ov5640 カメラの問題 チームの皆さん、こんにちは。 カスタムのi.MX95ボードにOV5640カメラセンサーを搭載しており、Android オートモーティブ 16でカメラをCSI1に接続すると問題が発生しています。 ハードウェア設計はすでに検証されています: - CSI0およびCSI1はLinux 6.18.20で正常に動作します。 - CSI0およびCSI1はLinux 6.18.20ベースのAndroid 16でも正常に動作します。 - この問題はLinux 6.18.20ベースのAndroid オートモーティブ 16でのみ観察されます。 観察結果: - CSI0は問題なく動作します。 - CSI1がストリーミングを開始できませんでした。 - CSI1については独自にテストを実施しました。 - また、NEO ISPを無効にしてISIパイプラインのみでテストしましたが、問題は解決しませんでした。 観測されたエラー: LIBCAMERA: ストリーミングの開始に失敗しました: 接続がタイムアウトしました LIBCAMERA: 'mxc_isi.0':パッド0/0でフォーマットを設定できません:デバイスまたはリソースがビジー状態です 参照用にlogおよびmedia-ctlの検証結果を添付します。 i.MX95 EVKやAndroid オートモーティブ 16で同様のCSI1問題に遭遇した方はいらっしゃいますか?EVKでのCSI1検証の提案、修正、パッチ、または確認があればぜひ教えてください。 ありがとう、 マルティ・ナイク 評価ボード Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue こんにちは、 カーネルのDTS設定が正しいことを確認しました。現在のAndroid オートモーティブ 16 BSPもLinux 6.18.20をベースにしており、同じDTS構成がLinux 6.18.20 BSPでも問題なく動作しています。 また、Android オートモーティブ 15 BSPでOV5640カメラを搭載したCSI1のテストと検証も成功裏に行っています。 最新のAndroid オートモーティブ 16.0.0_2.1.0でCSI1カメラのサポートに制限や制限があるかどうか、確認していただけますか?BSP?このリリースでCSI1カメラのサポートを有効にするために追加の変更は必要ですか? ご説明をお願いします。 よろしくお願いいたします。 マルチ Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue AAOSを確認しましたが、デフォルトでCSI0をサポートしています。現在のBSPはカメラ用のMIPI DSI/CSIをサポートしていません。DTSやカメラの設定を変更するべきです。何か変更しましたか?はいの場合、変更した手順とコードの詳細を共有してください。 Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue こんにちは、 @joanxie この件に関して何か進展はありましたか?CSI1カメラの問題解決に役立つ調査結果や技術的なアドバイスをぜひお寄せください。 Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue 親愛なる@joanxie  はい、私たちのB0ボードデザインはNXP i.MX95 19x19 EVKをベースにしています。 参考までに、同じハードウェアがLinux 6.18.20とAndroid 16(Linux 6.18.20ベース)で動作しています。CSI0とCSI1(CSI-DSIコンボ)はどちらも、2台のOV5640カメラで動作しています。 Android オートモーティブ 16.0.0_2.1.0を使用しています(6.18.20_2.0.0 BSP をベースにしており、同じカーネルバージョンとカーネル構成を使用しています。) しかし、Android オートモーティブ 16.0.0_2.1.0ではBSPでは、OV5640カメラはCSI0では動作しますが、 CSI1(CSI-DSIコンボ)上のOV5640カメラは動作しません。ログは既に共有済みです。 現在、i.MX95 B0 EVKボードは入手できず(A1 EVKボードを持っています)、EVK上でテストできません。 最新のAndroid オートモーティブ 16 BSPを使ってNXP i.MX95 19x19 EVK B0ボードで CSI1(CSI-DSIコンボ)を対応カメラでテストし、結果を共有していただけると助かります。 Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue こんにちは、 マルティさん ボードデザインはIMX95 EVKボードをベースにしたのですか?はいの場合、NXP IMX95 EVKボードでこの現象を再現できましたか?そして、詳細な車載Android 16 BSPバージョンは何ですか?1.1.0それとも1.3.0? B.R. ジョーン Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue @joanxie様、 CSI1カメラの問題について、最新情報をお伝えします。 Car2の画像では、CSI0とCSI1の両カメラが正常に動作しています。しかし、車の画像に関しては、CSI1カメラを正常に動作させるという問題が依然として発生しています。 カーイメージにおけるCSI1カメラの問題の調査と解決にご協力をお願いいたします。 Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue 親愛 なる@joanxieへ、 サポートありがとうございます。 Android オートモーティブ 16.0.0_2.1.0でCSI1(DSI-CSIコンボ)のカメラ検証サポートを有効にするための回避策やパッチを教えていただけますか? ご協力いただければ大変ありがたいです。 よろしくお願いします、 マルティ・ナイク Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue 車載AndroidチームはCSI1を以前にテストしたことがないと思います。デフォルトはCSI0専用なので、EVSやカメラAPK機能は必要でしたか?そしてCar2の画像タイプは使いましたか? Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue car2イメージとはどういう意味ですか? Arm Cortex-AコアのEVSでのことですか?車載Android 15でテストが成功したなら、車載Android 15では何をテストしていますか?確認のためにパッチを共有してもらえますか? Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue 親愛なる@joanxie 現在、私たちは自動車のイメージを使用しており、今のところEVS(電気自動車)には注力していません。私たちの要件は、Cameraアプリケーションを通じてCSI1カメラを直接有効化・検証することです。 CSI1カメラの問題を解決するためにご協力をお願いします。 Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue Android 車載チームから再度確認しますが、これまで車載 Android 16に制限があるとは言っていませんでした。あなたのテスト結果からすると、この問題は車載 Android 16に関連しているようです Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue こんにちは、 私たちのテストでは、Android オートモーティブ 15 BSP上で、CSI0とCSI1の両方のカメラが、車用画像(EVSはM7コア上で動作)とCar2画像(EVSはA55コア上で動作)の両方で正常に動作しました。 Android オートモーティブ 16 BSPでは、車のイメージ(M7コア上でEVSが動作している)ではCSI0は動作しますが、CSI1は動作しません。しかし、Car2イメージ(A55コア上で動作するEVS)では、CSI0とCSI1の両方が正しく動作します。 車の画像の背景処理がCSI1にアクセスしたり保持したりしていて、カメラが動かなくなるかどうか確認してもらえますか? Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue car2とcarimageの2つのログファイルを教えてもらえますか?CSI1専用で、AA15からAA16.0 2.1.0までの同じCM7 FWバージョンを使ってみてはどうでしょうか? Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue こんにちは、 問題の原因を特定することができました。これは、CARイメージ内のM7コア上で実行されていたリアビューカメラのデモが原因でした。CSI1ビジーエラーの原因となっているコードを特定し、現時点ではそのコードを切り離しました。 また、両方のカメラがカメラアプリで動作し、デュアルカメラサポートのevs_appも確認しました。 よろしくお願いいたします。 マルチ Re: i.MX95 Android Automotive 16 CSI1 Ov5640 Camera Issue こんにちは、 マルティさん。 それを聞いて安心しました。この問題はM7のSDKバージョンが現在のAndroidと一致していないことに関連しているのですか?車載Android 16の車載Android 15 M7ファームウェアは試しましたか?
View full article