Multi Source Translation Content

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

Multi Source Translation Content

讨论

排序依据:
NFC天线中固体平面的作用 你好, 我们已将NFC天线集成到控制器板上。 我们的天线尺寸约为 90 毫米 x 40 毫米,有 3 圈。 它两侧已被地面包围。地平面与天线之间的距离约为 5 毫米。 我们的PCB制造商(生产多层PCB)要求我们在内层天线区域填充铜。 由于我找到了 NXP 的 NFC 演示板,其中以类似的方式实现了此功能,我认为它应该可行,并且我想以类似的方式实现它。 这些评估委员会采用这种方式实施的原因是什么? 铜矿区对射程的影响程度如何? 铜箔面积会影响电磁兼容性吗?是更好还是更糟? 铜区域与天线之间的最小距离应该是多少? 使用一个大区域好,还是使用几个小区域好? 非常感谢,并致以最诚挚的问候。 迈克尔 Re: Function of solid plane in the NFC antenna 你好,迈克尔, 我们使用这种内部金属化的主要原因是为了演示目的,模拟 NFC 天线周围的真实环境,例如在 POS 终端中。 此外,这种金属填充物可能有助于减少其他物体造成的失谐效应,因为天线内部的“金属负载”已经使其调谐。 但是对于实际产品而言,我会选择内部没有任何填充物的传统 NFC 天线。 BR 托马斯 Re: Function of solid plane in the NFC antenna 嗨,托马斯, 非常感谢您提供的信息。 此后,我们进行了测试,将铜片(8 毫米 x 8 毫米,间隔 2 毫米,每片 2 层)粘到天线表面的顶部和底部。 然后我们测量了天线并重新匹配。 我们在功能方面(范围、电流测量和电磁干扰)检测不出任何差异。 您曾写道,您会推荐传统的设计方案。 造成这种情况的原因是什么?如果有,原因是什么? 或许几个间距更大的小区域会比间距为 2 毫米的 8x8 毫米区域更好? 非常感谢, 迈克尔 Re: Function of solid plane in the NFC antenna 你好@michael_d_1983 , 如前所述,我们使用铜瓦来展示更真实的场景。 这意味着您可能会观察到读数范围略低,这比自由空间中的理想天线更能反映实际情况。这是因为部分能量被金属瓦片吸收了。 但如果调谐保持不变,则发射电流和电磁干扰不会发生变化。 因此,没有必要将这种设计应用到“实际”产品中。 BR 托马斯 Re: Function of solid plane in the NFC antenna 嗨,托马斯, 感谢您的反馈! 我们其实根本不想把铜矿区包括在内。PCB制造商希望我们这样做。 (原因是,如果PCB上的铜分布不均匀,在PCB生产的层压过程中就会出现问题,例如气泡和分层,因为预浸料中的树脂不足以弥补铜的缺失。) 我们只是想澄清一下,是否存在我们尚未考虑到的反对这一做法的根本原因。 我们已经测试过了(阅读器功能)。一切似乎都正常运转。 此致, 迈克尔
查看全文
Unable to complete DDR test via NXP DDR Tool in IMX8M Plus Hi, I downloaded RPA Tool and updated the information. Here is the snapshot attached.   With the script I was able to get the PMIC information in debug. here are the debug log and .ds file for reference. I found out in the debug log the memory capacity was shown as : Density per chip select:  4096MB  Density per controller is: 4096MB  but I have used LPDDR4 RAM with 1GB capacity (W66DP2RQQAGJ: Dual-Die-Package (DDP) 32Mb x 16DQ x 8-banks x 2 channels with 8 Gb (8,589,934,592 bits) density. Also it got stuck in "Step 1: DDRPHY Training" Re: Unable to complete DDR test via NXP DDR Tool in IMX8M Plus hi, I am getting the same issue with Config tool. Here are the log for reference. Best regards Re: Unable to complete DDR test via NXP DDR Tool in IMX8M Plus Hello, I do not see issues in your configuration for that memory. Do you get the same issue if you try with DDR Tool of Config Tools? Best regards. Re: Unable to complete DDR test via NXP DDR Tool in IMX8M Plus Hello, The issue you are getting in Config Tools shows that there is an issue with serial port connection, please confirm that is connected to the Cortex-A console and the board in serial download mode. Could you please share you schematic? Best regards. Re: Unable to complete DDR test via NXP DDR Tool in IMX8M Plus Hi, The issue is resolved using MSCALE_DDR_TOOL. Here is the link of the page for IMX8MP https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-8M-Family-DDR-Tool-Release/ta-p/1104467 And RPA Sheet Link for LPDDR https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-8MPlus-m865S-DDR-Register-Programming-Aids-RPA/ta-p/1235352 Thanks
查看全文
编译 chromium-ozone-wayland 时构建失败 你好, 我尝试在 Yocto 上为 IMX8MP 开发板编译 chromium-ozone-wayland,但编译失败并出现以下错误: | 调试:Python 函数 extend_recipe_sysroot 已完成 | 调试:正在执行 shell 函数 do_configure | 错误位于 //.gn:150:5: 赋值无效。 | build_dotfile_settings.exec_script_allowlist + | ^--------------------------------------------- 您在此处设置了变量“exec_script_allowlist”,但在它离开之前未使用过。 | 超出范围。 | 警告:shell 命令的退出代码为 1。 错误:任务 (/home/admin/Dharmik/IMX8M-Plus/sources/meta-browser/meta-chromium/recipes-browser/chromium/chromium-ozone-wayland_138.0.7204.157.bb:do_configure)失败,退出代码为“1” 注意:任务摘要:尝试了 2814 个任务,其中 2800 个不需要重新运行,1 个失败。 我已在 conf/local.conf 中添加了 CORE_IMAGE_EXTRA_INSTALL += "chromium-ozone-wayland" 以下是我的 Yocto 配置: 构建配置: BB_VERSION = "2.16.0" BUILD_SYS = "x86_64-linux" NATIVELSBSTRING = "universal" TARGET_SYS =“aarch64-poky-linux” 机器 = "imx8mp-lpddr4-evk" DISTRO = "fsl-imx-wayland" DISTRO_VERSION = "6.18-whinlatter" TUNE_FEATURES = "aarch64 armv8a crc crypto" 谢谢! 达摩克 Re: Build failed while compiling chromium-ozone-wayland 我在之前的 Chromium 版本中遇到过这个错误,当时我的解决方法是修改以下文件: \tmp\work\armv8a-mx8-poky-linux\chromium-ozone-wayland\117.0.5938.132\chromium-117.0.5938.132\media\gpu\sandbox\BUILD.gn if (current_cpu != "s390x" && current_cpu != "ppc64" && is_linux && ozone_platform_x11 && !is_castos) { # For DRI_DRIVER_DIR. configs += [ "//build/config/linux/dri" ] } 添加“ && ozone_platform_x11 将“添加到此文件底部的平台列表”解决了这个问题。 请问 Chromium v138 是否已经添加了 ozone_platform_x11 模块? 顺祝商祺! 戴安娜 Re: Build failed while compiling chromium-ozone-wayland 添加PREFERRED_VERSION_gn-native = "0+git" 更改后,出现以下错误: | 调试:Python 函数 extend_recipe_sysroot 已完成 | 调试:正在执行 shell 函数 do_configure | 错误位于 //build/config/linux/dri/BUILD.gn:11:20: 脚本返回非零退出代码。 | dri_driver_dir = exec_script(pkg_config_script, | ^---------- | 当前目录:/home/admin/Dharmik/IMX8M-Plus/build-imx8mp/tmp/work/armv8a-mx8mp-poky-linux/chromium-ozone-wayland/138.0.7204.157/sources/chromium-138.0.7204.157/out/Release/ | 命令:python3 /home/admin/Dharmik/IMX8M-Plus/build-imx8mp/tmp/work/armv8a-mx8mp-poky-linux/chromium-ozone-wayland/138.0.7204.157/sources/chromium-138.0.7204.157/build/config/linux/pkg-config.py --dridriverdir dri 返回值为 1,并打印出来: | | pkg-config 出错。 | | 标准错误输出: | | 在 pkg-config 搜索路径中未找到软件包 dri。 或许您应该添加包含 `dri.pc` 的目录。 | 添加到 PKG_CONFIG_PATH 环境变量 未找到软件包“dri”。 | | 请参阅 //media/gpu/sandbox/BUILD.gn:31:18:导致该文件被包含。 | configs += [ "//build/config/linux/dri" ] | ^------------------------- | 警告:shell 命令的退出代码为 1。 谢谢! 达摩克 Re: Build failed while compiling chromium-ozone-wayland 你好, Dharmik, 除了 chromium 软件包之外,您能否尝试在local.conf中添加其他内容? PREFERRED_VERSION_gn-native = "0+git" 如果问题仍然存在,请告知我。 顺祝商祺! 戴安娜
查看全文
NFCアンテナにおける固体平面の機能 こんにちは、 私たちはNFCアンテナをコントローラボードに統合しています。 当社のアンテナは、約90mm×40mmのサイズで、3ターン巻かれています。 既に両側を地上の飛行機に囲まれている。グランドプレーンとアンテナ間の距離は約5mmです。 多層基板の製造業者から、内層のアンテナ領域を銅で埋めるように指示されています。 NXPのNFCデモボードで同様の実装例を見つけたので、うまくいくはずだと考え、同様の方法で実装したいと思っています。 なぜこれらの評価ボードでこのように実装されたのでしょうか? 銅の面積は、どの程度範囲に影響しますか? 銅箔面積はEMCに影響を与えますか?良くなったのか、悪くなったのか? 銅部分とアンテナ間の最小距離はどれくらいにすべきですか? 広い面積を1つ使うのと、小さな面積を複数使うのとでは、どちらが良いでしょうか? どうもありがとうございました。よろしくお願いいたします。 マイケル Re: Function of solid plane in the NFC antenna こんにちは、マイケルさん。 この内部金属配線を使用する主な理由は、主にデモンストレーション目的で、例えばPOS端末内におけるNFCアンテナ周辺の現実的な環境をシミュレートするためです。 また、この金属充填は、アンテナが内部の「金属負荷」によって既に同調されているため、他の物体による同調ずれの影響を軽減するのに役立つ可能性がある。 しかし製品なら、内部に充填のない従来のNFCアンテナを選びます。 BR トマス Re: Function of solid plane in the NFC antenna こんにちは、トーマスさん。 情報提供ありがとうございました。 その後、アンテナ表面の上下両面に銅製のタイル(8mm×8mm、2mm間隔、各2層)を接着して試験を実施しました。 次にアンテナを測定し、再調整しました。 機能面(航続距離、電流測定、EMI)で違いは検出できません。 あなたは従来型の設計を推奨すると書いていましたね。 その理由はあるのでしょうか?もしあれば、それは何でしょうか? 8×8mmで間隔が2mmの領域よりも、間隔の広い小さな領域をいくつか設けた方が良いかもしれません。 どうもありがとうございます、 マイケル Re: Function of solid plane in the NFC antenna こんにちは、 @michael_d_1983 さん、 前述の通り、よりリアルな環境を表現するために銅製のタイルを使用しています。 これは、受信範囲が若干狭くなる可能性があることを意味します。これは、自由空間にある理想的なアンテナよりも、より現実的な状況を反映しています。これは、金属タイルがエネルギーの一部を吸収するためです。 しかし、チューニングが同じままであれば、送信電流とEMIに変化はありません。 したがって、そのような設計を「実際の」製品に実装する必要はありません。 BR トマス Re: Function of solid plane in the NFC antenna こんにちは、トーマスさん。 ご意見ありがとうございます! 実際には、銅の領域は一切含めたくないのです。基板メーカーは私たちにそうしてほしいと望んでいます。 (その理由は、プリント基板上の銅の分布が不均一だと、プリプレグに含まれる樹脂が不足している銅を補うのに十分ではないため、プリント基板製造における積層工程で気泡や剥離などの問題が発生するからである。) 私たちがまだ考慮していない、これに対する根本的な反対理由があるかどうかを明確にしたいだけです。 (リーダー機能について)テスト済みです。すべて通常通りに機能しているようです。 よろしくお願いします、 マイケル
查看全文
RW610/RW612はTLS 1.2以降をサポートしていますか? RW610/RW612はTLS 1.2以降をサポートしていますか? Re: RW610/RW612 支持TLS 1.2及以上版本么 こんにちは、 @Cherlyn はい、RW610/RW612はTLS 1.2をサポートしています。 TLS 3.0については、frdmrw612_mbedtls3x_selftestやfrdmrw612_mbedtls3x_psatestなどの関連サンプルを用意しています。これらを参照して、要件を満たしているかどうかをご確認ください。 他に何か具体的なご要望がございましたら、遠慮なくお申し付けください。一緒に話し合いましょう。 よろしくお願いします、 クリスティン。
查看全文
[S32K324 / 定制板] HSE 固件已安装 (0x4039C028=1) 但初始化失败 (0x4038C107=0) 大家好, 我正在寻求有关 S32K324 定制板上 HSE 固件初始化无法完成的问题的建议。 1. 开发环境 MCU:S32K324(定制板) HSE固件:s32k3x4_hse_fw_1.5.0_2.55.0_pb250130.bin.pink 调试器:S32DS + T32 (Trace32) 2. 进度和状态登记册 已成功在 UTEST 区域 (0x1B000000) 中编程 HSE FW 使用标志。 已将粉色图像二进制文件下载到闪存中。 执行上电复位(POR)后,状态寄存器如下: 0x4039C028 (HSE GPR): 0x01 (安装已确认) 0x4038C107 (HSE_STATUS_INIT_OK): 0x00 (启动过程中停止) 3. 问题 我想请教各位专家以下问题: 我首先应该检查什么? 由于安装成功但初始化失败,是否有任何特定的寄存器(例如,故障状态)或硬件信号需要检查以找出确切的原因? 自定义板环境是否会影响初始化失败? 由于我使用的是定制板,我怀疑硬件差异(例如,初始晶振频率)或主核心(M7)的早期时钟(PLL)配置代码可能会干扰 HSE 启动序列。如果这是一个已知问题,能否指导我推荐的启动顺序(例如,在进行任何时钟设置之前轮询 INIT_OK 标志)或可能的解决方案? 任何线索都将对我们大有帮助。感谢您的支持! Re: [S32K324 / Custom Board] HSE FW Installed (0x4039C028=1) but Init Failed (0x4038C107=0) 您好, 非常感谢您提供的清晰指导。 首先,我使用演示应用程序进行固件安装,然后在系统启动状态下转储 MU 和 HSE GPR 寄存器值。如果这些注册地址有任何错误,请告知我。 结果如下: 1. MU0 寄存器(基地址:0x4038C000)     2. HSE GPR 寄存器(基地址:0x4039C000)   请您审核一下这些数值好吗?我非常希望您能提供专业意见,帮我判断这些是否表明存在具体的错误原因,例如时钟配置冲突或固件认证失败。 再次感谢您的时间和支持! Re: [S32K324 / Custom Board] HSE FW Installed (0x4039C028=1) but Init Failed (0x4038C107=0) 请问您能否提供以下信息? MU寄存器、FSR、GSR等: HSE GPR3: Re: [S32K324 / Custom Board] HSE FW Installed (0x4039C028=1) but Init Failed (0x4038C107=0) 谢谢。但我需要看到 HSE 核心处于 WFI 状态时的屏幕截图,而不是 RESET 后立即显示的屏幕截图。
查看全文
RT1176 PWMの起動に失敗しました 私はPWM + Fault + QTimerを使ってモーターパルス制御を実装していますが、PWM3サブモジュール0のPWM_Aチャネルが時々起動できず、最初のハイレベル以降は一定のままで、その後のパルスは現れません。検査の結果、PWMの「ラン」部分が正しく設定されていないことが判明しました。後からプログラムに起動時の処理を繰り返し追加したにもかかわらず、この異常は依然として発生した。 Re: RT1176 PWM startup failed こんにちは、 @liu626 さん。 カスタムボードを使用していますか、それともEVKを使用していますか?EVKを使用している場合、何か改造を加えましたか? PWM3で使っている構成を教えてもらえますか? 何か例を参考にしていますか?もしそうなら、どの学校ですか? PWM3のみを含むプロジェクトを使用して問題を再現しようとした場合、問題は解消されますか? これはPWM3サブモジュール0のPWM_Aチャネルだけに起こるのでしょうか?他のPWMモジュールやサブモジュールでも同様の現象が発生しましたか? PWM3レジスタを操作し、ランビットに影響を与えたり上書きしたりする他のタスクや割り込みはありますか? よろしくお願いします、 パブロ Re: RT1176 PWM startup failed こんにちは、カスタム回路基板を使用しました。私は具体的な例を挙げませんでした。これは、プロジェクトの正式な開発過程で発見された問題だった。パルス制御用に6つのPWMチャネルを設定しました。このチャネルだけが問題を起こし、他のサブモジュールでは同様の問題はありませんでした。調べたところ、このチャネルだけがPWM3モジュールを使っていることがわかりました。他に干渉因子は検出されなかった。以下は私の設定です。 static axis_ctrl_t g_axes[AXIS_NUM] = ヤージュ ヤージュ .id= AXIS_X1、.name= "X1", .pwmBase= PWM1、.pwmModule= kPWM_Module_0、.pwmChannel= kPWM_PwmA、 .tmrBase= TMR3、.lowCh= kQTMR_Channel_2、.highCh= kQTMR_Channel_3、 .tmrInputsrc=kQTMR_ClockCounter2InputPin、.cascadePcs= 6U、 .faultNum= 0U、.hwExactSupported= true、.outTrigMask= kPWM_ValueRegisterMask_3、 }、 ヤージュ .id= AXIS_X2、.name= "X2", .pwmBase= PWM2、.pwmModule= kPWM_Module_0、.pwmChannel= kPWM_PwmA、 .tmrBase= TMR2、.lowCh= kQTMR_Channel_0、.highCh= kQTMR_Channel_1、 .tmrInputsrc=kQTMR_ClockCounter0InputPin、.cascadePcs= 4U、 .faultNum= 0U、.hwExactSupported= true、.outTrigMask= kPWM_ValueRegisterMask_3、 }、 ヤージュ .id= AXIS_Y、.name= "Y"、 .pwmBase= PWM3、.pwmModule= kPWM_Module_0、.pwmChannel= kPWM_PwmA、 .tmrBase= TMR3、.lowCh= kQTMR_Channel_0、.highCh= kQTMR_Channel_1、 .tmrInputsrc=kQTMR_ClockCounter0InputPin、.cascadePcs= 4U、 .faultNum= 0U、.hwExactSupported= true、.outTrigMask= kPWM_ValueRegisterMask_3、 }、 ヤージュ .id= AXIS_Z、.name= "Z"、 .pwmBase= PWM4、.pwmModule= kPWM_Module_0、.pwmChannel= kPWM_PwmA、 .tmrBase= TMR1、.lowCh= kQTMR_Channel_0、.highCh= kQTMR_Channel_1、 .tmrInputsrc=kQTMR_ClockCounter0InputPin、.cascadePcs= 4U、 .faultNum= 0U、.hwExactSupported= true、.outTrigMask= kPWM_ValueRegisterMask_3、 }、 ヤージュ .id= AXIS_EX1、.name= "EX1", .pwmBase= PWM1、.pwmModule= kPWM_Module_1、.pwmChannel= kPWM_PwmA、 .tmrBase= TMR1、.lowCh= kQTMR_Channel_2、.highCh= kQTMR_Channel_3、 .tmrInputsrc=kQTMR_ClockCounter2InputPin、.cascadePcs= 6U、 .faultNum= 1U、.hwExactSupported= true、.outTrigMask= kPWM_ValueRegisterMask_3、 }、 ヤージュ .id= AXIS_EX2、.name= "EX2", .pwmBase= PWM2、.pwmModule= kPWM_Module_1、.pwmChannel= kPWM_PwmA、 .tmrBase= TMR2、.lowCh= kQTMR_Channel_2、.highCh= kQTMR_Channel_3、 .tmrInputsrc=kQTMR_ClockCounter2InputPin、.cascadePcs= 6U、 .faultNum= 1U、.hwExactSupported= true、.outTrigMask= kPWM_ValueRegisterMask_3、 }、 };static void APP_Init_PWM_QTMR(void) ヤージュ pwm_config_t pwmConfig; pwm_fault_param_t faultConfig; qtmr_config_t qtmrConfig; PWM_GetDefaultConfig(&pwmConfig); pwmConfig.pairOperation= kPWM_Independent; pwmConfig.reloadLogic = kPWM_ReloadImmediate; PWM_FaultDefaultConfig(&faultConfig); faultConfig.faultLevel = true; faultConfig.enableCombinationalPath= 偽; faultConfig.faultClearingMode= kPWM_ManualSafety; faultConfig.recoverMode = kPWM_NoRecovery; QTMR_GetDefaultConfig(&qtmrConfig); CLOCK_EnableClock(kCLOCK_Qtimer1); CLOCK_EnableClock(kCLOCK_Qtimer2); CLOCK_EnableClock(kCLOCK_Qtimer3); PWM_StopTimer(PWM1, 0x0FU); PWM_StopTimer(PWM2, 0x0FU); PWM_StopTimer(PWM3, 0x0FU); PWM_StopTimer(PWM4, 0x0FU); pwm_fault_input_filter_param_t faultFilter; faultFilter.faultFilterPeriod= 255U; faultFilter.aultFilterCount= 7U; faultFilter.faultGlitchStretch= 偽; /* 记录每个 PWM 实例上已配置的 faultチャネル,避免重复设置 */ uint16_t pwm1FaultDone = 0U, pwm2FaultDone = 0U, pwm3FaultDone = 0U, pwm4FaultDone = 0U; for (uint8_t i = 0U; i < AXIS_NUM; i++) { axis_ctrl_t *ax = &g_axes[i]; PWM_Init(ax->pwmBase, ax->pwmModule, &pwmConfig); PWM_SetupFaults(ax->pwmBase, (pwm_fault_input_t)ax->faultNum, &faultConfig); /* 故障濾波(每個 PWM 实例的每个 faultチャネル 只设一次) */ { uint16_t *faultDone; if (ax->pwmBase == PWM1) faultDone = &pwm1FaultDone; else if (ax->pwmBase == PWM2) faultDone = &pwm2FaultDone; else if (ax->pwmBase == PWM3) faultDone = &pwm3FaultDone; else faultDone = &pwm4FaultDone; uint16_t faultBit = (uint16_t)(1U << ax->faultNum); if((*faultDone & faultBit) == 0U) { PWM_SetupFaultInputFilterExt(ax->pwmBase, (pwm_fault_channels_t)ax->faultNum, &faultFilter); *faultDone |= faultBit; } } /* 故障時輸出低電平 */ ax->pwmBase->SM[ax->pwmModule].OCTRL &= ~(PWM_OCTRL_PWMAFS_MASK |PWM_OCTRL_PWMBFS_MASK); APP_PWM_Unmap_Selected_Fault(ax); APP_PWM_ClearFault_Safe(ax); ax->pwmBase->SM[ax->pwmModule].INIT = 0U; ax->pwmBase->SM[ax->pwmModule].VAL0 = 0U; ax->pwmBase->SM[ax->pwmModule].VAL1 = 1U; ax->pwmBase->SM[ax->pwmModule].VAL2 = 0U; ax->pwmBase->SM[ax->pwmModule].VAL3 = 0U; ax->pwmBase->SM[ax->pwmModule].VAL4 = 0U; ax->pwmBase->SM[ax->pwmModule].VAL5 = 0U; ax->pwmBase->SM[ax->pwmModule].TCTRL = PWM_TCTRL_OUT_TRIG_EN(ax->outTrigMask); APP_PWM_Disable_Output(ax); if (ax->hwExactSupported) { qtmrConfig.primarySource= ax->tmrInputSrc; QTMR_Init(ax->tmrBase, ax->lowCh, &qtmrConfig); QTMR_Init(ax->tmrBase, ax->highCh, &qtmrConfig); ax->tmrBase->CHANNEL[ax->lowCh]。CTRL = TMR_CTRL_CM(kQTMR_PriSrcRiseEdge) |TMR_CTRL_PCS(ax->tmrInputSrc); ax->tmrBase->CHANNEL[ax->highCh]。CTRL = TMR_CTRL_CM(kQTMR_CascadeCount) |TMR_CTRL_PCS(ax->カスケードPcs); APP_QTMR_Disable_Low_OFLAG_Output(ax); QTMR_DisableInterrupts(ax->tmrBase, ax->lowCh, 0xFFU); QTMR_DisableInterrupts(ax->tmrBase, ax->highCh, 0xFFU); QTMR_ClearStatusFlags(ax->tmrBase, ax->lowCh, 0xFFU); QTMR_ClearStatusFlags(ax->tmrBase, ax->highCh, 0xFFU); } ax->位相 = kAxisIdle; ax->armed = false; ax->running=false; ax->done = 真; #if HARD_PWM_STATE_GUARD_ENABLE APP_StateGuard_Reset(斧); #endif } /* 使能 QTMR 中断 */ NVIC_SetPriority(TMR1_IRQn、2U); NVIC_SetPriority(TMR2_IRQn、2U); NVIC_SetPriority(TMR3_IRQn、2U); EnableIRQ(TMR1_IRQn); EnableIRQ(TMR2_IRQn); EnableIRQ(TMR3_IRQn); }静的ブールAPP_PWM_Config_Pulse(axis_ctrl_t *軸、 uint32_t highCnt400M、 uint32_t 低Cnt400M) { pwm_clock_prescale_tプリスケール; uint16_t期間ダックス; uint32_t totalCnt400M = highCnt400M + lowCnt400M; もし((軸 == NULL) ||(totalCnt400M == 0U))Return false; もし(!APP_PWM_SelectPrescaler_FromPeriodCnt400M(totalCnt400M、およびprescale、&periodTicks)) Return false; uint32_t highTicks32 = (uint32_t)((((uint64_t)periodTicks * (uint64_t)highCnt400M + ((uint64_t)totalCnt400M / 2ULL))/ (uint64_t)totalCnt400M); もし(highTicks32 == 0U) highTicks32 = 1U; もし(highTicks32 >= periodTicks) highTicks32 = (uint32_t)periodTicks - 1U; uint32_t riseTicks32 = 0U; uint32_t fallTicks32 = highTicks32; #if HARD_PWM_LOW_START_PHASE_ENABLE uint32_t lowTicks32 = (uint32_t)periodTicks - highTicks32; もし (lowTicks32 >= (2U * HARD_PWM_LOW_START_PHASE_MIN_TICKS)) { uint32_t LeadCnt400M = highCnt400M; uint32_t minLeadCnt400M = (uint32_t)HARD_PWM_LOW_START_PHASE_MIN_US * 400U; もし(desiredLeadCnt400M < minLeadCnt400M) desiredLeadCnt400M = minLeadCnt400M; uint32_t desiredLeadTicks32 = (uint32_t)(((uint64_t)periodTicks * (uint64_t)desiredLeadCnt400M + ((uint64_t)totalCnt400M / 2ULL))/ (uint64_t)totalCnt400M); if (desiredLeadTicks32 < HARD_PWM_LOW_START_PHASE_MIN_TICKS) desiredLeadTicks32 = HARD_PWM_LOW_START_PHASE_MIN_TICKS; uint32_t maxRiseByHalfTicks32 = lowTicks32 / 2U; uint32_t postGuardTicks32 = (uint32_t)(((uint64_t)periodTicks * (uint64_t)(HARD_PWM_VAL3_POST_LOW_GUARD_US * 400U) + ((uint64_t)totalCnt400M / 2ULL))/ (uint64_t)totalCnt400M); if(postGuardTicks32 < HARD_PWM_VAL3_POST_LOW_GUARD_MIN_TICKS) postGuardTicks32 = HARD_PWM_VAL3_POST_LOW_GUARD_MIN_TICKS; uint32_t maxRiseByPostGuardTicks32 = (lowTicks32 > postGuardTicks32) ? (lowTicks32 - postGuardTicks32) : 0U; uint32_t RiseTicks32; もし (maxRiseByHalfTicks32 >= desiredLeadTicks32) { selectedRiseTicks32 = desiredLeadTicks32; if(selectedRiseTicks32 > maxRiseByHalfTicks32) selectedRiseTicks32 = maxRiseByHalfTicks32; } そうでなければ(maxRiseByPostGuardTicks32 >= desiredLeadTicks32) { selectedRiseTicks32 = desiredLeadTicks32; if (selectedRiseTicks32 > maxRiseByPostGuardTicks32) selectedRiseTicks32 = maxRiseByPostGuardTicks32; } そうでなければ { selectedRiseTicks32 = maxRiseByPostGuardTicks32; } if (selectedRiseTicks32 >= HARD_PWM_LOW_START_PHASE_MIN_TICKS) { riseTicks32 = selectedRiseTicks32; fallTicks32 = riseTicks32 + highTicks32; } } #endif もし(fallTicks32 >= (uint32_t)periodTicks) fallTicks32 = (uint32_t)periodTicks - 1U; uint16_t riseTicks = (uint16_t)riseTicks32; uint16_t fallTicks = (uint16_t)fallTicks32; PWM_SetPwmLdok(axis->pwmBase, APP_PwmModuleMask(axis), false); uint16_t ctrl = axis->pwmBase->SM[axis->pwmModule]。CTRL; ctrl &=(uint16_t)(~PWM_CTRL_PRSC_MASK); ctrl |= PWM_CTRL_PRSC(プリスケール); axis->pwmBase->SM[axis->pwmModule]。CTRL = ctrl; axis->pwmBase->SM[axis->pwmModule]。INIT = 0U; axis->pwmBase->SM[axis->pwmModule]。VAL0 = 0U; axis->pwmBase->SM[axis->pwmModule]。VAL1 = ((uint16_t)(periodTicks - 1U); もし(軸>pwmチャンネル== kPWM_PwmA) { axis->pwmBase->SM[axis->pwmModule]。VAL2 = riseTicks; axis->pwmBase->SM[axis->pwmModule]。VAL3 = fallTicks; } そうでなければ (axis->pwmChannel == kPWM_PwmB) { axis->pwmBase->SM[axis->pwmModule]。VAL4 = riseTicks; axis->pwmBase->SM[axis->pwmModule]。VAL5 = fallTicks; } axis->pwmBase->SM[axis->pwmModule]。TCTRL = PWM_TCTRL_OUT_TRIG_EN(axis->outTrigMask); PWM_SetPwmLdok(軸>pwmBase、APP_PwmModuleMask(軸)、真); PWM_SetPwmLdok(軸>pwmBase、APP_PwmModuleMask(軸)、真); axis->pwmConfigValid = true; 軸>キャッシュドHighCnt400M = highCnt400M; axis->cachedLowCnt400M = lowCnt400M; 真を返す; } Re: RT1176 PWM startup failed こんにちは、 @liu626 さん。 設定を分離して、PWM3だけを初期化しても問題が続くかテストするのを手伝ってもらえますか? ご提供いただいた設定を確認し、その動作を再現するために、以下の質問があります。 axis_ctrl_t の定義は何ですか? アプリケーションでHARD_PWM_LOW_START_PHASE_ENABLEとHARD_PWM_STATE_GUARD_ENABLEは有効になっていますか? 以下のアプリ機能はどのような働きをしますか? APP_PWM_Unmap_Selected_Fault APP_PWM_ClearFault_Safe APP_PWM_出力無効化 APP_QTMR_Disable_Low_OFLAG_Output APP_StateGuard_Reset APP_PWM_SelectPrescaler_FromPeriodCnt400M APP_PwmModuleMask よろしくお願いします、 パブロ Re: RT1176 PWM startup failed お返事ありがとうございます。私が使用しているGPIOピンはrt1176のGPIO_EMC_B1_29です。「axis_ctrl_t」はモーターシャフトに関連する定義です。 * PWM出力パルス -> XBAR信号をトリガー -> パルスの立ち下がりエッジがQTMRの外部クロック入力を駆動 -> * QTMR 32ビットカスケードカウンタが1ずつ減少する -> 0に達すると、QTMR比較割り込みがトリガーされる -> 割り込みにより内部的にPWMがオフになる * 同時に、QTMR はハードウェア障害をトリガーし、PWM の物理出力ピンを直接プルダウンします。.id= AXIS_Y、 。名前= "Y", /* シリアルポートのログ記録またはブレークポイントデバッグでY軸を識別するために使用されます */ /* ================= PWM出力リソース割り当て ================= */ .pwmBase= PWM3、/* Y軸はFlexPWM3モジュールを使用します */ .pwmモジュール= kPWM_Module_0, /* PWM3 のサブモジュール 0 を使用します (各 PWM には 0 から 3 までの 4 つのサブモジュールがあります) */ .pwmChannel= kPWM_PwmA, /* サブモジュール0のフェーズAの出力ピンを使用します。これは物理ピンGPIO_EMC_B1_29に対応します。 */ /* ================= 32 ビット QTMR カスケード カウント リソース割り当て ================= */ .tmrBase= TMR3, /* Y軸はQTMR3ペリフェラル(IRQ割り込み番号TMR3_IRQnに対応します)を使用します */ .lowCh= kQTMR_Channel_0, /* 16ビットローカウンタ:TMR3のチャンネル0を使用します */ .highCh= kQTMR_Channel_1,/* 16ビットハイカウンタ:TMR3のチャンネル1を使用 */ /* 👉 .lowCh と .highChこれらはペアになっており、ハードウェアレベルでは自動的に32ビットカウンタに結合されます。 /* ================= ハードウェアカスケードクロックソースの構成 (コアクリティカル) ================= */ .tmrInputsrc=kQTMR_ClockCounter0InputPin, /* チャンネル0のクロックソース:「外部ピン入力0」に設定。 XBAR構成では、PWM3からのパルスの落ち降り縁がXBARを介してTMR3のチャネル0の入力ピンに接続されます。 したがって、PWMでパルスが出力されるたびに、チャンネル0(16ビット)は一度だけ減衰操作を行います。*/ .cascadePcs = 4U, /* 高16ビットチャネル(チャネル1)のクロックソース(PCS)の設定。 i.MX RTのQTMRレジスタにおけるPCS値は以下の通りに対応します。 0-3 = 外部ピン入力; 4 = チャネル0のオーバーフロー/終了イベント; 5 = チャネル1のオーバーフロー/終了イベント; 6 = チャネル2のオーバーフロー/終了イベント; 7 = チャネル3のオーバーフロー/終了イベント。 ここでは4Uとして構成されており、つまり「TMR3のチャネル1」が「TMR3のチャネル0のオーバーフローイベント」を監視することを意味します。 HARD_PWM_LOW_START_PHASE_ENABLE と HARD_PWM_STATE_GUARD_ENABLE が有効になっています。APP_PWM_Unmap_Selected_Fault 機能:現在の軸に対応する故障ピンマッピングを削除します。障害を無効にするには、基となる PWM_SetupFaultDisableMap 関数を呼び出します。その目的は、ハードウェア障害が不要な場合に、偶発的な外部干渉によってPWMがオフになるのを防ぎ、根本的なデバッグプロセスを容易にすることです。 APP_PWM_ClearFault(元のコード関数) 機能:PWMモジュールの障害状態フラグ(axis->pwmBase->FSTS)をクリアします。ハードウェア故障が発生した後は、PWMの再起動を許可する前にまずこのフラグをクリアしなければなりません。 APP_PWM_出力無効化 機能: PWMタイマーを即座に停止し、ピンの出力を強制的に低レベル(PWM_SetPwmForceOutputToZero)にし、出力を有効にします。この目的は、ピンがモーター起動前に浮かんだりデフォルト状態に置かれたりして高レベルを出力し、モーターが不規則に動くのを防ぐことです。 APP_QTMR_Disable_Low_OFLAG_Output 機能:QTMRのOFLAG(ステータスフラグ)出力を無効にし、OFLAGを低レベルに強制的に設定します。XBARハードウェアと連携して、その役割はQTMR出力からPWMフォルトピンへの経路を遮断し、起動前にフォルトが誤ってトリガーされるのを防ぐことです。 APP_StateGuard_Reset 機能:国家警備隊(番犬)のカウンターと旗をクリアします。この関数は、HARD_PWM_STATE_GUARD_ENABLEが有効になっている場合に、長時間パルス変化がない状態やデッドロックが発生した場合に、システムを停止または再起動する前にこれらの保護変数をリセットするために使用されます。 APP_PWM_SelectPrescaler_FromPeriodCnt400M 機能:これは周波数計算の非常に重要な基本機能です。これは、High + Lowの合計400MHzカウント値を受け取り、16ビットPWMレジスタに収まるように設定すべきプリスケーラ(PRSC)とPWM周期(PERIOD)の数を計算します。ご注意ください:計算された周期が65535を超え、かつ除算係数が範囲外の場合、この関数はfalseを返し、モーターの起動に失敗します。 APP_PwmModuleMask 機能:PWMサブモジュールのインデックス番号(例えば、値が0のkPWM_Module_0)を、Nビット左シフトしたビットマスクに変換します。NXPのPWMレジスタの多く(OUTEN、MCTRLなど)はビット単位で制御されます。この関数は、正しいバイナリマスクを生成する役割を担っています。
查看全文
如何使用 PeMicro 调试器在 S32K3x4EVB-T172 (S32K344) 上安装 S32K344 A/B 交换 HSE 固件。 您好, 我想在 S32K344 上测试 OTA A/B 替换演示。 为此,我需要在我的 S32K344 芯片上安装 HSE (A/B) 固件,该芯片上没有任何 HSE 固件。 我携带了以下硬件: 1. S32K3x4EVB-T172 (S32K344) 2. PeMicro 调试器。 (注:我没有 Lauterbach TRACE32 工具) 因此,我请求您提供一个正确的步骤,以便借助 S32 设计工作室,使用 PE 微调试器在 s32k344 上安装 HSE (A/B) 固件。 请尽量提供一个完整的操作流程,其中应包含所有必要信息,例如要使用的 DS 版本、RTD、HSE 粉色文件等。 谢谢。 Re: How to install S32K344 A/B swap HSE FW using PeMicro debugger on S32K3x4EVB-T172 (S32K344). HSE DEMO 代码(可随 HSE FW 下载)使用 Lauterbach TRACE32。虽然没有使用不同调试器的专门示例,但有 HSE 示例包: https://www.nxp.com/webapp/Download?colCode=S32K3_HSE_DemoExamples 它基本上是将 HSE DEMO 的功能移植到与调试器无关的代码中。例如,如果您使用 S32K344_HSE_FW_INSTALL,则可以使用任何调试器安装 HSE 固件。
查看全文
RT1176 PWM startup failed I am using PWM + fault + QTimer to implement motor pulse control, but the PWM3 submodule 0 PWM_A channel occasionally fails to start, where after the first high level it remains constant and subsequent pulses do not appear.After the inspection, it was found that the "run" bit of the pwm was not correctly set. Even though repeated startup operations were added in the program later, this anomaly still occurred. Re: RT1176 PWM startup failed Hi @liu626, Are you using a custom board or an EVK? If you are using the EVK, did you make any rework to it? Could you share the configuration you are using for PWM3? Are you using an example as a reference? If so, which one? If you try to replicate the issue using a project with only PWM3, does the problem persist? Does this only happen with PWM3 submodule 0 PWM_A channel? Has this occurred on other PWM modules or submodules? Is there any other task or interrupt that manipulates PWM3 registers and could affect or overwrite the run bit? Best Regards, Pablo Re: RT1176 PWM startup failed hi,I used a custom circuit board. I didn't refer to any examples. This was a problem that was discovered during the official development of the project. I configured six PWM channels for pulse control. Only this channel had problems, while no such issue occurred on the other sub-modules. I checked and found that only this channel was using the PWM3 module. No other interfering factors were detected. Below is my configuration. static axis_ctrl_t g_axes[AXIS_NUM] = { { .id = AXIS_X1, .name = "X1", .pwmBase = PWM1, .pwmModule = kPWM_Module_0, .pwmChannel = kPWM_PwmA, .tmrBase = TMR3, .lowCh = kQTMR_Channel_2, .highCh = kQTMR_Channel_3, .tmrInputsrc=kQTMR_ClockCounter2InputPin, .cascadePcs = 6U, .faultNum = 0U, .hwExactSupported = true, .outTrigMask = kPWM_ValueRegisterMask_3, }, { .id = AXIS_X2, .name = "X2", .pwmBase = PWM2, .pwmModule = kPWM_Module_0, .pwmChannel = kPWM_PwmA, .tmrBase = TMR2, .lowCh = kQTMR_Channel_0, .highCh = kQTMR_Channel_1, .tmrInputsrc=kQTMR_ClockCounter0InputPin, .cascadePcs = 4U, .faultNum = 0U, .hwExactSupported = true, .outTrigMask = kPWM_ValueRegisterMask_3, }, { .id = AXIS_Y, .name = "Y", .pwmBase = PWM3, .pwmModule = kPWM_Module_0, .pwmChannel = kPWM_PwmA, .tmrBase = TMR3, .lowCh = kQTMR_Channel_0, .highCh = kQTMR_Channel_1, .tmrInputsrc=kQTMR_ClockCounter0InputPin, .cascadePcs = 4U, .faultNum = 0U, .hwExactSupported = true, .outTrigMask = kPWM_ValueRegisterMask_3, }, { .id = AXIS_Z, .name = "Z", .pwmBase = PWM4, .pwmModule = kPWM_Module_0, .pwmChannel = kPWM_PwmA, .tmrBase = TMR1, .lowCh = kQTMR_Channel_0, .highCh = kQTMR_Channel_1, .tmrInputsrc=kQTMR_ClockCounter0InputPin, .cascadePcs = 4U, .faultNum = 0U, .hwExactSupported = true, .outTrigMask = kPWM_ValueRegisterMask_3, }, { .id = AXIS_EX1, .name = "EX1", .pwmBase = PWM1, .pwmModule = kPWM_Module_1, .pwmChannel = kPWM_PwmA, .tmrBase = TMR1, .lowCh = kQTMR_Channel_2, .highCh = kQTMR_Channel_3, .tmrInputsrc=kQTMR_ClockCounter2InputPin, .cascadePcs = 6U, .faultNum = 1U, .hwExactSupported = true, .outTrigMask = kPWM_ValueRegisterMask_3, }, { .id = AXIS_EX2, .name = "EX2", .pwmBase = PWM2, .pwmModule = kPWM_Module_1, .pwmChannel = kPWM_PwmA, .tmrBase = TMR2, .lowCh = kQTMR_Channel_2, .highCh = kQTMR_Channel_3, .tmrInputsrc=kQTMR_ClockCounter2InputPin, .cascadePcs = 6U, .faultNum = 1U, .hwExactSupported = true, .outTrigMask = kPWM_ValueRegisterMask_3, }, };static void APP_Init_PWM_QTMR(void) { pwm_config_t pwmConfig; pwm_fault_param_t faultConfig; qtmr_config_t qtmrConfig; PWM_GetDefaultConfig(&pwmConfig); pwmConfig.pairOperation = kPWM_Independent; pwmConfig.reloadLogic = kPWM_ReloadImmediate; PWM_FaultDefaultConfig(&faultConfig); faultConfig.faultLevel = true; faultConfig.enableCombinationalPath = false; faultConfig.faultClearingMode = kPWM_ManualSafety; faultConfig.recoverMode = kPWM_NoRecovery; QTMR_GetDefaultConfig(&qtmrConfig); CLOCK_EnableClock(kCLOCK_Qtimer1); CLOCK_EnableClock(kCLOCK_Qtimer2); CLOCK_EnableClock(kCLOCK_Qtimer3); PWM_StopTimer(PWM1, 0x0FU); PWM_StopTimer(PWM2, 0x0FU); PWM_StopTimer(PWM3, 0x0FU); PWM_StopTimer(PWM4, 0x0FU); pwm_fault_input_filter_param_t faultFilter; faultFilter.faultFilterPeriod = 255U; faultFilter.faultFilterCount = 7U; faultFilter.faultGlitchStretch = false; /* 记录每个 PWM 实例上已配置的 fault channel,避免重复设置 */ uint16_t pwm1FaultDone = 0U, pwm2FaultDone = 0U, pwm3FaultDone = 0U, pwm4FaultDone = 0U; for (uint8_t i = 0U; i < AXIS_NUM; i++) { axis_ctrl_t *ax = &g_axes[i]; PWM_Init(ax->pwmBase, ax->pwmModule, &pwmConfig); PWM_SetupFaults(ax->pwmBase, (pwm_fault_input_t)ax->faultNum, &faultConfig); /* 故障滤波(每个 PWM 实例的每个 fault channel 只设一次) */ { uint16_t *faultDone; if (ax->pwmBase == PWM1) faultDone = &pwm1FaultDone; else if (ax->pwmBase == PWM2) faultDone = &pwm2FaultDone; else if (ax->pwmBase == PWM3) faultDone = &pwm3FaultDone; else faultDone = &pwm4FaultDone; uint16_t faultBit = (uint16_t)(1U << ax->faultNum); if ((*faultDone & faultBit) == 0U) { PWM_SetupFaultInputFilterExt(ax->pwmBase, (pwm_fault_channels_t)ax->faultNum, &faultFilter); *faultDone |= faultBit; } } /* Fault 时输出低电平 */ ax->pwmBase->SM[ax->pwmModule].OCTRL &= ~(PWM_OCTRL_PWMAFS_MASK | PWM_OCTRL_PWMBFS_MASK); APP_PWM_Unmap_Selected_Fault(ax); APP_PWM_ClearFault_Safe(ax); ax->pwmBase->SM[ax->pwmModule].INIT = 0U; ax->pwmBase->SM[ax->pwmModule].VAL0 = 0U; ax->pwmBase->SM[ax->pwmModule].VAL1 = 1U; ax->pwmBase->SM[ax->pwmModule].VAL2 = 0U; ax->pwmBase->SM[ax->pwmModule].VAL3 = 0U; ax->pwmBase->SM[ax->pwmModule].VAL4 = 0U; ax->pwmBase->SM[ax->pwmModule].VAL5 = 0U; ax->pwmBase->SM[ax->pwmModule].TCTRL = PWM_TCTRL_OUT_TRIG_EN(ax->outTrigMask); APP_PWM_Disable_Output(ax); if (ax->hwExactSupported) { qtmrConfig.primarySource = ax->tmrInputSrc; QTMR_Init(ax->tmrBase, ax->lowCh, &qtmrConfig); QTMR_Init(ax->tmrBase, ax->highCh, &qtmrConfig); ax->tmrBase->CHANNEL[ax->lowCh].CTRL = TMR_CTRL_CM(kQTMR_PriSrcRiseEdge) | TMR_CTRL_PCS(ax->tmrInputSrc); ax->tmrBase->CHANNEL[ax->highCh].CTRL = TMR_CTRL_CM(kQTMR_CascadeCount) | TMR_CTRL_PCS(ax->cascadePcs); APP_QTMR_Disable_Low_OFLAG_Output(ax); QTMR_DisableInterrupts(ax->tmrBase, ax->lowCh, 0xFFU); QTMR_DisableInterrupts(ax->tmrBase, ax->highCh, 0xFFU); QTMR_ClearStatusFlags(ax->tmrBase, ax->lowCh, 0xFFU); QTMR_ClearStatusFlags(ax->tmrBase, ax->highCh, 0xFFU); } ax->phase = kAxisIdle; ax->armed = false; ax->running = false; ax->done = true; #if HARD_PWM_STATE_GUARD_ENABLE APP_StateGuard_Reset(ax); #endif } /* 使能 QTMR 中断 */ NVIC_SetPriority(TMR1_IRQn, 2U); NVIC_SetPriority(TMR2_IRQn, 2U); NVIC_SetPriority(TMR3_IRQn, 2U); EnableIRQ(TMR1_IRQn); EnableIRQ(TMR2_IRQn); EnableIRQ(TMR3_IRQn); }static bool APP_PWM_Config_Pulse(axis_ctrl_t *axis, uint32_t highCnt400M, uint32_t lowCnt400M) { pwm_clock_prescale_t prescale; uint16_t periodTicks; uint32_t totalCnt400M = highCnt400M + lowCnt400M; if ((axis == NULL) || (totalCnt400M == 0U)) return false; if (!APP_PWM_SelectPrescaler_FromPeriodCnt400M(totalCnt400M, &prescale, &periodTicks)) return false; uint32_t highTicks32 = (uint32_t)(((uint64_t)periodTicks * (uint64_t)highCnt400M + ((uint64_t)totalCnt400M / 2ULL)) / (uint64_t)totalCnt400M); if (highTicks32 == 0U) highTicks32 = 1U; if (highTicks32 >= periodTicks) highTicks32 = (uint32_t)periodTicks - 1U; uint32_t riseTicks32 = 0U; uint32_t fallTicks32 = highTicks32; #if HARD_PWM_LOW_START_PHASE_ENABLE uint32_t lowTicks32 = (uint32_t)periodTicks - highTicks32; if (lowTicks32 >= (2U * HARD_PWM_LOW_START_PHASE_MIN_TICKS)) { uint32_t desiredLeadCnt400M = highCnt400M; uint32_t minLeadCnt400M = (uint32_t)HARD_PWM_LOW_START_PHASE_MIN_US * 400U; if (desiredLeadCnt400M < minLeadCnt400M) desiredLeadCnt400M = minLeadCnt400M; uint32_t desiredLeadTicks32 = (uint32_t)(((uint64_t)periodTicks * (uint64_t)desiredLeadCnt400M + ((uint64_t)totalCnt400M / 2ULL)) / (uint64_t)totalCnt400M); if (desiredLeadTicks32 < HARD_PWM_LOW_START_PHASE_MIN_TICKS) desiredLeadTicks32 = HARD_PWM_LOW_START_PHASE_MIN_TICKS; uint32_t maxRiseByHalfTicks32 = lowTicks32 / 2U; uint32_t postGuardTicks32 = (uint32_t)(((uint64_t)periodTicks * (uint64_t)(HARD_PWM_VAL3_POST_LOW_GUARD_US * 400U) + ((uint64_t)totalCnt400M / 2ULL)) / (uint64_t)totalCnt400M); if (postGuardTicks32 < HARD_PWM_VAL3_POST_LOW_GUARD_MIN_TICKS) postGuardTicks32 = HARD_PWM_VAL3_POST_LOW_GUARD_MIN_TICKS; uint32_t maxRiseByPostGuardTicks32 = (lowTicks32 > postGuardTicks32) ? (lowTicks32 - postGuardTicks32) : 0U; uint32_t selectedRiseTicks32; if (maxRiseByHalfTicks32 >= desiredLeadTicks32) { selectedRiseTicks32 = desiredLeadTicks32; if (selectedRiseTicks32 > maxRiseByHalfTicks32) selectedRiseTicks32 = maxRiseByHalfTicks32; } else if (maxRiseByPostGuardTicks32 >= desiredLeadTicks32) { selectedRiseTicks32 = desiredLeadTicks32; if (selectedRiseTicks32 > maxRiseByPostGuardTicks32) selectedRiseTicks32 = maxRiseByPostGuardTicks32; } else { selectedRiseTicks32 = maxRiseByPostGuardTicks32; } if (selectedRiseTicks32 >= HARD_PWM_LOW_START_PHASE_MIN_TICKS) { riseTicks32 = selectedRiseTicks32; fallTicks32 = riseTicks32 + highTicks32; } } #endif if (fallTicks32 >= (uint32_t)periodTicks) fallTicks32 = (uint32_t)periodTicks - 1U; uint16_t riseTicks = (uint16_t)riseTicks32; uint16_t fallTicks = (uint16_t)fallTicks32; PWM_SetPwmLdok(axis->pwmBase, APP_PwmModuleMask(axis), false); uint16_t ctrl = axis->pwmBase->SM[axis->pwmModule].CTRL; ctrl &= (uint16_t)(~PWM_CTRL_PRSC_MASK); ctrl |= PWM_CTRL_PRSC(prescale); axis->pwmBase->SM[axis->pwmModule].CTRL = ctrl; axis->pwmBase->SM[axis->pwmModule].INIT = 0U; axis->pwmBase->SM[axis->pwmModule].VAL0 = 0U; axis->pwmBase->SM[axis->pwmModule].VAL1 = (uint16_t)(periodTicks - 1U); if (axis->pwmChannel == kPWM_PwmA) { axis->pwmBase->SM[axis->pwmModule].VAL2 = riseTicks; axis->pwmBase->SM[axis->pwmModule].VAL3 = fallTicks; } else if (axis->pwmChannel == kPWM_PwmB) { axis->pwmBase->SM[axis->pwmModule].VAL4 = riseTicks; axis->pwmBase->SM[axis->pwmModule].VAL5 = fallTicks; } axis->pwmBase->SM[axis->pwmModule].TCTRL = PWM_TCTRL_OUT_TRIG_EN(axis->outTrigMask); PWM_SetPwmLdok(axis->pwmBase, APP_PwmModuleMask(axis), true); PWM_SetPwmLdok(axis->pwmBase, APP_PwmModuleMask(axis), true); axis->pwmConfigValid = true; axis->cachedHighCnt400M = highCnt400M; axis->cachedLowCnt400M = lowCnt400M; return true; } Re: RT1176 PWM startup failed Hi @liu626, Could you help me isolate the configuration and test whether the issue persists when only PWM3 is initialized? After reviewing the configuration, you shared and in order to try to replicate the behavior, I have the following questions: What is the definition of axis_ctrl_t? Are HARD_PWM_LOW_START_PHASE_ENABLE and HARD_PWM_STATE_GUARD_ENABLE enabled in your application? What do the following APP functions do? APP_PWM_Unmap_Selected_Fault APP_PWM_ClearFault_Safe APP_PWM_Disable_Output APP_QTMR_Disable_Low_OFLAG_Output APP_StateGuard_Reset APP_PWM_SelectPrescaler_FromPeriodCnt400M APP_PwmModuleMask Best Regards, Pablo Re: RT1176 PWM startup failed Thank you for your reply. The GPIO pin I'm using is GPIO_EMC_B1_29 of the rt1176."axis_ctrl_t" is the definition related to the motor shaft. * PWM output pulse -> Trigger XBAR signal -> Falling edge of pulse drives the external clock input of QTMR -> * QTMR 32-bit cascaded counter decrements by 1 -> When it reaches 0, triggers QTMR comparison interrupt -> Interrupt internally turns off PWM * At the same time, QTMR triggers the hardware Fault, directly pulling down the physical output pin of PWM. .id = AXIS_Y, .name = "Y", /* Used for serial port logging or breakpoint debugging to identify the Y-axis */ /* ================= PWM Output Resource Allocation ================= */ .pwmBase = PWM3, /* The Y-axis uses the FlexPWM3 module */ .pwmModule = kPWM_Module_0, /* Uses the sub-module 0 of PWM3 (each PWM has 4 sub-modules from 0 to 3) */ .pwmChannel = kPWM_PwmA, /* Uses the output pin of phase A of sub-module 0, corresponding to the physical pin GPIO_EMC_B1_29 */ /* ================= 32-bit QTMR cascaded count resource allocation ================= */ .tmrBase = TMR3, /* The Y-axis uses the QTMR3 peripheral (corresponding to IRQ interrupt number TMR3_IRQn) */ .lowCh = kQTMR_Channel_0, /* 16-bit low counter: uses channel 0 of TMR3 */ .highCh = kQTMR_Channel_1,/* 16-bit high counter: uses channel 1 of TMR3 */ /* 👉 .lowCh and .highCh are paired, and in the hardware level, they are automatically combined into a 32-bit counter */ /* ================= Configuration of Hardware Cascaded Clock Sources (Core Critical) ================= */ .tmrInputsrc=kQTMR_ClockCounter0InputPin, /* The clock source for Channel 0: Set to "External Pin Input 0". In the XBAR configuration, the falling edge of the pulse from PWM3 is connected to the input pin of Channel 0 of TMR3 through the XBAR. Therefore, every time a pulse is output by PWM, Channel 0 (16-bit) will perform a decrement operation once. */ .cascadePcs = 4U, /* Configuration of the clock source (PCS) for the high 16-bit channel (Channel 1). In the QTMR register of i.MX RT, the PCS value corresponds as follows: 0-3 = External pin input; 4 = Overflow/Termination event of Channel 0; 5 = Overflow/Termination event of Channel 1; 6 = Overflow/Termination event of Channel 2; 7 = Overflow/Termination event of Channel 3. Here, it is configured as 4U, meaning: Let "Channel 1 of TMR3" monitor the "Overflow event of Channel 0 of TMR3". HARD_PWM_LOW_START_PHASE_ENABLE and HARD_PWM_STATE_GUARD_ENABLE have been enabled. APP_PWM_Unmap_Selected_Fault Function: Remove the Fault pin mapping corresponding to the current axis. Call the underlying PWM_SetupFaultDisableMap function to disable the Fault. The purpose is: When the hardware Fault is not needed, prevent accidental external interference from causing the PWM to be turned off, facilitating the underlying debugging process. APP_PWM_ClearFault (original code function) Function: Clear the Fault status flag (axis->pwmBase->FSTS) of the PWM module. After triggering a hardware Fault, you must first clear this flag before the PWM can be allowed to restart. APP_PWM_Disable_Output Function: Immediately stop the PWM timer, force the pin to output a low level (PWM_SetPwmForceOutputToZero), and enable the output. Its purpose is to ensure that the pin does not output a high level due to being left floating or in the default state before the motor starts, which could cause the motor to move erratically. APP_QTMR_Disable_Low_OFLAG_Output Function: Disable the OFLAG (status flag) output of QTMR and force the OFLAG to be at a low level. In conjunction with the XBAR hardware, its role is to cut off the path from the QTMR output to the PWM Fault pin, preventing accidental triggering of Fault before startup. APP_StateGuard_Reset Function: Clears the counters and flags of the state guard (watchdog). This function is used to reset these protection variables before stopping or restarting the system if it encounters a long period of no pulse change or a deadlock when HARD_PWM_STATE_GUARD_ENABLE is enabled. APP_PWM_SelectPrescaler_FromPeriodCnt400M Function: This is a very core underlying frequency calculation function. It receives the total 400MHz count value of High + Low, and calculates how many prescalers (PRSC) and PWM periods (PERIOD) should be set in order to fit into the 16-bit PWM register. Please note: If the calculated period exceeds 65535 and the division coefficient is out of range, this function will return false, causing the motor to fail to start. APP_PwmModuleMask Function: Convert the index number of the PWM sub-module (for example, kPWM_Module_0 with the value 0) into a bit mask shifted left by N bits. Many of NXP's PWM registers (such as OUTEN, MCTRL) are controlled bit by bit. This function is responsible for generating the correct binary mask.
查看全文
RT1176 PWM启动失败 我使用PWM+故障+QTimer来实现电机脉冲控制,但PWM3子模块0的PWM_A通道偶尔无法启动,在第一个高电平之后就一直保持高电平,后续脉冲不再出现。检查后发现,PWM的“运行”位没有正确设置。即使后来在程序中添加了重复启动操作,这种异常情况仍然发生。 Re: RT1176 PWM startup failed 你好@liu626 , 你用的是定制板还是EVK板?如果你使用的是 EVK,你对它进行过任何修改吗? 能否分享一下您使用的PWM3配置? 您是使用示例作为参考吗?如果是,是哪一个? 如果尝试使用仅包含 PWM3 的项目来重现该问题,问题是否仍然存在? 这种情况是否只发生在 PWM3 子模块 0 PWM_A 通道上?其他PWM模块或子模块是否也出现过这种情况? 是否还有其他任务或中断会操作 PWM3 寄存器,从而影响或覆盖运行位? 此致, 巴勃罗 Re: RT1176 PWM startup failed 您好,我使用的是定制电路板。我没有举任何例子。这是在项目正式开发过程中发现的问题。我配置了六个PWM通道用于脉冲控制。只有这个通道出现了问题,其他子模块都没有出现此类问题。我检查后发现,只有这个通道使用了 PWM3 模块。未检测到其他干扰因素。以下是我的配置。 静态 axis_ctrl_t g_axes[AXIS_NUM] = { { 。ID= AXIS_X1,.name= "X1", .pwmBase= PWM1,.pwmModule= kPWM_Module_0,.pwmChannel= kPWM_PwmA, .tmrBase= TMR3,.lowCh= kQTMR_Channel_2,.highCh= kQTMR_Channel_3, .tmrInputsrc=kQTMR_ClockCounter2InputPin,.cascadePcs= 6U, 故障编号= 0U,.hwExactSupported= true,.outTrigMask= kPWM_ValueRegisterMask_3, }, { 。ID= AXIS_X2,.name= "X2", .pwmBase= PWM2,.pwmModule= kPWM_Module_0,.pwmChannel= kPWM_PwmA, .tmrBase= TMR2,.lowCh= kQTMR_Channel_0, .highCh= kQTMR_Channel_1, .tmrInputsrc=kQTMR_ClockCounter0InputPin,.cascadePcs= 4U, 故障编号= 0U,.hwExactSupported= true,.outTrigMask= kPWM_ValueRegisterMask_3, }, { 。ID= AXIS_Y,.name= "Y", .pwmBase= PWM3,.pwmModule= kPWM_Module_0,.pwmChannel= kPWM_PwmA, .tmrBase= TMR3,.lowCh= kQTMR_Channel_0, .highCh= kQTMR_Channel_1, .tmrInputsrc=kQTMR_ClockCounter0InputPin,.cascadePcs= 4U, 故障编号= 0U,.hwExactSupported= true,.outTrigMask= kPWM_ValueRegisterMask_3, }, { 。ID= AXIS_Z,.name= "Z", .pwmBase= PWM4,.pwmModule= kPWM_Module_0,.pwmChannel= kPWM_PwmA, .tmrBase= TMR1,.lowCh= kQTMR_Channel_0, .highCh= kQTMR_Channel_1, .tmrInputsrc=kQTMR_ClockCounter0InputPin,.cascadePcs= 4U, 故障编号= 0U,.hwExactSupported= true,.outTrigMask= kPWM_ValueRegisterMask_3, }, { 。ID= AXIS_EX1,.name= "EX1", .pwmBase= PWM1,.pwmModule= kPWM_Module_1,.pwmChannel= kPWM_PwmA, .tmrBase= TMR1,.lowCh= kQTMR_Channel_2,.highCh= kQTMR_Channel_3, .tmrInputsrc=kQTMR_ClockCounter2InputPin,.cascadePcs= 6U, 故障编号= 1U,.hwExactSupported= true,.outTrigMask= kPWM_ValueRegisterMask_3, }, { 。ID= AXIS_EX2,.name= "EX2", .pwmBase= PWM2,.pwmModule= kPWM_Module_1,.pwmChannel= kPWM_PwmA, .tmrBase= TMR2,.lowCh= kQTMR_Channel_2,.highCh= kQTMR_Channel_3, .tmrInputsrc=kQTMR_ClockCounter2InputPin,.cascadePcs= 6U, 故障编号= 1U,.hwExactSupported= true,.outTrigMask= kPWM_ValueRegisterMask_3, }, };static void APP_Init_PWM_QTMR(void) { pwm_config_t pwmConfig; pwm_fault_param_t faultConfig; qtmr_config_t qtmrConfig; PWM_GetDefaultConfig(&pwmConfig); pwmConfig.pairOperation= kPWM_Independent; pwmConfig.reloadLogic = kPWM_ReloadImmediate; PWM_FaultDefaultConfig(&faultConfig); faultConfig.faultLevel = true; faultConfig.enableCombinationPath= false; faultConfig.faultClearingMode= kPWM_手动安全; faultConfig.recoverMode = kPWM_NoRecovery; QTMR_GetDefaultConfig(&qtmrConfig); CLOCK_EnableClock(kCLOCK_Qtimer1); CLOCK_EnableClock(kCLOCK_Qtimer2); CLOCK_EnableClock(kCLOCK_Qtimer3); PWM_StopTimer(PWM1, 0x0FU); PWM_StopTimer(PWM2, 0x0FU); PWM_StopTimer(PWM3, 0x0FU); PWM_StopTimer(PWM4, 0x0FU); pwm_fault_input_filter_param_t faultFilter; 故障过滤器.故障过滤器周期= 255U; faultFilter.faultFilterCount= 7U; faultFilter.faultGlitchStretch= false; /* 记录每个PWM实例上已配置的故障通道,避免重复设置 */ uint16_t pwm1FaultDone = 0U, pwm2FaultDone = 0U, pwm3FaultDone = 0U, pwm4FaultDone = 0U; for (uint8_t i = 0U; i < AXIS_NUM; i++) { axis_ctrl_t *ax = &g_axes[i]; PWM_Init(ax->pwmBase, ax->pwmModule, &pwmConfig); PWM_SetupFaults(ax->pwmBase, (pwm_fault_input_t)ax->faultNum, &faultConfig); /* 故障提示(每个 PWM 实例的每个故障通道只设置一次) */ { uint16_t *faultDone; 如果 (ax->pwmBase == PWM1) faultDone = &pwm1FaultDone; 否则如果 (ax->pwmBase == PWM2) faultDone = &pwm2FaultDone; 否则如果 (ax->pwmBase == PWM3) faultDone = &pwm3FaultDone; 否则 faultDone = &pwm4FaultDone; uint16_t faultBit = (uint16_t)(1U << ax->faultNum); 如果 ((*faultDone & faultBit) == 0U) { PWM_SetupFaultInputFilterExt(ax->pwmBase, (pwm_fault_channels_t)ax->faultNum, &faultFilter); *faultDone |= faultBit; } } /* 故障时输出低电平 */ ax->pwmBase->SM[ax->pwmModule].OCTRL &= ~(PWM_OCTRL_PWMAFS_MASK | PWM_OCTRL_PWMBFS_MASK); APP_PWM_Unmap_Selected_Fault(ax); APP_PWM_ClearFault_Safe(ax); ax->pwmBase->SM[ax->pwmModule].INIT = 0U; ax->pwmBase->SM[ax->pwmModule].VAL0 = 0U; ax->pwmBase->SM[ax->pwmModule].VAL1 = 1U; ax->pwmBase->SM[ax->pwmModule].VAL2 = 0U; ax->pwmBase->SM[ax->pwmModule].VAL3 = 0U; ax->pwmBase->SM[ax->pwmModule].VAL4 = 0U; ax->pwmBase->SM[ax->pwmModule].VAL5 = 0U; ax->pwmBase->SM[ax->pwmModule].TCTRL = PWM_TCTRL_OUT_TRIG_EN(ax->outTrigMask); APP_PWM_Disable_Output(ax); 如果 (ax->hwExactSupported) { qtmrConfig.primarySource= ax->tmrInputSrc; QTMR_Init(ax->tmrBase, ax->lowCh, &qtmrConfig); QTMR_Init(ax->tmrBase, ax->highCh, &qtmrConfig); ax->tmrBase->CHANNEL[ax->lowCh].CTRL = TMR_CTRL_CM(kQTMR_PriSrcRiseEdge) | TMR_CTRL_PCS(ax->tmrInputSrc); ax->tmrBase->CHANNEL[ax->highCh].CTRL = TMR_CTRL_CM(kQTMR_CascadeCount) | TMR_CTRL_PCS(ax->cascadePcs); APP_QTMR_Disable_Low_OFLAG_Output(ax); QTMR_DisableInterrupts(ax->tmrBase, ax->lowCh, 0xFFU); QTMR_DisableInterrupts(ax->tmrBase, ax->highCh, 0xFFU); QTMR_ClearStatusFlags(ax->tmrBase, ax->lowCh, 0xFFU); QTMR_ClearStatusFlags(ax->tmrBase, ax->highCh, 0xFFU); } ax->phase = kAxisIdle; ax->armed = false; ax->running = false; ax->done = true; #if HARD_PWM_STATE_GUARD_ENABLE APP_StateGuard_Reset(ax); #endif } /* 使能 QTMR 中断 */ NVIC_SetPriority(TMR1_IRQn, 2U); NVIC_SetPriority(TMR2_IRQn, 2U); NVIC_SetPriority(TMR3_IRQn, 2U); 启用IRQ(TMR1_IRQn); 启用IRQ(TMR2_IRQn); 启用IRQ(TMR3_IRQn); }static bool APP_PWM_Config_Pulse(axis_ctrl_t *axis, uint32_t highCnt400M, uint32_t lowCnt400M) { pwm_clock_prescale_t 预分频; uint16_t periodTicks; uint32_t totalCnt400M = highCnt400M + lowCnt400M; 如果 ((axis == NULL) || (totalCnt400M == 0U)) 返回 false; 如果 (!APP_PWM_SelectPrescaler_FromPeriodCnt400M(totalCnt400M, &prescale, &periodTicks)) 返回 false; uint32_t highTicks32 = (uint32_t)(((uint64_t)periodTicks * (uint64_t)highCnt400M + ((uint64_t)totalCnt400M / 2ULL)) / (uint64_t)totalCnt400M); 如果 (highTicks32 == 0U) highTicks32 = 1U; 如果 (highTicks32 >= periodTicks) highTicks32 = (uint32_t)periodTicks - 1U; uint32_t riseTicks32 = 0U; uint32_t fallTicks32 = highTicks32; #if HARD_PWM_LOW_START_PHASE_ENABLE uint32_t lowTicks32 = (uint32_t)periodTicks - highTicks32; 如果 (lowTicks32 >= (2U * HARD_PWM_LOW_START_PHASE_MIN_TICKS)) { uint32_t desiredLeadCnt400M = highCnt400M; uint32_t minLeadCnt400M = (uint32_t)HARD_PWM_LOW_START_PHASE_MIN_US * 400U; 如果 (desiredLeadCnt400M < minLeadCnt400M) desiredLeadCnt400M = minLeadCnt400M; uint32_t desiredLeadTicks32 = (uint32_t)(((uint64_t)periodTicks * (uint64_t)desiredLeadCnt400M + ((uint64_t)totalCnt400M / 2ULL)) / (uint64_t)totalCnt400M); 如果 (desiredLeadTicks32 < HARD_PWM_LOW_START_PHASE_MIN_TICKS) desiredLeadTicks32 = HARD_PWM_LOW_START_PHASE_MIN_TICKS; uint32_t maxRiseByHalfTicks32 = lowTicks32 / 2U; uint32_t postGuardTicks32 = (uint32_t)(((uint64_t)periodTicks * (uint64_t)(HARD_PWM_VAL3_POST_LOW_GUARD_US * 400U) + ((uint64_t)totalCnt400M / 2ULL)) / (uint64_t)totalCnt400M); 如果 (postGuardTicks32 < HARD_PWM_VAL3_POST_LOW_GUARD_MIN_TICKS) postGuardTicks32 = HARD_PWM_VAL3_POST_LOW_GUARD_MIN_TICKS; uint32_t maxRiseByPostGuardTicks32 = (lowTicks32 > postGuardTicks32) ? (lowTicks32 - postGuardTicks32):0U; uint32_t selectedRiseTicks32; 如果 (maxRiseByHalfTicks32 >= desiredLeadTicks32) { selectedRiseTicks32 = desiredLeadTicks32; 如果 (selectedRiseTicks32 > maxRiseByHalfTicks32) selectedRiseTicks32 = maxRiseByHalfTicks32; } 否则如果(maxRiseByPostGuardTicks32 >= desiredLeadTicks32) { selectedRiseTicks32 = desiredLeadTicks32; 如果 (selectedRiseTicks32 > maxRiseByPostGuardTicks32) selectedRiseTicks32 = maxRiseByPostGuardTicks32; } 别的 { selectedRiseTicks32 = maxRiseByPostGuardTicks32; } 如果 (selectedRiseTicks32 >= HARD_PWM_LOW_START_PHASE_MIN_TICKS) { riseTicks32 = selectedRiseTicks32; fallTicks32 = riseTicks32 + highTicks32; } } #endif 如果 (fallTicks32 >= (uint32_t)periodTicks) fallTicks32 = (uint32_t)periodTicks - 1U; uint16_t riseTicks = (uint16_t)riseTicks32; uint16_t fallTicks = (uint16_t)fallTicks32; PWM_SetPwmLdok(axis->pwmBase, APP_PwmModuleMask(axis), false); uint16_t ctrl = axis->pwmBase->SM[axis->pwmModule].CTRL; ctrl &= (uint16_t)(~PWM_CTRL_PRSC_MASK); ctrl |= PWM_CTRL_PRSC(预分频); axis->pwmBase->SM[axis->pwmModule].CTRL = ctrl; axis->pwmBase->SM[axis->pwmModule].INIT = 0U; axis->pwmBase->SM[axis->pwmModule].VAL0 = 0U; axis->pwmBase->SM[axis->pwmModule].VAL1 = (uint16_t)(periodTicks - 1U); 如果 (axis->pwmChannel == kPWM_PwmA) { axis->pwmBase->SM[axis->pwmModule].VAL2 = riseTicks; axis->pwmBase->SM[axis->pwmModule].VAL3 = fallTicks; } 否则如果 (axis->pwmChannel == kPWM_PwmB) { axis->pwmBase->SM[axis->pwmModule]。VAL4 = riseTicks; axis->pwmBase->SM[axis->pwmModule].VAL5 = fallTicks; } axis->pwmBase->SM[axis->pwmModule].TCTRL = PWM_TCTRL_OUT_TRIG_EN(axis->outTrigMask); PWM_SetPwmLdok(axis->pwmBase, APP_PwmModuleMask(axis), true); PWM_SetPwmLdok(axis->pwmBase, APP_PwmModuleMask(axis), true); axis->pwmConfigValid = true; axis->cachedHighCnt400M = highCnt400M; axis->cachedLowCnt400M = lowCnt400M; 返回 true; } Re: RT1176 PWM startup failed 你好@liu626 , 您能否帮我找出配置问题,并测试一下仅初始化 PWM3 时问题是否仍然存在? 在查看了您分享的配置后,为了尝试重现该行为,我有以下问题: axis_ctrl_t 的定义是什么? 您的应用程序中是否启用了 HARD_PWM_LOW_START_PHASE_ENABLE 和 HARD_PWM_STATE_GUARD_ENABLE? 以下APP功能是做什么用的? APP_PWM_Unmap_Selected_Fault APP_PWM_ClearFault_Safe APP_PWM_禁用输出 APP_QTMR_Disable_Low_OFLAG_Output APP_StateGuard_Reset APP_PWM_SelectPrescaler_FromPeriodCnt400M APP_PwmModuleMask 此致, 巴勃罗 Re: RT1176 PWM startup failed 感谢你的回复。我使用的 GPIO 引脚是 rt1176 的 GPIO_EMC_B1_29。“axis_ctrl_t”是与电机轴相关的定义。 * PWM 输出脉冲 -> 触发 XBAR 信号 -> 脉冲下降沿驱动 QTMR 的外部时钟输入 -> * QTMR 32 位级联计数器递减 1 -> 当计数器达到 0 时,触发 QTMR 比较中断 -> 中断内部关闭 PWM * 同时,QTMR 触发硬件故障,直接拉低 PWM 的物理输出引脚。。ID= AXIS_Y, 。姓名= "Y", /* 用于串口日志记录或断点调试,以识别 Y 轴 */ /* ================= PWM 输出资源分配 ================= */ .pwmBase= PWM3, /* Y轴使用FlexPWM3模块 */ .pwm模块= kPWM_Module_0, /* 使用 PWM3 的子模块 0(每个 PWM 有 4 个子模块,编号从 0 到 3) */ .pwm通道= kPWM_PwmA, /* 使用子模块 0 的 A 相输出引脚,对应于物理引脚 GPIO_EMC_B1_29 */ /* ================= 32 位 QTMR 级联计数资源分配 ================= */ .tmrBase= TMR3, /* Y轴使用QTMR3外设(对应于IRQ中断号TMR3_IRQn) */ 低= kQTMR_Channel_0, /* 16 位低计数器:使用 TMR3 的通道 0 */ .highCh= kQTMR_Channel_1,/* 16 位高位计数器:使用 TMR3 的通道 1 */ /* 👉 .lowCh 和 .highCh它们成对出现,在硬件层面上,它们会自动组合成一个 32 位计数器。 /* ================= 硬件级联时钟源配置(核心关键) ================= */ .tmrInputsrc=kQTMR_ClockCounter0InputPin, /* 通道 0 的时钟源:设置为“外部引脚输入 0”。 在 XBAR 配置中,PWM3 脉冲的下降沿通过 XBAR 连接到 TMR3 通道 0 的输入引脚。 因此,每次 PWM 输出脉冲时,通道 0(16 位)将执行一次减量操作。*/ .cascadePcs = 4U, /* 高 16 位通道(通道 1)的时钟源 (PCS) 配置。 在 i.MX RT 的 QTMR 寄存器中,PCS 值对应如下: 0-3 = 外部引脚输入; 4 = 通道 0 的溢出/终止事件; 5 = 通道 1 的溢出/终止事件; 6 = 通道 2 的溢出/终止事件; 7 = 通道 3 的溢出/终止事件。 这里配置为 4U,意思是:让“TMR3 的通道 1”监测“TMR3 的通道 0 的溢出事件”。 已启用 HARD_PWM_LOW_START_PHASE_ENABLE 和 HARD_PWM_STATE_GUARD_ENABLE。APP_PWM_Unmap_Selected_Fault 功能:移除与当前轴对应的故障引脚映射。调用底层 PWM_SetupFaultDisableMap 函数来禁用故障。目的是为了:在不需要硬件故障的情况下,防止意外的外部干扰导致 PWM 关闭,从而方便底层调试过程。 APP_PWM_ClearFault(原始代码函数) 功能:清除 PWM 模块的故障状态标志(axis->pwmBase->FSTS)。触发硬件故障后,必须先清除此标志,然后才能允许 PWM 重新启动。 APP_PWM_禁用输出 功能:立即停止 PWM 定时器,强制引脚输出低电平(PWM_SetPwmForceOutputToZero),并启用输出。它的目的是确保在电机启动之前,引脚不会因为浮空或处于默认状态而输出高电平,这可能会导致电机运动不规则。 APP_QTMR_Disable_Low_OFLAG_Output 功能:禁用 QTMR 的 OFLAG(状态标志)输出,并强制 OFLAG 处于低电平。它与 XBAR 硬件配合使用,其作用是切断 QTMR 输出到 PWM 故障引脚的路径,防止在启动前意外触发故障。 APP_StateGuard_Reset 功能:清除国家卫队(看门狗)的计数器和旗帜。如果启用 HARD_PWM_STATE_GUARD_ENABLE 时系统遇到长时间无脉冲变化或死锁,则此功能用于在停止或重新启动系统之前重置这些保护变量。 APP_PWM_SelectPrescaler_FromPeriodCnt400M 功能:这是一个非常核心的底层频率计算函数。它接收高电平 + 低电平的总 400MHz 计数值,并计算应设置多少个预分频器 (PRSC) 和 PWM 周期 (PERIOD) 才能放入 16 位 PWM 寄存器中。请注意:如果计算出的周期超过 65535 且除法系数超出范围,则此函数将返回 false,导致电机无法启动。 APP_PwmModuleMask 功能:将 PWM 子模块的索引号(例如,值为 0 的 kPWM_Module_0)转换为左移 N 位的位掩码。NXP 的许多 PWM 寄存器(例如 OUTEN、MCTRL)都是逐位控制的。该函数负责生成正确的二进制掩码。
查看全文
[S32K324 / Custom Board] HSE FW Installed (0x4039C028=1) but Init Failed (0x4038C107=0) Hi everyone, I am seeking advice regarding an issue where the HSE Firmware initialization fails to complete on an S32K324 custom board. 1. Development Environment MCU: S32K324 (Custom Board) HSE FW: s32k3x4_hse_fw_1.5.0_2.55.0_pb250130.bin.pink Debugger: S32DS + T32 (Trace32) 2. Progress and Status Registers Successfully programmed the HSE FW Usage Flag in the UTEST region (0x1B000000). Downloaded the Pink Image binary into flash memory. After performing a Power-On Reset (POR), the status registers are as follows: 0x4039C028 (HSE GPR): 0x01 (Installation confirmed) 0x4038C107 (HSE_STATUS_INIT_OK): 0x00 (Halted during boot) 3. Questions I would like to ask the experts the following: What is the very first thing I should check? Since the installation succeeded but initialization failed, are there any specific registers (e.g., Fault status) I should dump or hardware signals to inspect to pinpoint the exact cause? Can the Custom Board environment affect the initialization failure? Since I am using a custom board, I suspect hardware differences (e.g., initial XTAL frequency) or the early clock (PLL) configuration code of the main core (M7) might be interfering with the HSE boot sequence. If this is a known issue, could you guide me on the recommended boot sequence (e.g., polling the INIT_OK flag before any clock setup) or potential solutions? Any clues would be a great help. Thank you in advance for your support! Re: [S32K324 / Custom Board] HSE FW Installed (0x4039C028=1) but Init Failed (0x4038C107=0) Hi there, Thank you so much for the clear guidance. First, I proceeded with the firmware installation using the demo app, and then dumped the MU and HSE GPR register values while in the system.up state. Please let me know if any of these register addresses are incorrect. The results are as follows: 1. MU0 Registers (Base Address: 0x4038C000)     2. HSE GPR Registers (Base Address: 0x4039C000)   Could you please review these values? I would highly appreciate your expert opinion on whether these indicate a specific error cause, such as a clock configuration conflict or a firmware authentication failure. Thank you again for your time and support! Re: [S32K324 / Custom Board] HSE FW Installed (0x4039C028=1) but Init Failed (0x4038C107=0) Could you provide following information? MU registers, FSR, GSR, etc: HSE GPR3: Re: [S32K324 / Custom Board] HSE FW Installed (0x4039C028=1) but Init Failed (0x4038C107=0) Thanks. But I would need to see this screenshot when HSE core is in WFI state, not directly after reset.
查看全文
RW610/RW612 支持TLS 1.2及以上版本么 RW610/RW612 支持TLS 1.2及以上版本么 Re: RW610/RW612 支持TLS 1.2及以上版本么 Hi, @Cherlyn  Yes, RW610/RW612 支持TLS 1.2. For TLS 3.0, 我们有提供相关的example:frdmrw612_mbedtls3x_selftest 以及frdmrw612_mbedtls3x_psatest 等,您可以参考看一下是否可以满足您的要求。 如果还有其他具体的诉求,也可以提出来,我们一起讨论。 Best regards, Christine.
查看全文
Do RW610/RW612 support TLS 1.2 and above? Do RW610/RW612 support TLS 1.2 and above? Re: RW610/RW612 支持TLS 1.2及以上版本么 Hi, @Cherlyn Yes, RW610/RW612 supports TLS 1.2. For TLS 3.0, we have provided relevant examples: frdmrw612_mbedtls3x_selftest and frdmrw612_mbedtls3x_psatest, etc. You can refer to them to see if they meet your requirements. If you have any other specific requests, please feel free to bring them up, and we can discuss them together. Best regards, Christine.
查看全文
[S32K324 / カスタムボード] HSEファームウェアがインストールされましたが(0x4039C028=1)、初期化に失敗しました(0x4038C107=0) こんにちは、皆さん S32K324カスタムボード上でHSEファームウェアの初期化が完了しない問題について、アドバイスを求めています。 1. 開発環境 MCU:S32K324(カスタムボード) HSE FW: s32k3x4_hse_fw_1.5.0_2.55.0_pb250130.bin.pink デバッガ: S32DS + T32 (Trace32) 2. 進捗状況およびステータス記録簿 UTEST領域(0x1B000000)にHSE FW使用フラグを正常にプログラムしました。 ピンクイメージのバイナリファイルをフラッシュメモリにダウンロードしました。 電源投入リセット(POR)を実行した後、ステータスレジスタは次のようになります。 0x4039C028 (HSE GPR): 0x01 (インストール確認済み) 0x4038C107 (HSE_STATUS_INIT_OK): 0x00 (起動中に停止) 3. 質問 専門家の方々に以下の点についてお伺いしたいと思います。 最初に確認すべきことは何ですか? インストールは成功したが初期化が失敗した場合、正確な原因を特定するために、ダンプすべき特定のレジスタ(例:障害ステータス)や検査すべきハードウェア信号はありますか? カスタムボード環境は初期化の失敗に影響を与えることがありますか? カスタムボードを使用しているため、ハードウェアの違い(例えば、初期水晶発振周波数)やメインコア(M7)の初期クロック(PLL)構成コードがHSEブートシーケンスに干渉している可能性があると考えています。もしこれが既知の問題であれば、推奨される起動手順(例えば、クロック設定前にINIT_OKフラグをポーリングする方法)や解決策について教えていただけませんか? どんな手がかりでも大変助かります。事前にサポートありがとうございます! Re: [S32K324 / Custom Board] HSE FW Installed (0x4039C028=1) but Init Failed (0x4038C107=0) こんにちは、 明確なご案内をありがとうございます。 まず、デモアプリを使用してファームウェアのインストールを進め、その後、system.up状態中にMUおよびHSE GPRレジスタの値をダンプしました。これらの登録住所に誤りがある場合はお知らせください。 結果は以下のとおりです。 1. MU0レジスタ(ベースアドレス:0x4038C000)     2. HSE GPRレジスタ(ベースアドレス:0x4039C000)   これらの数値を確認していただけますか?これらがクロック設定の競合やファームウェア認証の失敗など、特定のエラー原因を示しているのか、専門家のご意見をいただけると大変ありがたいです。 改めてお時間をいただき、サポートありがとうございます! Re: [S32K324 / Custom Board] HSE FW Installed (0x4039C028=1) but Init Failed (0x4038C107=0) 以下の情報を教えていただけますか? MUレジスタ、FSR、GSRなど: HSE GPR3: Re: [S32K324 / Custom Board] HSE FW Installed (0x4039C028=1) but Init Failed (0x4038C107=0) ありがとう。ただし、このスクリーンショットは、リセット直後ではなく、HSEコアがWFI状態にあるときに確認する必要があります。
查看全文
How to install S32K344 A/B swap HSE FW using PeMicro debugger on S32K3x4EVB-T172 (S32K344). Hi, I want to test an OTA A/B swap demo on S32K344.  For that i'll have to install HSE (A/B) firmware on my S32K344 chip which is not having any HSE FW on it.  I have following hardware with me 1. S32K3x4EVB-T172 (S32K344) 2. PeMicro Debugger. (Note - I dont have Lauterbach TRACE32 tool ) So i request you to please provide me a proper procedure to install HSE (A/B) firmware on s32k344 using PE micro debugger with the help of S32 design studio. Please try to provide me a proper procedure where everything is mentioned like which DS version, RTD, HSE pink file etc to be used. Thanks. Re: How to install S32K344 A/B swap HSE FW using PeMicro debugger on S32K3x4EVB-T172 (S32K344). HSE DEMO code (that can be downloaded with HSE FW) use Lauterbach TRACE32. There is not dedicated examples using different debugger, but there is HSE examples package: https://www.nxp.com/webapp/Download?colCode=S32K3_HSE_DemoExamples It is basically the same functionality as HSE DEMO ported to the code which is debugger independent. For instance if you use S32K344_HSE_FW_INSTALL, you may install HSE FW with using of any debugger.
查看全文
S32K3x4EVB-T172 (S32K344) に PeMicro デバッガを使用して S32K344 A/B スワップ HSE FW をインストールする方法。 こんにちは、 S32K344でOTA A/Bスワップのデモをテストしたい。 そのためには、HSEファームウェアがインストールされていないS32K344チップにHSE(A/B)ファームウェアをインストールする必要があります。 私は以下のハードウェアを所有しています 1. S32K3x4EVB-T172 (S32K344) 2. PeMicroデバッガー。 (注:私はLauterbach TRACE32ツールを持っていません) そこで、S32 design studioの助けを借りてPEマイクロデバッガーを使ってs32k344にHSE(A/B)ファームウェアをインストールする適切な手順を教えていただけるようお願いします。 使用するDSバージョン、RTD、HSEピンクファイルなど、すべてが記載された適切な手順書を提供してください。 ありがとうございます。 Re: How to install S32K344 A/B swap HSE FW using PeMicro debugger on S32K3x4EVB-T172 (S32K344). HSE DEMOコード(HSE FWでダウンロード可能)はLauterbach TRACE32を使用しています。異なるデバッガを使った専用の例はありませんが、HSE例パッケージがあります: https://www.nxp.com/webapp/Download?colCode=S32K3_HSE_DemoExamples これは基本的に、HSE DEMOと同じ機能をデバッガに依存しないコードに移植したものです。例えば、S32K344_HSE_FW_INSTALL を使用すると、任意のデバッガを使用して HSE FW をインストールできます。
查看全文
LPI2C 从机位错误问题 我使用的是S32K146,手册上说当从设备发送1但总线为0时会触发位错误。然而,在实际测试中,当从设备发送0但总线为1时也会触发位错误。我想知道这种现象是否正确? Re: An issue regarding slave bit errors in LPI2C 嗨@GXY , 是的,没错。当从机驱动 SDA 时,位错误标志会被触发,但采样结果却不同。 值比预期值大,不一定只在发送 1 而读取 0 时才如此。 我的猜测是,寄存器描述只是给出了一个位错误标志置位时的示例。 此致, 朱利安
查看全文
PCA9959 异常行为 我实现了一个电路,其中我使用一个控制器(MCU1)向 PCA9959 写入数据,然后使用 SN74CBTLV3257 多路复用器切换 SPI 总线,并使用第二个控制器(MCU2)读取这些值。MCU 之间不进行通信,但实现了轮流进行读写操作的仲裁机制。 只用 MCU1 写入数据而不切换开关时,一切正常。当我在 MCU1 和 MCU2 之间来回切换时,就会出现问题。 在这种情况下,LED驱动器会随机打开/关闭随机排列的LED。奇怪的是,当我使用 MCU1 写入值然后再读取时,寄存器内容似乎没问题。 有什么提示吗?未发现勘误。 开关上的信号: - SDI - 时钟 - SDO - nCS 来自MCU1的其他信号: - nEN - nRESET 非常感谢您的帮助!PCA9959 Re: PCA9959 strange behavior 你好 goepe 再会! 我不是 SN74CBTLV3257 的专家,但根据我能找到的信息,SN74CBTLV3257 是一个无源 FET 开关,而不是缓冲器。 切换通道时,断开的一侧变为高阻抗(浮空),PCA9959 仍然“看到”这些引脚。 尝试在 SCLK、MOSI 和 nCS 上添加上拉/下拉电阻。 希望这些信息对您有所帮助,如果您还需要其他帮助,请告诉我。 祝你今天过得愉快,一切顺利。 Re: PCA9959 strange behavior 谢谢你的建议。我已将 PCA9959 连接到多路复用器的 A 侧连接,而不是 B 侧连接,B 侧连接确实会连接到高阻抗端。我还用高速示波器测量了 PCA9959 的 SPI 信号,但没有发现任何异常。不过我还是会尝试一下,并向你汇报结果。
查看全文
How to Utilize VIT Voice Command Results from DSP in CM33 Hello, I am working with Voice Intelligent Technology (VIT) on the MIMXRT700 EVK using the "mimxrt700evk_dsp_xaf_record_cm33_core0" reference example. The VIT voice commands are being recognized on the DSP, and I would like to use the recognized command results in my CM33 application. Could you please let me know how the VIT results can be accessed from the CM33 core?  If there are any reference examples or documentation that explain the communication flow between the DSP and CM33 cores, please share them. Thanks Re: How to Utilize VIT Voice Command Results from DSP in CM33 Hi @arshtg , We have sdk demo on how to establish communication between CM core and DSP core, please kindly refer to https://github.com/nxp-mcuxpresso/mcuxsdk-examples/tree/release/26.06.00-pvw2/multicore_examples/rpmsg_lite_pingpong_dsp for details. 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. ------------------------------------------------------------------------------- Re: How to Utilize VIT Voice Command Results from DSP in CM33 The mimxrt700evk_dsp_xaf_record_cm33_core0 example already establishes the RPMsg link between the DSP and CM33. As shown in the console logs: [DSP_Main] established RPMsg link When the VIT engine detects a wake word or a voice command, the DSP prints messages such as: [DSP VIT] - WakeWord detected 1 HEY NXP [DSP VIT] - Voice Command detected 6 STOP I would like to use these recognition results in my CM33 application. Specifically, I would like to know where these VIT detection results are generated on the DSP side and how I can access them. I also noticed that the DSP-side implementation has limited accessible source code, so I am unable to determine where the detected wake word and voice command results are obtained. Could you please point me to the relevant source files, APIs, callbacks, or documentation that describe how to obtain the detected wake word and voice command results?
查看全文
LPC55S05-EVKのデフォルトクロック設定 みなさんこんにちは、 私はLPC55シリーズを使い始めたばかりで、現在はLPC55S06-EVKを使用しています。私は、LED D4を点滅させるだけの非常にシンプルなベアメタルプロジェクトを持っています。 混乱しているのは、クロック設定コードがないのにMCUが正常に起動して動作していることです。SystemInit() または ResetISR() のいずれかにデフォルトのクロック設定があるはずだと思っていたのですが、そこには何もありませんでした。 ResetISR()の最初の命令でMCUを停止すると、クロックレジスタはすでに設定されています: MAINCLKSELA = 3 MAINCLKSELB = 0 AHBCLKDIV = 1 しかし、ユーザーマニュアルによると、MAINCLKSELAとAHBCLKDIVのリセット値はどちらも0です。 どうしてそんなことが可能なのか?コードの実行開始前に、これらのレジスタはどこで設定されているのでしょうか? よろしくお願いします、 ニコライ LPC55xx Re: Default clock setting on the LPC55S05-EVK こんにちは、 @Nikolai_Baschinski さん。 ユーザーマニュアルのリセット値はハードウェアリセット値です。 しかし、あなたのアプリケーションResetISR()はLPC55 Boot ROMがすでに実行された後に実行されます。ブートROMはデバイスの起動準備を行い、メインのクロック経路を設定することもあります。例えばResetISR(で停止すると、これらのクロックレジスタは元のリセット値にならない状態になります)。   BR ハリー
查看全文