Multi Source Translation Content

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

Multi Source Translation Content

Discussions

Sort by:
K344 中心点対 PWM 中心点起動 ADC BCTU サンプリング https://community.nxp.com/t5/S32K-Knowledge-Base/RTD400-K344-Center-Aligned-PWM-Trigger-ADC-BCTU/ta-p/2034211に基づき、BCTU ウォーターマークをトリガーするのに 3 つの BCTU トリガー割り込みが必要な理由を知りたいです。割り込みを 1 回だけトリガーし、その後、割り込み内で PWM 周期の変更、ADC 値の読み取りなどを実行したいと考えています。EB MCAL 開発に基づいて、同じ機能を実現するための優れたソリューションやサンプルルーチンは何ですか? Re: K344中心对齐PWM中心点触发ADC BCTU采样 当社製品にご興味をお持ちいただき、また当社コミュニティに貢献していただき、ありがとうございます。 投稿に直接返信して、投稿の所有者からのフィードバックを得ることができます。 一方、単一の BCTU トリガーを使用した別のアプローチを参照することもできます。 S32M27x/S32K3 – eMIOS/BTCU/ADC/DMA – [RTD600] -> https://community.nxp.com/t5/S32M-Knowledge-Base/S32M27x-S32K3-eMIOS-BTCU-ADC-DMA-RTD600/ta-p/2155542 MCAL 実装については、ハードウェア抽象化レイヤーのADC から PWM の例を参照してください。 S32K3ページへ移動-> 設計リソース -> ソフトウェア -> S32K3リファレンスソフトウェア -> オートモーティブソフトウェア - S32K3 - ハードウェア抽象化レイヤー -> S32K3 HAL統合例 2025.07 次の ADC トリガーを実行します。 同時に、キャプチャされた ADC 値に応じてデューティ サイクルを更新します。 この情報が役に立つことを願います。 Re: K344中心对齐PWM中心点触发ADC BCTU采样 解決策をありがとうございます。複数のトリガー中断が発生する理由と、そのような中断を回避する方法を知りたいです。または、設定によってこの割り込みソースを無効にすることは可能ですか? Re: K344中心对齐PWM中心点触发ADC BCTU采样 こんにちは、 BCTU トリガー通知が有効になっている場合、BCTU が ADC をトリガーしたときに呼び出されます。例では、BCTU CL に 3 つの項目が含まれているため、ADC は入力 (eMIOS) トリガーごとに 3 回トリガーされます。 この通知を無効にするには、トリガー通知オプションに NULL を設定します。 BR、ペトル
View full article
How to use a GPIO(libgpiod) with gpioget/gpioset, on i.MX8Q as an example difference between gpioget and "cat /sys/class/gpio" in GPIO control: gpioget : This is a command-line utility provided by the  libgpiod  library. It is designed to interact with GPIO lines through the modern Linux GPIO character device interface ( /dev/gpiochipN ). /sys/class/gpio : This refers to the legacy sysfs interface for GPIO control in Linux. While widely used in the past, this interface has been officially deprecated in favor of the  libgpiod  character device interface since Linux kernel version 6.0 and later. Below is an example of libgpiod tested on i.MX8Q-MEK, L6.12.3 BSP. Device tree settings: We use GPIO1-05 and GPIO1-06 in this example. can put GPIO pinctrls in a specific group like “gpio_test”, or under certain driver like “gpio-keys” gpio_test: gpio-test { pinctrl-names = "default", "sleep"; pinctrl-0 = <&pinctrl_gpio_test_default>; pinctrl-1 = <&pinctrl_gpio_test_sleep>; status = "okay"; }; gpio-keys { compatible = "gpio-keys"; pinctrl-names = "default", "sleep"; pinctrl-0 = <&pinctrl_gpio_example_default>; pinctrl-1 = <&pinctrl_gpio_example_sleep>; key_wakeup2{ label = "wakeup_key"; gpios = <&lsio_gpio2 1 GPIO_ACTIVE_LOW>; linux,code = ; wakeup-source; }; pinctrl_gpio_test_default: gpiotestgrp_default { fsl,pins = < IMX8QM_LVDS0_I2C0_SDA_LSIO_GPIO1_IO07 0x06000061 IMX8QM_QSPI1A_DATA0_LSIO_GPIO4_IO26 0x06000041 IMX8QM_MIPI_CSI1_I2C0_SCL_LSIO_GPIO2_IO00 0x06000021 IMX8QM_LVDS0_I2C0_SCL_LSIO_GPIO1_IO06 0x06000021 >; }; pinctrl_gpio_test_sleep: gpiotestgrp_sleep { fsl,pins = < IMX8QM_LVDS0_I2C0_SDA_LSIO_GPIO1_IO07 0x07800061 IMX8QM_QSPI1A_DATA0_LSIO_GPIO4_IO26 0x07800041 IMX8QM_MIPI_CSI1_I2C0_SCL_LSIO_GPIO2_IO00 0x07800021 IMX8QM_LVDS0_I2C0_SCL_LSIO_GPIO1_IO06 0x07800021 >; }; pinctrl_gpio_example_default: gpioexamplegrp_default { fsl,pins = < IMX8QM_LVDS0_GPIO01_LSIO_GPIO1_IO05 0x06000021 IMX8QM_MIPI_CSI1_I2C0_SDA_LSIO_GPIO2_IO01 0x06000021 >; }; pinctrl_gpio_example_sleep: gpioexamplegrp_sleep { fsl,pins = < IMX8QM_LVDS0_GPIO01_LSIO_GPIO1_IO05 0x07800021 IMX8QM_MIPI_CSI1_I2C0_SDA_LSIO_GPIO2_IO01 0x07800021 >; }; Kernel commands to test GPIO function: gpiodetect and gpioinfo command: root@imx8qmmek:~# gpiodetect gpiochip0 [5d080000.gpio] (32 lines) gpiochip1 [5d090000.gpio] (32 lines) gpiochip2 [5d0a0000.gpio] (32 lines) gpiochip3 [5d0b0000.gpio] (32 lines) gpiochip4 [5d0c0000.gpio] (32 lines) gpiochip5 [5d0d0000.gpio] (32 lines) gpiochip6 [5d0e0000.gpio] (32 lines) gpiochip7 [5d0f0000.gpio] (32 lines) root@imx8qmmek:~# gpioinfo -c 1 gpiochip1 - 32 lines: line 0: unnamed input line 1: unnamed input line 2: unnamed input line 3: unnamed input line 4: unnamed input line 5: unnamed input line 6: unnamed output line 7: unnamed output line 8: unnamed input line 9: unnamed input line 10: unnamed input line 11: unnamed input line 12: unnamed input line 13: unnamed output consumer=regulator-pcie line 14: unnamed input line 15: unnamed input line 16: unnamed input line 17: unnamed input line 18: unnamed input line 19: unnamed input line 20: unnamed input line 21: unnamed input line 22: unnamed input line 23: unnamed input line 24: unnamed input line 25: unnamed input line 26: unnamed input line 27: unnamed input line 28: unnamed input line 29: unnamed input line 30: unnamed input line 31: unnamed input use cat /sys/kernel/debug/gpio to show current GPIO settings before GPIO1-05 and GPIO1-06 are set: root@imx8qmmek:~# cat /sys/kernel/debug/gpio gpiochip0: GPIOs 512-543, parent: platform/5d080000.gpio, 5d080000.gpio: gpio-526 ( |scl ) out lo gpio-527 ( |sda ) in lo gpiochip1: GPIOs 544-575, parent: platform/5d090000.gpio, 5d090000.gpio: gpio-557 ( |regulator-pcie ) out hi gpiochip2: GPIOs 576-607, parent: platform/5d0a0000.gpio, 5d0a0000.gpio: gpio-577 ( |wakeup_key ) in hi ACTIVE LOW gpiochip3: GPIOs 608-639, parent: platform/5d0b0000.gpio, 5d0b0000.gpio: gpio-618 ( |spi1 CS0 ) out hi ACTIVE LOW gpiochip4: GPIOs 640-671, parent: platform/5d0c0000.gpio, 5d0c0000.gpio: gpio-641 ( |enable ) out hi ACTIVE LOW gpio-643 ( |regulator-usbotg1-vb) out lo gpio-647 ( |usdhc2-vmmc ) out hi gpio-667 ( |enable ) out lo ACTIVE LOW gpio-668 ( |host-wake ) in hi ACTIVE LOW gpio-669 ( |PCIe reset ) out hi ACTIVE LOW gpiochip5: GPIOs 672-703, parent: platform/5d0d0000.gpio, 5d0d0000.gpio: gpio-673 ( |mux ) out hi gpio-693 ( |wp ) in lo gpio-694 ( |cd ) in lo ACTIVE LOW gpiochip6: GPIOs 704-735, parent: platform/5d0e0000.gpio, 5d0e0000.gpio: gpiochip7: GPIOs 736-767, parent: platform/5d0f0000.gpio, 5d0f0000.gpio: use gpioset command to set GPIO output, can also change GPIO direction(input → output) #set gpiochip1-5 and 1-6 root@imx8qmmek:~# gpioset -c gpiochip1 6=1 & [1] 700 root@imx8qmmek:~# gpioset -c gpiochip1 5=1 & [2] 702 check the changes from the commands above with cat /sys/kernel/debug/gpio and gpioinfo -c 1 : root@imx8qmmek:~# cat /sys/kernel/debug/gpio gpiochip0: GPIOs 512-543, parent: platform/5d080000.gpio, 5d080000.gpio: gpio-526 ( |scl ) out lo gpio-527 ( |sda ) in lo gpiochip1: GPIOs 544-575, parent: platform/5d090000.gpio, 5d090000.gpio: gpio-549 ( |gpioset ) out hi gpio-550 ( |gpioset ) out hi gpio-557 ( |regulator-pcie ) out hi gpiochip2: GPIOs 576-607, parent: platform/5d0a0000.gpio, 5d0a0000.gpio: gpio-577 ( |wakeup_key ) in hi ACTIVE LOW gpiochip3: GPIOs 608-639, parent: platform/5d0b0000.gpio, 5d0b0000.gpio: gpio-618 ( |spi1 CS0 ) out hi ACTIVE LOW gpiochip4: GPIOs 640-671, parent: platform/5d0c0000.gpio, 5d0c0000.gpio: gpio-641 ( |enable ) out hi ACTIVE LOW gpio-643 ( |regulator-usbotg1-vb) out lo gpio-647 ( |usdhc2-vmmc ) out hi gpio-667 ( |enable ) out lo ACTIVE LOW gpio-668 ( |host-wake ) in hi ACTIVE LOW gpio-669 ( |PCIe reset ) out hi ACTIVE LOW gpiochip5: GPIOs 672-703, parent: platform/5d0d0000.gpio, 5d0d0000.gpio: gpio-673 ( |mux ) out hi gpio-693 ( |wp ) in lo gpio-694 ( |cd ) in lo ACTIVE LOW gpiochip6: GPIOs 704-735, parent: platform/5d0e0000.gpio, 5d0e0000.gpio: gpiochip7: GPIOs 736-767, parent: platform/5d0f0000.gpio, 5d0f0000.gpio: root@imx8qmmek:~# gpioinfo -c 1 gpiochip1 - 32 lines: line 0: unnamed input line 1: unnamed input line 2: unnamed input line 3: unnamed input line 4: unnamed input line 5: unnamed output consumer=gpioset line 6: unnamed output consumer=gpioset line 7: unnamed output line 8: unnamed input line 9: unnamed input line 10: unnamed input line 11: unnamed input line 12: unnamed input line 13: unnamed output consumer=regulator-pcie   How to enable legacy GPIO SYSFS(default disabled on L6 kernel and above) refer to the comment of this commit: https://github.com/nxp-imx/linux-imx/commit/3b4feb21158f873269ff3fbe2fe8d23a88d64b24 commit 3b4feb21158f873269ff3fbe2fe8d23a88d64b24 Author: Linus Walleij Date: Tue Nov 10 15:27:24 2020 +0100 gpio: sysfs: Enforce character device If users select sysfs support they get the character device as well so that end-users cannot complain that they "only have sysfs on my system". They should have the character device at all times. If someone is in so dire need of stripping out the character device while still enabling the sysfs ABI they can very well patch the kernel. Also only show this obsolete option to expert users. Signed-off-by: Linus Walleij Link: <> diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 5d4de5cd6759..4dd566f7ea39 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -59,8 +59,9 @@ config DEBUG_GPIO that are most common when setting up new platforms or boards. config GPIO_SYSFS - bool "/sys/class/gpio/... (sysfs interface)" + bool "/sys/class/gpio/... (sysfs interface)" if EXPERT depends on SYSFS + select GPIO_CDEV # We need to encourage the new ABI help Say Y here to add the legacy sysfs interface for GPIOs. To enable GPIO_SYSFS, from the patch. The best way is CONFIG_EXPERT = y, then enable CONFIG_GPIO_SYSFS=Y. not need to revert the patch. SYSFS, as legacy interface for GPIO control in Linux. While widely used in the past, this interface has been officially deprecated in favor of the libgpiod character device interface since Linux kernel version 6.0 and later. i.MX Processors
View full article
LPC5536 和 Hyperram 你好 我在 LPC5536JBD100 上配置 FLEXSPI 外设时遇到了难题;hyperram 芯片是 S27KS0642GABHV020。该系统位于自定义板上,我们已经成功地在其中集成了其他功能。 我受到 AN12239 的启发,它适用于不同的处理器,但以一种与我正在使用的芯片非常相似的芯片为例:在我看来,主要区别在于 S27KS0642 的新节点技术,它比应用程序节点中使用的 S27KS0641 更快,但时序图(因此虚拟周期)和命令是相同的。 另一个灵感来源是这篇文章 https://community.nxp.com/t5/MCX-Microcontrollers-Knowledge/MCX-N947-FlexSPI-Connecting-to-HyperRAM-Analysis-and/ta-p/1988799 这与我使用的处理器不同,但解释了配置数据结构中某些字段的含义。 我还看了示例 lpcxpresso55s36_flexspi_octal_polling_transfer 来比较 FlexSPI 配置(知道必须进行某些更改,因为它针对的是闪存设备)。 我的症状是,当我尝试读取供应商 ID 时,函数不返回 kStatus_Success(返回值为 7001)。 我检查了时钟是否已连接: CLOCK_SetClkDiv(kCLOCK_DivFlexSpiClk, 0U, true); /*!< Reset FLEXSPICLKDIV divider counter and halt it */ CLOCK_SetClkDiv(kCLOCK_DivFlexSpiClk, 2U, false); /*!< Set FLEXSPICLKDIV divider to value 2 */ CLOCK_AttachClk(kPLL0_to_FLEXSPI); /*!< Switch FLEXSPI to PLL0 */ 并通过图形用户界面配置了引脚 周波的配置方式为 int config_hr(void) { flexspi_config_t config; uint32_t tempCustomLUT[ARRAY_SIZE(customLUT)] = {0U}; /* Copy LUT information from flash region into RAM region, because flash will be reset and back to single mode; In lately time, LUT table assignment maybe failed after flash reset due to LUT read entry is application's required mode(such as octal DDR mode) and flash is being in single SDR mode, they don't matched. */ memcpy(tempCustomLUT, customLUT, sizeof(tempCustomLUT)); /* Get FLEXSPI default settings and configure the flexspi. */ FLEXSPI_GetDefaultConfig(&config); /* Init FLEXSPI. */ config.rxSampleClock = kFLEXSPI_ReadSampleClkExternalInputFromDqsPad;//kFLEXSPI_ReadSampleClkLoopbackFromDqsPad;//kFLEXSPI_ReadSampleClkExternalInputFromDqsPad; //config.enableSckBDiffOpt = true; //config.enableCombination = true; config.ahbConfig.enableAHBPrefetch = true; config.ahbConfig.enableAHBBufferable = true; config.ahbConfig.enableAHBCachable = true; // config.enableDoze = false; FLEXSPI_Init(EXAMPLE_FLEXSPI, &config); /* Configure RAM settings according to serial RAM feature. */ FLEXSPI_SetFlashConfig(EXAMPLE_FLEXSPI, &deviceconfig, kFLEXSPI_PortA1); /* Update LUT table. */ FLEXSPI_UpdateLUT(EXAMPLE_FLEXSPI, 0, tempCustomLUT, ARRAY_SIZE(customLUT)); /* Do software reset. */ FLEXSPI_SoftwareReset(EXAMPLE_FLEXSPI); return 0; } 我检查过了,即使在读取供应商 ID 的函数中,我们使用的也是 A1 端口 status_t flexspi_hyper_ram_get_id(FLEXSPI_Type *base, uint32_t *vendorId) { flexspi_transfer_t flashXfer; status_t status; uint32_t id; /* Write data */ flashXfer.deviceAddress = 0x0U; flashXfer.port = kFLEXSPI_PortA1; flashXfer.cmdType = kFLEXSPI_Read; flashXfer.SeqNumber = 1; flashXfer.seqIndex = HYPERRAM_CMD_LUT_SEQ_IDX_READREG; flashXfer.data = &id; flashXfer.dataSize = 4; status = FLEXSPI_TransferBlocking(base, &flashXfer); *vendorId = id & 0xffffU; return status; } flexspi_device_config_t 结构的初始化过程如下 flexspi_device_config_t deviceconfig = { .flexspiRootClk = 75000000, /* 75MHZ SPI serial clock */ .isSck2Enabled = false, .flashSize = FLASH_SIZE, .CSIntervalUnit = kFLEXSPI_CsIntervalUnit1SckCycle, .CSInterval = 2, .CSHoldTime = 1, .CSSetupTime = 1, .dataValidTime = 1, .columnspace = 3, .enableWordAddress = true, .AWRSeqIndex = HYPERRAM_CMD_LUT_SEQ_IDX_WRITEDATA, .AWRSeqNumber = 1, .ARDSeqIndex =HYPERRAM_CMD_LUT_SEQ_IDX_READDATA, .ARDSeqNumber = 0, .AHBWriteWaitUnit = kFLEXSPI_AhbWriteWaitUnit2AhbCycle, .AHBWriteWaitInterval = 0, .enableWriteMask = true, }; LUT 值为 #define LATENCY (0x04) uint32_t customLUT[20] = { /* Read Data */ [4 * HYPERRAM_CMD_LUT_SEQ_IDX_READDATA] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_DDR, kFLEXSPI_8PAD, 0xA0,kFLEXSPI_Command_RADDR_DDR, kFLEXSPI_8PAD, 0x18), [4 * HYPERRAM_CMD_LUT_SEQ_IDX_READDATA + 1] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_CADDR_DDR, kFLEXSPI_8PAD, 0x10, kFLEXSPI_Command_DUMMY_RWDS_DDR, kFLEXSPI_8PAD, LATENCY), [4 * HYPERRAM_CMD_LUT_SEQ_IDX_READDATA + 2] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_READ_DDR, kFLEXSPI_8PAD, 0x04, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0x00), /* Write Data */ [4 * HYPERRAM_CMD_LUT_SEQ_IDX_WRITEDATA] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_DDR, kFLEXSPI_8PAD, 0x20,kFLEXSPI_Command_RADDR_DDR, kFLEXSPI_8PAD, 0x18), [4 * HYPERRAM_CMD_LUT_SEQ_IDX_WRITEDATA + 1] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_CADDR_DDR, kFLEXSPI_8PAD, 0x10, kFLEXSPI_Command_DUMMY_RWDS_DDR, kFLEXSPI_8PAD, LATENCY), [4 * HYPERRAM_CMD_LUT_SEQ_IDX_WRITEDATA + 2] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_WRITE_DDR, kFLEXSPI_8PAD, 0x04, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0x00), /* Read Register */ [4 * HYPERRAM_CMD_LUT_SEQ_IDX_READREG] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_DDR, kFLEXSPI_8PAD, 0xE0,kFLEXSPI_Command_RADDR_DDR, kFLEXSPI_8PAD, 0x18), [4 * HYPERRAM_CMD_LUT_SEQ_IDX_READREG + 1] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_CADDR_DDR, kFLEXSPI_8PAD, 0x10, kFLEXSPI_Command_DUMMY_RWDS_DDR, kFLEXSPI_8PAD, LATENCY), [4 * HYPERRAM_CMD_LUT_SEQ_IDX_READREG + 2] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_READ_DDR, kFLEXSPI_8PAD, 0x04, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0x00), /* Write Register */ [4 * HYPERRAM_CMD_LUT_SEQ_IDX_WRITEREG] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_DDR, kFLEXSPI_8PAD, 0x60,kFLEXSPI_Command_RADDR_DDR, kFLEXSPI_8PAD, 0x18), [4 * HYPERRAM_CMD_LUT_SEQ_IDX_WRITEREG + 1] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_CADDR_DDR, kFLEXSPI_8PAD, 0x10, kFLEXSPI_Command_DUMMY_RWDS_DDR, kFLEXSPI_8PAD, LATENCY), [4 * HYPERRAM_CMD_LUT_SEQ_IDX_WRITEREG + 2] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_WRITE_DDR, kFLEXSPI_8PAD, 0x04, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0x00), }; 这对我来说很有感知,因为我总共使用了 48 个地址位,8 个键盘上有 DDR 模式,命令是正确的。 我是不是漏掉了什么? Re: LPC5536 and Hyperram 你好 谢谢。 不,我配置了更多引脚,但截图拍得很差:我猜有 8 个数据引脚,一个 RWDS、一个 CS_n 和一对差分时钟引脚。 Re: LPC5536 and Hyperram 你好@img_gabrigob 关于引脚配置 您是否只配置了 5 个数据引脚? S27KS0642GABHV020 需要 8 个数据引脚。 BR 哈利 Re: LPC5536 and Hyperram 你好 谢谢。我给你回复了,但我想我做错了什么(第一次使用这个社区),回复直接转到了我的原帖。 Re: LPC5536 and Hyperram 你好@img_gabrigob 首先,我认为您可以检查硬件。 探测物理信号(示波器): 确认 CK 按您预期的速率切换,交易的 CS# 脉冲,当您触发信号 Read-ID 序列时,DQ [7:0]/RWDS 会显示活动。 并将 FlexSPI 串行时钟降低到较低的安全频率(例如20-25 MHz),同时进行调试。 那么我认为您可以参考这个 LUT。 /* Read Register */ [4 * HYPERRAM_CMD_LUT_SEQ_IDX_READREG] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_DDR, kFLEXSPI_8PAD, 0xE0, kFLEXSPI_Command_RADDR_DDR, kFLEXSPI_8PAD, 0x18), [4 * HYPERRAM_CMD_LUT_SEQ_IDX_READREG + 1] = FLEXSPI_LUT_SEQ( kFLEXSPI_Command_CADDR_DDR, kFLEXSPI_8PAD, 0x10, kFLEXSPI_Command_DUMMY_RWDS_DDR, kFLEXSPI_8PAD, 0x06), [4 * HYPERRAM_CMD_LUT_SEQ_IDX_READREG + 2] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_READ_DDR, kFLEXSPI_8PAD, 0x04, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0x00), /* Write Register */ [4 * HYPERRAM_CMD_LUT_SEQ_IDX_WRITEREG] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_DDR, kFLEXSPI_8PAD, 0x60, kFLEXSPI_Command_RADDR_DDR, kFLEXSPI_8PAD, 0x18), [4 * HYPERRAM_CMD_LUT_SEQ_IDX_WRITEREG + 1] = FLEXSPI_LUT_SEQ( kFLEXSPI_Command_CADDR_DDR, kFLEXSPI_8PAD, 0x10, kFLEXSPI_Command_DUMMY_RWDS_DDR, kFLEXSPI_8PAD, 0x06), [4 * HYPERRAM_CMD_LUT_SEQ_IDX_WRITEREG + 2] = FLEXSPI_LUT_SEQ( kFLEXSPI_Command_WRITE_DDR, kFLEXSPI_8PAD, 0x04, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0x00), RT1064 HyperRAM 支持 S27KS0641 和 S27KS0642 - NXP Community BR 哈利 Re: LPC5536 and Hyperram 你好,@Harry_Zhang、 谢谢您! 我试着查看我的 LUT 与您链接的另一篇文章中用户使用的 LUT 之间是否存在任何差异,但即使在尝试调整延迟等待状态下的假人数量后,我还是遇到了同样的问题。 我不知道我是否在安装 IDE 时配置错误,但在 LPC5536 上,我似乎无法通过 flexspi_config_t 数据结构设置差分时钟(字段 enableSckBDiffOpt 位于禁用的 ifdef 中)。 我们在董事会采取了一些措施。CSN 和 CLK 信号处于激活状态。 我们使用两种压摆率(标准和高)来捕获时钟 时钟频率比我预想的要慢(我想我把它设置为 75MHz,这里是 75/2,而不是 150/2)。 数据和 RWDS 信号稳定在 0V。我们只是在数据信号上看到一个小故障(5 毫微秒)。 我还附上了从图形用户界面输出的 pin_mux 和 clock_config 文件。 请问您还有其他建议吗? 顺祝商祺! Re: LPC5536 and Hyperram 您好! 感谢您的回复 我再次检查了电路图,...我意识到 RESN 不受 FLEXspi 控制,因此我更改了软件,使其上升。 现在控制器可以工作了,我们还将 MCU 上的引脚配置为快速转换速率选项。 例如,这是 RWDS 与 CLK 的对比。 因此,问题在于 LUT 中的延迟值(使用您的链接进行更正)和 RESET。 我还有一些不明白的地方,即使这对这个项目并不重要,但可能对未来的应用有用:从时钟树中的配置来看,我期望 CLK 频率为 75MHz,但我测量的频率为 37.5MHz。 还有其他我错过的时钟分频器吗? 谢谢! 顺祝商祺! 加布里埃尔 Re: LPC5536 and Hyperram 你好@img_gabrigob 您能分享与 HyperRAM 的连接原理图吗? BR 哈利 Re: LPC5536 and Hyperram 你好@img_gabrigob 根据 LPC55S36 数据表。 时钟频率最高为 50M(DDR 模式)。 /* Flexspi frequency 150MHz / 3 = 50MHz */ CLOCK_SetClkDiv(kCLOCK_DivFlexSpiClk, 0U, true); /*!< Reset FLEXSPICLKDIV divider counter and halt it */ CLOCK_SetClkDiv(kCLOCK_DivFlexSpiClk, 3U, false); /*!< Set FLEXSPICLKDIV divider to value 3 */ CLOCK_AttachClk(kPLL0_to_FLEXSPI); /*!< Switch FLEXSPI to PLL0 */ BR 哈利
View full article
S32G2 IPC通信 NXPコミュニティの親愛なるメンバーの皆様、 私はちょうどNXP S32G2 IPCフレームワークに取り組み始めました。私は次のアプリケーションノートAN13750ています:「S32G2でのマルチコアアプリケーションの有効化 using S32G2 Platform Software Integration」と題し、いくつかの疑問を抱きました。 まず、ドキュメントからの流れを正しく理解しているかどうか 1. IPCを使用してLinuxイメージをビルドし、SDカードを使用してA53コアを起動します。 2. Design Studio を使用して M7 の IPC イメージをビルドし、ブートローダーを使用して M7 を SRAM に読み込みます。ブートローダーはEB Tresosによって提供されます。 3. A53からM7でIP通信を開始します。 上記の理解が正しいことを前提として、 1. デバッガを使用して、デザインスタジオからM7アプリケーションを直接実行できますか。 2. LinuxイメージをA53のSDカードから起動させます。 3. A53 linuxからM7とのIPC通信を開始します。 これは可能ですか?私は今のところEBブートローダーを扱いたくありませんが、プロセス全体についての私の理解が間違っていて、このブートローダーがIPCの機能にとって重要である場合を除きます。どんなコメント/提案も大歓迎です。 PS:アプリケーションノートで使用されている3つのコアではなく、1つのM7コアのみを使用したいです。 最良 ヴィシュヌ Re:S32G2 IPC通信 編集:「Description.txt」
View full article
Linux 嵌入式挑战项目 - 2014 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 1. 带行人聚光灯功能的自适应动态大灯 - eVision 团队成员: Balaban Valeriu - 高级微电子学、电子学、UPB 硕士 Voicu Tudor Alexandru - 学士,应用电子,电子,UPB Stanescu Sebastian - 学士,电信网络和软件,UPB 简短描述: 由于夜间事故死亡率高,因此开展了大量研究以开发技术 增加夜间驾驶员的视野范围,并在无法避免的情况下减少事故损失。这 自适应大灯功能有助于在光线不足的情况下,尤其是在弯道中看得更远:转向灯 按照行驶方向旋转前照灯,旋转角度由 CPU 计算,以照亮尽可能多的道路 面积尽可能 一个有趣的解决方案是聚光灯照明功能,它是一种专门照亮潜在危险的 LED 光束。 如果近红外摄像头检测到路边的鹿或道路上的行人,它们就会被短暂地照亮 在远光灯正常覆盖范围之外,用聚光灯提醒驾驶员注意可能存在的危险。 推介会: 请查阅eVisionPresentation.pdf 。 文档: 请查阅eVisionDoc.pdf 。 代码源 https://github.com/izzi/app-evision https://github.com/izzi/meta-evision 2. 人车交互语音控制界面 - She# 团队成员: Iulia Neagoe - 军事技术学院计算机科学与军事信息系统专业 Mihaela-Anca Sorostinean - 军事技术学院计算机科学与军事信息系统 简短描述: 在汽车和通信领域技术不断进步的背景下,驱动因素 责任已经从仅仅控制汽车转变为与汽车提供的众多小工具进行交互 制造商。该项目的目的是设计一个界面,为驾驶员提供控制 通过语音命令来控制汽车的一些非重要功能,以便驾驶员集中注意力 在路上行驶的同时还能与汽车进行舒适的通讯。 我们开发了一个语音识别系统,可以识别收音机、窗户、气候或电话等一些基本功能 我们在 Wandboard 上实现了它。我们还为用户提供了一个公认的图形界面 命令以增强他与车辆的互动。 推介会: 请查阅ShePresentation.pdf 。 文档: 请查阅SheDoc.pdf 。 代码源 请参阅She#_Project_Source.zip。 3. 驾驶控制软件 - FreeSoftwares 团队成员: Petrosanu Adrian-Sabin - 计算机科学,UPB Birsan Nicoleta Cosmina - 计算机科学,UPB Radoi Ioana Gabriela - 计算机科学,UPB 简短描述: 《驾驶控制软件》是一款控制自动变速箱的软件。该项目包括模拟行为 自动变速箱在 Wandboard 上的应用。自动变速箱是一种机动车辆变速箱,可以 随着车辆移动自动改变齿轮比。 推介会: 请查阅FreeSoftwaresPresentation.pdf 。 文档: 请查阅FreeSoftwaresDoc.pdf 。 代码源 请参阅Freesoftwares_Project_Source.zip。 4. 自动泊车 - 通过 ATM 团队成员: Mihai Coca - 军事技术学院计算机科学与军事信息系统专业 格鲁吉亚安德烈 - 军事技术学院计算机科学与军事信息系统 Hiji Iulian -军事技术学院计算机科学与军事信息系统 简短描述: 许多公司正在开发自动驾驶汽车技术,通过将其在该领域的工作应用于 一个特定的用例:停车。该项目的目的是设计一款概念车,它可以停放在 主人把车停在路边,让它自己进入停车位。这个过程甚至可以逆转 当车主准备离开时,汽车会自行停放离开现场,并在路边与钥匙持有者再次会合。 文档: 请查阅ATM Doc.pdf 代码源 请参阅ATM_Project_Source.zip。 5. 碰撞检测 - Beer2.0 团队成员: Nitu Adrian - 计算机科学,UPB 简短描述: 我们项目的目的是让汽车感知前方道路,并使其能够采取预防措施 碰撞;我们希望通过这种方式减少道路上的事故。它将收集来自不同硬件的信号和信息 并会向驾驶员发出警报或立即控制车辆,以便采取关键操作来保护驾驶员 免受任何危及生命的事件的影响。 飞思卡尔杯赛车将配备一个Wandboard和两个USB摄像头,以便我们能够追踪环境。初始之后 对象跟踪我们将通过远程控制融入人机交互。对于这个项目,我们相信一个简单的警告系统 和/或打破就足以作为概念的证明。 推介会: 请参阅Beer20Presentation.pdf 文档: 请查阅Beer20Doc.pdf 代码源 https://bitbucket.org/adriannitu92/freechallenge 6. 使用子带归一化滤波 X LMS 算法实现前馈自适应噪声消除 - Brainiacs 团队成员: Cristian Monea - 电信和信息技术、电子、UPB Madalin Zaharia - 电信和信息技术、电子、UPB 简短说明 本项目提出了一种基于子带归一化滤波X LMS(NFXLMS)的前馈自适应噪声消除(ANC)算法。 使用自适应算法比固定 FIR 或 IIR 滤波器等简单滤波算法具有优势。此外, 汽车环境可以被认为是静止的,因为它保留了一些属性,比如光谱分布、均值、方差,这些属性 允许在汽车噪音消除应用中使用自适应滤波器。 前馈系统应该比反馈系统更有效。在这种情况下,在它之前感测到相干参考噪声输入 传播通过取消扬声器。 因此,该算法将模拟两个传感器(麦克风):参考传感器,用于测量需要消除的主要噪声, 和错误传感器。 推介会: 请参阅BrainiacsPresentation.pdf 文档: 请查阅BrainiacsDoc.pdf 2014年Linux嵌入式挑战赛
View full article
S32K314 RTD (MCAL) - 由 OsIf 临界区引起的高优先级 ISR 死锁 S32K314 RTD (MCAL) - 由 OsIf 临界区引起的高优先级 ISR 死锁 你好, 我正在以下平台上开发一个应用程序: MCU:NXP S32K314 RTD 7.0.0(AUTOSAR MCAL) FreeRTOS 7.0.0 S32 设计工作室 3.6.4 在开发过程中,我遇到了与高优先级中断相关的死锁,想请教一下我的理解是否正确,以及是否有推荐的解决方案。 背景信息 FreeRTOS 规定优先级高于 configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 的中断服务例程 (ISR) 不得调用 FreeRTOS API。 然而,我发现许多 RTD MCAL API 在内部通过以下调用链执行 FreeRTOS 临界区 API: MCAL API ↓ SchM_Enter_xxx() ↓ OsIf_SuspendAllInterrupts() ↓ SuspendAllInterrupts() ↓ OsIf_Interrupts_SuspendAllInterrupts() ↓ taskENTER_CRITICAL_FROM_ISR() 以及 MCAL API ↓ SchM_Exit_xxx() ↓ OsIf_ResumeAllInterrupts() ↓ ResumeAllInterrupts() ↓ OsIf_Interrupts_ResumeAllInterrupts() ↓ taskEXIT_CRITICAL_FROM_ISR() 即使在仅执行简单外设寄存器访问的 API(例如 DIO 和 GPT)中,也存在这种行为。 问题 当从高优先级 ISR(优先级高于 configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY)调用 MCAL API 时,对 taskENTER_CRITICAL_FROM_ISR() 的内部调用会导致 FreeRTOS 中断屏蔽状态变得不一致。 因此,在 taskEXIT_CRITICAL_FROM_ISR() 返回后,BASEPRI 无法正确恢复,导致 SysTick 和 PendSV 等低优先级中断保持屏蔽状态。 调度程序最终停止,因为 xPortSysTickHandler() 不再执行。 我使用以下 API 重现了这个问题: Dio_FlipChannel() GPT(PIT)中断处理 其他使用 SchM 专属区域的 MCAL API 当前解决方法 为了避免直接修改 RTD 生成的源代码,我使用了 GNU 链接器的 --wrap 选项来包装以下函数: OsIf_Interrupts_SuspendAllInterrupts() OsIf_Interrupts_ResumeAllInterrupts() 该包装器会检查当前的中断优先级。 请参考附件WrapperExample.c 。 如果当前 ISR 优先级高于 configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY,则跳过原始函数。 否则,它将调用原始实现。 这种变通方法似乎可以解决死锁问题,同时保持生成的 RTD 源不变。 问题 RTD MCAL 的这种行为是设计预期的吗? 是否建议从高优先级 ISR 调用 DIO、GPT、CAN 或其他 MCAL API? NXP 是否建议为看门狗服务或 GPIO 切换等高优先级实时功能实现专用驱动程序(复杂设备驱动程序)? 使用 GNU 链接器的 --wrap 选项包装 OsIf_Interrupts_SuspendAllInterrupts() 和 OsIf_Interrupts_ResumeAllInterrupts() 是否是一种可接受的解决方法? 是否有官方或推荐的解决方案来解决此问题,而无需修改生成的 RTD 源代码? 任何建议或推荐都将不胜感激。 谢谢! Re: S32K314 RTD (MCAL) - High Priority ISR Deadlock Caused by OsIf Critical Sections 你好@tobara , 目前该案件正在等待RTD开发团队的意见。 BR,丹尼尔 Re: S32K314 RTD (MCAL) - High Priority ISR Deadlock Caused by OsIf Critical Sections 您好, 以下是对您问题的及时解答: RTD MCAL 的这种行为是预期行为吗?答:是的,这是因为您正在从 CAT1 中断(即优先级高于 MAX SYSCALL 的中断)调用操作系统 API。大于 MAX_SYSCALL 的中断次数是为了以最小的延迟完成工作,并且不受 RTOS 的干扰。如果您需要避免 RTOS 引入的延迟,则不应该调用最终会使用 RTOS 的 API。 是否建议从高优先级 ISR 调用 DIO、GPT、CAN 或其他 MCAL API? 答:不,不能大于 MAX_SYSCAL,原因已在第一个答案中提及。 NXP 是否建议为看门狗服务或 GPIO 切换等高优先级实时功能实现专用驱动程序(复杂设备驱动程序)? 回答: 如果您已经能够容忍 RTD SchM、OSIf API、RTOS 引入的延迟,那么您可以直接使用现有的驱动程序,但只需从高于 MAX_SYSCALL 的中断调用它们即可。您仍然可以获得优先级提升,但不会遇到工单中描述的问题。 使用 GNU 链接器的 --wrap 选项包装 OsIf_Interrupts_SuspendAllInterrupts() 和 OsIf_Interrupts_ResumeAllInterrupts() 是否是一种可接受的解决方法? 答:不,简单的分析表明,这种变通方法只能在一个方向上起到保护作用。它或许可以避免死锁,但不能保护与优先级更高的 ISR (> MAX_SYSCALL) 共享寄存器/资源的优先级较低的 ISR。这种实现方式可能会在共享寄存器和全局变量上引入竞争条件。 是否有官方或推荐的解决方案来解决此问题,而无需修改生成的 RTD 源代码?答案(但需要 RTD 团队确认) :不要从 IRQ > MAX_SYSCALL 调用 RTD / RTOS API。如果您可以容忍当前的 RTD->OSIF->RTOS 延迟,那么只需使用优先级更高的 IRQ,但低于 MAX_SYSCALL 即可。 所有答案都需要RTD团队确认,我是从RTOS的角度回答的。 Re: S32K314 RTD (MCAL) - High Priority ISR Deadlock Caused by OsIf Critical Sections 非常感谢您的详细解释。 我现在理解了NXP RTD/MCAL的以下设计限制: 不得从高优先级 ISR(优先级高于configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY的中断)调用 RTD/MCAL API。 虽然使用--wrap可以防止死锁,但绕过 RTD 临界区可能会在高优先级和低优先级上下文之间共享资源或寄存器时引入竞争条件。 我还有几个问题。 如果应用程序需要在高优先级 ISR(AUTOSAR 1 类 ISR)中进行处理,推荐的软件架构是什么?此类功能是否应该始终以复杂设备驱动程序 (CDD) 或专用底层驱动程序的形式实现? 如果一个 GPIO 端口或定时器通道被一个高优先级 ISR 独占,并且从未被任何其他任务或 ISR 访问,那么对于--wrap解决方法,竞争条件的问题是否仍然适用? 目前的 RTD/MCAL 不支持从高优先级 ISR 中使用其 API,因此必须使用 CDD 或专用驱动程序来实现高实时性功能,这种理解是否正确? 根据我在汽车领域之外的嵌入式软件开发经验,硬件抽象层通常被设计成独立于操作系统。因此,我惊讶地发现,简单的 GPIO 和定时器 API 在内部调用了 RTOS 临界区 API。 作为参考,我附上了我为避免此问题而实现的 GPT 驱动程序(CpuPit.h/c)。 我非常感谢RTD团队的任何意见或建议。 再次感谢您的支持。
View full article
i.MX8QM-MEK 上的 AAOS 15 中 CAN 接口的可用性和集成 您好,NXP支持团队, 我们目前正在评估 i.MX8QM-MEK 平台,用于构建汽车安卓系统 (AAOS) 概念验证,其中包括: 双触控显示屏 CAN通信接口 通过AAOS框架实现车辆信号可视化 我们已成功版本并刷写了 AAOS 15 (15.0.0_2.1.0)在 i.MX8QM 换成产品名,如“i.mx8-mek是……” 板上,目前正在进行 CAN 集成。   版本目标:mek_8q_car-nxp_stable-userdebug 我们的目标是从汽车网络接收 CAN 消息,并通过车辆 HAL (VHAL) 和车辆属性管理器框架将这些信号映射到 AAOS 车辆属性。 然而,我们面临以下问题: 目标系统上没有 CAN 接口(例如 can0)。 CAN 网络接口未出现在ifconfig -a或ip link show中。 我们想了解在 i.MX8QM-MEK 平台上将 CAN 信号集成到 AAOS 15 中的推荐方法。 根据我们的调查,我们了解到 CAN 收发器控制信号(例如 CAN01_EN 和 CAN01_STB_B)是通过连接到 M4 子系统的 I/O 扩展器,经由 M41_I2C0_1V8_SCL 和 M41_I2C0_1V8_SDA 接口进行控制的。 请问您能否帮忙澄清以下问题: AAOS 15 (15.0.0_2.1.0) 是否正式支持 CAN 功能?适用于 i.MX8QM-MEK? 要启用 CAN 接口,是否需要额外的设备树配置、内核配置、固件要求或 M4 固件依赖项? 在 Linux/Android 系统中,CAN 控制器可用之前,是否需要通过 M4 固件配置 I/O 扩展器? 是否有任何参考文档、应用笔记或示例实现可用于将 CAN 信号与 AAOS 中的 VHAL/Car Property Manager 内置? 请查看下方附件中的相关调试信息。 mek_8q:/ # ifconfig -a lo Link encap:本地环回 互联网地址:127.0.0.1 掩码:255.0.0.0 inet6 地址:::1/128 范围:主机 环路已启动,运行中,MTU:65536,指标:1 接收数据包:0 个错误:0 个丢弃:0 个溢出:0 个帧:0 个 发送数据包:0 个错误:0 个丢弃:0 个溢出:0 个载波:0 个 碰撞次数:0 txqueuelen:1000 接收字节数:0 发送字节数:0 dummy0 链路封装:以太网硬件地址 da:0a:64:88:22:0b inet6 地址:fe80::d80a:64ff:fe88:220b/64 范围:链路 广播已启动 NOARP MTU:1500 指标:1 接收数据包:0 个,错误:0 个,丢弃:0 个,溢出:0 个,帧:0 个 发送数据包:10 个,错误:0 个,丢弃:0 个,溢出:0 个,载波:0 个 碰撞次数:0 txqueuelen:1000 接收字节数:0 发送字节数:700 ifb0 链接 encap:以太网 HWaddr b2:9d:fa:9a:d4:6b 广播 NOARP MTU:1500 指标:1 接收数据包:0 个错误:0 个丢弃:0 个溢出:0 个帧:0 个 发送数据包:0 个错误:0 个丢弃:0 个溢出:0 个载波:0 个 碰撞次数:0 txqueuelen:32 接收字节数:0 发送字节数:0 ifb1 链路封装:以太网硬件地址 3e:8d:51:4e:e0:8b 广播 NOARP MTU:1500 指标:1 接收数据包:0 个,错误:0 个,丢弃:0 个,溢出:0 个,帧:0 个 发送数据包:0 个错误:0 个丢弃:0 个溢出:0 个载波:0 个 碰撞次数:0 txqueuelen:32 接收字节数:0 发送字节数:0 tunl0 链接封装:UNSPEC NOARP MTU:1480 公制:1 接收数据包:0 个,错误:0 个,丢弃:0 个,溢出:0 个,帧:0 个 发送数据包:0 个错误:0 个丢弃:0 个溢出:0 个载波:0 个 碰撞次数:0 txqueuelen:1000 接收字节数:0 发送字节数:0 gre0 链接封装:UNSPEC NOARP MTU:1476 公制:1 接收数据包:0 个,错误:0 个,丢弃:0 个,溢出:0 个,帧:0 个 发送数据包:0 个错误:0 个丢弃:0 个溢出:0 个载波:0 个 碰撞次数:0 txqueuelen:1000 接收字节数:0 发送字节数:0 gretap0 链路封装:以太网 硬件地址 00:00:00:00:00:00 广播组播 MTU:1462 度量:1 接收数据包:0 个,错误:0 个,丢弃:0 个,溢出:0 个,帧:0 个 发送数据包:0 个错误:0 个丢弃:0 个溢出:0 个载波:0 个 碰撞次数:0 txqueuelen:1000 接收字节数:0 发送字节数:0 erspan0 链路封装:以太网 硬件地址 00:00:00:00:00:00 广播组播 MTU:1450 度量:1 接收数据包:0 个错误:0 个丢弃:0 个溢出:0 个帧:0 个 发送数据包:0 个错误:0 个丢弃:0 个溢出:0 个载波:0 个 碰撞次数:0 txqueuelen:1000 接收字节数:0 发送字节数:0 ip_vti0 链路封装:UNSPEC NOARP MTU:1480 公制:1 接收数据包:0 个错误:0 个丢弃:0 个溢出:0 个帧:0 个 发送数据包:0 个错误:0 个丢弃:0 个溢出:0 个载波:0 个 碰撞次数:0 txqueuelen:1000 接收字节数:0 发送字节数:0 ip6_vti0 链路封装:UNSPEC NOARP MTU:1364 公制:1 接收数据包:0 个,错误:0 个,丢弃:0 个,溢出:0 个,帧:0 个 发送数据包:0 个错误:0 个丢弃:0 个溢出:0 个载波:0 个 碰撞次数:0 txqueuelen:1000 接收字节数:0 发送字节数:0 sit0 链路封装:IPv6-in-IPv4 NOARP MTU:1480 公制:1 接收数据包:0 个错误:0 个丢弃:0 个溢出:0 个帧:0 个 发送数据包:0 个错误:0 个丢弃:0 个溢出:0 个载波:0 个 碰撞次数:0 txqueuelen:1000 接收字节数:0 发送字节数:0 ip6tnl0 链路封装:UNSPEC NOARP MTU:1452 公制:1 接收数据包:0 个错误:0 个丢弃:0 个溢出:0 个帧:0 个 发送数据包:0 个错误:0 个丢弃:0 个溢出:0 个载波:0 个 碰撞次数:0 txqueuelen:1000 接收字节数:0 发送字节数:0 ip6gre0 链接封装:UNSPEC NOARP MTU:1448 公制:1 接收数据包:0 个错误:0 个丢弃:0 个溢出:0 个帧:0 个 发送数据包:0 个错误:0 个丢弃:0 个溢出:0 个载波:0 个 碰撞次数:0 txqueuelen:1000 接收字节数:0 发送字节数:0 eth0 链路封装:以太网 硬件地址 00:04:9f:05:ed:db 驱动程序 fec 内部地址:10.16.102.48 广播地址:10.16.102.255 掩码:255.255.255.0 inet6 地址:fe80::260d:6a5f:7a04:afdd/64 范围:链路 广播运行中 多播 MTU:1500 指标:1 接收数据包:301803 个,错误:0 个,丢弃:73390 个,溢出:0 个,帧:0 个 发送数据包:241 个,错误:0 个,丢弃:0 个,溢出:0 个,载波:0 个 碰撞次数:0 txqueuelen:1000 接收字节:52500562 发送字节:25613 mek_8q:/ # dmesg | grep i2c [ 0.062877] /bus@5b000000/usb@5b110000/usb@5b120000:修复了与 /bus@5a000000/i2c@5a800000/tcpc@51 的依赖循环 [ 0.063545] /bus@5b000000/usb@5b110000/usb@5b120000:修复了与 /bus@5a000000/i2c@5a800000/tcpc@51 的依赖循环 [ 0.075349] /bus@56240000/i2c@56247000/lvds-to-hdmi-bridge@4c:修复了与 /bus@56240000/ldb1-display-controller/lvds-channel@0 的依赖循环。 [ 0.075382] /bus@56240000/ldb1-display-controller/lvds-channel@0:修复了与 /bus@56240000/i2c@56247000/lvds-to-hdmi-bridge@4c 的依赖循环 [ 0.076099] /bus@56240000/i2c@56247000/lvds-to-hdmi-bridge@4c:修复了与 /bus@56240000/ldb1-display-controller/lvds-channel@0 的依赖循环。 [ 0.076180] /bus@56240000/ldb1-display-controller/lvds-channel@0:修复了与 /bus@56240000/i2c@56247000/lvds-to-hdmi-bridge@4c 的依赖循环 [ 0.076927] /bus@56220000/i2c@56226000/adv7535@3d:修复了与 /bus@56220000/dsi_host@56228000 的依赖循环 [ 0.076980] /bus@56220000/dsi_host@56228000:已修复与 /bus@56220000/i2c@56226000/adv7535@3d 的依赖循环 [ 0.077923] /bus@56220000/i2c@56226000/adv7535@3d:修复了与 /bus@56220000/dsi_host@56228000 的依赖循环 [ 0.078188] /bus@56220000/i2c@56226000/adv7535@3d:修复了与 /bus@56220000/dsi_host@56228000 的依赖循环 [ 0.078294] /bus@56220000/dsi_host@56228000:修复了与 /bus@56220000/i2c@56226000/adv7535@3d 的依赖循环 [ 0.079093] /bus@57220000/i2c@57226000/adv7535@3d:修复了与 /bus@57220000/dsi_host@57228000 的依赖循环 [ 0.079148] /bus@57220000/dsi_host@57228000:修复了与 /bus@57220000/i2c@57226000/adv7535@3d 的依赖循环 [ 0.080033] /bus@57220000/i2c@57226000/adv7535@3d:修复了与 /bus@57220000/dsi_host@57228000 的依赖循环 [ 0.080278] /bus@57220000/i2c@57226000/adv7535@3d:修复了与 /bus@57220000/dsi_host@57228000 的依赖循环 [ 0.080331] /bus@57220000/dsi_host@57228000:修复了与 /bus@57220000/i2c@57226000/adv7535@3d 的依赖循环 [ 0.080618] /bus@5a000000/i2c@5a800000/tcpc@51/connector:修复了与 /cbtl04gp 的依赖循环 [ 0.080674] /cbtl04gp:修复了与 /bus@5a000000/i2c@5a800000/tcpc@51/connector 的依赖循环 [ 4.329499] imx-lpi2c 5a800000.i2c:使用 PIO 模式 [ 4.335299] /bus@5b000000/usb@5b110000/usb@5b120000:修复了与 /bus@5a000000/i2c@5a800000/tcpc@51 的依赖循环 [ 4.346831] /bus@5a000000/i2c@5a800000/tcpc@51:修复了与 /bus@5b000000/usb@5b110000/usb@5b120000 的依赖循环 [ 4.358306] /bus@5a000000/i2c@5a800000/tcpc@51/connector:修复了与 /cbtl04gp 的依赖循环 [ 4.369504] i2c i2c-2: of_i2c: /bus@5a000000/i2c@5a800000/fxos8700@1e 上的模态别名失败 [ 4.378432] i2c i2c-2:创建 /bus@5a000000/i2c@5a800000/fxos8700@1e 的 I2C 设备失败 [ 4.387694] i2c i2c-2:LPI2C 适配器已注册 [ 4.393761] imx-lpi2c 5a810000.i2c:使用 PIO 模式 [ 4.399176] i2c i2c-3:使用引脚控制状态进行 GPIO 恢复 [ 4.415470] i2c i2c-3:使用通用 GPIO 进行恢复 [ 4.421623] i2c i2c-3:LPI2C 适配器已注册 [ 4.427928] imx-lpi2c 56247000.i2c:使用 PIO 模式 [ 4.433503] /bus@56240000/ldb1-display-controller/lvds-channel@0:修复了与 /bus@56240000/i2c@56247000/lvds-to-hdmi-bridge@4c 的依赖循环 [ 4.447437] /bus@56240000/i2c@56247000/lvds-to-hdmi-bridge@4c:修复了与 /bus@56240000/ldb1-display-controller/lvds-channel@0 的依赖循环。 [ 4.461316] i2c i2c-4:LPI2C 适配器已注册 [ 4.467791] imx-lpi2c 56226000.i2c:使用 PIO 模式 [ 4.473320] /bus@56220000/dsi_host@56228000:修复了与 /bus@56220000/i2c@56226000/adv7535@3d 的依赖循环 [ 4.484383] /bus@56220000/i2c@56226000/adv7535@3d:修复了与 /bus@56220000/dsi_host@56228000 的依赖循环 [ 4.495461] i2c i2c-5:LPI2C 适配器已注册 [ 4.501796] imx-lpi2c 57226000.i2c:使用 PIO 模式 [ 4.507337] /bus@57220000/dsi_host@57228000:修复了与 /bus@57220000/i2c@57226000/adv7535@3d 的依赖循环 [ 4.518372] /bus@57220000/i2c@57226000/adv7535@3d:修复了与 /bus@57220000/dsi_host@57228000 的依赖循环 [ 4.529441] i2c i2c-6:LPI2C 适配器已注册 [ 4.538112] i2c i2c-2:新增多路复用 i2c 总线 7 [ 4.543745] i2c i2c-2:新增多路复用 i2c 总线 8 [ 4.549248] i2c-mux-gpio i2cmux:5a800000.i2c 适配器上的 2 端口复用器 [ 4.586228] i2c i2c-2:未找到电源 VDD,使用虚拟稳压器 [ 4.593252] i2c i2c-2:未找到供电的 VDDIO,使用虚拟稳压器 [ 4.651657] st-accel-i2c 2-0019: 未找到电源 VDD,使用虚拟稳压器 [ 4.659540] st-accel-i2c 2-0019:未找到供电的 vddio,使用虚拟稳压器 [ 4.674354] st-accel-i2c 2-0019:使用驱动程序 st-accel-i2c 进行探测失败,错误代码为 -5 [ 4.684848] st-magn-i2c 8-001e:未找到电源 VDD,使用虚拟稳压器 [ 4.692677] st-magn-i2c 8-001e:未找到供电电压输入/输出 (VDIO),使用虚拟稳压器 [ 4.708084] st-magn-i2c 8-001e:未找到安装矩阵:使用标识... [ 4.720647] st-gyro-i2c 2-0069:未找到电源 VDD,使用虚拟稳压器 [ 4.728469] st-gyro-i2c 2-0069:未找到供电的 vddio,使用虚拟稳压器 [ 4.743163] st-gyro-i2c 2-0069:使用驱动程序 st-gyro-i2c 进行探测失败,错误代码为 -5 [ 4.861147] virtio_rpmsg_bus virtio1:创建通道 rpmsg-i2c-channel 地址 0x2 [ 4.876919] i2c-rpmsg virtio1.rpmsg-i2c-channel.-1.2: 新通道: 0x400 -> 0x2! [ 4.901196] imx_rpmsg_i2c i2c-rpbus-1: 成功添加 I2C 适配器 i2c-rpmsg-adapter [ 5.007981] /bus@5a000000/i2c@5a800000/tcpc@51:修复了与 /bus@5b000000/usb@5b110000/usb@5b120000 的依赖循环 [ 5.024985] /bus@5b000000/usb@5b110000/usb@5b120000:修复了与 /bus@5a000000/i2c@5a800000/tcpc@51 的依赖循环 [ 16.457456] imx-lpi2c 57247000.i2c:使用 PIO 模式 [ 16.463779] i2c i2c-9:LPI2C 适配器已注册 [ 16.470664] /bus@57240000/ldb2-display-controller/lvds-channel@0:修复了与 /bus@57240000/i2c@57247000/lvds-to-hdmi-bridge@4c 的循环依赖问题 [ 17.057471] /bus@58000000/i2c@58226000/max9286_csi0@6a:修复了与 /bus@58000000/i2c@58226000/max9286_csi0@6a/i2c-mux/i2c@0/c1 的依赖循环 [ 17.083749] /bus@58000000/i2c@58226000/max9286_csi0@6a:修复了与 /bus@58000000/i2c@58226000/max9286_csi0@6a/i2c-mux/i2c@1/c2 的循环依赖关系 [ 17.112012] /bus@58000000/i2c@58226000/max9286_csi0@6a:修复了与 /bus@58000000/i2c@58226000/max9286_csi0@6a/i2c-mux/i2c@2/c3 的依赖循环 [ 17.126760] /bus@58000000/i2c@58226000/max9286_csi0@6a:修复了与 /bus@58000000/i2c@58226000/max9286_csi0@6a/i2c-mux/i2c@3/c4 的依赖循环 [ 17.141567] /bus@58000000/i2c@58226000/max9286_csi0@6a/i2c-mux/i2c@3/camera@54:修复了与 /bus@58000000/i2c@58226000/max9286a 的循环依赖问题 [ 17.156682] /bus@58000000/i2c@58226000/max9286_csi0@6a/i2c-mux/i2c@2/camera@53:修复了与 /bus@58000000/i2c@58226000/max9286a 的循环依赖问题 [ 17.171754] /bus@58000000/i2c@58226000/max9286_csi0@6a/i2c-mux/i2c@1/camera@52:修复了与 /bus@58000000/i2c@58226000/max9286a 的循环依赖问题 [ 17.186407] /bus@58000000/i2c@58226000/max9286_csi0@6a/i2c-mux/i2c@0/camera@51:修复了与 /bus@58000000/i2c@58226000/max9286a 的循环依赖问题 [ 17.204964] imx-lpi2c 58226000.i2c:使用 PIO 模式 [ 17.211086] /bus@58000000/i2c@58226000/max9286_csi0@6a:修复了与 /bus@58000000/i2c@58226000/max9286_csi0@6a/i2c-mux/i2c@0/c1 的依赖循环 [ 17.225631] /bus@58000000/i2c@58226000/max9286_csi0@6a:修复了与 /bus@58000000/i2c@58226000/max9286_csi0@6a/i2c-mux/i2c@1/c2 的依赖循环 [ 17.240271] /bus@58000000/i2c@58226000/max9286_csi0@6a:修复了与 /bus@58000000/i2c@58226000/max9286_csi0@6a/i2c-mux/i2c@2/c3 的依赖循环 [ 17.254871] /bus@58000000/i2c@58226000/max9286_csi0@6a:修复了与 /bus@58000000/i2c@58226000/max9286_csi0@6a/i2c-mux/i2c@3/c4 的依赖循环 [ 17.269824] /bus@58000000/i2c@58226000/max9286_csi0@6a/i2c-mux/i2c@3/camera@54:修复了与 /bus@58000000/i2c@58226000/max9286a 的循环依赖问题 [ 17.284422] /bus@58000000/i2c@58226000/max9286_csi0@6a/i2c-mux/i2c@2/camera@53:修复了与 /bus@58000000/i2c@58226000/max9286a 的循环依赖问题 [ 17.299030] /bus@58000000/i2c@58226000/max9286_csi0@6a/i2c-mux/i2c@1/camera@52:修复了与 /bus@58000000/i2c@58226000/max9286a 的循环依赖问题 [ 17.314057] /bus@58000000/i2c@58226000/max9286_csi0@6a/i2c-mux/i2c@0/camera@51:修复了与 /bus@58000000/i2c@58226000/max9286a 的循环依赖问题 [ 17.328911] i2c i2c-10:LPI2C 适配器已注册 [ 17.349901] /bus@58000000/i2c@58226000/max9286_csi0@6a:修复了与 /bus@58000000/csi@58227000 的依赖循环 [ 17.361147] /bus@58000000/csi@58227000:修复了与 /bus@58000000/i2c@58226000/max9286_csi0@6a 的依赖循环 mek_8q:/ # mek_8q:/ # mek_8q:/ # dmesg | grep -我可以 [ 6.341664] init: 初始化程序无法将“ro.boot.boot_devices”设置为“bus@5b000000/5b010000.mmc”:只读属性已被设置 [ 6.650631] apexd-bootstrap:正在扫描 /odm/apex 目录,查找预安装的 Apex 文件 [ 6.665082] apexd-bootstrap:正在扫描 /vendor/apex 目录,查找预安装的 Apex 文件 [ 6.734597] apexd-bootstrap:正在扫描 /product/apex 目录,查找预安装的 Apex 文件 [ 7.762352] 可以:控制器区域网络核心 [ 7.767572] NET:已注册 PF_CAN 协议族 [ 7.778629] 可以:广播管理器协议 [ 7.789732] CAN 设备驱动程序接口 [ 7.798655] 可以:netlink 网关 - max_hops=1 [ 7.809873] 可以:原始协议 [ 8.206633] vdc: 线程池最大线程数为 0。无法缓存 binder,因为 linkToDeath 无法实现。服务名称:vold [ 8.306877] vdc: 线程池最大线程数为 0。无法缓存绑定器,因为无法实现 linkToDeath。服务名称:vold [ 9.537245] slcan:串行线路 CAN 接口驱动程序 [ 9.765447] vcan:虚拟 CAN 接口驱动程序 [ 9.871087] vdc:线程池最大线程数为 0。无法缓存绑定器,因为无法实现 linkToDeath。服务名称:vold [ 10.127065] apexd:线程池最大线程数为 0。无法缓存 binder,因为 linkToDeath 无法实现。服务名称:vold [ 10.140039] apexd:正在扫描 /odm/apex 目录,查找预安装的 Apex 文件 [ 10.165055] apexd:正在扫描 /vendor/apex 目录,查找预安装的 Apex 文件 [ 10.190899] 热报警已取消。GPU3D 时钟频率将恢复到 64/64 [ 12.094764] vdc: 线程池最大线程数为 0。无法缓存 binder,因为 linkToDeath 无法实现。服务名称:vold [ 12.980708] apexd-snapshotde: 线程池最大线程数为 0。无法缓存 binder,因为 linkToDeath 无法实现。服务名称:vold [ 14.174685] update_verifier: 线程池最大线程数为 0。无法缓存 binder,因为 linkToDeath 无法实现。服务名称:android.hat [ 27.936501] 平台 fec2_nvcc:延迟探测待处理:reg-fixed-voltage:无法获取 GPIO mek_8q:/ # ls /sys/总线/i2c/设备/ 1-0048 2-0020 2-0069 4-004c 7-001e i2c-1 i2c-3 i2c-6 i2c-9 10-006a 2-0044 3-001a 5-003d 8-001e i2c-10 i2c-4 i2c-7 2-0019 2-0051 4-0033 6-003d 9-004c i2c-2 i2c-5 i2c-8 Android i.MX 8 系列 | i.MX 8QuadMax (8QM) | 8QuadPlus Re: CAN Interface Availability and Integration in AAOS 15 on i.MX8QM-MEK 你好, 您需要将 FLEXCAN 添加到内核中,您可以参考 Android 用户指南第 9 章“通用内核映像 (GKI) 开发”。 https://www.nxp.com/docs/en/user-guide/UG10176.pdf 另外请注意,如果您想在 A 核心上使用它们,则需要在 SCFW 中将资源移动到该核心。 测试方面也是如此,您可以添加 canutils: https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/All-Boards-FlexCAN/ta-p/1103092 此致敬礼/Saludos, 阿尔多。
View full article
rte_eth_rx_burst -> 连续两次返回相同的 mbuff 指针 从我的应用程序调用 rte_eth_rx_burst 有时同一 mbuff 会出现两次。已检查代码缓冲区未释放 .在没有空闲 mbuff 的情况下,同一 mbuff 指针会收到两次。 QorIQ LS1设备 Re: rte_eth_rx_burst -> returning same mbuff pointer twice consecutively 启用 DPDK 日志级别(首先尝试) 运行应用程序: --日志级别=8 你会看到什么? 处理 RX 描述符 缓冲区分配/再循环 PMD 行为 启用 mbuf 调试检查(非常有用) 用以下工具重建 DPDK CONFIG_RTE_LIBRTE_MBUF_DEBUG=y 这将 验证 mbuf 的一致性 接住: 损坏的元数据 错误地重复使用了 mbuf 无效 启用 mempool 调试 CONFIG_RTE_LIBRTE_MEMPOOL_DEBUG=y 有助于检测 双分配 缓存损坏 从 mempool 返回两次相同的缓冲区 毒物/自由追踪(非常有用) 您可以启用内存覆盖检查: CONFIG_RTE_MALLOC_DEBUG=y 以及 -mp-alloc=debug 这有助于检测: 覆盖之前/之后的 mbuf 隐藏的内存损坏 快速隔离技巧(非常有效) 运行 testpmd -- -i 然后: set fwd rxonly 开始 如果重复消失: 您的应用程序错误 如果仍然发生: PMD / HW / 队列配置问题 Re: rte_eth_rx_burst -> returning same mbuff pointer twice consecutively 感谢@yipingwang的快速回复和建议。我无法从代码中找出更多信息。有任何 DPDK 调试标志可以提供帮助吗? Re: rte_eth_rx_burst -> returning same mbuff pointer twice consecutively 如果您的代码中没有明确的 mbuf 空白,最有可能的情况是 mbuf 仍在通过应用程序中的其他路径有效返回/重复使用,或者不安全地跨线程/内核共享,或者特定于驱动程序/路径的特殊缓冲区处理问题正在破坏生命周期状态。 跨核/共享 mbuf 所有权问题。 一个记录在案的案例中使用了一个 CPU 用于 RX,许多工作程序 CPU 消耗了环中的 mbuf;然后看到 mbuf 地址被重复使用/覆盖,但仍在其他地方被引用。恩智浦特别询问 RTE_MBUF_REFCNT_ATOMIC 是否为多核访问启用,客户说是,但问题仍被视为应用级所有权/寿命处理、 应用程序管道中有重复的版本或隐藏的返回路径。在这种情况下,恩智浦的指导方针是分析缓冲区分配/释放/数据包发送操作,以查看相同的地址是否被多次释放回缓冲池。 PMD/driver 在特殊路径中向池返回畸形 mbufs。 另外还有一个涉及链式 mbuf 的 DPAA2 PMD 案例,在该案例中,返回 mempool 的 mbuf 出现损坏( 下一个 未清除),从而导致以后分配时的正确性检查失败。这与您的报告症状不同,但它确实表明特殊的缓冲区处理路径可能会导致以后的重复使用/损坏症状。 加密路径中的源和目标 mbuf 相同。 在 DPAA 网络安全/IPsec 案例中,恩智浦指出,如果  sym->m_dst  为  NULL  ,则  m_src  和  m_dst  使用相同的 mbuf。这可能会使数据包内容在负载情况下 "就地 "重写,即使指针标识没有改变。 Re: rte_eth_rx_burst -> returning same mbuff pointer twice consecutively 感谢@yipingwang的快速回复。我会尽量向您汇报情况。 每当多个 mbuf(来自同一地址)到达时,屏幕上都会显示以下内容: fslmc: dpaa2_get_qbman_swp(): 新增门户 0x17ffd61c0 (5) 关联线程 - 1953 fslmc: dpaa2_configure_stashing(): 门户= 5 CPU= 10 SDEST= 5 fslmc: DPAA 门户=0x17ffd61c0 (5) 已绑定至线程 1953 Re: rte_eth_rx_burst -> returning same mbuff pointer twice consecutively 这些 fslmc / dpaa2 portal affined thread 日志强烈表明门户(QbMan SWP)正在重新连接到不同的线程/内核,这可能会破坏所有权模型 → 导致 mbuf 重复使用/重复症状。
View full article
llcecan问题 嗨,NXP 小组: 测试硬件:S32G274 软件版本:bsp38 can setting: ip link set llcecan(0~3)type can \ bitrate 500000 \ sample-point 0.8 \ dbitrate 2000000 \ dsample-point 0.7 \ fd on 测试用例: 1: Vector v1640 can1 可以连接到 s32g 的 can0~can3, can2 可以连接到 s32g 的 llce_can0~llce_can3 2: vector1640 发送 can 数据,s32g 接收 can 数据。 3: 检查发送和接收的数据帧是否一致。 测试结果: 1:数据帧在 llce_can0~llce_can3 中丢失,但在 can0~can3 中没有丢失。 参考图像如下 图 1:我们可以看到 v1640 can1 共发送了 1,823,705 帧,而在图 2 中,s32g274 can0~can3 收到了 1,823,705 帧而没有任何帧损失。 我们可以看到,v1640 can2 发送的帧总数为 1 845 947,而 s32g274 llce_can0~llce_can3 接收的帧总数约为 1 845 887。损失 60 帧。 当 CPU 负载相对较高时,丢帧情况就会恶化。是否有可能增加 LLCE_CAN_MAX_RX_MB,以减少 CPU 负载。同时,如何解决丢帧问题?是否有任何优化项目? Re: llcecan question 你好,@张博文 感谢您的回复。 为了进一步调查这个问题,我首先希望在本地 RDB2 上重现这个问题。 您能否澄清以下问题? 1.您的测试使用的是哪个版本的 LLCE FW? 2。你有没有用其他版本的 BSP 测试过?如果是这样,结果也一样吗? 3.是否只有在通过所述的 8 个 CAN 通道进行基准测试时才会出现丢帧现象?请问您是否只对 LLCE CAN 接口进行过压力测试?有没有简化的测试设置可以重现该问题? 4.测试的负载是多少?发现帧丢失时的吞吐量值是多少?测试期间 CPU 的平均负载是多少? BR 切宁 Re: llcecan question 您好, 感谢您的回复。 在我将 LLCE_CAN_MAX_RX_MB 修改为 64 和 128 后,CPU 负载并没有减少,或者减少得不明显,因此很难观察到。 而 llcecan 的丢帧现象依然存在 Re: llcecan question 你好,@张博文 谢谢您的帖子。 从共享的描述来看,似乎是在系统负荷较高时丢失了帧。 我建议尝试更改 LLCE_CAN_MAX_RX_MB 中的 值。 drivers/net/can/llce/llce_can_common.c的新值,如 32 或 64,然后重建内核进行另一次测试,检查测试中是否仍存在问题。 BR 切宁 Re: llcecan question 您好, 感谢您的回复。 1.LLCE FW 版本为 HHFF_2A [REL_LLCE1_0_6|BLD_RDC2303221606]。 2.只对 bsp38 进行了测试。 3.仅对 llcecan 进行了无帧丢失的压力测试。但是,在同时对所有 8 个 can 通道进行压力测试时,出现了丢帧(4 通道 llce 测试和 8 通道 can 测试使用的软件相同)。 4. canoe 总线负载为 55% ,8 通道 can 测试期间的平均 CPU 负载为 60% ,4 通道 llce 测试期间的平均 CPU 负载为 37% Re: llcecan question 你好,@张博文 感谢您的回复。 1.请您帮助检查是否有更简单的方法来重现该问题? 2。我知道目前它只发生在 8 通道测试中,我能知道你的板上是否只有 4+4 CAN 接口吗?是否只能在 LLCE 上进行测试才能重现该问题?(说LLCE 接口上有 4 个以上通道) 在 RDB2 上,只有 2 个 FlexCAN,但有 16 个 LLCE CAN,如果能提供简化的测试方法,将非常有帮助。 BR 切宁 Re: llcecan question 您好, (1) 我在开发板上运行了我们的项目程序。我不方便把整个文件发给你进行测试。您可以直接使用 canoe 将 llcecan0 连接到 llcecan3,而无需运行任何程序,以每秒 8000 帧的速度进行流媒体测试。 (2) 它只能以每秒 8000 帧的速度流式传输 4 个频道的 llcecan。即使发送 1000 万帧,也不会出现丢帧现象
View full article
S32G:为什么 QSPI_IP_HyperflashProgram 每 2 字节发送一次写入命令? 专家们好 CTM: 法雷奥 平台:S32G3 模块:RTD 5.0.0QLP04 Fls 驱动程序 客户报告说,他们遇到的或非闪存写入吞吐量明显低于预期。 客户可能想知道为什么 QSPI_IP_HyperflashPro gram 函数 2 字节以 2 字节传输数据。看来这就是瓶颈所在。 是否有专家能就这一问题提供帮助? 感谢你的支持 狮子座 RTD Re: S32G: why the Qspi_Ip_HyperflashProgram sends write command for every 2 bytes? 你好@Nhi_Nguyen 谢谢您的帮助。但是在我们的驱动程序中一次写入 2 字节对客户来说太慢了吗?怎样才能提高性能? BR、 狮子座 Re: S32G: why the Qspi_Ip_HyperflashProgram sends write command for every 2 bytes? 你好@LeoLiAP、 这是因为 Hyperbus 支持以下两种类型的数据发送: 驱动程序支持将单个字写入内部缓冲(您的代码是每个地址数据的单个字),然后调用命令将缓冲区发送到 Fls(写入缓冲区)。 顺祝商祺! Nhi Re: S32G: why the Qspi_Ip_HyperflashProgram sends write command for every 2 bytes? 你好@LeoLiAP、 写入 2 字节遵循 Hyperbus 协议,所以我知道我们无法改变这一点。但 SW 团队将改进代码以节省时间,相关票据为ARTDCMEM-1247。 顺祝商祺! Nhi
View full article
i.MX8MP 板。show error DRM_CAP_DUMB_BUFFER"/dev/dri/card0 我将代码从 gui-guider 导出到 yocto。设置环境并 版本 bitbake imx-image-multimedia。运行 gui 应用程序(gui-guider)时部署到 板 上显示错误 DRM_CAP_DUMB_BUFFER " /dev/dri/card0 " 没有 dunb 缓冲区。 Re: i.MX8MP board. show error DRM_CAP_DUMB_BUFFER "/dev/dri/card0 你好 /dev/dri/card0 是默认值,你需要在 GUI Guider 的项目设置中根据你的主板更改这个值。 只需在板上使用以下命令进行检查即可: $ ls-l /dev/dri/card * 顺祝商祺! 宗春 Re: i.MX8MP board. show error DRM_CAP_DUMB_BUFFER "/dev/dri/card0 i use 8MPLUSLPD4-PEVK board. Re: i.MX8MP board. show error DRM_CAP_DUMB_BUFFER "/dev/dri/card0 我改为使用 /dev/dri/card1。但请遵循以下提示 错误:drmModeAtomicCommit 失败:Permission denied error:刷新失败 Re: i.MX8MP board. show error DRM_CAP_DUMB_BUFFER "/dev/dri/card0 你好 请尝试使用 /dev/dri/card1。 最佳回复 宗春 Re: i.MX8MP board. show error DRM_CAP_DUMB_BUFFER "/dev/dri/card0 在板中,我找到了 /dri/card0 和 /dri/card1。
View full article
Creating SREC file for HAB bootable image generation I'm generating command line tools for flashing the application image to the NOR flash of the MIMXRT1170 (EVKB board). I know that the nxpimage tool helps create SREC format files from axf/elf files like this:  nxpimage utils binary-image convert -i "%AXF_FILE%" -f s19 -o "%SREC_FILE%"   But the SREC file generated is different from the SREC file that is created when using the MCUXpresso Secure Provisioning Tool in terms of the contents and addressing. When I use the MCUXpresso Secure Provisioning Tool to load an elf/axf file to create a bootable image, it adds the srec file and parsed dcd file in the source folder of the MCUXpresso Secure Provisioning Tool's workspace.  I would like to know how those srec and parsed dcd file is generated by the MCUXpresso Secure Provisioning Tool. Also checking if there is a way to extract the parsed DCD file from SREC/elf/axf file separately with any CLI tools?   I know that the MCUXpresso Secure Provisioning Tool can be invoked from CLI to automate the whole process, but we are trying to create a script that can flash the MCU with just the nxpimage and blhost tools.     Re: Creating SREC file for HAB bootable image generation Hi @tj787 , What can be seen here is the following command creates this output into specified “parsed-directory”: nxpimage.exe hab parse -f mimxrt1176 -o parsed-directory -b my-application-with-dcd.bin Hope that helps, Have a great day, Kan ------------------------------------------------------------------------------- Note: - If this post answers your question, please click the "Mark Correct" button. Thank you! - We are following threads for 7 weeks after the last post, later replies are ignored Please open a new thread and refer to the closed one, if you have a related question at a later point in time. -------------------------------------------------------------------------------
View full article
Flexera License Dongle Hello, We have been using CodeWarrior 5.2 and 11.1 for some time with the Flexera License keys. Everything was working correctly and then all of a sudden the CodeWarrior Suites do not seem to recognize the Dongle anymore.  lmtools correctly displays the FLEXid: I have the license.dat files at the following paths: C:\Program Files (x86)\Freescale\CWS12v5.2 C:\Freescale\CW MCU v11.1\MCU For CodeWarrior 5.2 I get the following error: And for 11.1 I get: The computer I am using is running Windows 11. We have some older laptops that are Windows 10 and have no issues on those. Any help will be greatly appreciated! Thank you, Zach
View full article
Unable to flash S32K146EVB-Q144 board as D1 glowing red I have a S32K146EVB-Q144 evaluation board which was working fine initially. During a debug session where I had implemented Lin stack, it stopped working. When i reset my controller i see a continuous Red light on D1 and other two green lights are still there. I've used J10 and J107 at position 2-3 to select power from USB source and J104 at position 2-3 to select OpenSDA app flash mode. Now my controller is not getting detected at all by S32DS. I tried following the steps mentioned in below post as symptom seems exactly same. Re: S32K144 D2 RED LED is ON always - NXP Community Here I was able to halt the processor in OpenSDA using P&E Kinetics Recovery Tool but still not able to flash any new application. Even if halt is achieved, i am not able to flash it again and red light is still on. Controller is able to go into bootloader mode as well by adjusting jumper J104 and i was actually able to flash ne bootloader app in it as well. But somehow I am not able to write the flash again, and if i try flashing any example .srec file, D2 keeps on flashing periodically (usually in successful flashing it blinks once and then app starts running). So in a nutshell : -Controller is not able to reach main or getting continuous resets -Controller is not able to write the flash again (could be security issue). I did tried mentioned techniques in above thread except the one involving SEGGER-JLINK as I dont have that debug probe. I do have a PE Multilink Universal with me but its not able to recover/erase the flash as well. Here are the details of board : Board Name is: S32K146EVB-Q144 MicroBoot Kernel Version is: 1.08 Bootloader Version is: 1.13 Installed Application: PEMicro EVB-S32K144 Mass Storage/Debug App Application Version is: 1.25 DUID is: 39A33939-91818199-37539805-F97AE678 EUID is: 4141A238-1BDB8733-1854BA22-D38368D6 TUID is: 74823938-47328196-8576CC9B-0242983E TOA is: 86B6E505-56F042E0-79B2A114-62BA758F TOA2 is: 86B6E505-EB1A8A7C-AF6E54B6-43532420 SUID is: 86B6E505-5BA18877-37239804-8003EC65 Is MCU locked permanently ? If not how can i recover my board ? Is there any h/w failure I am looking at ? (Just FYI D2 and D3 glows green which i think means my 5V and 3.3V power rails are working fine) Is there a physical way to mass erase ? (Cant use S32DS emergency kinetics option as board is not detectable there at all).  Can grounding any pin of OpenSDA chip leads to erase of flash memory ? Re: Unable to flash S32K146EVB-Q144 board as D1 glowing red Please note that during the Christmas holiday period, our support response times may be longer than usual. In some cases, your request might be addressed after the New Year. Thank you for your understanding. Re: Unable to flash S32K146EVB-Q144 board as D1 glowing red Hi After the P&E Recovery Utility halt MCU, close the tool. Then follow the Step 3 or Step 4 to reprogram the S32K146. I'm not sure if this is due to the Application Version is: 1.25 . Please press and hold the reset button SW5, then insert the USB cable and place MSD-DEBUG-S32K146EVB-Q144_Pemicro_v121.SDA into the BOOTLOADER drive. This will update the Application Version to 1.21. I've also attached lpit_periodic_interrupt_s32k146.srec. By the way, you don't need external Segger J-Link. If you follow Step6:Inserting J7 while holding down SW5 puts OpenSDA into BOOTLOADER mode. And then drop SEGGER J-Link application firmware into it(OpenSDA_V1.bin).  The onboard debugger will then become J-Link.  Best Regards, Robin ------------------------------------------------------------------------------- Note: - If this post answers your question, please click the "ACCEPT AS SOLUTION" button. Thank you! - We are following threads for 7 weeks after the last post, later replies are ignored Please open a new thread and refer to the closed one, if you have a related question at a later point in time. ------------------------------------------------------------------------------- Re: Unable to flash S32K146EVB-Q144 board as D1 glowing red Hello Robin, Thank you for your prompt response, well I tried rolling it back to MSD-DEBUG-S32K146EVB-Q144_Pemicro_v121.SDA,  Its behaving the same way, bootloader app is flashed but D1 still glowing red and I am not able to flash .srec file after halting it using kinetis recovery tool. I see that controller is trying to flash the srec but fails since D2 blinks periodically(usually it blinks only 3-4 times and app is flashed). I then tried switching the bootloader to  OpenSDA_V1.bin, I tried attempting connection using J-Link commander afterwards and I see following logs : SEGGER J-Link Commander V8.94 (Compiled Dec 10 2025 14:50:47) DLL version V8.94, compiled Dec 10 2025 14:49:54 Connecting to J-Link via USB...O.K. Firmware: J-Link OpenSDA compiled Jan 31 2023 13:42:36 Hardware version: V1.00 J-Link uptime (since boot): 0d 00h 00m 28s S/N: 621000000 VTref=3.300V Type "connect" to establish a target connection, '?' for help J-Link>connect Please specify device / core. : S32K146 Type '?' for selection dialog Device>S32K146 Please specify target interface: J) JTAG (Default) S) SWD T) cJTAG TIF>SWD Specify target interface speed [kHz]. : 4000 kHz Speed>100 Device "S32K146" selected. Connecting to target via SWD ConfigTargetSettings() start ConfigTargetSettings() end - Took 22us InitTarget() start SWD selected. Executing JTAG -> SWD switching sequence. Timeout while halting CPU. InitTarget() end - Took 392ms Found SW-DP with ID 0x2BA01477 DPv0 detected CoreSight SoC-400 or earlier Scanning AP map to find all available APs AP[2]: Stopped AP scan as end of AP map has been reached AP[0]: AHB-AP (IDR: 0x24770011, ADDR: 0x00000000) AP[1]: JTAG-AP (IDR: 0x001C0000, ADDR: 0x01000000) Iterating through AP map to find AHB-AP to use AP[0]: Core found AP[0]: AHB-AP ROM base: 0xE00FF000 CPUID register: 0x410FC241. Implementer code: 0x41 (ARM) Found Cortex-M4 r0p1, Little endian. FPUnit: 6 code (BP) slots and 2 literal slots CoreSight components: ROMTbl[0] @ E00FF000 [0][0]: E000E000 CID B105E00D PID 000BB00C SCS-M7 [0][1]: E0001000 CID B105E00D PID 003BB002 DWT [0][2]: E0002000 CID B105E00D PID 002BB003 FPB [0][3]: E0000000 CID B105E00D PID 003BB001 ITM [0][4]: E0040000 CID B105900D PID 000BB9A1 TPIU Initializing 126976 bytes work RAM @ 0x1FFF0000 Reset type: NORMAL (https://kb.segger.com/J-Link_Reset_Strategies) Reset: Halt core after reset via DEMCR.VC_CORERESET. Reset: Reset device via AIRCR.SYSRESETREQ. Reset: S_RESET_ST never gets cleared. CPU seems to be kept in reset forever. Reset: Using fallback: Reset pin. Reset: Halt core after reset via DEMCR.VC_CORERESET. Reset: Reset device via reset pin Reset: VC_CORERESET did not halt CPU. (Debug logic also reset by reset pin?). Reset: Reconnecting and manually halting CPU. Found SW-DP with ID 0x2BA01477 DPv0 detected CoreSight SoC-400 or earlier AP map detection skipped. Manually configured AP map found. AP[0]: AHB-AP (IDR: Not set, ADDR: 0x00000000) AP[0]: Core found AP[0]: AHB-AP ROM base: 0xE00FF000 CPUID register: 0x410FC241. Implementer code: 0x41 (ARM) Found Cortex-M4 r0p1, Little endian. CPU could not be halted Reset: Core did not halt after reset, trying to disable WDT. Reset: Halt core after reset via DEMCR.VC_CORERESET. Reset: Reset device via reset pin Reset: VC_CORERESET did not halt CPU. (Debug logic also reset by reset pin?). Reset: Reconnecting and manually halting CPU. Found SW-DP with ID 0x2BA01477 DPv0 detected CoreSight SoC-400 or earlier AP map detection skipped. Manually configured AP map found. AP[0]: AHB-AP (IDR: Not set, ADDR: 0x00000000) AP[0]: Core found AP[0]: AHB-AP ROM base: 0xE00FF000 CPUID register: 0x410FC241. Implementer code: 0x41 (ARM) Found Cortex-M4 r0p1, Little endian. CPU could not be halted Reset: Failed. Toggling reset pin and trying reset strategy again. Found SW-DP with ID 0x2BA01477 DPv0 detected CoreSight SoC-400 or earlier AP map detection skipped. Manually configured AP map found. AP[0]: AHB-AP (IDR: Not set, ADDR: 0x00000000) AP[0]: Core found AP[0]: AHB-AP ROM base: 0xE00FF000 CPUID register: 0x410FC241. Implementer code: 0x41 (ARM) Found Cortex-M4 r0p1, Little endian. Reset: Halt core after reset via DEMCR.VC_CORERESET. Reset: Reset device via AIRCR.SYSRESETREQ. Reset: S_RESET_ST never gets cleared. CPU seems to be kept in reset forever. Reset: Using fallback: Reset pin. Reset: Halt core after reset via DEMCR.VC_CORERESET. Reset: Reset device via reset pin Reset: VC_CORERESET did not halt CPU. (Debug logic also reset by reset pin?). Reset: Reconnecting and manually halting CPU. Found SW-DP with ID 0x2BA01477 DPv0 detected CoreSight SoC-400 or earlier AP map detection skipped. Manually configured AP map found. AP[0]: AHB-AP (IDR: Not set, ADDR: 0x00000000) AP[0]: Core found AP[0]: AHB-AP ROM base: 0xE00FF000 CPUID register: 0x410FC241. Implementer code: 0x41 (ARM) Found Cortex-M4 r0p1, Little endian. CPU could not be halted Reset: Core did not halt after reset, trying to disable WDT. Reset: Halt core after reset via DEMCR.VC_CORERESET. Reset: Reset device via reset pin Reset: VC_CORERESET did not halt CPU. (Debug logic also reset by reset pin?). Reset: Reconnecting and manually halting CPU. Found SW-DP with ID 0x2BA01477 DPv0 detected CoreSight SoC-400 or earlier AP map detection skipped. Manually configured AP map found. AP[0]: AHB-AP (IDR: Not set, ADDR: 0x00000000) AP[0]: Core found AP[0]: AHB-AP ROM base: 0xE00FF000 CPUID register: 0x410FC241. Implementer code: 0x41 (ARM) Found Cortex-M4 r0p1, Little endian. CPU could not be halted CPU could not be halted CPU could not be halted ****** Error: Failed to halt CPU. Memory zones: Zone: "Default" Description: Default access mode Cortex-M4 identified. J-Link> Re: Unable to flash S32K146EVB-Q144 board as D1 glowing red Please use an oscilloscope to observe the waveform of the reset pin, send me the waveform and tell me the reset period and high-level width. In some cases, it may be impossible to recover, and you may have to replace the S32K1 chip.   Connection strategies & recovery steps: Goal: give the debugger a chance to halt the core and neutralize problematic firmware. A. Lower SWD speed + “connect under reset” In J‑Link Commander: J-Link> device S32K146 J-Link> if SWD J-Link> speed 1000 ; start at 1 MHz; if still failing, drop to 100 kHz J-Link> connect If it still fails, use manual connect‑under‑reset: Hold RESET_b low externally, power the board. Run connect in Commander. Release reset and immediately: J-Link> r J-Link> h J-Link> halt Try several times, especially with 100 kHz SWD speed—timing can be critical. B. Change J‑Link reset strategy Different Reset Strategy values behave differently. In Commander (exact IDs may vary by version): J-Link> SetResetType = 3 ; a common “connect under reset / halt after reset”; Try 2 / 4 / 12 etc. depending on your J-Link version J-Link> r J-Link> halt Alternatively, try selecting "Connect under reset" in J-Link Commander. Re: Unable to flash S32K146EVB-Q144 board as D1 glowing red According to the S32K146EVB-SPF-29844-RB.pdf: J104 1-2 Reset signal from OpenSDA J10 2-3 P5V0 If you have an external 9V or 12V power supply, you can also try connecting J107 1-2 P5V_SBC. If you happen to have an external debugger, such as PEMicro Multilink, try using it to see if it can download programs for the S32K146. What was the last project downloaded? Is CSEc enabled? Please answer my previous questions and provide me with the reset signal measured using an oscilloscope.
View full article
使用 8x DPDMUX 加载静态 DPL 失败 嗨,社区、 成功使用动态创建 DPDMUX 和 DPNI,并通过以下命令生成 DPL: 8x ls-addni --fs-entries=8 --num-queues=8 -n source /usr/local/dpdk/dpaa2/dynamic_dpl.sh ... 8x restool dpdmux create 8x restool dprc connect dprc.1 --endpoint1= .n.0/1/2 --endpoint2= / /dpni.k> restool dprc generate-dpl dprc.1> dpl-8-dpdmux.dts 使用 dpl-8-dpdmux.dtb(由 dtc 工具生成)更新静态 DPL,以便 uboot 启动 MC 布局。 错误显示为 "吹": [E, mem_mng_get_phys_mem:655] 主内存。管理器内存分配失败 [E, mem_mng_get_phys_mem:658] Required size 0x000040000 alignment 0x000000100 exceeds available memory for partition ID 7 [E, init_bman_bp:399, DPDMUX] ID[6] - dpbp_allocate_buffers(),分配 dpbp 缓冲区失败 [E, init_infrastructure:3750, DPDMUX] swlib_init_bman_bp :-12 [E, dpdmux_init:4487, DPDMUX] init_infrastructure : -12 [E, mem_mng_get_phys_mem:655] MAJOR mem.管理器内存分配失败 [E, mem_mng_get_phys_mem:658] Required size 0x000040000 alignment 0x000000100 exceeds available memory for partition ID 7 [E, init_bman_bp:399, DPDMUX] ID[7] - dpbp_allocate_buffers(), 分配 dpbp 缓冲区失败 [E, init_infrastructure:3750, DPDMUX] swlib_init_bman_bp :-12 [E, dpdmux_init:4487, DPDMUX] init_infrastructure : -12 [E, resman_is_link_permitted:6375, RESMAN] Object wasn't found [E, linkman_probe_cb:205] No common ancestor - Failed to connect dpdmux@6 and dpmac@9 [E, subnode_process:155] Probing module 'connection' return error code -1.继续 dpl 处理... [E, resman_is_link_permitted:6375, RESMAN] 对象未找到 [E, linkman_probe_cb:205] 没有共同祖先 - 连接 dpdmux@6 和 dpni@15 失败 [E, subnode_process:155] 探测模块 'connection' 返回错误代码 -1.继续 dpl 处理... [E, resman_is_link_permitted:6375, RESMAN] Object wasn't found [E, linkman_probe_cb:205] No common ancestor - Failed to connect dpdmux@6 and dpni@7 [E, subnode_process:155] Probing module 'connection' return error code -1.继续 dpl 处理... [E, resman_is_link_permitted:6375, RESMAN] 对象未找到 [E, linkman_probe_cb:205] 没有共同祖先 - 连接 dpdmux@7 和 dpmac@10 失败 [E, subnode_process:155] 探测模块 'connection' 返回错误代码 -1.继续 dpl 处理... [E, resman_is_link_permitted:6375, RESMAN] 对象未找到 [E, linkman_probe_cb:205] 没有共同祖先 - 连接 dpdmux@7 和 dpni@16 失败 [E, subnode_process:155] 探测模块 'connection' 返回错误代码 -1.继续 dpl 处理... [E, resman_is_link_permitted:6375, RESMAN] 对象未找到 [E, linkman_probe_cb:205] 没有共同祖先 - 连接 dpdmux@7 和 dpni@8 失败 [E, subnode_process:155] 探测模块 'connection' 返回错误代码 -1.继续 dpl 处理... [E, dpl_process:527] 解析 "连接 "时出错。跳过处理 DPL 的其余部分。 [E, main:198] DPL 处理失败;继续... 静态 DPL 在支持与动态方式相同的布局方面是否有任何限制? QorIQ LS2 设备 Re: Failed to load static DPL with 8x DPDMUX 你好 yipingwang, 在动态创建布局时使用"--max-dmat-entries "不会改变 "restool dprc generate-dpl dprc.1 "的最终 dts。 因此,我尝试在 .dts 中添加以下元素 "mem-size "和"max-dmat-entries" 。手动 dpdmux@0 { 兼容 ="FSL,DPDMUX" ; options ="DPDMUX_OPT_CLS_MASK_SUPPORT","DPDMUX_OPT_AUTO_MAX_FRAME_LEN" ; method ="DPDMUX_METHOD_CUSTOM" ; manip ="DPDMUX_MANIP_NONE" ; num_ifs =<0x2> ; mem-size =<0x100>; // 这是我手动添加的 max-dmat-entries =<0x8>; // 这是我手动添加的 }; 遗憾的是,这并没有解决问题,MC 调试器中显示的错误信息还是一样。 还请检查随附的我的 dpl。 Re: Failed to load static DPL with 8x DPDMUX 请尝试以下方法是否可行。 创建 DPDMUX 时,请指定"--max-dmat-entries=8" 以减少资源分配。 -max-dmat-entries= DPDMUX 地址表的最大条目数。默认为 64。 如果问题仍然存在,请共享创建 DPDMUX 和生成 DPL 文件的整个控制台日志。 此外,您使用的是哪种处理器? Re: Failed to load static DPL with 8x DPDMUX 您好, 通过更正 DPL 参数名称,我设法解决了这个问题。
View full article
i.MX 93プロセッサ: セキュアブートの署名と認証の仕組みを解説 (日本語ブログ) 昨今、サイバーレジリエンス法(EU)やJC-STAR(日本)等、世界各国で法規制が確立しつつあります。またそれらの技術要件の中には、セキュアブートの要件も入ってきており、みなさまもよく耳にする重要な機能の一つかと思います。 しかしながら、実際にはセキュアブートの仕組みを理解せず使用してるユーザーも多いです。そのため、今回はi.MX 93のセキュアブート(AHAB)を例に仕組みを解説していきたいと思います。 目次 i.MX 93 AHABの署名と認証の仕組み 1. イメージのコンテナ化 2. コンテナに公開鍵と署名を付加 3. 署名付きコンテナの認証 4. U-Bootでの署名付きコンテナの認証 i.MX 93 AHABの署名と認証の仕組み¶ i.MX 93プロセッサのAdvanced High Assurance Boot (AHAB)の署名と認証の仕組みを説明します。 i.MX 93の起動ファイルは固有のコンテナ形式になっています。 AHABを使用したセキュアブートでは、コンテナに公開鍵と署名を付加し、デバイス起動時にはコンテナに含まれている公開鍵を認証し、コンテナの内容が改変されていないか検証することで、不正なソフトウェアの起動を防ぐことができます。 1. イメージのコンテナ化¶ Fig. 1 イメージのコンテナ化¶ i.MX 93のBOOTROMやU-Bootがメモリにロードして使用するイメージは、あらかじめコンテナ形式に変換しておく必要があります。 Note ここでイメージと言っているのは、U-Boot-SPL, U-Boot, ATF, OPTEE, M-Core SW, Kernel, DTB, Ramdisk, その他メモリ上に配置したいデータ等のことです。 コンテナ形式の詳細は i.MX 93 Applications Processor Reference Manual のSystem Bootの章にに記載があります。 イメージをコンテナ化するには、 imx-mkimage と、それに含まれる mkimage_imx8 というツールを使用します。 コンテナを生成すると、コンテナファイルの先頭にはContainer Headerが付加されます。この中には各イメージのオフセット、サイズ、ハッシュ値などを集めたImageArray、セキュアブートのため公開鍵、署名を書き込むSignature Blockなどがあります。Signature Blockは、ほぼ空の状態で生成されます。 複数のイメージを一つのコンテナにすることができます。イメージのデータはコンテナファイルの一番後ろに連結されます。 2. コンテナに公開鍵と署名を付加¶ Fig. 2 コンテナに公開鍵と署名を付加¶ i.MX 93デバイスで意図しないコンテナを使用されないよう、また、コンテナの内容の改変を検知できるよう、Code Signing Tool(以下、CST)を使用して、コンテナに公開鍵と署名を付加します。 最初にSuper Root Key (以下、SRK)を生成します。 CSTに含まれるスクリプト ahab_pki_tree.sh でCAとSRK1~SRK4を生成します。SRKは公開鍵とプライベート鍵のペアとなっていて、プライベート鍵は秘匿しておく必要があります。 CSTに含まれる srktool を使用して、SRK1~SRK4の4つの公開鍵を連結したSRK Tableを生成します。同時にSRK TableのSHA-256であるSRK Hashも生成されます。 SRK Hashは、i.MX 93デバイスのSRK_HASHヒューズに書き込みます。 SRKはi.MX 93デバイスのライフサイクルが終了するまで長期にわたり保存しておく必要があります。 次に、CSTに含まれる cst でコンテナに公開鍵と署名を付加します。 先ほど生成したSRK Tableは、Signature BlockのSRK Tableフィールドに書き込まれます。 Container Headerの先頭からSRK Tableフィールドの末尾の領域に対して、SRKのプライベート鍵の一つを使用して署名されます。 署名データは、Signature BlockのSignatureフィールドに書き込まれます。 3. 署名付きコンテナの認証¶ Fig. 3 署名付きコンテナの認証¶ 最初に、コンテナ上のSRK TableのSHA-256を計算して、i.MX 93デバイスのSRK_HASHヒューズの内容が一致していれば、SRK Tableは署名に使用したSRKと同じ、ということを認証できます。 SRK Tableが認証されれば、次に、SRK Tableの中に含まれるSRK公開鍵と署名データを使用して、Container Headerの先頭からSRK Tableフィールドの末尾の領域が改変されていないかを検証できます。 最後に、Container Headerが改変されていないことが検証できれば、ImageArrayに書かれているHash値と各ImageのHash値を比較することで、イメージが改変されていないかを検証できます。 4. U-Bootでの署名付きコンテナの認証¶ U-Bootでの署名付きコンテナの認証には、U-Bootの auth_cntr コマンドが使用されています。 https://github.com/nxp-imx/uboot-imx/blob/lf-6.6.36-2.1.0/arch/arm/mach-imx/ele_ahab.c#L811-L815 auth_cntr コマンドが実行されると、do_authenticate関数がコールされ、そこからauthenticate_os_container関数がコールされます。 https://github.com/nxp-imx/uboot-imx/blob/lf-6.6.36-2.1.0/arch/arm/mach-imx/ele_ahab.c#L400-L416 authenticate_os_container関数から、ahab_auth_cntr_hdr関数とahab_verify_cntr_image関数がコールされます。 https://github.com/nxp-imx/uboot-imx/blob/lf-6.6.36-2.1.0/arch/arm/mach-imx/ele_ahab.c#L330-L398 ahab_auth_cntr_hdr関数からは、ele_auth_oem_ctnr関数がコールされます。 ahab_verify_cntr_image関数からは、ele_verify_image関数がコールされます。 https://github.com/nxp-imx/uboot-imx/blob/lf-6.6.36-2.1.0/arch/arm/mach-imx/ele_ahab.c#L261-L278 https://github.com/nxp-imx/uboot-imx/blob/lf-6.6.36-2.1.0/arch/arm/mach-imx/ele_ahab.c#L297-L309 ele_auth_oem_ctnr関数とele_verify_image関数からは、ELEに対してコマンドが送信され、ELEから結果を受信します。 https://github.com/nxp-imx/uboot-imx/blob/lf-6.6.36-2.1.0/drivers/misc/imx_ele/ele_api.c#L76-L104 https://github.com/nxp-imx/uboot-imx/blob/lf-6.6.36-2.1.0/drivers/misc/imx_ele/ele_api.c#L134-L161 U-Bootの ahab_status コマンドで認証の結果を確認することができます。主要なエラーコードは以下のとおりです。 Table 1 ahab_status コマンドの主要なエラーコード¶ エラーコード エラーの意味 エラーが発生する状況 ELE_NO_AUTHENTICATION_FAILURE_IND (0xEE) 認証は行われなかった。 署名していないコンテナを認証しようとした。 ELE_BAD_KEY_HASH_FAILURE_IND (0xFA) ヒューズSRK_HASHと、署名付きコンテナのSRK TableのHASHがが一致しない。 ・ヒューズSRK_HASHに何も書かれていないデバイスで署名付きコンテナを認証しようとした。 ・ヒューズSRK_HASH生成時に使用したSRK Tableには含まれないSRKで署名したコンテナを認証しようとした。 ・署名付きコンテナのSRK Tableが書き換えられている。 ・署名付きコンテナのSRK Tableが正しくロードできなかった。(メモリ上に正しく書かれていない。) ELE_BAD_SIGNATURE_FAILURE_IND (0xF0) 署名が正しくない。 ・署名付きコンテナのSigned regionが書き換えられている。 ・署名付きコンテナのSignatureが書き換えられている。 ・上記のいずれかが正しくロードできなかった。(メモリ上に正しく書かれていない。) ELE_BAD_HASH_FAILURE_IND (0xF1) ImageのHASHが、Image Arrayに書かれているHASHと異なる。 ・署名付きコンテナのImageが書き換えられている。 ・署名付きコンテナのImageが正しくロードできなかった。(メモリ上に正しく書かれていない。)   Note これらのエラーコードはOEM Openの場合に観測できます。OEM Closedの場合はエラー発生時にデバイスが停止するためエラーコードは表示されません。 本資料はNXP製品を活用していただくための参考資料です。 正式な仕様は製品マニュアル・アプリケーションノートを参照ください。 使用ソフトウェアのバージョンなど諸条件の差異により、記載内容と実際の動作が異なる場合があります。 すべての機能検証を行ったものではありませんので、必ずご使用目的に適合した検証・試験を行ってください。 次回は、セキュアブート(AHAB)の実装・動作方法について、説明したいと思います。  記事:i.MX 93プロセッサ: セキュアブートの実装方法 - 実践編 (日本語ブログ)   =========================​ 本投稿の「Comment」欄にコメントをいただいても、現在返信に対応しておりません。​ お手数をおかけしますが、お問い合わせの際には「NXPへの技術質問 - 問い合わせ方法 (日本語ブログ)」をご参照ください。​ (既に弊社NXP代理店、もしくはNXPとお付き合いのある方は、直接担当者へご質問いただいてもかまいません。)​ 昨今、サイバーレジリエンス法(EU)やJC-STAR(日本)等、世界各国で法規制が確立しつつあります。またそれらの技術要件の中には、セキュアブートの要件も入ってきており、みなさまもよく耳にする重要な機能の一つかと思います。 しかしながら、実際にはセキュアブートの仕組みを理解せず使用してるユーザーも多いです。そのため、今回はi.MX 93のセキュアブート(AHAB)を例に仕組みを解説していきたいと思います。 i.MX Processors Security 日本語ブログ
View full article
異なる DDR サイズに応じて i.MX8MP の予約メモリを調整するにはどうすればよいでしょうか? NXPエキスパートの皆様、こんにちは。 コミュニティ全体を検索しましたが、満足のいく答えは見つかりませんでした。 以下はNXPのLinux 6.12のimx8mp.dtsiの予約メモリノードです。 予約メモリ { #アドレスセル = <2>; #size-cells = <2>; 範囲; /* * optee の使用のために予約されたメモリ。使用しないでください。 * OP-TEE がインストールされている場合は、これが dtb に自動的に追加されます。 * optee@56000000 { * reg = <0 0x56000000 0 0x2000000>; * マップなし; * }; */ /* 連続した割り当てのためのグローバル自動構成領域 */ Linux、cma { compatible = "共有DMAプール"; 再利用可能 サイズ = <0 0x3c000000>; 割り当て範囲 = <0 0x40000000 0 0xC0000000>; linux、cma-デフォルト; }; GPU予約済み: GPU予約済み@100000000 { マップなし; レジスタ = <0x1 0x00000000 0 0x10000000>; }; dsp_reserved: dsp@92400000 { レジスタ = <0 0x92400000 0 0x1000000>; マップなし; }; dsp_reserved_heap: dsp_reserved_heap@93400000 { レジスタ = <0 0x93400000 0 0xef0000>; マップなし; }; dsp_vdev0vring0: vdev0vring0@942f0000 { レジスタ = <0 0x942f0000 0 0x8000>; マップなし; }; dsp_vdev0vring1: vdev0vring1@942f8000 { レジスタ = <0 0x942f8000 0 0x8000>; マップなし; }; dsp_vdev0バッファ: vdev0バッファ@94300000 { compatible = "共有DMAプール"; レジスタ = <0 0x94300000 0 0x100000>; マップなし; }; }; 1.2GB/4GB/8GB DDR サイズの i.MX8MP の reserved-memory/linux,cma/size と reserved-memory/linux,cma/alloc-ranges を調整するにはどうすればよいでしょうか?(サイズ(960MB)は2GB DDRには大きすぎること、割り当て範囲も2GB DDRの範囲外であることは明らかです) 2.linux,cma/size と linux,cma/alloc-ranges を除いて、DDR サイズ 2GB/4GB/8GB に応じて変更する必要がある他のプロパティはありますか? 3. gpu_reserved ノードの reg が 2GB ddr の範囲外であることは明らかですが、どのように変更すればよいでしょうか? NXP の linux6.12 arch/arm64/boot/dts/freescale/imx8mp-tqma8mpql-mba8mpxl.dts で、reserved-memory/linux,cma/size&alloc-ranges が変更されていることがわかります。 予約メモリ { #アドレスセル = <2>; #size-cells = <2>; 範囲; /* 連続した割り当てのためのグローバル自動構成領域 */ Linux、cma { compatible = "共有DMAプール"; 再利用可能 サイズ = <0 0x38000000>; 割り当て範囲 = <0 0x40000000 0 0xB0000000>; linux、cma-デフォルト; }; }; 4.この変更のきっかけは何ですか?これは DDR サイズの違いによるものでしょうか? また、NXP の Linux 6.12 arch/arm64/boot/dts/freescale/imx8mp-evk-root.dts では、node/reserved-memory がさらに変更されていることにも気付きました。 &{/予約メモリ} { jh_reserved: jh@fdc00000 { マップなし; レジスタ = <0 0xfdc00000 0x0 0x400000>; }; loader_reserved: loader@fdb00000 { マップなし; レジスタ = <0 0xfdb00000 0x0 0x00100000>; }; ivshmem_reserved: ivshmem@fda00000 { マップなし; reg = <0 0xfda00000 0x0 0x00100000>; }; ivshmem2_reserved: ivshmem2@fd900000 { マップなし; reg = <0 0xfd900000 0x0 0x00100000>; }; pci_reserved: pci@fd700000 { マップなし; レジスタ = <0 0xfd700000 0x0 0x00200000>; }; 受刑者予約: 受刑者@c0000000 { マップなし; レジスタ = <0 0xc0000000 0x0 0x3d700000>; }; }; &{/予約メモリ/linux,cma} { サイズ = <0 0x28000000>; 割り当て範囲 = <0 0x40000000 0 0x60000000>; }; 5. 新しく追加されたノード jh_reserved/loader_reserved/ivshmem_reserved/ivshmem2_reserved/pci_reserved/inmate_reserved はどのような状況で使用する必要がありますか? 上記の疑問について詳しく説明してください。 i.MX 8M | i.MX 8M ミニ | i.MX 8M ナノ Re: How to adjust i.MX8MP's reserved-memory accroding different DDR size? こんにちは、ホルヘ・カスさん。 ご協力誠にありがとうございます。Quction6についてはまだ疑問があります。 2GB/4GB/8GB DDR を搭載したカスタム imx8mp ボード (6GB DDR を搭載した imx8mpevk ボードに基づく) では、異なる DDR サイズの各ボードごとに個別の u-boot.imx があり、linux6.12 ソース コードの imx8mp-evk.dts から次の ' memory@40000000' ノードを変更せずに保持します。 メモリ@40000000 { device_type = "メモリ"; レジスタ = <0x0 0x40000000 0 0xc0000000>, <0x1 0x00000000 0 0xc0000000>; //3GB+3GB=6GB }; そして、弊社の imx8mp ボードは正常に動作します。また、彼らは一晩のテストに合格することもできます。 以下は 4GB DDR を搭載した imx8mp ボードです。 root@router:/#無料 使用可能な使用済み無料共有バフ/キャッシュの合計 Mem: 3686580 159528 2914044 19536 613008 3458156 // 4GB DDR の場合、合計 3686580 KB を認識するのが妥当です。 スワップ: 0 0 0 root@router:/# /プレスリリース、製品ニュース/MCB2/memtester 3G memtester バージョン 4.3.0 (32 ビット) 著作権 (C) 2001-2012 Charles Cazabon。 GNU General Public License バージョン 2 (のみ) に基づいてライセンスされます。 ページサイズは4096です ページサイズマスクは0xfffff000です 3072MB(3221225472バイト)必要 3072MB (3221225472 バイト) を取得しました。mlock を試行しています...ロックされました。 ループ1: スタックアドレス: テスト3[3326.210063] clean_cache.sh (100707): drop_caches: 1 [ 3326.277139] clean_cache.sh (100707): drop_caches: 2 [ 3326.316299] clean_cache.sh (100707): drop_caches: 3 わかりました ランダム値: OK XOR比較: OK 比較SUB:OK MULを比較: OK DIVを比較: OK 比較OR:OK ANDを比較: OK 順次増分: OK ソリッドビット:OK ブロックシーケンシャル:OK チェッカーボード:OK ビットスプレッド:OK ... // 一晩のテストでは問題は見つかりませんでした。 4GB DDRデバイスのカーネル起動段階のメモリ情報は次のとおりです。 [ 0.000000] マシンモデル: NXP i.MX8MPlus EVKボード [ 0.000000] efi: UEFI が見つかりません。 [ 0.000000] 予約メモリ: 0x00000000c4000000 に CMA メモリプールを作成しました。サイズは 960 MiB です。 [ 0.000000] OF: 予約済みメモリ: 初期化されたノード Linux、cma、互換ID 共有DMAプール [ 0.000000] OF: 予約済みメモリ: 0x00000000c4000000..0x00000000ffffffff (983040 KiB) マップ再利用可能 Linux,cma [ 0.000000] OF: 予約済みメモリ: 0x0000000057c00000..0x0000000057ffffff (4096 KiB) nomap 再利用不可 optee_shm@0x57c00000 [ 0.000000] OF: 予約済みメモリ: 0x0000000056000000..0x0000000057bfffff (28672 KiB) nomap 再利用不可 optee_core@0x56000000 [ 0.000000] OF: 予約済みメモリ: 0x0000000100000000..0x000000010ffffffff (262144 KiB) nomap 再利用不可 gpu_reserved@100000000 [ 0.000000] OF: 予約済みメモリ: 0x0000000092400000..0x00000000933fffff (16384 KiB) nomap 再利用不可 dsp@92400000 [ 0.000000] OF: 予約済みメモリ: 0x0000000093400000..0x00000000942effff (15296 KiB) nomap 再利用不可 dsp_reserved_heap@93400000 [ 0.000000] OF: 予約済みメモリ: 0x00000000942f0000..0x00000000942f7fff (32 KiB) nomap 再利用不可 vdev0vring0@942f0000 [ 0.000000] OF: 予約済みメモリ: 0x00000000942f8000..0x00000000942fffff (32 KiB) nomap 再利用不可 vdev0vring1@942f8000 [ 0.000000] 予約メモリ: 0x0000000094300000 に DMA メモリプールを作成しました。サイズは 1 MiB です。 [ 0.000000] OF: 予約済みメモリ: 初期化されたノード vdev0buffer@94300000、互換性のあるIDは共有DMAプール [ 0.000000] OF: 予約済みメモリ: 0x0000000094300000..0x00000000943fffff (1024 KiB) nomap 再利用不可 vdev0buffer@94300000 [ 0.000000] NUMA: [mem 0x0000000040000000-0x000000013fffffff] でノードを偽装しています [ 0.000000] NODE_DATA(0) 割り当て済み [mem 0x13f84a840-0x13f84d3bf] [ 0.000000] ゾーン範囲: [ 0.000000] DMA [メモリ 0x0000000040000000-0x00000000ffffffff] [ 0.000000] DMA32 空 [ 0.000000] 正常 [メモリ 0x0000000100000000-0x000000013ffffffff] [ 0.000000] 各ノードの移動可能ゾーンの開始 [ 0.000000] 初期メモリノード範囲 [ 0.000000] ノード 0: [メモリ 0x0000000040000000-0x0000000055ffffff] [ 0.000000] ノード 0: [メモリ 0x0000000058000000-0x00000000923fffff] [ 0.000000] ノード 0: [メモリ 0x0000000092400000-0x00000000943fffff] [ 0.000000] ノード 0: [メモリ 0x0000000094400000-0x00000000ffffffff] [ 0.000000] ノード 0: [メモリ 0x0000000100000000-0x000000010fffffff] [ 0.000000] ノード 0: [メモリ 0x0000000110000000-0x000000013ffffffff] [ 0.000000] 初期化メモリ セットアップ ノード 0 [メモリ 0x0000000040000000-0x000000013fffffff] [ 0.000000] ノード0のゾーンDMA: 使用できない範囲に8192ページ 1.実際には 4GB DDR デバイスの memory@40000000 ノードの6GB reg 構成によって発生した不合理なログを特定できますか? 2.SO、カーネルはDTSのmemory@40000000/reg構成のみに基づいてメモリ範囲を計算しているのではなく、U-BootからATAGを介してカーネルに渡される実際の物理メモリサイズと合わせて、包括的にメモリ範囲を決定しているのではないかと推測しています。つまり、2GB/4GB/8GBのメモリ構成ごとに別々のDTBファイルを用意する必要はないのではないかと考えています。この点についてご確認いただけますでしょうか? 改めて感謝申し上げます。 Re: How to adjust i.MX8MP's reserved-memory accroding different DDR size? こんにちは、 1. デバイス ツリー内の予約済みメモリ ノードを調整するための具体的なドキュメントはありません。これらの値は DDR サイズとアプリケーションによって異なるためです。唯一の制限は、リファレンス マニュアルのメモリ マップに記載されているように、各モジュールに割り当てられた最大メモリ領域になります。 BSP のデフォルトの CMA サイズは 960 MB CAN が、2GB DDR の場合、960 MB は大きすぎるため、CMA を 256 MB ~ 512 MB 程度に減らすのが一般的です。有効な DDR スペースでの割り当てに重点を置く必要があります。 2. 追加のプロパティを追加する必要はありません。 3. 設計で使用可能なサイズに応じて各ノードを再編成できます。例: gpu_reserved: gpu_reserved@70000000 { no-map; reg = <0 0x70000000 0 0x10000000>; }; 他も同様です。 4. このデバイス ツリーは、ハイパーバイザーの予約済みメモリに使用されます。 5. これらのノードは Jailhouse/PCIe/仮想化に使用されますが、使用しない場合はこれらのノードを省略できます。 詳細については、このドキュメントをCAN参照できます。 i.MX 仮想化ユーザーガイド 6. はい、各 DDR サイズに一致するはずです。 よろしくお願いいたします。 Re: How to adjust i.MX8MP's reserved-memory accroding different DDR size? 質問6:(追加 ) メモリ@400000000ノード(arch/arm64/boot/dts/freescale/imx8mp-evk.dts内)のregプロパティはDDR容量(2GB/4GB/8GB)に応じて変更する必要がありますか? メモリ@40000000 { device_type = "メモリ"; レジスタ = <0x0 0x40000000 0 0xc0000000>, <0x1 0x00000000 0 0xc0000000>; }; はいの場合、異なる DDR サイズのカスタム i.MX8MP ボードには個別の DTB ファイルが必要であることを意味しますか? 事前に考えます! Re: How to adjust i.MX8MP's reserved-memory accroding different DDR size? こんにちは、ホルヘ・カスさん。 カーネルは U-boot から渡された DDR サイズを使用するので、DTS で memory@40000000/reg を構成する目的は何ですか? Re: How to adjust i.MX8MP's reserved-memory accroding different DDR size? こんにちは、 情報ありがとうございます。 1. エラーや警告などの重大なログはなく、カーネルは U-boot から利用可能なメモリ範囲を使用するだけです。 2. カーネルでは U-boot と DTS の両方の構成が使用されます。 デバイス ツリーでは、物理メモリが十分でない場合でも仮想メモリをさらに割り当てることができますが、RAM の使用量が多いとシステムがクラッシュする可能性があります。 よろしくお願いいたします。 Re: How to adjust i.MX8MP's reserved-memory accroding different DDR size? こんにちは、 社内チームに確認しました。 U-boot 構成には、使用可能な物理 DDR メモリに関する正しいデータが含まれていますが、DTS 予約メモリ ノードもカーネルに渡されます。あなたのCASE、ノードにさらに仮想メモリを割り当てることができますが、物理予約メモリをすべて使い切ると、使用可能なメモリがないためエラーが発生し、物理アドレスが存在しない、または他のモジュールによって使用される可能性があるためにリソースの問題が発生します。 予約メモリを各ボードに適合させる必要があります。おっしゃるとおり、これは機能しますが、RAM の使用量が多い場合は、エラーやカーネル パニックが発生する可能性があります。 前回の返信を訂正させていただきます。 よろしくお願いいたします。
View full article
I²C Hardware Debugging I²C is used as a serial interface between chips. It is so commonplace that it is used in so many systems that no problems arise. However, sometimes even small things can get you hooked. Here we will introduce some common I²C problems and some easy debugging methods. 0. Table of Contents table of contents Anyway it doesn't work! (--; The target doesn't respond (꒪⌓꒪) Repeat start was necessary/unavailable Controllers that do not support clock stretching Multi-Controller The clock frequency is lowered Long distance routing. Noise and crosstalk can cause communication problems. Measuring Bus Capacitance SDA Line Stuck and Bus Clear Who is giving the signal? Reference materials 1. It just doesn't work! (--;   I forgot to put on the pull-up orz This is a common problem when using an I²C device for the first time. When you obtain a sample chip and try it out on a breadboard or universal board, you connect it to a microcontroller while checking the I²C signal names. At this point, it's easy to forget to attach a pull-up resistor . I²C signals have an output called " open drain ." A high-level voltage cannot be obtained unless an external pull-up resistor is attached. When trying to easily check operation using a breadboard, it is easy to forget about this resistor. Don't forget to use pull-up resistors on the SDA and SCL signals! How do you determine the pull-up resistor value? How is the value of a pull-up resistor determined? Generally, values such as 2.2 kΩ or 4.7 kΩ are used. I think many people use these values without much consideration. But what happens if a smaller or larger value is used ? A pull-up with a small resistance value can cause the problem of "not being able to pull the signal low enough." When a device outputs a low signal, current flows through the pull-up resistor. If the resistance is small, the current flowing here will be large, and this current will flow into the device that is outputting a low signal. The transistor that pulls the signal low inside the device has a resistance component, and this resistance and current create a voltage. For this reason, if the current becomes large, a higher-than-expected voltage will be generated, and a sufficiently low low-level voltage will not be obtained. Conversely, pull-up resistors with large resistance values can cause problems such as insufficient communication speeds. When a signal transitions from LOW to HIGH, the capacitance of the signal line is charged via the pull-up resistor, causing the voltage to rise. If a large resistance value is used for the pull-up, the current at this time becomes smaller, and it takes longer for the signal to rise (voltage to rise). There is a method for calculating the value of the pull-up resistor. Details are provided in Section 7 of the I²C Specification [English version (rev7)] [Japanese version (rev5)] . Generally, when using I²C fast mode (400kHz) with a pull-up voltage of 3.3V, a pull-up resistance of around 1kΩ to 8kΩ can be used without any problems [Figure 1]. Figure 1: Pull-up resistor values for I²C signal lines 2. The target doesn't respond (꒪⌓꒪)   No ACK returned!😭 I connected the microcontroller to the target, added a pull-up resistor, and checked the signal's HIGH level with an oscilloscope, but the target still did not respond . "Target not responding" means that no ACK is returned after the target address is sent. This is common in the early stages of evaluation. Many targets allow you to change the target address depending on their settings (for example, by connecting the address setting pin to power or GND), so you need to double-check which address is set. Also, even if you think you've set the address correctly, you need to check whether the address written in hexadecimal on the datasheet is a 7-bit representation (right-justified) or an 8-bit representation (left-justified). Furthermore, the microcontroller development tool (SDK) you're using may specify hexadecimal addresses in 7-bit representation (such as MicroPython) or 8-bit representation (such as Arm Mbed).💦 The I²C specification does not use either representation, and addresses are standardized to binary representation, so there is no such misunderstanding, but you should be careful when specifying them in hexadecimal.   How to check How can you specify the target address? Check this in the device specifications and development tools. Then double-check that the device address is set as intended. When checking on an actual device, for example in MicroPython the I2C class has a scan() method which displays a list of devices connected to the bus that are returning ACKs. One technique is to use this kind of function to quickly see what the settings are [Figure 2]. If the SDK you are using does not have a function like I2C::scan(), try sending addresses in order and checking for ACK/NACK. Figure 2: Testing I2C.scan() 3. Repeat starts were necessary/unavailable   Even if I communicate according to the target device specifications, I can't read the data? The I²C specification defines the signal levels and protocols in detail. Writes and reads can be performed in a defined manner on any target device. However , the method for accessing the registers and data buffers within that target is determined by the specifications of each device. For target devices with multiple internal registers, it is generally possible to specify and read/write registers using communications such as those shown in Figure 3. However, even if communications are performed in this manner, there are cases where the expected data is not read.   Repeat Start Condition When executing a write transaction to specify a register address and a read transaction to read the register consecutively, a repeated start condition is often used to start the second transaction. The repeated start condition is used to avoid the bus-free state that occurs after a stop condition before generating the next start condition. From the target device's perspective, using a repeated start condition is usually equivalent to using a stop and start condition. However, there are devices that do not do this, and for such devices you must use one of the two methods to read the registers. Some microcontroller SDKs provide an API for reading registers on I²C targets, which automatically handles access with a repeated start condition, but some microcontrollers do not support inserting a stop condition. In such cases, the API cannot be used as is, and it becomes necessary to handle the protocol at a lower level. It is important to be careful as devices and microcontroller SDKs can have "specification pitfalls" like this that you only notice later. Figure 3: Typical register access 4. Controllers that do not support clock stretching   The behavior is strange! I²C has an optional function called " clock stretching ." Even nowadays, there are rare devices that have this function. The general I²C controllers installed in many microcontrollers support this clock stretching function, so you don't have to worry about it too much, but if you are implementing your own controller, you need to be aware of this optional function.   What is clock stretching? I²C transmits and receives data according to the timing of the clock output by the controller. However, clock stretching is an option that allows the target side to make the controller wait [Figure 4]. The controller also outputs the clock via open drain. The controller monitors its own clock output and checks whether the signal is HIGH when it outputs HIGH. If the target side wants to make the controller wait, it holds this clock signal LOW. The controller knows it is being made to wait when the clock, which should be HIGH, turns LOW. If the controller ignores this target behavior, it may cause communication problems such as fewer clocks being output. Figure 4: Clock stretching 5. Multi-Controller   Also for debugging a running target device Multi-controller is also an optional feature of I²C. Multiple controllers can control communication on the same bus without affecting each other's communication.   There aren't many applications that use it There are not many cases where multiple controllers are used, except for a few applications. However, the I²C controllers built into many microcontrollers have this function. Using this function, for example, if there is a problem with a running system, you can connect another microcontroller to the I²C bus and read or overwrite the contents of each target's register settings to verify them [Figure 5]. Normal debugging involves checking the code you have written, so you probably won't have an opportunity to do this, but it may be useful when verifying an unknown system for which the source code is unavailable. Figure 5: Multi-master debugging 6. Clock frequency is lower   I thought I had set it to a 100kHz clock. There aren't many cases where the I²C bandwidth is used to its full potential. However, what if you find that communication is occurring at a clock frequency that is significantly different from the speed you intended? Clock stretching, which was introduced in the previous section, is related to frequency reduction . Below is an example at 100kHz, but the higher the frequency used, the greater this effect (rate of frequency reduction).   Check the waveform and adjust the frequency Clock stretching is a function that makes the controller wait. However, it does not only affect the target. As the signal line length increases and the number of connected devices increases, the capacitance of the bus increases. In this case, if a large resistor is used for pull-up, the rise of the signal will be slowed down. A slow signal rise time increases the time it takes for the clock to go high. After the clock goes high, the controller operates to ensure the set high hold time, resulting in a longer low-to-high transition time, which extends the low period. This causes a drop in the clock frequency [Figure 6]. Depending on the controller, you may be able to set the clock frequency in detail, or the LOW and HIGH periods of the clock. If you are concerned about the frequency, check the waveform and adjust the clock settings. 7. Long-distance routing. Noise and crosstalk can cause communication problems.   Data errors caused by waveform distortion I²C is an easy-to-use two-wire serial bus. Because it is a slow signal, it will operate stably even if the signal line is extended to a distance of a few tens of centimeters (although this depends on the environment). However, if you are not careful and consider the characteristics of I²C, you may experience unexpected behavior. High impedance, two wires Because I²C is an open-drain signal, when a HIGH level is output, the impedance of the signal line is high. With a push-pull signal, if the device outputting the signal is LOW it is close to short-circuiting to GND, and if it is HIGH it is close to short-circuiting to the power supply, but with I²C it is connected to the power supply via a pull-up resistor. If noise is picked up on the signal line here, the noise current will escape to the power supply via the resistor. In addition, the currents of each I²C signal line also affect each other, which causes crosstalk. To reduce noise and crosstalk, careful wiring is required. For example, GND or power supply wiring should be placed between the data and clock signals [Figure 7]. Alternatively, using a bus buffer is effective when transmitting over long distances via cable. However, because I²C is a bidirectional open-drain signal, standard logic buffers cannot be used as is. Various buffers are available for I²C, including those with signal voltage conversion functions and those that convert single-ended I²C to differential signals. By combining these, it is possible to create a stable and reliable system even when signal lines are run long distances. Figure 7: Crosstalk and noise 8. Measuring Bus Capacitance   Bus capacity limit... But how do you measure it? Up to 400kHz, I²C can communicate with a bus capacitance of up to 400pF. For 1MHz, I²C can communicate with a bus capacitance of up to 550pF. But how can we know this bus capacitance?   Calculate backward from the signal waveform This blog post introduces several topics related to bus capacitance, all of which point out that the rise time of signals increases. Bus capacitance can be determined from this rise time. [Figure 8] shows an example waveform. For an I²C signal pulled up to a 5V power supply with 2.2kΩ, the rise time (T) from the LOW reference voltage V OL = 1.5V to the HIGH reference voltage V OH = 3.5V is 154ns. The formula in section 7.1 of the I²C specification [English version (rev7)] [Japanese version (rev5)] is "T = 0.8473 x RC," so if we apply "C = T / (0.8473 x R)," we get approximately 82pF. Subtracting the capacitance of the probe used for measurement (15pF), we get approximately 67pF. Figure 8: Calculating bus capacitance 9. SDA Line Stuck and Bus Clear   SDA stuck at LOW and stopped working The controller and target communicate with each other based on a clock. If the number of clocks becomes inconsistent due to noise or other reasons, not only will the communication be bit-shifted, but the situation will become known as "bus stuck." Figure 9-a shows an example in which the controller thinks it has sent nine clock pulses and finished communication, but the target is still returning an ACK as the last bit.   Getting out of a stuck bus situation There are two ways to get out of this state. One is to reset the target. The other is to clear the bus. Bus clearing is described in the I²C specification [English version (rev7)] [Japanese version (rev5)] (Section 3.1.16). If SDA is stuck LOW, you can return the target state to normal by generating nine clock pulses. [Figure 9-b] shows an example where an ACK was issued at the end of a read transfer due to a programming error on the microcontroller side. The MSB of the next data to be read happened to be 0, so SDA was fixed LOW. To get out of this situation, we issue a clock nine times and clear the bus, after which we can see that the target has returned to normal. In addition, the System Management Bus (SMBus), which uses I²C as its specification, has a timeout function on top of the normal I²C specification, and is specified to automatically return to normal operation after a maximum of 35 ms has elapsed on the target device. The I²C specification does not have such a timeout provision, so once a stuck state occurs, it cannot be recovered from without resetting or clearing the bus. Figure 9-a: Example of a bus stuck Figure 9-b: Bus Clear   10. Who is sending the signal? Series resistor   Who is keeping the signal low? When looking at the bus status of the bus stack mentioned above or a multi-controller system, you may want to know which device is sending the signal. The voltage when a LOW signal is output varies depending on the drive capacity of each device, and this can tell you which device is sending the signal.   Add a series resistor and check the voltage [Figure 10] is an example of a multi-controller waveform. This waveform shows two controllers attempting to start communication at the same time, with clock synchronization and arbitration taking place. One controller (microcontroller 1) is attempting to start communication at 400 kHz, and the other controller (microcontroller 0) is attempting to start communication at 100 kHz, each driving the SCL signal. Looking at the clock waveform, we can see that the terminal of the 100kHz controller is connected to the bus via a 100Ω resistor, so when microcontroller 0 outputs a LOW, this series resistor limits its ability to draw current, causing the LOW voltage to rise slightly. By using this mechanism, we can determine which device output a LOW. Figure 10: Who is signaling?   11. Reference materials I2C Bus Specification and User Manual (Rev5.0 Japanese version) I2C Bus Specification and User Manual (Rev7.0 English version) Interface March 2024 issue (CQ Publishing) : Special feature "Serial communication from scratch [UART/I2C/SPI with Pico]" Transistor Technology Special No.161 "Measure, Measure, Measure Circuit & Technique Collection" Appendix: "Detailed Explanation of 2-wire Serial Interface I²C" - The above magazine article is an excerpt from this article. NXP Community Blog: An Overview of the I²C Bus [Originally published in Interface, March 2024 issue (CQ Publishing), " UART, I²C, SPI, CAN... Problems that can occur with various standards " pp. 101-115. The I²C-related section has been excerpted and revised for this blog post .] Change history: 2025-02-04: First Edition 2025-08-14: Corrected a typographical error in the section "3. Repeat Start was necessary/unavailable." Added a line break to the text of the section "7. Long-distance routing. Communication becomes erratic due to noise and crosstalk." 2026-01-02: Added an introductory section before the table of contents / Added a YouTube video link to the section about MicroPython. 2026-04-14: Fixed broken links. Improved readability.     ========================= We are currently unable to respond to comments in the "Comment" section of this post. We apologize for the inconvenience, but when making inquiries, please refer to `` Technical Questions to NXP - How to Contact Us( Japanese Blog) ''. (If you are already an NXP distributor or have a relationship with NXP, you may ask the person in charge directly.) I²C is used as a serial interface between chips. It is so commonplace that it is used in so many systems that no problems arise. However, sometimes even small things can get you hooked. Here we will introduce some common I²C problems and some easy debugging methods. Interface Japanese blog
View full article
nxp.comへのアクセス こんにちは、 VPN を使用せずに nxp.com ドメインのすべてのサイトにアクセスすることはできません。 次のエラーが発生します: Access Denied You don't have permission to access "http://mcuxpresso.nxp.com/en/dashboard" on this server. Reference #18.977a7b5c.1754475329.7d13ec17 https://errors.edgesuite.net/18.977a7b5c.1754475329.7d13ec17 おそらく、IP アドレスによる停止リストの設定に誤りがある可能性があります。 NXP の誰かがこの問題を解決できますか? Re: Access to nxp.com   同じ問題 このサーバーの「 http://www.nxp.com/ 」にアクセスする権限がありません。 参照番号18.633c655f.1754500173.c79a737 https://errors.edgesuite.net/18.633c655f.1754500173.c79a737
View full article
tl431 レギュレータ抵抗器 こんにちは、チーム TEA1733T ic に関していくつか疑問があり、説明をいただきたいと思います。 tea1733t ic データシート: https://www.nxp.com/docs/en/データシート/TEA1733T.pdf アプリケーションノート: https://www.nxp.com/docs/en/application-note/AN10868.pdf 図:1 - これは TEA1733T IC の参照回路図です。 1- 最初の質問は、出力として 24V 3 アンペアが必要な場合、抵抗器 R23 と R24 の値はいくらですか (これらの抵抗器はどのように選択するのですか)、R25 と C17 はどうですか。 2- 2 番目の質問は、ゲート電圧が 10 ~ 12 V、スイッチング周波数が 66 kHz の場合に、トランスの一次側に供給される MOSFET のスイッチング電圧はいくらかということです。 よろしくお願いします。 絶縁ゲートドライバ Re: tl431 regulator resistor こんにちは@TomasVaverkaいくつか疑問があります、説明していただけますか? 1- この D9 および D10 ダイオード (MBR20100) の目的は何ですか? 2- OPTIMER ピンと ISENSE ピンは内部でどのように動作しますか? アプリケーションノート: https://www.nxp.com/docs/en/application-note/AN10868.pdf Re: tl431 regulator resistor @TomasVaverkaさん、ご回答ありがとうございます。 Re: tl431 regulator resistor こんにちは、ジャスティン。 24V/3A 出力の場合、フィードバック分圧器 (R23 と R24) は TL431 リファレンスを 2.5V に設定します。比率は次のとおりです。 SO、R24 = 5.1 kΩの場合、R23 ≈ 43 kΩになります。 R25 と C17 は、ループの安定性のための補償ネットワークの一部を形成します。標準値は R25 = 1 kΩ~10 kΩ、C17 = 100 nF~470 nF で、AN10868 に従って調整されています。 MOSFET は整流された DC バス電圧をスイッチします。この電圧は、115 VAC 入力の場合は約 160 V、230 VAC 入力の場合は約 325 V です。ゲート駆動は10~12 V、スイッチング周波数は約66 kHzです。 BRs、トーマス
View full article