Multi Source Translation Content

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

Multi Source Translation Content

Discussions

Sort by:
升级 RTD 时出现意外的 BSP 变化 MCU:S32K148 144引脚封装 IDE:Windows 11 上的 S32DS 3.6.6 实时操作系统:裸金属 驱动型号:非MCAL 当我将现有项目从 RTD v 3.0.0 升级到 QPL06 时,以下更改自动插入到 .mex 文件中。文件(以及其他文件,但其他文件似乎很普通) true 我想知道“enable_parallel_routing”参数的作用是什么? 我对“serdes”标签感到困惑:它是否代表串行器-反串行器(Serializer-Deserializer)?K148芯片并不具备这种功能。为什么需要这样做?
View full article
重複した変数宣言 私はLPC824ボードとダウンロードしたlpcxpresso824max_new_projectを使用して新しいプロジェクトに取り組んでいます。ビルド、ダウンロード、デバッグは問題なく完了しました。まず最初に、3桁の7セグメントLEDディスプレイを実装しようとしています。ペリフェラルに宣言を追加しました。そして、main.c に更新ルーチンがあります。ビルド時に、重複した変数宣言という2つのエラーが発生します。それらをコメントアウトすると、「未宣言の変数」というメッセージが表示されます。変数名を変更しても、同じ重複エラーが発生します。プロジェクト内のすべてのソースファイルを調べましたが、重複は見つかりませんでした。エラーメッセージの一つは次のとおりです。 /アプリケーション/MCUXpressoIDE_25.6.136/ide/plugins/com.nxp.mcuxpresso.tools.macosx_25.6.0.202501151204/tools/bin/../lib/gcc/arm-none-eabi/14.2.1/./../../../arm-none-eabi/bin/ld: ./source/ペリフェラル.o:/Users/julian/Documents/MCUXpressoIDE_25.6.136/workspace/lpcxpresso824max_new_project/Debug/../source/ペリフェラル.h:57: 'CA_LUT'の複数定義; ./source/main.o:/Users/julian/Documents/MCUXpressoIDE_25.6.136/workspace/lpcxpresso824max_new_project/Debug/../source/ペリフェラル.h:57: ここで最初に定義されました Re: Duplicate variable declarations こんにちは、 あなたのペリフェラルを教えていただけますか?ファイルとペリフェラルについて?または、CA_LUTの宣言をどのように追加したか説明してください。 main.cでどのように使ったのか教えていただけますかCA_LUT? どのファイル名に[#include "peripherals.h"】があるのか教えてください。それらのファイルのヘッダーはmain.cに含まれていますか? 敬具、ルイス
View full article
i.mx8M Plus 上的 wm8962 错误 我们正在设计基于 NXP i.MX 8M Plus (i.MX8MP) 处理器和 Wolfson WM8962 音频编解码器的定制电路板。我们目前正在将驱动程序移植到Linux 内核 5.4。以下是错误日志和我们的 DTS(设备树源)配置。 日志: [ 2.097680] imx-wm8962 sound-wm8962: 2111111111111111111111111 [ 2.103533] imx-wm8962 sound-wm8962: 22222222222222222222222222 [ 2.109467] imx-wm8962 sound-wm8962: 333333333333333333 [ 2.114705] imx-wm8962 sound-wm8962: 888888888888888888 [ 2.119953] imx-wm8962 sound-wm8962: failed to find codec platform device [ 2.126759] imx-wm8962: probe of sound-wm8962 failed with error -22 [ 2.995796] wm8962 2-001a: afrrgrgtrggggggggggggggggggg [ 3.001038] wm8962 2-001a: bbbbbbbbbbbbbbbbbbbbbbbbb [ 3.008259] random: fast init done [ 3.011807] wm8962 2-001a: customer id 0 revision F​ DTS:   sound-wm8960-forenex { compatible = "fsl,imx-audio-wm8962"; model = "wm8962-audio"; audio-codec = <&codec>; audio-cpu = <&sai3>; audio-routing = "Headphone Jack", "HPOUTL", "Headphone Jack", "HPOUTR", "Ext Spk", "SPKOUTL", "Ext Spk", "SPKOUTR", "AMIC", "MICBIAS", "IN3R", "AMIC", "IN1R", "AMIC"; }; &i2c3 { clock-frequency = <100000>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c3>; status = "okay"; pca6416: gpio@20 { compatible = "ti,tca6416"; reg = <0x20>; gpio-controller; #gpio-cells = <2>; }; ov5640_1: ov5640_mipi@3c { compatible = "ovti,ov5640"; reg = <0x3c>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_csi0_pwn>, <&pinctrl_csi0_rst>, <&pinctrl_csi_mclk>; clocks = <&clk IMX8MP_CLK_IPP_DO_CLKO2>; clock-names = "xclk"; assigned-clocks = <&clk IMX8MP_CLK_IPP_DO_CLKO2>; assigned-clock-parents = <&clk IMX8MP_CLK_24M>; assigned-clock-rates = <24000000>; csi_id = <0>; powerdown-gpios = <&gpio4 1 GPIO_ACTIVE_HIGH>; reset-gpios = <&gpio4 0 GPIO_ACTIVE_LOW>; mclk = <24000000>; mclk_source = <0>; mipi_csi; status = "disabled"; port { ov5640_mipi_1_ep: endpoint { remote-endpoint = <&mipi_csi1_ep>; data-lanes = <1 2>; clock-lanes = <0>; }; }; }; codec: wm8962@1a { compatible = "wlf,wm8962"; reg = <0x1a>; clocks = <&audiomix_clk IMX8MP_CLK_AUDIOMIX_SAI3_MCLK1>; clock-names = "mclk"; wlf,shared-lrclk; AVDD-supply = <&reg_audio_pwr>; CPVDD-supply = <&reg_audio_pwr>; DBVDD-supply = <&reg_audio_pwr>; DCVDD-supply = <&reg_audio_pwr>; MICVDD-supply = <&reg_audio_pwr>; PLLVDD-supply = <&reg_audio_pwr>; SPKVDD1-supply = <&reg_audio_pwr>; SPKVDD2-supply = <&reg_audio_pwr>; gpio-cfg = < 0x0000 /* 0:Default */ 0x0000 /* 1:Default */ 0x0000 /* 2:FN_DMICCLK */ 0x0000 /* 3:Default */ 0x0000 /* 4:FN_DMICCDAT */ 0x0000 /* 5:Default */ >; }; };​ 根据我们的分析,当内核尝试初始化 imx-wm8962 机器驱动程序时,I2C 总线上的 WM8962 编解码器尚未完成探测/注册。WM8962 之后才会完成初始化。这种探针顺序不一致会导致驱动程序初始化失败并出现错误。 请问您能否帮忙分析一下这个问题,并提出解决此问题的建议? IMX8MPLUS音频软件 NXP_MICR Android Linux Re: wm8962 on i.mx8M Plus error 当编解码器或 SAI 平台设备未准备就绪时,返回 -EPROBE_DEFER 在你的 imx-wm8962.c 中探测路径,区分以下几种情况: 缺少/无效的 DT 句柄 → 实际错误,返回 -EINVAL; 句柄存在,但引用的设备尚未注册 → 依赖项未准备就绪,返回 -EPROBE_DEFER。 例如,从概念上讲: codec_np = of_parse_phandle(np, "audio-codec", 0); 如果 (!codec_np) { dev_err(&pdev->dev, "音频编解码器缺失或无效\n");         返回-EINVAL; } codec_dev = of_find_i2c_device_by_node(codec_np); 如果 (!codec_dev) { dev_info(&pdev->dev, "编解码器设备未就绪,延迟探测\n"); of_node_put(codec_np); 返回 -EPROBE_DEFER; } 同样适用于 CPU DAI / SAI 节点: cpu_np = of_parse_phandle(np, "audio-cpu", 0); 如果 (!cpu_np) { dev_err(&pdev->dev, "audio-cpu 缺失或无效\n");         返回-EINVAL; } cpu_pdev = of_find_device_by_node(cpu_np); 如果 (!cpu_pdev) { dev_info(&pdev->dev, "SAI 平台设备未就绪,延迟探测\n"); of_node_put(cpu_np); 返回 -EPROBE_DEFER; } 如果您保留当前的机器驱动程序,这是最直接的解决方法。 如果可用,请优先选择 Linux 5.4 fsl-asoc-card 路径。 对于 Linux 5.4 时代的 NXP 内核,compatible = "fsl,imx-audio-wm8962" 由 sound/soc/fsl/fsl-asoc-card.c 处理,其中显式地处理了 WM8962,包括编解码器 DAI 名称 "wm8962" 和 WM8962 时钟/FLL ID。还要验证 snd-soc-fsl-asoc-card.ko 是否已加载或已构建。 这意味着您应该避免让旧版/自定义 imx-wm8962 机器驱动程序和 fsl-asoc-card 尝试绑定同一个兼容字符串。推荐方法: 启用/使用 CONFIG_SND_SOC_FSL_ASOC_CARD; 确保您的声音节点使用兼容的 = "fsl,imx-audio-wm8962";  ; 除非您有意保留,否则请移除或禁用该兼容字符串的旧版/自定义 imx-wm8962 绑定。 确保DTS具有所需的SAI和编解码器DAI属性 您的编解码器节点大致符合预期形状:WM8962 的示例使用 compatible = "wlf,wm8962" 、 reg = <0x1a> 、 clocks、 supply properties 和 gpio-cfg。但是,请确认您的DTS中未显示的部件: &sai3 { #sound-dai-cells = <0>         pinctrl-names = "default"; pinctrl-0 = <&pinctrl_sai3>;         assigned-clocks = <&clk IMX8MP_CLK_SAI3>;         assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT> assigned-clock-rates = <12288000>; /* 或板要求的 MCLK */         status = "okay"; }; 此外,编解码器通常还应公开以下内容: 编解码器:wm8962@1a { 兼容 = "wlf,wm8962"; reg =<0x1a> � #sound-dai-cells = <0> clocks = <&audiomix_clk IMX8MP_CLK_AUDIOMIX_SAI3_MCLK1>; 时钟名称 = "mclk"; …… }; 同时确保 reg_audio_pwr 引用的稳压器已定义、已启用,并且具有有效的电压范围。您的编解码器已被检测到,因此电源可能不是造成此特定错误的原因,但不良的电源或 MCLK 设置可能会导致以后的音频故障。 验证 MCLK 是否使能。 已知有一类 WM8962 启动问题,需要在音频机器驱动程序中启用编解码器 MCLK;据报道,在 imx_wm8962_probe() 中添加 clk_prepare_enable(codec_clk) 可以使 WM8962 音频工作。如果编解码器探测成功,但之后播放/捕获失败,请检查在编解码器初始化和流启动期间,SAI3 MCLK 是否实际存在于编解码器引脚上。 检查是否存在重复或冲突的声卡节点 确保只有一个活动的声音节点指向此编解码器/SAI 对,并且模型字符串是唯一的。在 NXP 社区调试中,还出现了类似的故障,即找不到编解码器平台设备,这与声卡命名/重复卡冲突有关。您的节点名称显示为 sound-wm8960-forenex,而兼容/型号为 WM8962;节点名称本身通常不起作用,但我建议您将其重命名以使其更清晰,并确认其他地方没有第二个已启用的 sound-wm8962 节点。 推荐的最短路径 如果可能,请使用适用于 Linux 5.4 的 fsl-asoc-card。 如果 WM8962 节点缺少 #sound-dai-cells = <0>;,请添加它。 确认 &sai3 已启用且已配置时钟/引脚控制。 如果保留自定义的 imx-wm8962 驱动程序,请修补失败的编解码器/CPU 查找路径,使其返回 -EPROBE_DEFER 而不是 -EINVAL。 确认 MCLK 已启用且存在。
View full article
RTDのアップグレード時に予期せぬBSPの変更が発生する MCU:S32K148 144ピンパッケージ IDE:Windows 11 上の S32DS 3.6.6 RTOS: ベアメタル ドライバーモデル:非MCAL 既存プロジェクトをRTD v 3.0.0からQPL06にアップグレードした際、以下の変更が.mexに自動的に挿入されましたファイル(他にもあるが、他は平凡なものに思える) true 「enable_parallel_routing」は何をするものなのでしょうか? そして、「serdes」というタグが気になります。これはシリアライザー・デシリアライザーの略でしょうか?K148チップにはこの機能はありません。なぜこれが必要なのですか?
View full article
GMAC RX interrupt of S32K328 I use GMAC of S32K328, and want to use interrupt method to receive package from my PC. But found some differnt phenomenon: 1. Interrupt handler GMAC0_CH0_RX_IRQHandler can be called, and receive package normally. 2. Many seconds GMAC0_CH0_RX_IRQHandler called after PC send package. 3. GMAC0_CH0_RX_IRQHandler can't called, and no package receive? What might be the reason? How to solve that? Re: GMAC RX interrupt of S32K328 Hello @zyt , Thank you for sharing the configuration. Since I do not have EB tresos available, I reviewed the GMAC configuration manually from the provided files. I compared your Eth_43_GMAC configuration with a working S32K358 GMAC 1G lwIP FreeRTOS reference project. One significant difference is the Egress FIFO configuration. In your project, the Egress FIFO buffer length is configured to 128 bytes and the MTL Egress queue size is 256 bytes. In the reference project, the Egress FIFO buffer length is 1536 bytes and the MTL Egress queue size is 4096 bytes.   If your application transmits any frames or if the upper layer sends responses, this small TX/Egress configuration may be too limited for standard Ethernet frames, especially in 1G RGMII mode. As a test, please try increasing:   - EthCtrlConfigEgressFifoBufLenByte to 1536 - EthCtrlConfigMTLEgressQueueSizeInBytes to 4096   For the RX path, the RX buffer length itself is 1536 bytes, which looks reasonable. However, your MTL Ingress queue size is also 1536 bytes, while the reference project uses 4096 bytes. Therefore, as another test, please also try increasing:   - EthCtrlConfigMTLIngressQueueSizeInBytes to 4096   In addition, for debugging, please temporarily enable receive-all mode. Your current configuration has PKT_FILTER_RECV_ALL disabled, while the reference project enables it. This can help to exclude MAC filtering from the analysis.   There are also other differences like EthEnableCacheManagement and EthCtrlReleaseResourceAfterReception, but this is not necessarily wrong.   Best regards, Pavel Re: GMAC RX interrupt of S32K328 Hello: I have tried both unicast frames or broadcast frames, the delay between every frame is 1 second, I think it's enough slow. The phenomenon is the same, there is no RxStatsDropEvents at bigining, but it appears after a few frames. My EB configuration is like attachment, please help to check if it's convenience for you. Thanks. Re: GMAC RX interrupt of S32K328 Hello @zyt , RxStatsDropEvents suggests that some frames are seen by the GMAC, but are dropped somewhere in the RX path. This may be related to RX resource availability, RX FIFO/queue handling, descriptor/buffer availability, packet filtering or the upper-layer receive processing.   Please try the following checks:   1. Please send the same unicast frames slowly from the PC, for example one frame at a time or with a larger delay between frames, and compare the RX statistics before and after the test. If RxStatsDropEvents no longer increases, the issue may be related to RX buffer recycling, processing time, or burst traffic from the PC.   2. Please repeat the test with broadcast frames and then with unicast frames addressed exactly to the MAC address configured in the GMAC driver. This will help to exclude a MAC address/filtering issue.   Please also verify the RGMII clock and peripheral configuration. As a reference, I have published an S32K358 GMAC example on the NXP Community: https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K358-GMAC-1G-lwIP-FreeRTOS-S32DS-3-6-1-RTD600/ta-p/2355872     Please note that this example is for S32K358, not S32K328, so it must not be copied directly without checking the S32K328 pinout and clock configuration. However, it can be used as a reference for the overall clock setup, Eth_43_GMAC configuration and the DCMRWF register workaround.   If possible, could you please also share your zipped project? Without the project, it is difficult to determine whether the drops are caused by configuration, RX resource handling, queue routing or the application receive path. Best regards, Pavel Re: GMAC RX interrupt of S32K328 Hello: I read the frame info by RTD function Eth_43_GMAC_GetRxStats, it looks has drop event. zyt_0-1787017861198.pngzyt_0-1787017861198.pngzyt_0-1787017861198.pngzyt_0-1787017861198.pngzyt_0-1787017861198.png The RX flow all handled by RTD like below, I didn't modify. GMAC0_CH0_RX_IRQHandler -> GMAC_RxIRQHandler -> Eth_43_GMAC_RxIrqCallback -> Eth_43_GMAC_Receive What might be the reason for this? Thanks. Re: GMAC RX interrupt of S32K328 Hello @zyt , Thank you for the details.   Please also check Pins/Clocks/device_init() accordingly to this thread: S32K358 - GMAC Clock Configuration   From the screenshot, the GMAC0 interrupt vectors seem to be configured and mapped to the RTD handlers, including GMAC0_CH_0_RX_IRQHandler. Since this handler is sometimes entered and the frame can be received, the basic interrupt routing does not look completely wrong.   However, when using the AUTOSAR Eth_43_GMAC driver, please also check the receive flow above the low-level IRQ handler. The RX interrupt handler itself is not usually the complete application-level receive processing. The application or upper layer still needs to call the expected Eth_43_GMAC receive API flow, for example Eth_43_GMAC_Receive(), so that the received frame is read from the driver and passed further through the configured callback path.   Please check the following points:   1. Please confirm that Eth_43_GMAC_Receive() is called after the RX interrupt event, or periodically from your main/task context, according to your application design. If the interrupt occurs but the received frame is not consumed from the RX buffers, the following frames may not be received as expected.   2. Please verify that the received unicast frame destination MAC address exactly matches the MAC address configured in the GMAC driver. For debug purposes, you can temporarily enable receive-all/promiscuous mode to exclude MAC filtering as the reason.   3. Please check which RX queue/FIFO is used. Your screenshot shows RX interrupt handlers for CH0, CH1, and CH2. If the packet filter or queue configuration routes frames to another RX queue, the application must call the receive function with the corresponding FIFO index and handle that queue correctly.   4. Please verify RX buffer/descriptor availability. After a received frame is processed, the driver must be able to reuse or obtain RX buffers again. If the RX buffers are exhausted, the first frame may be received correctly, but later frames may be delayed or lost.   5. If cache is enabled, please verify that the GMAC descriptors and RX buffers are placed in a non-cacheable memory region, or that the required cache maintenance is performed. Otherwise, the CPU may see stale descriptor status or stale received data.   6. Since the frames are sent from a Python script as unicast frames, please also confirm by Wireshark that the PC really sends the frames continuously with the expected destination MAC address. If some frames require address resolution or if the destination is not reachable as expected, the PC side may introduce retries or delays, which can look like delayed RX interrupt behavior on the MCU side.   As a reference, I would recommend comparing the project with an adapted S32K3 Ethernet/lwIP example first. This can help to confirm that the RGMII PHY interface, clocks, MAC address, and basic RX path are working before focusing on the custom AUTOSAR Eth_43_GMAC interrupt receive implementation.   If the issue still remains, please share the Eth_43_GMAC receive part of the application, especially where Eth_43_GMAC_Receive() is called, the RX FIFO configuration, MAC address/filter configuration, and the GMAC DMA/MTL/MAC status registers after the failure. Bets regards, Pavel Re: GMAC RX interrupt of S32K328 Hello: 1.I use RGMII 2. I use RTD 6.0.0. 3. I use the Eth_43_GMAC driver. 4. Interruption is like the following: zyt_0-1786962682804.pngzyt_0-1786962682804.pngzyt_0-1786962682804.pngzyt_0-1786962682804.pngzyt_0-1786962682804.png 5. I send unicast frames with python script. All the packages I send are the same, and GMAC0_CH0_RX_IRQHandler is from RTD which is the lowest handler like picture above. Re: GMAC RX interrupt of S32K328 Hello @zyt , Could you please provide a few more details about your setup?   1. Which MAC/PHY interface are you using on S32K328, for example MII, RMII or RGMII? 2. Which S32K3 RTD version are you using? 3. Are you using the AUTOSAR MCAL Eth_43_GMAC driver or the lower-level GMAC IP driver? 4. Could you share the relevant interrupt configuration and the implementation of GMAC0_CH0_RX_IRQHandler? 5. What kind of frames are sent from the PC, for example ping/ICMP, UDP, raw Ethernet frames, broadcast or unicast frames?   As a reference test, I would also recommend trying to reproduce the behavior using an adapted S32K3 Ethernet/lwIP example first. This can help to separate a basic GMAC/PHY/clock/configuration issue from an application-specific interrupt or RX-buffer handling issue.     Regarding the symptoms, if the RX interrupt is sometimes called and the frame can be received correctly, the basic RX path is likely at least partially working. However, the inconsistent behavior may still be caused by one of the following points:   - RX buffer or descriptor handling: after a received frame is processed, the RX buffer/descriptor must be returned back to the driver/DMA. If this is not done correctly, RX buffers may become unavailable and further RX interrupts may stop or become inconsistent.   - Interrupt handling: please make sure that the RX interrupt is configured for the correct GMAC channel and that the expected driver interrupt handler/status clearing flow is used. If the interrupt status is not cleared correctly, the following RX events may not be reported as expected.   - Cache/memory coherency: if cache is enabled, please verify that the GMAC descriptors and RX buffers are placed in a suitable non-cacheable memory region, or that the required cache maintenance is performed. Otherwise, the CPU may see stale descriptor status or stale received data.   - Packet filtering/MAC address: for debug purposes, please try enabling receive-all/promiscuous mode temporarily. This helps to check whether the frame is rejected by the MAC address filter, VLAN filter, or another packet filter setting.   - Frame type and PC behavior: if the PC sends IP traffic such as ping, the first frames may be ARP requests/replies before ICMP traffic is sent. If ARP resolution fails or some frames are filtered/dropped, it may look like the interrupt is delayed by several seconds because the PC retransmits ARP or the application retries later.   - PHY link and clocks: please also confirm that the PHY link is up and that the required input clocks for the selected MII/RMII/RGMII interface are present and stable.   Please share the above configuration details and, if possible, the GMAC DMA/MTL/MAC status registers after the failure. This should help identify whether the issue is related to interrupt configuration, RX descriptor/buffer handling, packet filtering, or the external PHY/interface setup. Best regards, Pavel Re: GMAC RX interrupt of S32K328 Hello: I follow the configuration as your advice like below: zyt_0-1787045193851.pngzyt_0-1787045193851.pngzyt_0-1787045193851.pngzyt_0-1787045193851.png zyt_1-1787045222335.pngzyt_1-1787045222335.pngzyt_1-1787045222335.pngzyt_1-1787045222335.png zyt_2-1787045282610.pngzyt_2-1787045282610.pngzyt_2-1787045282610.pngzyt_2-1787045282610.png zyt_3-1787045358003.pngzyt_3-1787045358003.pngzyt_3-1787045358003.pngzyt_3-1787045358003.png The EthCtrlReleaseResourceAfterReception is gray could not be modified, because it's only applied when external data buffers are used. zyt_4-1787045508280.pngzyt_4-1787045508280.pngzyt_4-1787045508280.pngzyt_4-1787045508280.png After modify these, the result is the same, RxStatsDropEvents appeared. zyt_5-1787045605969.pngzyt_5-1787045605969.pngzyt_5-1787045605969.pngzyt_5-1787045605969.png The modified configuration file is like attachment. Could you give some more advice? Thanks. Re: GMAC RX interrupt of S32K328 Sorry, I forget you do not have EB. The attachment is the generated file after modification. Re: GMAC RX interrupt of S32K328 Hello @zyt , Thank you for the update. I reviewed your files again and I haven't seen anything suspicious. If the behavior remains unchanged after increasing the FIFO/queue resources, I would not continue changing configuration parameters blindly. The next step should be to identify which frames are actually counted as RxStatsDropEvents. Please check whether the drop counter increases only when your Python unicast frames are sent or also when no Python traffic is running, as PC-side background traffic or filtered frames may also affect the RX statistics. Bets regards, Pavel
View full article
S32K344 FlexIO I2C DMA 你好, 我有一些关于S32K344上的FlexIO I2C DMA的问题,希望您能提供一些见解。 1. 当使用 FlexIO 模拟 I2C 时,Tx 长度设置为 尺寸 + 1。这是因为 “发送移位器在 SCL 引脚的最后一个下降沿加载一个额外的字” ? 1.png1.png 2.png2.png 2. 当使用DMA发送数据时, 主要循环计数 也设置为 大小 + 1。这是出于同样的原因吗?使用 DMA 时,所有传输的数据都来自 Master->TxData 。调用时 Flexio_I2c_Ip_MasterSendData ,应该 德州牛 长度为 大小 + 1 ,最后一个字节是否为 0xFF 或者 0x00 ? 3.png3.png 3. 用于接收数据, 主要循环计数 设置为 尺寸 – 1。这是为什么呢? 4. 我在 S32K344 上进行了测试,发现使用 DMA 进行 FlexIO I2C 接收数据时,接收到的数据比预期少一个字节。用示波器观察,最后一个字节的时钟信号只显示大约五六位波形。在 S32K312 上进行同样的测试没有问题。 S32K344 S32DS3.6.4 RTD700   BR, 杰森 Re: S32K344 FlexIO I2C DMA 嗨@Jason07 由于 FlexIO 不是专用的 I2C 外设,因此其实现需要额外的内部步骤才能正确完成 I2C 总线序列。 传输中的 Size + 1U 与 FlexIO 完成 I2C 帧序列所需的最终移位器负载有关。此次额外传输并不代表额外的有效载荷字节。相反,它被 FlexIO 硬件内部用于生成最终时钟脉冲,并将总线正确转换到传输结束状态。 接收端需要使用 1U 的尺寸,因为接收到的最后一个字节需要单独处理。这样,驱动程序就可以在正确的时间生成所需的 NACK 和 STOP 条件。 另外,请注意,使用 DMA 传输模式时,数据传输可能会受到缓存一致性问题的影响。为避免启用 数据缓存 时出现潜在问题,请确保用作 DMA TCD 源和目标的缓冲区分配在不可缓存的内存区域中。 调用 Flexio_I2c_Ip_MasterReceiveData() 函数时,无需增加 TRANSFER_SIZE 参数。驱动程序已经处理了接收序列所需的内部调整。 最后,在检查您的配置时,我注意到相同的 DMA 中断回调被分配给了两个 DMA 通道。根据 Flexio_I2c_Ip.c 中的描述,发送和接收应该使用不同的回调函数: FlexIO_I2c_Ip_DmaTransferCompleteNotificationShifter0() 用于 FlexIO 通道 0/1 TX FlexIO_I2c_Ip_DmaTransferCompleteNotificationShifter1() 用于 FlexIO 通道 0/1 RX BR,VaneB
View full article
multicore trigger Using the two demos, multicore_trigger and cm7_helloworld, I did not enable ECC for the CM7 ITCM. I used the SPT tool to merge the CM33 image and the CM7 image, which is intended to run from memory, into a single image, and then programmed the merged image into NOR Flash through UART. However, the boot process failed. According to the manual, a container can contain up to 8 OEM image entries. In my test, I only included two images: one CM33 image and one CM7 image. CM7 ITCM ECC was not enabled. Neither the CM33 nor the CM7 image started. However, when I checked the container header, I found that only the CM33 image was present. The CM33 image itself can boot normally without any issues when used alone. I would like to understand why the CM7 image was not included or processed as expected, and whether the lack of CM7 ITCM ECC configuration affects how Boot ROM processes the CM7 image. Question 2: If I merge 8 CM7 images and 1 CM33 image into a single container, what will the Boot ROM do during the startup process? Since there is only one CM7 core, how does Boot ROM determine which CM7 image should be booted? If all 8 image entries are CM7 images, will Boot ROM load all 8 images, select only one image, or leave the selection to the CM33 application? How does Boot ROM identify and process multiple CM7 image entries in the same container? Is there a priority, image index, Core ID, load address, entry point, or another mechanism used to determine which CM7 image is executed? I would also like to understand the exact Boot ROM behavior when CM7 ITCM ECC is enabled and when it is not enabled. When CM7 ITCM ECC is enabled, does Boot ROM initialize the CM7 ITCM ECC memory, copy the CM7 image from NOR Flash into CM7 ITCM, and then release CM7 from reset? Or does Boot ROM only load the CM7 image, while the CM33 application is responsible for releasing CM7 from reset and starting it? When CM7 ITCM ECC is not enabled, what does Boot ROM do when it encounters a CM7 image whose load address is in CM7 ITCM? Does Boot ROM skip the CM7 image, fail to load it, leave CM7 in reset, or cause the entire container boot process to fail? In particular, I would like to clarify whether the following container is supported: Image 0: CM33 Image 1: CM7 Image 2: CM7 Image 3: CM7 Image 4: CM7 Image 5: CM7 Image 6: CM7 Image 7: CM7 Image 8: CM7 If it is supported, what exactly happens to these 8 CM7 images during Boot ROM startup, and which component is responsible for selecting the CM7 image that will actually execute? Finally, I would like to clarify whether the maximum of 8 OEM image entries means that the container can simply store 8 different images, or whether Boot ROM also provides a mechanism to select and boot a specific image for a given core. Re: multicore trigger Hi @yanyanwang, If the container header showed only the CM33 image, then the Boot ROM/ELE never had a CM7 entry to process, which might be the cause of the behavior you are seeing. Also, it's important to note that the container order is also relevant. As the RM mentions: "The OEM container can have 8 images at the maximum. The Cortex-M33 core (booting core) images must be located after the other ones." In other words, the scheme you mention of having one CM33 followed by 8 CM7 images is not possible. You would have to reduce the number of CM7 images by one, and invert order. If multiple images are present, ELE verifies the hash for each one, and if any fail, the device enters the reset loop. The mechanism used array processing, meaning that each image is loaded in order, having their own flags to identify each. BR, Edwin. Re: multicore trigger Hi,  @EdwinHz  As shown in the figure below, I selected the CM7 image when building the bootable image and then parsed the container header. The container contains an entry for the CM7 image. However, after programming the image into flash and rebooting the device, the device fails to boot, and I am also unable to connect to it using the debugger. Could you please explain how the RT1180 Boot ROM processes the CM7 image in this configuration? If possible, could you please reproduce and verify this behavior on the FRDM-IMXRT1186 development board? yanyanwang_1-1787018660982.pngyanyanwang_1-1787018660982.png
View full article
I2S DMA PARAの定義方法 こんにちは、NXPチームの皆様、 #DEMO_I2S_TX_INSTANCE_INDEX ( 7U )を定義します #DEMO_DMA_INSTANCE_INDEX ( 0U )を定義します #DEMO_I2S_TX_CHANNEL を定義する( 19 ) #DEMO_I2S_MASTER_CLOCK_FREQUENCY ( 24576000 )を定義します   上記の定義では、DMA を使用して I2S TX (I2S7) を送信します。ここで、I2S DMA 受信に I2S6 を使用したいと思います。これらの値をどのように設定すればよいでしょうか? これらの設定は DMA 転送 I2S TX (I2S7) を使用することですが、私たちは I2S6 を使用して i2s dma rx を使用する予定です。この値をどのように構成しますか? #DEMO_I2S_RX_INSTANCE_INDEXを定義します( ???? ) #DEMO_RX_DMA_INSTANCE_INDEXを定義します( ???? ) #DEMO_I2S_RX_CHANNELを定義します( ???? )   よろしくお願いします。 ハリー Re: HOW TO DEFINE I2S DMA PARA こんにちは@harry3 どのチップを使っているか教えていただけますか? BR ハリー Re: HOW TO DEFINE I2S DMA PARA チップのリファレンス・マニュアル/DMAのMuxリクエストソーステーブルでI2S6 RX / SAI6 RX(多くの場合はシーケンシャルまたはTXチャネルからオフセット)を確認してください。
View full article
如何定义 i2s dma 段落 您好,NXP团队: #define demo_i2s_tx_instance_index (7U) #define demo_dma_instance_index (0U) #define demo_i2s_tx_channel (19) #define demo_i2s_master_clock_frequency(24576000)   上述定义使用 DMA 传输 I2S TX (I2S7)。现在我想使用 I2S6 进行 I2S DMA 接收。我应该如何配置这些值? 上面这些定义是使用 DMA 传输 I2S TX (I2S7), 我现在要使用 I2S6 做 I2S DMA RX。改如何配置这几个值呢? #define demo_i2s_rx_instance_index (????) #define demo_rx_dma_instance_index (????) #define demo_i2s_rx_channel (????)   谢谢! 哈利 Re: HOW TO DEFINE I2S DMA PARA 你好@harry3 请问您使用的是哪种芯片? BR 哈利 Re: HOW TO DEFINE I2S DMA PARA 查看芯片的参考手册/DMA Mux 请求源表,了解 I2S6 RX/SAI6 RX(通常是顺序的或与 TX 通道偏移的)。
View full article
S32K358:アプリケーションを直接フラッシュした際、電源オンリセット後にCore 0およびCore 2が実行されません  S32K358デュアルコアアプリケーション(Core 0およびCore 2)に問題が発生しています 電源オン時のリセット時に。  Core 0およびCore 2のアプリケーションコードを直接フラッシュすると、アプリケーションは正常に実行され、すべての機能が期待通りに動作します。 しかし、 電源オンリセット(POR) を実行した後、制御は コア0に到達しますが、アプリケーションは期待通りに実行できず、コア2は実行されていません。 この問題は、ブートローダーなしでアプリケーションを直接起動した場合、POR後に一貫して再現可能です。 対照的に、 アプリケーションがブートローダー経由で起動 されると、Core 0とCore 2の両方が正しく実行され続け、その後のPOR後も同様に動作します。 したがって、この問題は POR後の直接アプリケーション起動 特定のものであり、ブートローダーを通じてアプリケーションを入力する際には観察されません。 Re: S32K358: Core 0 and Core 2 Fail to Execute After Power-On Reset When Application Is Flashed Dire こんにちは、@ Julián_AragónM さん、 現在、s32k358カスタムボードを使用していますが、POR後に制御がcore0に渡るものの、そこで停止してしまいます。これはアプリケーションを直接フラッシュしたときに起こります。 コア0からコア2を有効化します。 直接フラッシュ書き込みを行う際、CM7_0_VTOR_ADDRとCM7_2_VTOR_ADDRの両方が正しく設定されていますか?- はい、初めてアプリケーションをフラッシュしたときは両方のコアは動作しますが、問題はPORの後だけです。 あなたのリファレンスプロジェクトと比較したところ、System.cで唯一の違いが見られますファイル /* サイズ:リンカーシンボルからの情報インポート、タイプ:ノーマル、インナーキャッシュポリシー:インナーライトバック、書き込み・読み込み割り当て、アウトドアキャッシュポリシー:アウトライトバック、書き込み・読み込み割り当て、共有可能:いいえ、特権アクセス:RW、非特権アクセス:RW */  #if (defined(S32K396) || defined(S32K394)) & defined(MULTIPLE_IMAGE) rasr[6]=((uint32)0x030B0001UL)|(((uint32)__RAM_CACHEABLE_SIZE - 1) << 1); #else /* サブリージョン7と8*を無効にしてください rasr[6]=((uint32)0x030B0001UL)|(((uint32)__RAM_CACHEABLE_SIZE - 1) << 1)|(1<<15)|(1<<14); #endif Re: S32K358: Core 0 and Core 2 Fail to Execute After Power-On Reset When Application Is Flashed Dire こんにちは、 @Indhumathi さん。 これはNXPのEVB S32K358ですか?それともカスタムデザインですか? この問題についてもう少し情報を教えていただけますか?「期待通りにアプリケーションを実行しない」とはどういう意味ですか?MCUがリセットされているのか、それともSWのどこかで閉じ込められているのでしょうか? 直接フラッシュ書き込みを行う際、CM7_0_VTOR_ADDRとCM7_2_VTOR_ADDRの両方が正しく設定されていますか? 起動時のIVTマーカー(CM7_2_ENABLE=1)でCM7_2を有効にしていますか?それともSW(MCU/電源ドライバー)で有効化していますか? コア0からコア2を始めるシンプルなマルチコアプロジェクトがあります。リファレンスとして使って設定を点検・比較できるかもしれません。S32K358マルチコアはCM7_0からCM7_2を開始します。 よろしくお願いします、 ジュリアン Re: S32K358: Core 0 and Core 2 Fail to Execute After Power-On Reset When Application Is Flashed Dire こんにちは、 @Julián_AragónM さん、 POR後もコア0は動作していますが、コア2に切り替わりません。 問題解決のためにサポートしていただけませんか?
View full article
S32K344 FlexIO I2C DMA こんにちは、 S32K344のFlexIO I2C DMAに関していくつか質問がありますので、ご意見をいただければ幸いです。 1. FlexIOを使用してI2Cをエミュレートする場合、Txの長さは次のように設定されます。 サイズ+1 。これは 「送信シフターは、SCLピンの最後の立ち下がりエッジで追加のワードを1つロードします」 ? 1.png1.png 2.png2.png 2. DMAを使用してデータを送信する場合、 メジャーループ数 また、 サイズ + 1。これは同じ理由ですか? DMA を使用する場合、送信されるすべてのデータは Master->TxDataを呼び出すとき Flexio_I2c_Ip_MasterSendData 、 送信バッファ 長さは サイズ + 1 、最後のバイトは 0xFF または 0x00 ? 3.png3.png 3. データを受信するには、 メジャーループ数 設定されています サイズ – 1。なぜでしょうか? 4. S32K344でこれをテストしたところ、FlexIO I2CでDMAを使用してデータを受信すると、受信データが予想より1バイト少ないことがわかりました。オシロスコープで観測すると、最後のバイトのクロック信号には、わずか5~6ビット程度の波形しか見られない。S32K312での同じテストは問題なく動作します。 S32K344 S32DS3.6.4 RTD700   BR、 ジェイソン Re: S32K344 FlexIO I2C DMA こんにちは、 @Jason07さん FlexIOは専用のI2Cペリフェラルではないため、その実装にはI2Cバスシーケンスを正しく完成させるための追加の内部手順が必要です。 伝送における「サイズ + 1U」は、FlexIOがI2Cフレームシーケンスを完了するために必要な最終的なシフター負荷に関連しています。この追加転送は、追加のペイロードバイトを表すものではありません。その代わりに、FlexIOハードウェア内部で最終的なクロックパルスを生成し、バスを正しく転送終了状態に移行させるために使用されます。 受信時のサイズ指定(-1U)が必要なのは、最後に受信したバイトが個別に処理されるためです。これにより、運転者は必要なNACKおよびSTOP条件を適切なタイミングで生成できます。 また、DMA転送モードを使用する場合、データ転送はキャッシュの一貫性の問題によって影響を受ける可能性があることを考慮してください。Dキャッシュが有効になっている場合に発生する可能性のある問題を回避するため、DMA TCDの送信元および送信先として使用されるバッファは、キャッシュ不可能なメモリ領域に割り当てられていることを確認してください。 Flexio_I2c_Ip_MasterReceiveData() 関数を呼び出す際に、TRANSFER_SIZE パラメータを増やす必要はありません。ドライバーは受信シーケンスの必要な内部調整をすでに処理しています。 最後に、あなたの設定を確認していると、両方のDMAチャネルに同じDMA割り込みコールバックが割り当てられていることに気づきました。Flexio_I2c_Ip.cに記載されている説明によると、送信と受信には異なるコールバック関数を使用する必要があります。 FlexIOチャンネル0/1 TX用のFlexIO_I2c_Ip_DmaTransferCompleteNotificationShifter0() FlexIOチャンネル0/1 RX用のFlexIO_I2c_Ip_DmaTransferCompleteNotificationShifter1() BR、VaneB
View full article
S32K358: Core 0 and Core 2 Fail to Execute After Power-On Reset When Application Is Flashed Directly We are observing an issue with the S32K358 dual-core application (Core 0 and Core 2) during power-on reset. When the Core 0 and Core 2 application code is flashed directly, the application executes successfully, and all functionalities operate as expected. However, after performing a Power-On Reset (POR), control comes to Core 0 but fail to execute the application as expected and core 2 not even executed. The issue is consistently reproducible following a POR when the application is started directly without the bootloader. In contrast, when the application is launched through the bootloader, both Core 0 and Core 2 continue to execute correctly, including after subsequent PORs. The issue is therefore specific to the direct application startup after POR and is not observed when the application is entered through the bootloader. Re: S32K358: Core 0 and Core 2 Fail to Execute After Power-On Reset When Application Is Flashed Dire Hello @Julián_AragónM, Currently i am working with s32k358 custom board, After POR control is coming to core0 but it got stuck. This is happening when we flash application directly.   Enabling the core 2 from core 0. Are both CM7_0_VTOR_ADDR & CM7_2_VTOR_ADDR correctly configured when flashing directly?    -  Yes, because first time flashing the application both core works but the issue is only after POR. I compared with your reference project only difference i can see in system.c file /* Size: import information from linker symbol, Type: Normal, Inner Cache Policy: Inner write-back, write and read allocate, Outer Cache Policy: Outer write-back, write and read allocate, Shareable: No, Privileged Access:RW, Unprivileged Access:RW */  #if (defined(S32K396) || defined(S32K394)) && defined(MULTIPLE_IMAGE)  rasr[6]=((uint32)0x030B0001UL)|(((uint32)__RAM_CACHEABLE_SIZE - 1) << 1);  #else /* Disable subregion 7 & 8*/ rasr[6]=((uint32)0x030B0001UL)|(((uint32)__RAM_CACHEABLE_SIZE - 1) << 1)|(1<<15)|(1<<14);  #endif Re: S32K358: Core 0 and Core 2 Fail to Execute After Power-On Reset When Application Is Flashed Dire Hello @Indhumathi, Is this S32K358 NXP EVB, or is this a custom design? Could you share a bit more information regarding this issue? What does "fail to execute the application as expected" mean? Is the MCU resetting, or maybe stuck in SW somewhere?  Are both CM7_0_VTOR_ADDR & CM7_2_VTOR_ADDR correctly configured when flashing directly?  Are you enabling CM7_2 through startup IVT marker (CM7_2_ENABLE = 1) or through SW (Mcu/Power driver)? There is a simple multicore project, which starts core 2 from core 0, maybe you can use it as reference and inspect/compare configuration? S32K358 Multicore Start CM7_2 from CM7_0. Best regards, Julián Re: S32K358: Core 0 and Core 2 Fail to Execute After Power-On Reset When Application Is Flashed Dire Hello @Julián_AragónM, Core 0 is working even after POR, but it's not jumping to core 2. Could you please support us to fix the issue.
View full article
マルチコアトリガー multicore_triggerとcm7_helloworldという2つのデモを使用した際、CM7 ITCMのECCは有効にしませんでした。私はSPTツールを使用して、メモリから実行することを目的としたCM33イメージとCM7イメージを1つのイメージに統合し、その後、統合したイメージをUART経由でNORフラッシュに書き込みました。しかし、起動プロセスが失敗しました。マニュアルによると、コンテナには最大8つのOEM画像エントリーを含めることができます。今回のテストでは、CM33画像とCM7画像の2枚のみを使用しました。CM7 ITCM ECCは有効になっていませんでした。 CM33イメージもCM7イメージも起動しなかった。しかし、コンテナヘッダーを確認したところ、CM33イメージしか存在しないことがわかりました。CM33イメージ自体は単独で使っても問題なく正常に起動できます。 CM7イメージが想定どおりに含まれなかった、あるいは処理されなかった理由、そしてCM7 ITCM ECC構成の欠如がブートROMによるCM7イメージの処理方法に影響を与えるかどうかを理解したいと考えています。 質問2: 8つのCM7イメージと1つのCM33イメージを1つのコンテナに統合した場合、ブートROMは起動プロセス中にどのような動作をしますか? CM7コアは1つしかないのに、ブートROMはどのCM7イメージを起動するかをどのように判断するのでしょうか?もし8枚の画像エントリすべてがCM7の画像なら、Boot ROMは8枚すべての画像を読み込むのか、1枚だけを選択するのか、それとも選択はCM33アプリケーションに任せるのか? Boot ROMは、同じコンテナ内の複数のCM7イメージエントリをどのように識別し、処理するのですか?どのCM7イメージを実行するかを決定するために使用される優先順位、イメージインデックス、コアID、ロードアドレス、エントリポイント、またはその他のメカニズムはありますか? また、CM7 ITCM ECCが有効になっている場合と無効になっている場合における、ブートROMの正確な動作についても理解しておきたい。 CM7 ITCM ECCが有効になっている場合、ブートROMはCM7 ITCM ECCメモリを初期化し、NORフラッシュからCM7イメージをCM7 ITCMにコピーし、その後CM7をリセット状態から解放するのでしょうか?それとも、Boot ROMはCM7イメージだけを読み込み、CM33アプリケーションはCM7のリセット解除と起動を担当しているのでしょうか? CM7 ITCM ECCが有効になっていない場合、ブートROMは、ロードアドレスがCM7 ITCM内にあるCM7イメージを検出したときにどのような動作をしますか?Boot ROMはCM7イメージをスキップしたり、ロードに失敗したり、CM7をリセット状態にしたり、コンテナのブートプロセス全体を失敗させたりしますか? 特に、以下のコンテナがサポートされているかどうかを確認したいです。 画像0:CM33 画像1:CM7 画像2:CM7 画像3:CM7 画像4:CM7 画像5:CM7 画像6:CM7 画像7:CM7 画像8:CM7 もしサポートされている場合、ブートROM起動時にこれら8つのCM7イメージは具体的にどのように処理されるのでしょうか?また、実際に実行されるCM7イメージを選択する役割を担うコンポーネントはどれでしょうか? 最後に、最大8つのOEMイメージエントリがコンテナに8つの異なるイメージを保存できるのか、それともBoot ROMが特定のコアに対して特定のイメージを選択して起動する仕組みを提供しているのかを明確にしたいと思います。 Re: multicore trigger こんにちは@yanyanwangさん コンテナヘッダーにCM33イメージしか表示されていなかった場合、ブートROM/ELEには処理すべきCM7エントリが存在しなかったことになり、それが現在発生している現象の原因である可能性があります。 また、コンテナの順序も重要であることに留意する必要があります。RMが述べているように、「OEMコンテナは最大8枚の画像を収録できます。Cortex-M33コア(起動コア)イメージは他のイメージの後に位置しなければなりません。」 つまり、CM33を1枚撮影した後にCM7を8枚撮影するという、あなたが言及したような構成は不可能です。CM7画像の数を1つ減らし、順序を反転させる必要があります。 複数のイメージが存在する場合、ELEはそれぞれのハッシュを検証し、いずれか1つでも検証に失敗した場合、デバイスはリセットループに入ります。 この仕組みは配列プロセッシングを用いており、各画像は順番に読み込まれ、それぞれを識別するためのフラグが付けられていました。 BR、 エドウィン。 Re: multicore trigger こんにちは、 @EdwinHz 下の図に示すように、起動可能なイメージを構築する際にCM7イメージを選択し、コンテナヘッダーを解析しました。コンテナにはCM7イメージのエントリが含まれています。 しかし、イメージをフラッシュメモリに書き込み、デバイスを再起動した後、デバイスが起動せず、デバッガーを使用して接続することもできません。 RT1180ブートROMがこの構成でCM7イメージをどのように処理しているのか説明していただけますか? 可能であれば、この動作をFRDM-IMXRT1186開発ボード上で再現し、検証していただけますか? yanyanwang_1-1787018660982.pngyanyanwang_1-1787018660982.png
View full article
i.mx8M Plus の wm8962 エラー NXP i.MX 8M Plus(i.MX8MP)プロセッサとWolfson WM8962オーディオコーデックをベースにカスタムボードを設計しています。現在、このドライバーをLinuxカーネル5.4に移植中です。以下に、エラーログとDTS(デバイスツリーソース)の設定を示します。 ログ: [ 2.097680] imx-wm8962 sound-wm8962: 2111111111111111111111111 [ 2.103533] imx-wm8962 sound-wm8962: 22222222222222222222222222 [ 2.109467] imx-wm8962 sound-wm8962: 333333333333333333 [ 2.114705] imx-wm8962 sound-wm8962: 888888888888888888 [ 2.119953] imx-wm8962 sound-wm8962: failed to find codec platform device [ 2.126759] imx-wm8962: probe of sound-wm8962 failed with error -22 [ 2.995796] wm8962 2-001a: afrrgrgtrggggggggggggggggggg [ 3.001038] wm8962 2-001a: bbbbbbbbbbbbbbbbbbbbbbbbb [ 3.008259] random: fast init done [ 3.011807] wm8962 2-001a: customer id 0 revision F​ DTS:   sound-wm8960-forenex { compatible = "fsl,imx-audio-wm8962"; model = "wm8962-audio"; audio-codec = <&codec>; audio-cpu = <&sai3>; audio-routing = "Headphone Jack", "HPOUTL", "Headphone Jack", "HPOUTR", "Ext Spk", "SPKOUTL", "Ext Spk", "SPKOUTR", "AMIC", "MICBIAS", "IN3R", "AMIC", "IN1R", "AMIC"; }; &i2c3 { clock-frequency = <100000>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c3>; status = "okay"; pca6416: gpio@20 { compatible = "ti,tca6416"; reg = <0x20>; gpio-controller; #gpio-cells = <2>; }; ov5640_1: ov5640_mipi@3c { compatible = "ovti,ov5640"; reg = <0x3c>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_csi0_pwn>, <&pinctrl_csi0_rst>, <&pinctrl_csi_mclk>; clocks = <&clk IMX8MP_CLK_IPP_DO_CLKO2>; clock-names = "xclk"; assigned-clocks = <&clk IMX8MP_CLK_IPP_DO_CLKO2>; assigned-clock-parents = <&clk IMX8MP_CLK_24M>; assigned-clock-rates = <24000000>; csi_id = <0>; powerdown-gpios = <&gpio4 1 GPIO_ACTIVE_HIGH>; reset-gpios = <&gpio4 0 GPIO_ACTIVE_LOW>; mclk = <24000000>; mclk_source = <0>; mipi_csi; status = "disabled"; port { ov5640_mipi_1_ep: endpoint { remote-endpoint = <&mipi_csi1_ep>; data-lanes = <1 2>; clock-lanes = <0>; }; }; }; codec: wm8962@1a { compatible = "wlf,wm8962"; reg = <0x1a>; clocks = <&audiomix_clk IMX8MP_CLK_AUDIOMIX_SAI3_MCLK1>; clock-names = "mclk"; wlf,shared-lrclk; AVDD-supply = <&reg_audio_pwr>; CPVDD-supply = <&reg_audio_pwr>; DBVDD-supply = <&reg_audio_pwr>; DCVDD-supply = <&reg_audio_pwr>; MICVDD-supply = <&reg_audio_pwr>; PLLVDD-supply = <&reg_audio_pwr>; SPKVDD1-supply = <&reg_audio_pwr>; SPKVDD2-supply = <&reg_audio_pwr>; gpio-cfg = < 0x0000 /* 0:Default */ 0x0000 /* 1:Default */ 0x0000 /* 2:FN_DMICCLK */ 0x0000 /* 3:Default */ 0x0000 /* 4:FN_DMICCDAT */ 0x0000 /* 5:Default */ >; }; };​ 私たちの分析によれば、カーネルがimx-wm8962マシンドライバの初期化を試みる際、I2Cバス上のWM8962コーデックはまだプローブ/登録を完了していません。WM8962はその後になってようやく初期化を完了する。このプローブの順序不一致により、ドライバーの初期化がエラーで失敗します。 この問題を分析し、この行動を解決するための解決策を提案していただけませんか? IMX8MPLUSオーディオソフトウェア_NXP_MICR Android Linux Re: wm8962 on i.mx8M Plus error コーデックやSAIプラットフォームデバイスが準備できない場合は-EPROBE_DEFER返します imx-wm8962.c でプローブパス、以下を区別する: DT phandle が欠落/無効です → 実際のエラー、-EINVAL を返します。 phandle は存在しますが、参照されているデバイスがまだ登録されていません → 依存関係が準備できていないため、-EPROBE_DEFER を返します。 例えば、概念的には: codec_np = of_parse_phandle(np、「オーディオコーデック」、0); if (!codec_np) { dev_err(&pdev->dev、「オーディオ-codec missing またはinvalid\n」);         -EINVAL を返します。 } codec_dev = of_find_i2c_device_by_node(codec_np); if (!codec_dev) { dev_info(&pdev->dev, "codec device not ready, defer probe\n"); of_node_put(codec_np);         return -EPROBE_DEFER; } CPU DAI / SAIノードについても同様です。 cpu_np = of_parse_phandle(np、「audio-cpu」、0); if (!cpu_np) { dev_err(&pdev->dev、「audio-cpu missing or invalid\n」);         -EINVAL を返します。 } cpu_pdev = of_find_device_by_node(cpu_np); if (!cpu_pdev) { dev_info(&pdev->dev、「SAIプラットフォームデバイスは準備完了、プローブを延期\n」); of_node_put(cpu_np);         return -EPROBE_DEFER; } 現在のマシンドライバーを使い続けるなら、これが最も直接的な解決策です。 可能であればLinux 5.4のFSL-asoc-cardパスを推奨します Linux 5.4時代のNXPカーネルでは、互換=「fsl,imx-audio-wm8962」はsound/soc/fsl/fsl-asoc-card.cによって処理され、コーデックDAI名「wm8962」やWM8962クロック/FLL IDを含む明示的なWM8962処理が行われます。また、snd-soc-fsl-asoc-card.ko がロードされているか、組み込まれていることを確認してください。 つまり、レガシー/カスタムのimx-wm8962マシンドライバーとFSL-ASOC-cardの両方が同じ互換文字列をバインドしようとするのは避けるべきです。推奨されるアプローチ: CONFIG_SND_SOC_FSL_ASOC_CARD を有効化/使用する; サウンドノードがCompatible = "FSL,IMX-オーディオ-WM8962"; 意図的に維持する場合を除き、その互換性のある文字列のレガシー/カスタム imx-wm8962 バインディングを削除または無効にします。 DTSに必要なSAIとコーデックDAIプロパティが備わっていることを確認してください。 コーデックノードは概ね想定どおりの形状です。WM8962 の例では compatible = "wlf,wm8962"、reg =<0x1a> �、clocks、supply properties、gpio-cfg を使用します。ただし、DTSに表示されていない部品を確認してください。 &sai3 {      #sound-dai-cells = <0>;         pinctrl-names = "default";      pinctrl-0 = <&pinctrl_sai3>;         assignment-clocks = <&clk IMX8MP_CLK_SAI3>;         assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>; assignment-clock-rates = <12288000>; /* またはボード指定のMCLK */ status = "オーケー"; }; また、コーデックは通常、以下の情報も公開する必要があります。 コーデック: wm8962@1a { 互換性 = "wlf,wm8962";      reg = <0x1a>;      #sound-dai-cells = <0>;      clocks = <&audiomix_clk IMX8MP_CLK_AUDIOMIX_SAI3_MCLK1>;      clock-names = "mclk";      ... }; また、reg_audio_pwr で参照されるレギュレータが定義され、有効になっており、有効な電圧範囲を持っていることを確認してください。コーデックが検出されているので、電源がこの特定のエラーの原因ではない可能性が高いですが、電源の不具合やMCLKの設定不良が後のオーディオ故障の原因になることがあります。 MCLKイネーブルメントの検証 WM8962のブリングアップ問題の中には、オーディオマシンドライバでコーデックMCLKを有効にする必要があることが知られています。imx_wm8962_probe()にclk_prepare_enable(codec_clk)を加えると、WM8962の音声が動作すると報告されています。コーデックのプローブが成功したにもかかわらず、その後の再生/キャプチャが失敗する場合は、コーデックの初期化時およびストリームの起動時に、SAI3 MCLKが実際にコーデックピンに存在していることを確認してください。 サウンドカードのノードに重複や競合がないか確認してください。 このコーデック/SAIペアをターゲットにしているアクティブなサウンドノードは1つだけ、モデル文字列が一意であることを確認しましょう。コーデックプラットフォームデバイスの見つかりに失敗した類似の失敗は、NXPコミュニティデバッグにおけるサウンドカード命名や重複カードの競合に関連していました。ノード名はsound-wm8960-forenexと表示されていますが、対応モデルはWM8962です。ノード名自体は通常機能しませんが、明確にするために名前を変更し、他に2つ目のSound-WM8962ノードがないか確認したほうがいいでしょう。 推奨される最小パス 可能であればLinux 5.4用にFSL-asoc-cardを使いましょう。 WM8962 ノードに #sound-dai-cells = <0> が追加されている場合は、追加してください。 &sai3 が有効になっており、clocks/pinctrl が設定されていることを確認してください。 カスタムのimx-wm8962ドライバーを維持する場合は、失敗したコーデックやCPUの検索パスを-EINVALではなく-EPROBE_DEFERにパッチしてください。 MCLKが有効になっており、存在していることを確認してください。
View full article
wm8962 on i.mx8M Plus error We are designing our custom board based on the NXP i.MX 8M Plus (i.MX8MP) processor with the Wolfson WM8962 audio codec. We are currently porting the driver to the Linux kernel 5.4. Below are the error logs and our DTS (Device Tree Source) configuration. LOG: [ 2.097680] imx-wm8962 sound-wm8962: 2111111111111111111111111 [ 2.103533] imx-wm8962 sound-wm8962: 22222222222222222222222222 [ 2.109467] imx-wm8962 sound-wm8962: 333333333333333333 [ 2.114705] imx-wm8962 sound-wm8962: 888888888888888888 [ 2.119953] imx-wm8962 sound-wm8962: failed to find codec platform device [ 2.126759] imx-wm8962: probe of sound-wm8962 failed with error -22 [ 2.995796] wm8962 2-001a: afrrgrgtrggggggggggggggggggg [ 3.001038] wm8962 2-001a: bbbbbbbbbbbbbbbbbbbbbbbbb [ 3.008259] random: fast init done [ 3.011807] wm8962 2-001a: customer id 0 revision F​ DTS:   sound-wm8960-forenex { compatible = "fsl,imx-audio-wm8962"; model = "wm8962-audio"; audio-codec = <&codec>; audio-cpu = <&sai3>; audio-routing = "Headphone Jack", "HPOUTL", "Headphone Jack", "HPOUTR", "Ext Spk", "SPKOUTL", "Ext Spk", "SPKOUTR", "AMIC", "MICBIAS", "IN3R", "AMIC", "IN1R", "AMIC"; }; &i2c3 { clock-frequency = <100000>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c3>; status = "okay"; pca6416: gpio@20 { compatible = "ti,tca6416"; reg = <0x20>; gpio-controller; #gpio-cells = <2>; }; ov5640_1: ov5640_mipi@3c { compatible = "ovti,ov5640"; reg = <0x3c>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_csi0_pwn>, <&pinctrl_csi0_rst>, <&pinctrl_csi_mclk>; clocks = <&clk IMX8MP_CLK_IPP_DO_CLKO2>; clock-names = "xclk"; assigned-clocks = <&clk IMX8MP_CLK_IPP_DO_CLKO2>; assigned-clock-parents = <&clk IMX8MP_CLK_24M>; assigned-clock-rates = <24000000>; csi_id = <0>; powerdown-gpios = <&gpio4 1 GPIO_ACTIVE_HIGH>; reset-gpios = <&gpio4 0 GPIO_ACTIVE_LOW>; mclk = <24000000>; mclk_source = <0>; mipi_csi; status = "disabled"; port { ov5640_mipi_1_ep: endpoint { remote-endpoint = <&mipi_csi1_ep>; data-lanes = <1 2>; clock-lanes = <0>; }; }; }; codec: wm8962@1a { compatible = "wlf,wm8962"; reg = <0x1a>; clocks = <&audiomix_clk IMX8MP_CLK_AUDIOMIX_SAI3_MCLK1>; clock-names = "mclk"; wlf,shared-lrclk; AVDD-supply = <&reg_audio_pwr>; CPVDD-supply = <&reg_audio_pwr>; DBVDD-supply = <&reg_audio_pwr>; DCVDD-supply = <&reg_audio_pwr>; MICVDD-supply = <&reg_audio_pwr>; PLLVDD-supply = <&reg_audio_pwr>; SPKVDD1-supply = <&reg_audio_pwr>; SPKVDD2-supply = <&reg_audio_pwr>; gpio-cfg = < 0x0000 /* 0:Default */ 0x0000 /* 1:Default */ 0x0000 /* 2:FN_DMICCLK */ 0x0000 /* 3:Default */ 0x0000 /* 4:FN_DMICCDAT */ 0x0000 /* 5:Default */ >; }; };​ Based on our analysis, when the kernel attempts to initialize the imx-wm8962 machine driver, the WM8962 codec on the I2C bus has not yet completed its probing/registration. The WM8962 only finishes its initialization afterward. This probe ordering discrepancy causes the driver initialization to fail with an error. Could you please help analyze this issue and suggest solutions to resolve this behavior? IMX8MPLUS AUDIO_SOFTWARE_NXP_MICR  Android Linux Re: wm8962 on i.mx8M Plus error Return -EPROBE_DEFER when the codec or SAI platform device is not ready In your imx-wm8962.c probe path, distinguish between: missing/invalid DT phandle → real error, return -EINVAL ; phandle exists, but referenced device is not registered yet → dependency not ready, return -EPROBE_DEFER . For example, conceptually: codec_np = of_parse_phandle(np, "audio-codec", 0); if (!codec_np) {         dev_err(&pdev->dev, "audio-codec missing or invalid\n");         return -EINVAL; } codec_dev = of_find_i2c_device_by_node(codec_np); if (!codec_dev) {         dev_info(&pdev->dev, "codec device not ready, defer probe\n");         of_node_put(codec_np);         return -EPROBE_DEFER; } Similarly for the CPU DAI / SAI node: cpu_np = of_parse_phandle(np, "audio-cpu", 0); if (!cpu_np) {         dev_err(&pdev->dev, "audio-cpu missing or invalid\n");         return -EINVAL; } cpu_pdev = of_find_device_by_node(cpu_np); if (!cpu_pdev) {         dev_info(&pdev->dev, "SAI platform device not ready, defer probe\n");         of_node_put(cpu_np);         return -EPROBE_DEFER; } This is the most direct fix if you keep your current machine driver. Prefer the Linux 5.4 fsl-asoc-card path if available For Linux 5.4-era NXP kernels, compatible = "fsl,imx-audio-wm8962" is handled by sound/soc/fsl/fsl-asoc-card.c , which has explicit WM8962 handling, including codec DAI name "wm8962" and WM8962 clock/FLL IDs . Also verify that snd-soc-fsl-asoc-card.ko is loaded or built in . That means you should avoid having both a legacy/custom imx-wm8962 machine driver and fsl-asoc-card trying to bind the same compatible string. Recommended approach: enable/use CONFIG_SND_SOC_FSL_ASOC_CARD ; ensure your sound node uses compatible = "fsl,imx-audio-wm8962"; ; remove or disable the legacy/custom imx-wm8962 binding for that compatible string, unless you intentionally maintain it. Make sure the DTS has the required SAI and codec DAI properties Your codec node is broadly in the expected shape: examples for WM8962 use compatible = "wlf,wm8962" , reg = <0x1a> , clocks , supply properties, and gpio-cfg . However, confirm the parts not shown in your DTS: &sai3 {         #sound-dai-cells = <0>;         pinctrl-names = "default";         pinctrl-0 = <&pinctrl_sai3>;         assigned-clocks = <&clk IMX8MP_CLK_SAI3>;         assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>;         assigned-clock-rates = <12288000>; /* or board-required MCLK */         status = "okay"; }; And the codec should also normally expose: codec: wm8962@1a {         compatible = "wlf,wm8962";         reg = <0x1a>;         #sound-dai-cells = <0>;         clocks = <&audiomix_clk IMX8MP_CLK_AUDIOMIX_SAI3_MCLK1>;         clock-names = "mclk";         ... }; Also ensure the regulator referenced by reg_audio_pwr is defined, enabled, and has a valid voltage range. Your codec is being detected, so the supplies are probably not the cause of this specific error, but bad supply or MCLK setup can cause later audio failures. Verify MCLK enablement There is a known class of WM8962 bring-up issues where enabling the codec MCLK in the audio machine driver was required; adding clk_prepare_enable(codec_clk) in imx_wm8962_probe() was reported to make WM8962 audio work . If your codec probe succeeds but playback/capture later fails, check that SAI3 MCLK is actually present at the codec pin during codec initialization and stream startup. Check for duplicate or conflicting sound-card nodes Make sure only one active sound node targets this codec/SAI pair and that the model string is unique. A similar failure involving failed to find codec platform device was also associated with sound-card naming / duplicate-card conflicts in NXP community debugging . Your node name says sound-wm8960-forenex while the compatible/model are WM8962; the node name itself is not normally functional, but I would rename it for clarity and verify there is no second enabled sound-wm8962 node elsewhere. Recommended minimal path Use fsl-asoc-card for Linux 5.4 if possible. Add #sound-dai-cells = <0>; to the WM8962 node if missing. Confirm &sai3 is enabled and has clocks/pinctrl configured. If keeping your custom imx-wm8962 driver, patch the failed codec/CPU lookup paths to return -EPROBE_DEFER instead of -EINVAL . Confirm MCLK is enabled and present.
View full article
FRDM-IMX95でWi-Fi接続を自動で行うスクリプトの書き方 (日本語ブログ) ​ 1. はじめに FRDM-IMX95のようなボードで開発を進めていると、起動後に毎回手作業でWi-Fiに接続するのが煩わしくなってきます。そこで、モジュールのロードからDHCPによるIPアドレス取得までを一気に行うシェルスクリプト connect_wifi.sh を用意すると便利です。 一見単純なタスクですが、組み込みLinux環境(特にNXPの *moal ドライバや、機能を絞った wpa_supplicant ビルド)では、デスクトップLinuxでは遭遇しないいくつかの落とし穴があります。ここでは、実際に動作するスクリプト(connect_wifi.sh)を1行ずつ解説しながら、それぞれの処理がなぜ必要なのかを説明します。 対象は、i.MX 8M / i.MX 93 / i.MX 95 などNXP SoC上でYoctoベースのLinuxを扱う開発者を想定しています。 *MOAL(MAC OS/A-kernel/OS-adaptor Layer)ドライバとは?  主にNXP Semiconductors(旧Marvell)製の無線LAN(Wi-Fi)チップセットにおいて、LinuxやAndroidなどのOS上で動作するOS依存型のホストドライバモジュールです。   <目次> 1. はじめに 2.  完成版スクリプト (connect_wifi.sh) 3. 各ブロックの解説 3.1 前提チェック — 静かに失敗させない 3.2 認証情報の読み込み — クオートという落とし穴 3.3 ドライバのロードとインターフェース起動 3.4 PSKをPBKDF2で計算 — wpa_passphraseを使わない理由 3.5 wpa_supplicant.conf の生成 — ctrl_interfaceを忘れない 3.6 wpa_supplicant の起動 — 既存プロセスの掃除 3.7 接続完了のポーリング — 固定sleepにしない 3.8 DHCPでIPアドレス取得 3.9 DNS設定 4. スクリプトの実行 5. まとめ 6. 関連情報   ​ 2.  完成版スクリプト (connect_wifi.sh) まずconnect_wifi.shの全体像を示します。以降のセクションで各ブロックを順に解説します。 #!/bin/bash set -uo pipefail readonly CRED_FILE="/etc/wifi/wifi.conf" readonly WPA_CONF="/etc/wpa_supplicant.conf" readonly IFACE="mlan0" # --- 1. 前提チェック --- if [[ ${EUID} -ne 0 ]]; then     echo "[ERROR] root権限で実行してください" >&2     exit 1 fi if [[ ! -f "${CRED_FILE}" ]]; then     echo "[ERROR] 認証情報ファイルが見つかりません: ${CRED_FILE}" >&2     exit 1 fi # --- 2. 認証情報の読み込み --- SSID=$(grep -E '^SSID=' "${CRED_FILE}" | cut -d= -f2-) PASSWORD=$(grep -E '^PASSWORD=' "${CRED_FILE}" | cut -d= -f2-) # 前後のクオートを防御的に除去 SSID="${SSID%\"}"; SSID="${SSID#\"}" SSID="${SSID%\'}"; SSID="${SSID#\'}" PASSWORD="${PASSWORD%\"}"; PASSWORD="${PASSWORD#\"}" PASSWORD="${PASSWORD%\'}"; PASSWORD="${PASSWORD#\'}" if [[ -z "${SSID}" || -z "${PASSWORD}" ]]; then     echo "[ERROR] SSID または PASSWORD が読み取れません" >&2     exit 1 fi echo "[OK] 認証情報を読み込みました (SSID=${SSID})" # --- 3. ドライバのロードとインターフェース起動 --- modprobe moal mod_para=nxp/wifi_mod_para.conf echo "[OK] モジュールをロードしました" ip link set "${IFACE}" up 2>/dev/null echo "[OK] ${IFACE} をupにしました" # --- 4. PSKをPBKDF2で計算 --- PSK_HEX=$(python3 -c " import sys, hashlib, binascii ssid = sys.argv[1] passphrase = sys.stdin.readline().rstrip('\n') psk = hashlib.pbkdf2_hmac('sha1', passphrase.encode(), ssid.encode(), 4096, 32) print(binascii.hexlify(psk).decode()) " "${SSID}" <<< "${PASSWORD}") unset PASSWORD if [[ -z "${PSK_HEX}" ]]; then     echo "[ERROR] PSKの計算に失敗しました" >&2     exit 1 fi # --- 5. wpa_supplicant.conf の生成 --- cat > "${WPA_CONF}" <<EOF ctrl_interface=/var/run/wpa_supplicant ctrl_interface_group=0 network={     ssid="${SSID}"     psk=${PSK_HEX} } EOF chmod 600 "${WPA_CONF}" # --- 6. wpa_supplicant の起動 --- pkill -f "wpa_supplicant.*${IFACE}" 2>/dev/null sleep 1 wpa_supplicant -B -i "${IFACE}" -c "${WPA_CONF}" if [[ $? -ne 0 ]]; then     echo "[ERROR] wpa_supplicantの起動に失敗しました" >&2     exit 1 fi echo "[OK] wpa_supplicantを起動しました" # --- 7. 接続完了のポーリング --- connected=0 for i in $(seq 1 20); do     state=$(wpa_cli -i "${IFACE}" status 2>/dev/null | grep ^wpa_state | cut -d= -f2)     echo "  [${i}/20] wpa_state=${state:-unknown}"     if [[ "${state}" == "COMPLETED" ]]; then         connected=1         break     fi     sleep 1 done if [[ ${connected} -eq 0 ]]; then     echo "[ERROR] Wi-Fi認証に失敗しました(タイムアウト)" >&2     exit 1 fi echo "[OK] Wi-Fi認証に成功しました" # --- 8. DHCPでIPアドレス取得 --- udhcpc -i "${IFACE}" -n -t 5 -T 3 if [[ $? -ne 0 ]]; then     echo "[ERROR] DHCPによるIPアドレス取得に失敗しました" >&2     exit 1 fi echo "[OK] DHCPでIPアドレスを取得しました" # --- 9. DNS設定 --- if ! grep -q "nameserver 8.8.8.8" /etc/resolv.conf 2>/dev/null; then     echo "nameserver 8.8.8.8" >> /etc/resolv.conf fi echo "=== 接続完了 ===" ip addr show "${IFACE}" 認証情報は、スクリプト本体とは分離した /etc/wifi/wifi.conf に置きます。 root@frdm-imx95:~# mkdir -p /etc/wifi root@frdm-imx95:~# cat > /etc/wifi/wifi.conf <<'EOF' SSID=exampleSSID PASSWORD=examplePassword EOF 認証情報は他のユーザーからアクセスできないよう、権限を変更しておきます。 root@frdm-imx95:~# chmod 600 /etc/wifi/wifi.conf   ​ 3. 各ブロックの解説 ​ 3.1 前提チェック — 静かに失敗させない set -uo pipefail '-u'オプション は未定義変数の参照をエラーにし、'-o pipefail' はパイプ内のいずれかのコマンドが失敗した場合に終了コードへ反映します。 なお、あえて '-e'(エラーで即終了)は付けていません。ネットワーク系のコマンドは「失敗しても後続の診断を続けたい」ケースが多く、'-e' があると失敗した瞬間に何のメッセージも出さずにスクリプトが終わってしまうためです。代わりに、各コマンドの直後で '$?' を明示的にチェックし、どの段階で失敗したかを '[OK]' / '[ERROR]' のログとして残す方針にしています。 root権限チェックと認証情報ファイルの存在チェックも、後続処理が意味不明なエラーで落ちる前に、原因を明確にして早期終了させるためのものです。 ​ 3.2 認証情報の読み込み — クオートという落とし穴 SSID=$(grep -E '^SSID=' "${CRED_FILE}" | cut -d= -f2-) 認証情報ファイルから 'SSID=' で始まる行を取り出し、'=' 以降を値として抽出します。'cut -d= -f2-' の '-f2-'(2フィールド目以降すべて)がポイントで、これによりパスワードに '=' が含まれていても正しく取り出せます。 続く4行のクオート除去が、実は本スクリプトで最も重要な防御処理です。 SSID="${SSID%\"}"; SSID="${SSID#\"}" これはbashのパラメータ展開で、'${var%\"}' が末尾のダブルクオート、'${var#\"}' が先頭のダブルクオートを除去します。 なぜ必要かというと、認証情報ファイルにうっかり 'SSID="exampleSSID"' とクオート付きで書いてしまった場合、'cut' はクオートも含めて値として取り込みます。その状態で後段の 'wpa_supplicant.conf' 生成時に 'ssid="${SSID}"' とさらにクオートを付けると、 ssid=""exampleSSID"" という二重クオートになります。'wpa_supplicant' のパーサーは外側の1組しか想定していないため、内側のクオートまでSSIDの一部として解釈してしまい、スキャン結果に存在するはずのAPとマッチしません。結果として 'wpa_state' が 'SCANNING' から一切進まないという、原因の分かりにくい症状になります。 この防御処理を入れておけば、認証情報ファイルの記法がクオートあり・なしのどちらでも正しく動作します。 ​ 3.3 ドライバのロードとインターフェース起動 modprobe moal mod_para=nxp/wifi_mod_para.conf ip link set "${IFACE}" up 2>/dev/null NXPのWi-Fiは 'moal' カーネルモジュールで提供され、'mod_para' でファームウェアの動作パラメータファイルを指定します。ロード後にインターフェース(ここでは 'mlan0')を明示的にupしておきます。 ​ 3.4 PSKをPBKDF2で計算 — wpa_passphraseを使わない理由 通常、WPA2-PSKの設定生成には 'wpa_passphrase' コマンドを使います。しかし組み込み環境では2つの問題に直面しました。 パスワードの露出です。'wpa_passphrase SSID PASSWORD' のように引数で渡すと、実行中に 'ps' コマンドや '/proc/ /cmdline ' から平文パスワードが見えてしまいます。 標準入力経由での動作不良です。露出を避けるため 'wpa_passphrase "$SSID" <<< "$PASSWORD"' とヒアストリングで渡すと、環境によっては次のエラーが出て空のファイルが生成されました。 reading passphrase from stdin tcgetattr: Inappropriate ioctl for device これは 'wpa_passphrase' が端末のエコーを制御しようと 'tcgetattr()' を呼ぶものの、標準入力が実端末(TTY)ではないために失敗し、その後のパスフレーズ読み込みも中断されるためです。 そこで、WPA2-PSKの鍵導出仕様をそのままpython3で実装しました。 psk = hashlib.pbkdf2_hmac('sha1', passphrase.encode(), ssid.encode(), 4096, 32) WPA2-PSKのPSKは、仕様上 PBKDF2-HMAC-SHA1(パスフレーズ, SSID, 4096回, 256bit) という決まった計算で導出されます。これを直接計算することで、'wpa_passphrase' のTTY依存を完全に回避できます。パスワードは引数ではなく 'sys.stdin' から受け取るため 'ps' にも露出しません。 unset PASSWORD 計算が終わったら、平文パスワードを保持する変数は速やかに破棄します。 ​ 3.5 wpa_supplicant.conf の生成 — ctrl_interfaceを忘れない cat > "${WPA_CONF}" <<EOF ctrl_interface=/var/run/wpa_supplicant ctrl_interface_group=0 network={     ssid="${SSID}"     psk=${PSK_HEX} } EOF このブロックで見落としやすいのが冒頭の `ctrl_interface` の指定です。 'wpa_cli' は '/var/run/wpa_supplicant/<インターフェース名>' というUNIXドメインソケット経由で 'wpa_supplicant' と通信します。このソケットは 'ctrl_interface' を設定ファイルに書かないと生成されません。これを忘れると、後段のポーリング('wpa_cli status')が次のエラーで動かず、実際には接続に成功していても状態を取得できないため「失敗」と誤判定してしまいます。 Failed to connect to non-global ctrl_ifname: mlan0  error: No such file or directory また、'psk=' 行の値('PSK_HEX')は16進のハッシュ値なのでクオートを付けません。クオートを付けると平文パスフレーズとして再解釈されてしまうため注意が必要です。一方 'ssid=' は文字列なのでクオートで囲みます。 生成後は 'chmod 600' で他ユーザーから読めないようにします。 ​ 3.6 wpa_supplicant の起動 — 既存プロセスの掃除 pkill -f "wpa_supplicant.*${IFACE}" 2>/dev/null sleep 1 wpa_supplicant -B -i "${IFACE}" -c "${WPA_CONF}" 再実行時に古い 'wpa_supplicant' プロセスが残っていると、新しいプロセスとソケットが競合したり、古い設定のまま動き続けたりします。起動前に 'pkill' で確実に掃除しておきます。'-B' はバックグラウンド実行を指定するオプションです。 デバッグ時にログをファイルへ出したくなりますが、ビルドによっては '-B'(バックグラウンド)と '-f'(ログファイル)を併用できないことがあります('-f' 未サポートのビルドでは引数解析に失敗し、ヘルプが表示されて起動しません)。その場合は次のようにシェルのリダイレクトを使います。 wpa_supplicant -dd -i "${IFACE}" -c "${WPA_CONF}" > /var/log/wpa_supplicant.log 2>&1 &   ​ 3.7 接続完了のポーリング — 固定sleepにしない for i in $(seq 1 20); do     state=$(wpa_cli -i "${IFACE}" status 2>/dev/null | grep ^wpa_state | cut -d= -f2)     echo "  [${i}/20] wpa_state=${state:-unknown}"     if [[ "${state}" == "COMPLETED" ]]; then         connected=1         break     fi     sleep 1 done 電波状況によって認証完了までの時間は変動するため、固定待機は「まだ繋がっていないのに次へ進む」「無駄に待ちすぎる」のどちらかになりがちです。 代わりに 'wpa_cli status' の 'wpa_state' を1秒間隔でポーリングし、'COMPLETED' になった時点で先へ進みます。各ステップで状態を出力しているので、認証がどのフェーズで止まっているか('SCANNING' / 'ASSOCIATING' / '4WAY_HANDSHAKE' など)がリアルタイムに見えるのも利点です。 'wpa_state' の正常な遷移は次のとおりです。 DISCONNECTED → SCANNING → AUTHENTICATING → ASSOCIATING → ASSOCIATED → 4WAY_HANDSHAKE → GROUP_HANDSHAKE → COMPLETED どこで止まるかによって原因の切り分けができます。'SCANNING' から進まなければAPが見つかっていない(SSID誤り、電波、バンド設定など)、'4WAY_HANDSHAKE' で 'WRONG_KEY' が出れば鍵(パスワードまたはSSID)の不一致、といった具合です。   ​ 3.8 DHCPでIPアドレス取得 udhcpc -i "${IFACE}" -n -t 5 -T 3 BusyBoxの 'udhcpc' (Micro DHCP Client) でIPアドレスを取得します。 オプションは、 '-n'(リース取得失敗時に終了) '-t 5'(リクエスト再送を最大5回) '-T 3'(再送間隔3秒) です。これらを指定しないと、DHCPサーバに到達できない環境でスクリプトが無限に待ち続けてしまうため、必ず入れておきます。 ​ 3.9 DNS設定 if ! grep -q "nameserver 8.8.8.8" /etc/resolv.conf 2>/dev/null; then     echo "nameserver 8.8.8.8" >> /etc/resolv.conf fi '/etc/resolv.conf' にフォールバック用のDNSサーバを追記します。既に同じ行があれば重複追記しないよう 'grep' でチェックしています。 なお、DHCP取得したDNS情報をネットワーク管理系(udhcpcのデフォルトスクリプトやsystemd-resolvedなど)が '/etc/resolv.conf' に書き込む構成では、手動追記が上書きされることがあります。固定DNSを確実に効かせたい場合は、udhcpc側のフックスクリプトで制御するのが本来は堅実です。   ​ 4. スクリプトの実行 作成したスクリプトに'chmod'コマンドで実行権限を付加し、実行します。 root@frdm-imx95:~# chmod +x connect_wifi.sh root@frdm-imx95:~# ./connect_wifi.sh ​ 5. まとめ FRDM-IMX95上でのWi-Fi自動接続スクリプトを題材に、組み込みLinux特有の注意点を解説しました。デスクトップLinuxでは意識する必要のない、次のようなポイントがつまずきどころになります。 'wpa_passphrase' はヒアストリング入力でTTYエラーになることがあり、PBKDF2の自前計算が確実 'wpa_supplicant.conf' に 'ctrl_interface' がないと 'wpa_cli' で状態を取得できない SSIDのクオートの二重化は 'SCANNING' から進まない原因になる SSIDはPSK計算の入力の一部であり、SSIDの誤りは鍵の不一致として現れる ビルドによっては '-B' と '-f' を併用できない 同様の課題に取り組まれている方の参考になれば幸いです。 ​ 6. 関連情報 i.MX FRDMボードの部屋 Yocto Linux BSPの利用方法 ~まとめページ~ (日本語ブログ) ========================= 本投稿の「Comment」欄にコメントをいただいても、現在返信に対応しておりません。 お手数をおかけしますが、お問い合わせの際には「NXPへの技術質問 - 問い合わせ方法 (日本語ブログ)」をご参照ください。 (既に弊社NXP代理店、もしくはNXPとお付き合いのある方は、直接担当者へご質問いただいてもかまいません。) FRDM-IMX95に搭載されているWi-Fiモジュールを、起動後に毎回手作業で接続するは非常に煩わしいです。そこで本記事では、起動時に自動でWi-Fi接続するための方法と、スクリプトの書き方例について紹介します。 同様のWi-Fiモジュールを搭載しているi.MXファミリの評価ボードにも流用できます。 (読了:20分) (作業時間: 10分) ※i.MX向けYocto Linuxをビルド、動作確認している前提 i.MX Processors 日本語ブログ
View full article
Replacement of some IIC drivers for K312 RTD3.0.0 to RTD6.0.0 Hi I'm currently encountering an IIC slave clock suspension issue in RTD 3.0.0, which I've found to be related to the IIC clock extension function. Following a recommendation from the FAE, it was stated that this issue doesn't exist in the 6.0.0 driver. Due to project timelines and based on the principle of minimal changes, I will...The IIC driver files were extracted from version 6.0.00 and placed in version 3.00.In the RTD, I found it wasn't working properly. After the changes, the IIC couldn't exit the interrupt once it received data. I would like to ask: 1. Has anyone tried this operation (3.00RTD)?(I've replaced some drivers with version 6.00). Do you support this change? Do I have any other related drivers that haven't been ported yet? 2. I discovered an IIC change item in version 6.0.00, which was fixed in version 4.00. Version 5.00 inherited this fix, but version 6.00 reverted to the logic of version 3.00. However, in the 6.00 release...There is no related description in the notes. Did version 6.00 make other changes to fix this bug? static void Lpi2c_Ip_SlaveIRQHandlerInternal(uint8 Instance) { LPI2C_Type *BaseAddr; Lpi2c_Ip_SlaveStateType * Slave; boolean StopDetect = FALSE; boolean RepeatStartDetect = FALSE; BaseAddr = Lpi2c_Ip_pxBase[Instance]; Slave = Lpi2c_Ip_pxSlaveState[Instance]; StopDetect = LPI2C_Get_SlaveSTOPDetectEvent(BaseAddr); RepeatStartDetect = LPI2C_Get_SlaveRepeatedStartEvent(BaseAddr); /* Check address valid and tx/rx event */ Lpi2c_Ip_SlaveCheckDataEvent(Instance, BaseAddr, Slave); if (RepeatStartDetect) { Slave->RepeatedStarts++; if ((1U == Slave->RepeatedStarts) && (Slave->Is10bitAddress)) // This has been modified in version 4.00 { RepeatStartDetect = FALSE; LPI2C_Clear_SlaveRepeatedStartEvent(BaseAddr); } } if ((TRUE == StopDetect) || (TRUE == RepeatStartDetect)) { /* Stop/repeated start detected */ Lpi2c_Ip_SlaveStopDetectHandler(BaseAddr, Slave); if (TRUE == StopDetect) { /* reset repetead starts for a new transfer */ Slave->RepeatedStarts = 0U; } } /* Check for slave errors */ Lpi2c_Ip_SlaveCheckErrorEvent(BaseAddr, Slave); } Related bug: ARTD-6112 Reyna_pan45_0-1785920300296.pngReyna_pan45_0-1785920300296.png Re: K312 RTD3.0.0到RTD6.0.0 IIC部分驱动更换 Hi @Reyna_pan45  We do not recommend mixing code from different RTD releases, as this combination has not been validated. For this reason, we can not guarantee the expected functionality or behavior when components from different releases are used together. Regarding ARTD-81841, in the most recent releases this issue is tracked under ARTDCC2-91. It is currently a known issue and, unfortunately, there is no available workaround at this time, as shown in the image below. VaneB_0-1785963496184.pngVaneB_0-1785963496184.png Sorry for any inconvenience this may cause. BR, VaneB Re: K312 RTD3.0.0到RTD6.0.0 IIC部分驱动更换 Hi @VaneB  Is there any more relevant description about this bug? I found during testing that modifying item ARTD-81841  can alleviate some issues (when frequently switching interrupts), even if the root cause cannot be identified. Re: K312 RTD3.0.0到RTD6.0.0 IIC部分驱动更换 Hi @Reyna_pan45  At this time, this is all the information available, as the investigation is still ongoing. We apologize for any inconvenience this may cause.
View full article
LX2162A USXGMII link never completes Hey all, I have an LX2162A SoM manufactured by Solidrun. I'm using a Clearfog devkit but moving to a custom carrier soon.  Solidrun provides base RCW/DCP/DPL and I've verified functionality. In my case, the DPC for dpmac3 works for the SFP cage and I get an XFI link via SFP DAC cable and various SFP modules. The RCW "rcw_2000_650_2900_3_11_0_auto" sets to SerDes1=3, SerDes2=11 and I'm using a QorIQ kernel (lf-6.6.52-2.2.0) and mc-utils (10.39.0) but with some Solidrun patched applied to both. Uboot and other things are also patched. All patches come from here: https://github.com/SolidRun/lx2160a_build/tree/develop-ls-6.6.52-2.2.0 I have a MaxLinear GPY245-EKV-1 (and -2) devkit(s) that wants USXGMII over DAC cable to connect the phy to the device. Apparently this is pretty normal. Eventually this phy chip will be integrated into SerDes2=7 Lane6 and Lane7 but I have to use the SFP cage on the Clearfog for testing. Clearfog SFP (mac3) <-> DAC CABLE <-> GPY245-EVK-2 SFP I'm only trying to configure dpmac3 to use this USXGMII link via DPC: mac@3 { link_type = "MAC_LINK_TYPE_PHY"; enet_if = "USXGMII"; }; (I've also tried MAC_LINK_TYPE_BACKPLANE) Confirmed via "restool dpmac info dpmac.3" shows "DPMAC ethernet interface: DPMAC_ETH_IF_USXGMII". In Linux, I added the MaxLinear driver and patched a few things: gpy_update_interface() fix (LKML, Daniel Golle). This was returning -EINVAL for USXGMII interface, crashing phy_state_machine. Patched lynx_pcs_config_usxgmii() in pcs-lynx.c to also write MII_BMCR (BMCR_ANENABLE | BMCR_ANRESTART) via mdiobus_c45_modify(), since the function only ever wrote MII_ADVERTISE and never enabled AN on the Replicator block itself. This gap matches another post on this forum ("LS1028A 10g-qxgmii phy bring-up") which found the identical symptom (MMD31.0/Replicator control register stuck at 0) and got AN to kick in after manually setting bit 12. This is the DPMAC3 Linux devicetree entry: &dpmac3 { managed = "in-band-status"; phy-mode = "usxgmii"; phy-handle = <&gpy245_p0>; phys = <&serdes_1 7>; status = "okay"; }; where `gpy245_0` is the MDIO node. MDIO traffic to the phy is working. I added a printout in the lynx_pcs driver which shows the readback: mdio_bus 0x0000000008c0f000:00: USXGMII: wrote ADV=0xd601 BMCR=0x1a00 readback ADV=0x6b00 BMCR=0x0800 BMSR=0x0000 LPA=0x0000 Question: Given writes to MDIO_MMD_VEND2 registers on this PCS instance don't appear to persist, is there a known additional step (SerDes/PCS block enable, protocol-specific initialization, or similar) required before the USXGMII on the LX2162A family SoCs will accept configuration? Is protocol 3 fully validated for USXGMII on dpmac3, or primarily intended/tested for XFI? Other questions: Maybe I don't understand GPY245 and USXGMII. I see some folks refer to this as QXGMII and I can't tell if the LX2162A is even capable of that working. Maybe I need to reach out to Solidrun, but all of their patches do not seem to limit the LX2162A's capability. Thanks! Re: LX2162A USXGMII link never completes @yipingwang I really appreciate the detailed response! Everything you said makes sense and I've started learning more about the platform. I've started using the advice in AN13329.pdf. Some of the addresses and things aren't working (probably a version mismatch) but at least I can get the MC log as shown below: => md 0x8340020 10 08340020: e0000006 00000021 00060000 00000000 ....!........... 08340030: 00000000 00000000 00000000 00000000 ................ 08340040: 00000000 00000000 00000000 00000000 ................ 08340050: 00000000 00000000 00000000 00000000 ................ => md 0x21e1000000 21e1000000: 4d430100 00000000 01400000 00300000 [email protected]. 21e1000010: 00000073 00000000 00000000 00000000 s............... 21e1000020: 00000000 00000000 00000000 00000000 ................ 21e1000030: 00000000 00000000 00000000 00000000 ................ => md 0x21e1400000 50 21e1400000: 202c575b 54414c50 4d524f46 5520205d [W, PLATFORM] U 21e1400010: 20545241 6e697270 61662074 64656c69 ART print failed 21e1400020: 6c61202c 6564206c 20677562 61746164 , all debug data 21e1400030: 6c697720 6562206c 69727020 6465746e will be printed 21e1400040: 206f7420 66667562 0a2e7265 6e6e7552 to buffer..Runn 21e1400050: 20676e69 6120434d 202c7070 74696177 ing MC app, wait 21e1400060: 20676e69 20726f66 6e657665 2e207374 ing for events . 21e1400070: 000a2e2e 00000000 00000000 00000000 ................ 21e1400080: 00000000 00000000 00000000 00000000 ................ 21e1400090: 00000000 00000000 00000000 00000000 ................ 21e14000a0: 00000000 00000000 00000000 00000000 ................ 21e14000b0: 00000000 00000000 00000000 00000000 ................ 21e14000c0: 00000000 00000000 00000000 00000000 ................ 21e14000d0: 00000000 00000000 00000000 00000000 ................ 21e14000e0: 00000000 00000000 00000000 00000000 ................ 21e14000f0: 00000000 00000000 00000000 00000000 ................ 21e1400100: 00000000 00000000 00000000 00000000 ................ 21e1400110: 00000000 00000000 00000000 00000000 ................ 21e1400120: 00000000 00000000 00000000 00000000 ................ 21e1400130: 00000000 00000000 00000000 00000000 ................ I've attempted to poke at the PCCC via uboot. Here are the relevant things: crc32+ MC firmware version 10.39.0 fsl-mc: Booting Management Complex ... SUCCESS fsl-mc: Management Complex booted (version: 10.39.0, boot status: 0x1) Autoboot in 3 seconds => mmc read 0x80d00000 0x6800 0x800 => fsl_mc apply dpl 0x80d00000 fsl-mc: Deploying data path layout ... SUCCESS => md.l 0x1ea10b0 1 01ea10b0: 88889991 .... I really hope 0x1ea10b0 is the right address. According the LX2162ARM.pdf, that *could* be the right address and decoding the bits shows: A (lane 0) bit 31 1 = XFI/SFI B (lane 1) bit 27 1 = XFI/SFI C (lane 2) bit 23 1 = XFI/SFI D (lane 3) bit 19 1 = XFI/SFI Is the right right register address (PCCC) to observe? Is there any other information I can provide? Thanks! Re: LX2162A USXGMII link never completes The LX2162A side is documented to support USXGMII on the paths you are using , but the symptom you show looks less like a missing Linux pcs-lynx write and more like the selected PCS instance is still not actually in USXGMII application mode, or MC firmware is programming the wrong 10G PCS selector. For SerDes1 protocol 3 , the LX2162A reference manual lists all four SerDes1 lanes as USXGMII / XFI , including USXGMII / XFI.3 for the first lane, which corresponds to the DPMAC3 use case you are testing on the Clearfog SFP path . For your future custom-carrier target, SerDes2 protocol 7 also documents lane 6 and lane 7 as USXGMII / XFI.13 and USXGMII / XFI.14 . The important catch is that the USXGMII / XFI entry is not automatically “USXGMII.” The reference manual says that between USXGMII and XFI on a lane, the default is XFI . The mode is selected through PCCC , the Protocol Configuration Register C, and its SXGMII*_XFI bits select 0b = USXGMII and 1b = XFI/SFI . So the first thing I would check is not the Linux BMCR write itself, but whether the specific SXGMII instance for DPMAC3 has its PCCC XFI-select bit cleared after MC/DPC initialization. There is also precedent for this exact class of failure being in MC firmware , not in the Linux PCS driver: one LX2162A ticket shows MC clearing the wrong 10G interface selector in PCCC for a USXGMII configuration, and an MC firmware engineering build, version 10.35.101 , resolved the issue . Another ticket notes that MC settings are done by MC firmware, with NXP providing MC as a binary . Since you are on MC 10.39.0 , you should be beyond that specific old fix, but the failure mode you see is still consistent with “MC did not put the intended PCS into USXGMII mode” or “the wrong PCS instance is being addressed.” What I would do next: Read PCCC before Linux changes anything. After RCW + MC + DPL/DPC load, but before the Linux PCS driver runs, read PCCC and confirm the relevant SXGMII*_XFI bit is 0 . For DPMAC3 / USXGMII/XFI.3 , expect the first SXGMII selector, not the selector for MAC13/14. If that bit remains 1 , the lane is still XFI/SFI and your VEND2/USXGMII PCS writes are not being applied to a live USXGMII PCS path. Check that the MDIO access is hitting the intended PCS management port. The SXGMII protocol-control register has an MDEV_PORT field used to match MDIO accesses, and the manual says software must wait at least 3 platform clocks after changing it before MDIO accesses to the SGMII/PCS target . If the MDIO address decode is wrong, writes can appear to “not persist” because you are reading a different or reset/default PCS window. Confirm the USXGMII AN registers are meaningful only after the mode select is correct. The USXGMII PCS CONTROL register has AUTO_NEGOTIATION_ENABLE at bit 12, and DEV_ABILITY / PARTNER_ABILITY are RW registers . The DEV_ABILITY lower vendor arbitrary speed field must be non-zero, because zero can cause auto-negotiation failure . But if PCCC still selects XFI, these BMCR/ability writes are not the real root problem. Do not treat QXGMII as a separate required external protocol unless the GPY245 board documentation explicitly says so. LX2162A documentation does contain QXGMII protocol-converter registers, including reset/powerdown control bits such as PD_QXGM and RST_QXGM . NXP community material for LS1028A also refers to a 10G_QXGMII Lynx SerDes driver path . But the documented LX2162A DPMAC interface you are selecting is still USXGMII / XFI , and NXP documentation separately states that LX2160-class devices support USXGMII and that “SXGMII” is not the same thing . In other words: “QXGMII” references in driver/community discussions may describe an internal converter/driver naming path, not necessarily a different MAC-to-PHY contract than the USXGMII mode you configured. For this Clearfog SFP test, keep the DPC simple. MAC_LINK_TYPE_PHY with enet_if = "USXGMII" is the more natural model for a managed external PHY over MDIO. I would not expect MAC_LINK_TYPE_BACKPLANE to fix a PHY-facing USXGMII setup unless you are intentionally using a backplane/KR-style flow. I would not conclude that protocol 3 is “primarily XFI-only.” The reference manual documents protocol 3 as USXGMII / XFI for DPMAC3’s SerDes1 lane . What I cannot verify from the retrieved material is a separate validation statement saying “protocol 3 + DPMAC3 + USXGMII was validated with GPY245.” The stronger, evidence-backed statement is: the hardware mode exists, defaults to XFI unless PCCC selects USXGMII, and there is known MC-firmware precedent for programming the wrong 10G PCS selector . For your specific readback: wrote ADV=0xd601 BMCR=0x1a00 readback ADV=0x6b00 BMCR=0x0800 BMSR=0x0000 LPA=0x0000 that is exactly the kind of result I would expect if the PCS instance is not fully enabled/selected for USXGMII, or the MDIO management window is not addressing the intended PCS instance. I would verify PCCC and the MC log first, before adding more Linux-side writes. LX2162A protocol 3 is documented for USXGMII / XFI on DPMAC3, but USXGMII depends on MC/PCCC selecting the USXGMII PCS; if VEND2/BMCR writes do not persist, first prove the correct PCCC bit is cleared for DPMAC3 and that MDIO is addressing the correct SXGMII PCS instance. Re: LX2162A USXGMII link never completes Yes. For SerDes1 ,  0x1ea10b0  is the right address for PCCC : LX2162A CCSR map lists SerDes 1 at  0x1EA_0000–0x1EA_FFFF  . The SerDes memory map lists Protocol Configuration Register C / PCCC at offset  0x10B0  . Therefore: 0x1EA0000+0x10B0=0x1EA10B00x1EA0000+0x10B0=0x1EA10B0 So your U-Boot read: Copy => md.l 0x1ea10b0 1 01ea10b0: 88889991   is observing the expected SerDes1 PCCC register. The important caveat is the naming: I would not describe those fields as physical SerDes lane A/B/C/D for your current setup. In the LX2162A SerDes1 protocol table, protocol  3  maps physical lane H / lane 0 to  USXGMII / XFI.3  , then lane G/lane 1 to  .4  , lane F/lane 2 to  .5  , and lane E/lane 3 to  .6  . PCCC field names such as  SXGMIIA_XFI  ,  SXGMIIB_XFI  , etc. are PCS/protocol-control fields, not necessarily the same naming convention as the physical lane letters. For your value  0x88889991  , the high nibbles decode like this: Copy PCCC = 0x88889991 bits 31:28 = 0x8 -> SXGMIIA_XFI = 1, CFG = 000 bits 27:24 = 0x8 -> SXGMIIB_XFI = 1, CFG = 000 bits 23:20 = 0x8 -> SXGMIIC_XFI = 1, CFG = 000 bits 19:16 = 0x8 -> SXGMIID_XFI = 1, CFG = 000 bits 15:12 = 0x9 -> SXGMIIE_XFI = 1, CFG = 001 bits 11:8 = 0x9 -> SXGMIIF_XFI = 1, CFG = 001   The key bit is the  _XFI  bit. The RM defines  0  as USXGMII mode and  1  as XFI/SFI mode for these fields . So the value you read strongly suggests the relevant USXFI/SXGMII PCS instances are still being selected as XFI/SFI , not USXGMII. That lines up with your symptom: Linux/restool may report  DPMAC_ETH_IF_USXGMII  , but if PCCC still has the relevant  _XFI  select bit at  1  , the underlying SerDes/PCS selection is still effectively in XFI/SFI mode. The RM also explicitly says that to enable 10G-SXGMII, software must set  PCCC[SGMIIa_XFI] = 0  . Your MC log extraction also looks sane. AN13329 says to read MCFBAL/MCFBAH at  0x8340020  , build the MC firmware base, then dump the log-buffer structure at offset  0x01000000  ; the structure contains the magic, log-buffer offset, and log-buffer length . Your  0x21e1000000  dump shows the expected  0x4d430100  magic and points to log offset  0x01400000  , which matches your later dump at  0x21e1400000  . What I would capture next: PCCC snapshots at each stage Copy md.l 0x1ea10b0 1 Capture it: immediately after reset / before MC boot if possible, after MC boot, after DPC/DPL apply, after Linux boots, after the DPMAC is probed/configured. Adjacent protocol config registers Copy md.l 0x1ea10a0 1 # PCC8 md.l 0x1ea10a4 1 # PCC9 md.l 0x1ea10b0 1 # PCCC PCC8/PCC9 contain other SGMII configuration fields, while PCCC is the SXGMII/XFI selector register . Confirm which PCCC field changes when you try forcing USXGMII If you can safely poke in U-Boot for experiment only, try clearing the candidate  _XFI  bit and reading it back immediately. For example, if dpmac3 corresponds to the first SXGMII/USXFI control field, clearing bit 31 would be the experimental check: Copy mw.l 0x1ea10b0 0x08889991 1 md.l 0x1ea10b0 1 If it immediately reads back as  0x88889991  , then either the write is blocked/overridden, or that field is not writable in the current block state. If it sticks until MC or Linux runs, then MC/Linux is likely restoring XFI/SFI mode. Full RCW SerDes decode You already have  SerDes1=3, SerDes2=11  ; that matches the dpmac3 lane being available as  USXGMII / XFI.3  under SerDes1 protocol 3 . Still, include the full RCW string and raw RCW dump when escalating, because MC firmware often keys off the complete protocol set. MC firmware + DPC/DPL artifacts Since your MC is  10.39.0  , include: MC firmware version, DPC source, DPL source, exact  dpmac@3  block, restool dpmac info dpmac.3  , the PCCC value after each step. My current read of your data: yes,  0x1ea10b0  is the correct SerDes1 PCCC address, and  0x88889991  looks like the relevant PCS selectors are still in XFI/SFI mode. That is consistent with XFI working through the SFP cage and USXGMII not accepting/retaining the expected PCS configuration.
View full article
Inquiry regarding whether data tampering can occur due to noise in the field Hello, NXP. We are currently working on a project using the S32K312 MCU. We are writing to inquire because we encountered a defective unit in the field. During the analysis of the defective unit, we compared the dump files of a normal unit with a good unit and found differences in specific areas between the two. jeongwoo_0-1786583945706.png The photo on the left is a normal DUMP file, and the one on the right is a high-quality DUMP file. The failure is related to a dark current issue. When accessed via Trace32, we confirmed that the Watchdog was continuously triggering a reset during the controller's sleep process. The image on the left shows the normal dump file, and the image on the right shows the defective dump file. Upon checking the .map file, the issue is related to the LIN section (Mcal_LIN). Our project does not use a LIN transceiver, and LIN-related functions have been blocked. We are considering two possibilities: 1. Data tampering caused by noise during the writing process 2. CodeFlash tampering caused by noise in the field Is it possible that noise generated in the field due to static electricity or power interruptions could cause the CodeFlash area to be tampered with?A reset by Wdg occurs when entering Sleep mode. Is there a way to identify the cause of this Wdg reset? Re: Inquiry regarding whether data tampering can occur due to noise in the field Hello @jeongwoo. This is an S-record, type S3, with a byte count of 0x25. The record starts at address 0x0046D0E0. Only 4 bytes differ in the data payload, at address 0x0046D0F8: 0x11 00 02 00 changed to 0x40 78 09 78, and the S-record checksum changes accordingly from 0x89 to 0x63. What is notable is that bits are flipped in both directions — from 1 to 0 and from 0 to 1. In NOR flash, bits can only be programmed from 1 to 0; flipping a bit from 0 to 1 requires a sector erase first. So the 0 to 1 transitions cannot be the result of a simple programming operation. To change bits from 0 to 1 without an erase, charge would need to be removed from the isolated floating gates, which requires both energy and a discharge path. EMI cannot provide this. ESD of sufficient energy to discharge a floating gate would almost certainly cause broader damage. Regarding SEU, we observe many bit flips across 4 separate bytes. A more likely explanation is that the defective unit was programmed from day one with a different binary, and the flash content has never changed since initial production programming. In that case the ECC checksums stored in flash would be consistent with the data and no ECC error would be reported when the flash is read. Could you confirm this? If the content was instead corrupted after programming, reading flash at address 0x0046D0F8 should trigger an ECC error — do you see ???? displayed at this location when reading from TRACE32? Additionally, could you read DCMROD4[12]? Regarding the watchdog reset, which watchdog do you mean? It could be the SWT, an external watchdog, or the POR_WDOG. An SWT (or external watchdog) reset is triggered when the watchdog is not serviced, typically because execution is stuck in a loop. If this is the case, could you disable the watchdog and attach the debugger to the MCU to capture where execution is halted? If it is a POR_WDOG reset, please read registers DCMROPP1–DCMROPP4, which will provide more detailed information about it. Regards, Daniel Re: Inquiry regarding whether data tampering can occur due to noise in the field Hello, thank you for your reply. In other words, are you saying that the 4-byte difference is likely not due to field factors? We do not currently have the original parts on hand, so it is difficult to perform the address reading and register verification you mentioned. 1. I would like to inquire if there are any similar cases in the field. If so, was it a case where multiple bytes were changed? 2. If firmware that has been modified due to noise is written during the process, could you tell me specifically what the causes of that writing noise might be? Re: Inquiry regarding whether data tampering can occur due to noise in the field Hello @jeongwoo, 1. I'm not aware of any similar cases. 2. This is just a hypothesis at this point — it needs to be tested first. If there is no ECC error at the affected address, the flash has most likely been programmed with this content from the start. If there is an ECC error, the record has been corrupted, but the corruption is overwhelmingly more likely to have occurred during programming rather than after the data was written to flash. Possible causes include power supply instability or an interruption during the flash write operation. After programming the image, do you verify the flash content? Do you use a Margin Read during verification? Do you keep logs from the production programming process? Is the flash ever modified at runtime, or is it programmed once in the factory and never touched again? Regards, Daniel
View full article
LX2160A JTAG (CCS) connection fails I'm trying to use DDR Tool with my LX2160A, but I can't connect. I think the cause is that the CCS cannot confirm the JTAG connection. Attach the result of the IDcode verification. KAZU_ISHI_0-1786615924736.pngKAZU_ISHI_0-1786615924736.pngKAZU_ISHI_0-1786615924736.pngKAZU_ISHI_0-1786615924736.pngKAZU_ISHI_0-1786615924736.png When I tried connecting a while ago, I was able to confirm a connection from JTAG, but the files were corrupted, and since revisions were not carefully managed, recovery was not possible. We are unaware that downloading from the internet via "check for update" can sometimes result in file corruption, and therefore we are currently unable to match the software's status. Since I was able to connect once, I suspect it might be a software issue. If you know a solution, please let me know. Thank you very much for your understanding. Re: LX2160AのJTAG(CCS)接続が失敗する Thank you for your reply. I performed the installation using "CodeWarrior for ARMv8 v11.5.0 b200629 Windows Offline Installer". After that, I tried updating using CodeWarrior IDE by selecting Help → Install New Software → Add → Archive and specifying com.freescale.armv8.11.5.12.GA.Win.updatesite.221209.zip, but an error occurred during installation. The error message is as follows: KAZU_ISHI_0-1786959225115.pngKAZU_ISHI_0-1786959225115.pngKAZU_ISHI_0-1786959225115.pngKAZU_ISHI_0-1786959225115.pngKAZU_ISHI_0-1786959225115.png An error occurred while installing the items session context was:(profile=epp.package.cpp, phase=org.eclipse.equinox.internal.p2.engine.phases.Install, operand=[R]com.freescale.core.debugger.fsl_gdb13.0.0.202003111126 --> [R]com.freescale.core.debugger.fsl_gdb14.0.0.202204131357, action=com.freescale.updater.customactions.actions.FreescaleProcessCheck). NLS missing message: param_not_set in: com.freescale.updater.customactions.Messages Could you please advise me on how to deal with this? Thank you very much for your understanding. Re: LX2160AのJTAG(CCS)接続が失敗する Please check whether you have installed the latest CodeWarrior for ARMv8 11.5.12. Please open CodeWarrior IDE and check the version from Help->About CodeWarrior Development Studio for QorIQ LS series - ARM V8 ISA. If you have already installed this version CodeWarrior, please plug off USB cable from CodeWarrior TAP and plug in again. Re: LX2160AのJTAG(CCS)接続が失敗する Thank you for your reply. The version information for CodeWarrior currently in use is as follows: CodeWarrior Development Studio for QorIQ LS series - ARM V8 ISA Version: 11.5.0 Build ID: 200629GA Compared to the latest version you provided, my environment appears to be running an older version. By the way, if I select "com.freescale.armv8.11.5.12.GA.Win.updatesite.221209.zip" via "Install New Software" → "Add" → "Archive", which items should I install? Selecting "Select All" results in an error and the installation fails. Re: LX2160AのJTAG(CCS)接続が失敗する Please install CW_ARMv8_v2020.06_b200629GA_Win_Offline.exe first, then open CodeWarrior IDE and install service pack com.freescale.armv8.11.5.12.GA.Win.updatesite.221209.zip from Help->Install New Software->Add->Archive. If your problem persists, please provide screenshot to show your error.
View full article