Multi Source Translation Content

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

Multi Source Translation Content

Discussions

Sort by:
RT1189はLPSPI_CPUからLPSPI_DMAへのデータ転送時に誤ったデータを受け取る バックグランド MCU:MIMXRT1189 コア:M33のみ RTOS:Zephyr v4.3 ADCデータを収集するために、SPIマスターとしてMIMXRT1189、SPIスレーブとしてADS1235を使用しています。関連するDTSコンテンツはこちらです。 &lpspi4 { status = "okay"; cs-gpios = <&gpio5 17 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; dmas = <&edma4 18 15>, <&edma4 19 14>; dma-names = "rx", "tx"; pinctrl-0 = <&pinmux_lpspi4>; pinctrl-names = "default"; }; pinmux_lpspi4: pinmux_lpspi4 { group0 { pinmux = <&iomuxc_gpio_sd_b2_07_gpio5_io17>; drive-strength = "high"; bias-pull-up; slew-rate = "fast"; }; group1 { pinmux = <&iomuxc_gpio_sd_b2_08_lpspi4_sck>, <&iomuxc_gpio_sd_b2_10_lpspi4_sout>, <&iomuxc_gpio_sd_b2_11_lpspi4_sin>; drive-strength = "high"; slew-rate = "fast"; }; }; 以前はCONFIG_SPI_NXP_LPSPI_DMAを無効にしていましたが、問題なく動作していました。 問題の説明 今度は、LPSPIにDMAを使用し、次のような方法でバッファをキャッシュ不可能なDTCMにアラインする必要があります。 static uint8_t spi_tx[9] __aligned(32) __dtcm_noinit_section; static uint8_t spi_rx[9] __aligned(32) __dtcm_noinit_section; ADS1235のデータシートに記載されているように、RXの最初のバイトは0xFFで、2番目のバイトはTXの最初のバイトをエコーする必要があります。複数のレジスタに書き込む必要があります。レジスタを1つずつ書き込むと(書き込みごとにspi_transceive_dtを呼び出す)、2番目のレジスタからデータが一致しなくなります。 [00:00:05.536,000] ads1235: ADS1235 SPI validate mismatch: opcode=0x40 tx0=0x42 rx0=0xFF rx1=0xC2 [00:00:05.536,000] ads1235: ADS1235 SPI validate mismatch: opcode=0x40 tx0=0x43 rx0=0x0F rx1=0xF3 [00:00:05.537,000] ads1235: ADS1235 SPI validate mismatch: opcode=0x40 tx0=0x44 rx0=0xFF rx1=0xE4 [00:00:05.537,000] ads1235: ADS1235 SPI validate mismatch: opcode=0x40 tx0=0x45 rx0=0x1F rx1=0xF5 [00:00:05.537,000] ads1235: ADS1235 SPI validate mismatch: opcode=0x40 tx0=0x46 rx0=0xFF rx1=0xC6 [00:00:05.538,000] ads1235: ADS1235 SPI validate mismatch: opcode=0x40 tx0=0x47 rx0=0x0F rx1=0xF7 [00:00:05.538,000] ads1235: ADS1235 SPI validate mismatch: opcode=0x40 tx0=0x48 rx0=0xFF rx1=0xC8 [00:00:05.538,000] ads1235: ADS1235 SPI validate mismatch: opcode=0x40 tx0=0x49 rx0=0xFF rx1=0xE9 [00:00:05.539,000] ads1235: ADS1235 SPI validate mismatch: opcode=0x40 tx0=0x4A rx0=0xFF rx1=0xEA [00:00:05.539,000] ads1235: ADS1235 SPI validate mismatch: opcode=0x40 tx0=0x4B rx0=0x1F rx1=0xFB [00:00:05.539,000] ads1235: ADS1235 SPI validate mismatch: opcode=0x40 tx0=0x4C rx0=0xFF rx1=0xFC [00:00:05.540,000] ads1235: ADS1235 SPI validate mismatch: opcode=0x40 tx0=0x4D rx0=0xFF rx1=0xFD [00:00:05.540,000] ads1235: ADS1235 SPI validate mismatch: opcode=0x40 tx0=0x4E rx0=0x1F rx1=0xFE [00:00:05.540,000] ads1235: ADS1235 SPI validate mismatch: opcode=0x40 tx0=0x4F rx0=0x3F rx1=0xEF [00:00:05.540,000] ads1235: ADS1235 SPI validate mismatch: opcode=0x40 tx0=0x50 rx0=0xFF rx1=0xF0 [00:00:05.541,000] ads1235: ADS1235 SPI validate mismatch: opcode=0x40 tx0=0x51 rx0=0x1F rx1=0xF1 すべてのレジスタに対して一度だけspi_transceive_dtを実行すると、異なる動作でデータ不一致が発生します。 [00:00:05.538,000] ads1235: ADS1235 SPI validate mismatch: opcode=0x40 tx0=0x47 rx0=0x0A rx1=0x3B [00:00:05.539,000] ads1235: ADS1235 SPI validate mismatch: opcode=0x40 tx0=0x49 rx0=0x00 rx1=0xDB [00:00:05.539,000] ads1235: ADS1235 SPI validate mismatch: opcode=0x40 tx0=0x4B rx0=0x00 rx1=0xF1 [00:00:05.539,000] ads1235: ADS1235 SPI validate mismatch: opcode=0x40 tx0=0x4D rx0=0x40 rx1=0x48 [00:00:05.539,000] ads1235: ADS1235 SPI validate mismatch: opcode=0x40 tx0=0x4F rx0=0x00 rx1=0xA5 [00:00:05.539,000] ads1235: ADS1235 SPI validate mismatch: opcode=0x40 tx0=0x51 rx0=0x07 rx1=0x31 どなたかこの問題について助けていただけませんか?   i.MX RT Re: RT1189 get wrong data when transfer from LPSPI_CPU to LPSPI_DMA こんにちは、カンさん これら2つのキャプチャは、最初の書き込み成功と、それに続く2回目の書き込み失敗を示しています。2番目のMOSIは0x42 0x4B、MISOは0xFF 0x42になると予想されます。そして2回目の書き込みから、TXとRXの両方が破損しているようです。LPSPI CPUを使用した成功時とLPSPI DMAを使用した失敗時のキャプチャデータ一式をこの返信に添付しています。 SPIレートは800KHz、モードはCPOL=0、CPHA=1です。 Re: RT1189 get wrong data when transfer from LPSPI_CPU to LPSPI_DMA こんにちは、 @renrad さん。 ご連絡いただきありがとうございます! CS、SCK、MOSI、MISOの4チャンネルキャプチャを、1回の書き込み成功後、最初の失敗した書き込みをSPIクロックレートとモードで提供することは可能でしょうか。これにより、予期しないバイトが線上にあるのか、それとも にしか現れないのかがわかります spi_rx お待ちいただきありがとうございます! すてきな一日を、 カン ------------------------------------------------------------------------------- 注記: この投稿があなたの質問への回答になっている場合は、「正解としてマーク」ボタンをクリックしてください。ありがとうございます! - 前回の投稿から7週間Threadをフォローしており、その後の返信は無視しています もし後で関連する質問があれば、新しいThreadを開き、閉じたThreadを参照してください。 ------------------------------------------------------------------------------- Re: RT1189 get wrong data when transfer from LPSPI_CPU to LPSPI_DMA こんにちは、 @renrad さん。 撮影していただきありがとうございます。2回目の書き込みでは、MOSIのバイトが意図した 0x42 0x4B と異なっているようです。MISOは、回線上で確認されたコマンドバイトをそのまま反映しているようだ。これは、ADCの応答を別の問題として扱う前に、まず送信されたバイト数が異なる理由を特定する必要があることを示唆している。 最初の2回の spi_transceive_dt() 通話のコード、TXバッファの埋め方、 spi_buf ポインタと長さ、各通話の返り値などを教えていただけますか?各呼び出しの直前と直後に、TXバッファとRXバッファのアドレスと内容をログに記録し、それらのバッファがリンカマップのどこに配置されているかを確認してください。 最後に、2番目のキャプチャが、ログに記録された tx0=0x42, rx1=0xC2 不一致に対応しているかどうかを確認してください。キャプチャ内の見かけのエコーはそのログ値と異なるため、キャプチャを正確なトランザクションに合わせることで、ワイヤーレベルの問題とRXバッファの問題を区別できます。   すてきな一日を、 カン ------------------------------------------------------------------------------- 注記: この投稿があなたの質問への回答になっている場合は、「正解としてマーク」ボタンをクリックしてください。ありがとうございます! - 前回の投稿から7週間Threadをフォローしており、その後の返信は無視しています もし後で関連する質問があれば、新しいThreadを開き、閉じたThreadを参照してください。 ------------------------------------------------------------------------------- Re: RT1189 get wrong data when transfer from LPSPI_CPU to LPSPI_DMA こんにちは、カンさん 関連コードはこちら static uint8_t s_ads1235_spi_tx[32] __aligned(32) __dtcm_noinit_section; static uint8_t s_ads1235_spi_rx[32] __aligned(32) __dtcm_noinit_section; static void ads1235_spi_tranceive(uint8_t *data_tx, uint8_t *data_rx, uint8_t byte_length) { struct spi_buf tx_bufs = { .buf = s_ads1235_spi_tx, .len = byte_length }; struct spi_buf rx_bufs = { .buf = s_ads1235_spi_rx, .len = byte_length }; struct spi_buf_set tx = { .buffers = &tx_bufs, .count = 1 }; struct spi_buf_set rx = { .buffers = &rx_bufs, .count = 1 }; int ret; memcpy(s_ads1235_spi_tx, data_tx, byte_length); memset(s_ads1235_spi_rx, 0, byte_length); ret = spi_transceive_dt(&s_spi, &tx, &rx); if (ret < 0) { memset(data_rx, 0, byte_length); LOG_ERR("ADS1235 SPI transfer failed: %d", ret); } else { memcpy(data_rx, s_ads1235_spi_rx, byte_length); } } static bool ads1235_write_single_register(uint8_t addr, uint8_t data) { // Check that the register address is in range assert(addr < NUM_REGISTERS); uint8_t data_tx[4]; uint8_t data_rx[4] = {0}; uint8_t byte_length = (CRC_BYTE_ENABLED ? 4 : 2); // Build TX array and send it data_tx[0] = OPCODE_WREG + (addr & 0x1F); data_tx[1] = data; // Currently CRC is not enabled if (CRC_BYTE_ENABLED) { data_tx[2] = ads1235_calc_crc8_by_table(data_tx, 2); // Compute CRC-2 data_tx[3] = s_adc_dont_care; } ads1235_spi_tranceive(data_tx, data_rx, byte_length); // Handle SPI errors // if (ads1235_validate_spi(data_tx, data_rx, OPCODE_WREG)) { // LOG_ERR("ADS1235 write reg 0x%02X err", addr); // return false; //} // update the global register map variable s_ads1235_register_map[addr] = data; return true; } static bool ads1235_write_multiple_registers(uint8_t addr, uint8_t count, const uint8_t data[]) { for (uint8_t i = 0; i < count; i++) { if (!ads1235_write_single_register(addr + i, data[i])) { return false; } } return true; } TXの最初のバイトは、オペコードとアドレスを表します。書き込みオペコードは0x40です。したがって、0x41はアドレス0x01に書き込むことを意味します。spi_tranceive_dtの前後にログ記録を追加した後、ログの一部を以下に示します。 [00:00:05.436,000] main: Initializing ADC Before transfering TX: 0X41 0X 2 Before transfering RX: 0X 0 0X 0 After transfering TX: 0X41 0X 2 After transfering RX: 0XFF 0X41 Before transfering TX: 0X42 0X4B Before transfering RX: 0X 0 0X 0 After transfering TX: 0X42 0X4B After transfering RX: 0X 7 0XFE [00:00:05.538,000] ads1235: ADS1235 SPI validate mismatch: opcode=0x40 tx0=0x42 rx0=0x07 rx1=0xFE Before transfering TX: 0X43 0X 1 Before transfering RX: 0X 0 0X 0 After transfering TX: 0X43 0X 1 After transfering RX: 0X F 0XFB [00:00:05.539,000] ads1235: ADS1235 SPI validate mismatch: opcode=0x40 tx0=0x43 rx0=0x0F rx1=0xFB Before transfering TX: 0X44 0XF0 Before transfering RX: 0X 0 0X 0 After transfering TX: 0X44 0XF0 After transfering RX: 0X F 0XF4 [00:00:05.539,000] ads1235: ADS1235 SPI validate mismatch: opcode=0x40 tx0=0x44 rx0=0x0F rx1=0xF4 --- 2 messages dropped --- Before transfering TX: 0X45 0X60 Before transfering RX: 0X 0 0X 0 After transfering TX: 0X45 0X60 After transfering RX: 0X1F 0XF5 2回目のキャプチャは、記録されたtx0=0x42、rx1=0xC2ミスマッチに対応していることは確かです。問題はドライバの内部バッファが汚れていることだと思います。 私が提供した情報は十分かつ価値のあるものでしょうか?
View full article
Request to Review of WM8962 Audio Codec Integration with SAI4 on i.MX95-15x15 Hello NXP Team, I have created a device-tree patch (wm8662_audio_codec_imx95_15x15.patch) to integrate the WM8962 audio codec with SAI4 on my custom i.MX95 15×15 board. Could you please review the patch and verify whether the audio integration is correct? Please focus on: WM8962 I²C configuration, address, clocks, and power supplies. SAI4 configuration, pinctrl, clock rates, and master-clock settings.   Note: The patch also contains HDMI, LVDS, and other configurations. Please ignore these changes and review only the WM8962 audio codec and SAI4 integration. Please suggest the necessary corrections and provide a reference device-tree example if available. please find the attachment. Thank you for your support. Request to Review of WM8962 Audio Codec Integration with SAI4 on i.MX95-15x15-FRDM Dear @Zhiming_Liu , Thank you for your suggestion regarding the external MCLK and dummy clock configuration. I have updated my device-tree patch (wm8662_audio_codec_imx95_15x15.patch) based on your recommendation. Could you please again  review the attached patch and clarify the following points? Missing properties: Are all the remaining WM8962 codec device-tree properties correct, or are any additional properties required? MCLK configuration: I am using an external MCLK { 24.000MHZ-D2Y-T} and have added the dummy fixed-clock node as suggested. Is the clock configuration correct, including the frequency of 12.288 MHz? SAI4 configuration: Is my SAI4 configuration correct, particularly the assigned clocks, clock parents, clock rates, and fsl,sai-mclk-direction-output property? &sai4 { #sound-dai-cells = <0>; pinctrl-names = "default", "sleep"; pinctrl-0 = <&pinctrl_sai4>; pinctrl-1 = <&pinctrl_sai4_sleep>; assigned-clocks = <&scmi_clk IMX95_CLK_AUDIOPLL1_VCO>, <&scmi_clk IMX95_CLK_AUDIOPLL2_VCO>, <&scmi_clk IMX95_CLK_AUDIOPLL1>, <&scmi_clk IMX95_CLK_AUDIOPLL2>, <&scmi_clk IMX95_CLK_SAI4>; assigned-clock-parents = <0>, <0>, <0>, <0>, <&scmi_clk IMX95_CLK_AUDIOPLL1>; assigned-clock-rates = <3932160000>, <3612672000>, <393216000>, <361267200>, <12288000>; fsl,sai-mclk-direction-output; status = "okay"; 4. Required changes: Should I remove or modify any properties in the SAI4 or WM8962 nodes. Thank you for your continued support. Re: Request to Review of WM8962 Audio Codec Integration with SAI4 on i.MX95-15x15 Hi @deepak_k  If you are using external MCLK, please add dummy clock information in dts. m8962_ext_mclk: wm8962-ext-mclk { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <12288000>; clock-accuracy = <20>; clock-output-names = "wm8962_ext_mclk"; }; wm8962: audio-codec@1a { compatible = "wlf,wm8962"; reg = <0x1a>; clocks = <&wm8962_ext_mclk>; clock-names = "mclk"; ..... /delete-property/ fsl,sai-mclk-direction-output; }; Best Regards, Zhiming
View full article
R47 EVK 的示意图 哪里可以找到 R47 EVK S32R47-EVB-SLD的原理图 Re: Schematic diagram of R47 EVK 你好, 我在网页上没有找到。 由于不允许通过社区分享,请联系格拉斯哥雷达团队,他们会为您提供。 顺祝商祺! Peter
View full article
RT1176 MT25QL256ABA8E12 フラッシュをプログラムできません 新しい3.3V NORフラッシュ、MT25QL256ABA8E12をプログラムしようとしたときに、「20107 (0x4e8b) FlexSPINOR: SFDP Not Found」というエラーが発生しました。 以前のバージョンでは、USB経由でNORフラッシュメモリへの書き込みに成功していました。 EV設計の大きな違いはNORフラッシュデバイスです。同じフラッシュシリーズのMT25QL256ABA8E12-0AATに移行しましたが、これは3.3Vの自動車グレード部品です。 旧フラッシュメモリ:MT25QU256ABA8E12-1SIT 新しいフラッシュメモリ:MT25QL256ABA8E12-0AAT この変更により、NVCC_SD2には安定した3.3Vが供給され、新しい3.3V NORフラッシュに合わせて3.3Vレールも更新されます。 ご確認いただき、フラッシュ作業に関して他に設定が必要な箇所があればお知らせください。 Re: RT1176 Not able to program MT25QL256ABA8E12 flash こんにちは、ギャビンさん。 ありがとうございます。 SECログに完全なFCB設定を含む書き込みファイルを添付しましたのでご確認ください。ご覧になって、ご意見をお聞かせください。 共有したいデータポイントの1つは、NOR信号をプローブしたときに、RESET#ネットが1.1~1.3Vにプルダウンされていることに気づいたことです。これは予想外のことで、今のところこの現象に対する良い説明が見つかっていません。 クリス Re: RT1176 Not able to program MT25QL256ABA8E12 flash ありがとう。3.3Vレールのアップデートをすべて含んでいるデザインが確認されました。 Re: RT1176 Not able to program MT25QL256ABA8E12 flash SFDPに加えて、供給電圧の変化により回路図設計が異なる可能性があり、1.8Vが3.3Vに変換される必要があります。関連するNOR VCC回路図とPCBレイアウトも1.8Vから3.3Vに変更してください。 Re: RT1176 Not able to program MT25QL256ABA8E12 flash こんにちは、 @chryao さん。 ご連絡いただきありがとうございます! 「完全なFCB」テストは、FCB内のパラメータを使ってFlexSPIコントローラのみを初期化します。フラッシュに対して消去、プログラム、読み取りは行われていないため、フラッシュが実際に反応しているかどうかは確認できません。対照的に、簡略化されたオプション(0xC0000005)はフラッシュからSFDPテーブルを読み込む必要があり、両ログで唯一の本格的なフラッシュアクセスでした。20107年に失敗した。 XMCDなしでSECで完全なFCB構成を使った完全な書き込みを実行し、ログ全体を共有していただけませんか?さらに、通常のブートモードでフラッシュメモリにアクセス(読み書き)する際に、ハードウェア関連の問題の可能性を除外するために、まずテストを行うことが推奨されます。 よろしくお願いします、 ギャビン Re: RT1176 Not able to program MT25QL256ABA8E12 flash ログを添付します。 点滅するエラーログ CompleteFCBテスト接続合格ログ。 Re: RT1176 Not able to program MT25QL256ABA8E12 flash @Gavin_Jia NXPがRT1176 3.3V NORフラッシュ(BGA-24パッケージ)のベンダーリストを承認しているかどうか教えてください。 Re: RT1176 Not able to program MT25QL256ABA8E12 flash こんにちは、 @chryao さん。 追加のログファイルをありがとうございます。 ログを見ると、完全なFCBを持つ configure-memory はFlexSPIコントローラーのみを初期化するため、フラッシュとはデータをやり取りしません。最初の本格的なフラッシュアクセスは flash-erase-region であり、 20106 Command Failure で失敗します。 これは、以前の簡易オプションで発生した「SFDP が見つかりません」というエラー(20107)と一致します。2つの異なる設定方法が最初のリアルフラッシュアクセスで失敗し、フラッシュが全く反応していないことを示しています。これはFCBやLUTの設定ではなく、ハードウェアの問題を示唆しています。   3.3Vフラッシュの場合、RESET#の1.1〜1.3Vは有効な論理ハイではないため、フラッシュはリセットされたままか、未定義の状態に放置されている可能性が高いです。同じ理由で、SRAMからflexspi_nor_polling_transfer例を実行してもフラッシュにアクセスできないと予想されます。 まずは回路図と基板から始めることをお勧めします。まず、RESET#がクリーンで有効な3.3Vレベルを検出していることを確認してから、再度フラッシュメモリの有効化とプログラミングを試してください。 承認されたベンダーリストについて:NXPは外部NORフラッシュ用の公式AVLを維持しておらず、RTのEVKは3.3V BGA-24 NORを使っていません。一般的に、JEDEC SFDP標準をサポートするシリアルNORフラッシュはFlexSPIで動作するはずです。 よろしくお願いします、 ギャビン Re: RT1176 Not able to program MT25QL256ABA8E12 flash これら2つのNORデータシートによると、MT25QL256ABA 3.3VはMT25QU256ABA 1.8Vと同じコマンドリストを共有しており、以下の96Hコマンドが期待されます。ご確認ください。 一方、MT25QU256ABA MT25QL256ABAと比べて最大クロック周波数が高い場合は、ソフトウェアの設定を確認し、周波数を下げて確認してください
View full article
LS1028Aカスタムボードは、CPLDを取り外した後、起動しません。RCWはプルアップ/プルダウン抵抗によって構成されています。 NXPサポートの皆さん、こんにちは。 LS1028Aをベースにした独自の基板の設計を開始しました。この設計ではCPLDを廃止し、RCWはプルアップ/プルダウン抵抗器で構成されています。LS1028AのPORリセットは、200msのリセット遅延を持つリセットICによって制御されます。 測定によると、基板の電源レール、クロック、リセット信号はすべて揃っていますが、プロセッサは起動しません。理由は不明です。 原因の分析を手伝ってもらえますか? ありがとうございます。 Re: LS1028A custom board does not boot after removing CPLD — RCW configured by pull-up/pull-down res 最も可能性の高い原因は以下のとおりです。 CPLDの取り外しにより、cfg_rcw_src抵抗ストラップの設定が誤っています。 RESET_REQ_B意図せずリセット経路に繋がっていること。RESET_REQ_BがPORESET_Bと関連付けられていないことを確認してください。 リセットICが原因でPORESET_Bのタイミングに問題が発生しています。データシートによると、PORESET_Bの立ち上がり/立ち下がり時間はSYSCLKの1周期を超えてはならない。 選択したブートソース内のRCWイメージが無効またはアクセスできません。 HRESET_Bの解放を阻止する外部回路。 一時的にハードコードされたRCWブートモードを選択し、CodeWarriorがCWTAP経由でデバイスに正常に接続できるか確認することをお勧めします。これにより、問題がRCWブートパスに関連するものなのか、リセットハードウェアの実装に関連するものなのかを特定するのに役立ちます。 ありがとうございます。 Re: LS1028A custom board does not boot after removing CPLD — RCW configured by pull-up/pull-down res LS1028AからCPLDを取り外しました。電源投入シーケンスは、リファレンスボードの回路図に従います。RCWは、プルアップ/プルダウン抵抗器によって構成され、ハードウェアエンコードされたブートを選択します。その他のすべての構成も、プルアップ/プルダウン抵抗によって設定されます。我々の測定では、PORESET_Bの立ち上がり時間は1クロックサイクルを超えず、リセット時間は200msでした。HRESET_Bはハイレベルからローレベルに変化します。しかし、LS1028Aは正常に起動せず、SDHC1_CLKにクロック信号が出力されません。 Re: LS1028A custom board does not boot after removing CPLD — RCW configured by pull-up/pull-down res ハードウェアエンコードモードを設定したとき、HRESET_Bが最後に高くなれなかったことを確認させてください。 もしSOなら、ハードウェアの問題の可能性もあります。 LS1028Aリファレンスマニュアル 4.8.6 Power-On Reset Sequence Timing に従って、PORESET_B、HRESET_B、RESET_REQ、ASLEEPの波形をテストしてください 。SYSCLKとPORの設定ピンを同時にテストし、タイミング要件と比較してハードウェアの問題がいつ発生するかを確認するのが良いです。 よろしくお願いします。
View full article
F2400 LIMP0 错误 我们发现,在 30 电源频繁开关机循环期间,LIMP0 引脚被拉低。我们尚未找到根本原因。请帮忙分析一下。 通过软件调试,我们发现当报告故障时,以下寄存器被置位: FS_CRC 位 12 INIT_CRC_NOK_I FS_SAFETY_OUTPUTS bit3 LIMP0_DRV M_WU1_FLG 位9 FS_EVT M_GEN_FLAG 位6 WD_G 此外,当 LIMP0 引脚被拉低后,收发器仍处于正常模式,CAN 消息的发送/接收正常。在软件中,我们将看门狗周期配置为无限,但当发生故障时,寄存器仍然显示 256 毫秒。 Re: F2400 LIMP0 ERROR 1:fault error counter default值是1,你读的对不对? FS_I_FSSM_CFG[3:0]的值 2:我把所有影响带LIMP的因素都贴在下面了: 用最笨的方法一个个排除吧只能 Re: F2400 LIMP0 ERROR 1:确认LIMP的上拉还在吗?正常吗?正常 2:读一下Fault error counter是多大在LIMP拉低的状态下 这个值通过SPI回读有点奇怪,是0, FS_I_FSSM_CFG这个寄存器是0x8000 Re: F2400 LIMP0 ERROR 1:确认LIMP的上拉还在吗?正常吗? 2:读一下Fault error counter是多大在LIMP拉低的状态下 Re: F2400 LIMP0 ERROR 是的 Re: F2400 LIMP0 ERROR Hi PINKMAN 您说的是FS2400?
View full article
Zephyr RTOS 入口处的新配置找不到 i.MXRT1185 您好,NXP, 我无法从 Zephyr RTOS 入口找到 i.MXRT1185 型号。 能否帮忙检查并版本我们可以配置运行 Zephyr 的 i.MXRT1185? 非常感谢。 MCUXpresso 配置工具 v26.09 Re: New config from Zephyr RTOS entrance can't find i.MXRT1185 嗨@jimmyli , 感谢您的耐心等待。 经与相关团队核实,我可以确认 i.MX RT1185 目前不受支持。我们已将此议题提交相关团队进一步讨论。 感谢您让我们注意到这个问题,也感谢您提供的宝贵意见。 顺祝商祺! 刘梅
View full article
LS1028A custom board does not boot after removing CPLD — RCW configured by pull-up/pull-down resisto Hi NXP Support, We have started designing our own board based on the LS1028A. In this design, we removed the CPLD, and the RCW is configured using pull-up/pull-down resistors. The LS1028A POR reset is controlled by a reset IC with a 200 ms reset delay. From our measurements, all board power rails, clocks, and reset signals are present, but the processor does not boot. We do not know the reason. Could you please help analyze the possible cause? Thanks. Re: LS1028A custom board does not boot after removing CPLD — RCW configured by pull-up/pull-down res The most probable causes are: Incorrect cfg_rcw_src resistor strap settings due to the removal of the CPLD. RESET_REQ_B being unintentionally connected into the reset path. Please verify that RESET_REQ_B is not tied to PORESET_B. PORESET_B timing issues caused by the reset IC. Per the datasheet, the PORESET_B rise/fall time should not exceed one SYSCLK period. An invalid or inaccessible RCW image in the selected boot source. External circuitry preventing HRESET_B from being released. We recommend temporarily selecting a hard-coded RCW boot mode and verifying whether CodeWarrior can successfully connect to the device through CWTAP. This would help isolate whether the issue is related to the RCW boot path or to the reset hardware implementation. Thanks. Re: LS1028A custom board does not boot after removing CPLD — RCW configured by pull-up/pull-down res We removed the CPLD on the LS1028A. The power-up sequence follows the reference board circuit. The RCW is configured by pull-up/pull-down resistors, selecting hardware-encoded boot. All other configurations are also set by pull-up/pull-down resistors. In our measurements, the rise of PORESET_B does not exceed one clock cycle, and the reset duration is 200 ms. HRESET_B goes high and then low. However, the LS1028A does not boot normally, and no clock is output on SDHC1_CLK. Re: LS1028A custom board does not boot after removing CPLD — RCW configured by pull-up/pull-down res Let me confirm when you set hardware-encoded mode the HRESET_B could not get high at the end. If so, it is possible that this is a hardware issue. Please test the waveforms of PORESET_B, HRESET_B, RESET_REQ and ASLEEP following the LS1028A Reference Manual, 4.8.6 Power-On Reset Sequence Timing. It's better to test the SYSCLK and POR configs pins at the same time, and compare them against the timing requirements to confirm when the hardware issue occurs. Thanks
View full article
F2400 LIMP0 エラー 30電源の頻繁な電源オン/オフサイクル中に、LIMP0ピンがローにプルダウンされることがわかった。根本原因はまだ特定できていません。分析にご協力ください。 ソフトウェアデバッグの結果、故障が報告される際に以下のレジスタが設定されることがわかりました。 FS_CRC bit12 INIT_CRC_NOK_I FS_SAFETY_OUTPUTS bit3 LIMP0_DRV M_WU1_FLG ビット9 FS_EVT M_GEN_FLAG bit6 WD_G さらに、LIMP0ピンがローに引き込まれた後もトランシーバは通常モードのまま、CANメッセージの送受信は正常です。ソフトウェアではウォッチドッグ期間を無限に設定しましたが、故障が発生した時もレジスタは256msと表示されます。 Re: F2400 LIMP0 ERROR 1:障害エラーカウンタのデフォルト値は1です。正しく読みましたか? FS_I_FSSM_CFG[3:0] の値 2:以下に、LIMPに影響を与えるすべての要因を列挙しました。 最も基本的な方法を使って、一つずつ排除していきましょう。 Re: F2400 LIMP0 ERROR 1. LIMPプルアップはまだ有効ですか?これは正常ですか? はい、正常です。 2:LIMPが低いときに、故障エラーカウンタの値を読み取ります。 SPI経由で読み戻すと、この値は少し奇妙で、0になります。FS_I_FSSM_CFGレジスタは0x8000です。 Re: F2400 LIMP0 ERROR 1. LIMPプルアップはまだ可能ですか?これは正常ですか? 2:LIMPが低いときに、故障エラーカウンタの値を読み取ります。 Re: F2400 LIMP0 ERROR はい Re: F2400 LIMP0 ERROR こんにちは、ピンクマン FS2400のことでしょうか?
View full article
Zephyr RTOSの入口からの新しい設定が見つかりませんMXRT1185 こんにちは、NXPさん。 I.MXRT1185タイプNo.が見つかりません。ZephyrのRTOS入口から。 Zephyrを実行しているi.MXRT1185の設定が可能かどうか確認してリリースしてもらえますか? どうもありがとうございました。 MCUXpresso 設定ツール v26.09 Re: New config from Zephyr RTOS entrance can't find i.MXRT1185 こんにちは、 @jimmyli さん。 ご辛抱いただきありがとうございます。 関係チームに確認したところ、RT1185 i.MX 現在はサポートされていないことが確認できました。この問題は関係チームに提起し、さらなる検討を依頼しました。 この件をご指摘いただき、また貴重なご意見をいただき、ありがとうございます。 よろしくお願いいたします。 メイ・リウ
View full article
F2400 LIMP0 ERROR We found that during frequent power-on/off cycling of the 30 power supply, the LIMP0 pin is pulled low. We have not yet identified the root cause. Please help analyze this. Through software debugging, we found that the following registers are set when the fault is reported: FS_CRC bit12 INIT_CRC_NOK_I FS_SAFETY_OUTPUTS bit3 LIMP0_DRV M_WU1_FLG bit9 FS_EVT M_GEN_FLAG bit6 WD_G In addition, after the LIMP0 pin is pulled low, the transceiver remains in normal mode and CAN message transmission/reception is normal. In software, we configured the watchdog period as INFINITE, but when the fault occurs, the register still shows 256 ms. Re: F2400 LIMP0 ERROR 1: The default value of the fault error counter is 1. Did you read it correctly? The value of FS_I_FSSM_CFG[3:0] 2: I've listed all the factors that affect LIMP below: Let's use the most basic method to eliminate them one by one. Re: F2400 LIMP0 ERROR 1. Is the LIMP pull-up still active? Is this normal? Yes, it's normal. 2: Read the value of the Fault Error Counter when LIMP is low. This value is a bit strange when read back via SPI; it's 0. The FS_I_FSSM_CFG register is 0x8000. Re: F2400 LIMP0 ERROR 1. Is the LIMP pull-up still active? Is this normal? 2: Read the value of the Fault Error Counter when LIMP is low. Re: F2400 LIMP0 ERROR Yes Re: F2400 LIMP0 ERROR Hi PINKMAN Are you referring to the FS2400?
View full article
New config from Zephyr RTOS entrance can't find i.MXRT1185 Hi NXP,       I can't find i.MXRT1185 type No. from Zephyr RTOS entrance.       Can you help to check and release that we can config for i.MXRT1185 running Zephyr ?        Thanks very much. MCUXpresso Config Tool v26.09 Re: New config from Zephyr RTOS entrance can't find i.MXRT1185 Hi @jimmyli , Thank you for your patience. After checking with the relevant teams, I can confirm that i.MX RT1185 is currently not supported. We have raised this topic with the relevant teams for further consideration. Thank you for bringing this to our attention and for your valuable feedback. Best Regards May Liu
View full article
移除CPLD后,LS1028A定制板无法启动——RCW由上拉/下拉电阻配置 您好,NXP技术支持, 我们已经开始基于LS1028A设计我们自己的板。在这个设计中,我们移除了CPLD,并且RCW采用上拉/下拉电阻进行配置。LS1028A POR 复位由复位 IC 控制,复位延迟为 200 毫秒。 根据我们的测量,所有板电源轨、时钟和复位信号都存在,但处理器无法启动。我们不知道原因。 请问您能否帮忙分析一下可能的原因? 谢谢。 Re: LS1028A custom board does not boot after removing CPLD — RCW configured by pull-up/pull-down res 最可能的原因有: 由于移除了 CPLD,cfg_rcw_src 电阻器跳线设置不正确。 RESET_REQ_B 被意外地连接到了复位路径中。请确认 RESET_REQ_B 是否与 PORESET_B 关联。 由复位IC引起的PORESET_B时序问题。根据数据手册,PORESET_B 上升/下降时间不应超过一个 SYSCLK 周期。 所选启动源中存在无效或无法访问的 RCW 映像。 外部电路阻止 HRESET_B 释放。 我们建议暂时选择硬编码的 RCW 启动模式,并验证 CodeWarrior 是否能够通过 CWTAP 成功连接到设备。这有助于确定问题是与 RCW 启动路径有关,还是与 RESET 硬件实现有关。 谢谢。 Re: LS1028A custom board does not boot after removing CPLD — RCW configured by pull-up/pull-down res 让我确认一下,当您设置硬件编码模式时,HRESET_B 最后无法达到高电平。 如果是这样,那很可能是硬件问题。 请按照 LS1028A 参考手册 4.8.6 节“上电复位序列时序”测试 PORESET_B、HRESET_B、RESET_REQ 和 ASLEEP 的波形 。最好同时测试 SYSCLK 和 POR 配置引脚,并将其与时序要求进行比较,以确认硬件问题何时发生。 谢谢! Re: LS1028A custom board does not boot after removing CPLD — RCW configured by pull-up/pull-down res 我们拆除了LS1028A上的CPLD。上电顺序遵循参考电路板电路。RCW 通过上拉/下拉电阻进行配置,选择硬件编码启动。其他所有配置也都是通过上拉/下拉电阻设置的。在我们的测量中,PORESET_B 的上升时间不超过一个时钟周期,RESET 持续时间为 200 毫秒。HRESET_B 先变为高电平,然后变为低电平。但是,LS1028A 无法正常启动,SDHC1_CLK 上没有时钟输出。
View full article
Schematic diagram of R47 EVK Where to find the schemtics of the R47 EVK S32R47-EVB-SLD Re: Schematic diagram of R47 EVK Hello, I do not see it on our web page available. Since it is not allowed to share it via community, please get in touch with Glasgow RADAR team, they will provide it for you. Best regards, Peter
View full article
R47 EVKの概略図 R47 EVK S32R47-EVB-SLDの回路図はどこで入手できますか? Re: Schematic diagram of R47 EVK こんにちは、 弊社のウェブページには掲載されていないようです。 コミュニティでの共有は許可されていないため、グラスゴーのレーダーチームにご連絡ください。彼らが提供してくれます。 よろしくお願いいたします。 ピーター
View full article
RT1176 无法对 MT25QL256ABA8E12 闪存进行编程 尝试对新的 3.3V 或非 闪存 MT25QL256ABA8E12 进行编程时,出现“20107 (0x4e8b) FlexSPINOR: SFDP Not Found.”错误。 之前,我们在上一版硬件中已经能够通过 USB 成功对 或非 Flash 进行编程。 电动汽车设计的关键区别在于 或非 Flash 设备:我们改用了 MT25QL256ABA8E12-0AAT,它虽然属于同一闪存系列,但却是 3.3V 的汽车级设备。 旧版闪存:MT25QU256ABA8E12-1SIT 新固件:MT25QL256ABA8E12-0AAT 此次更改会向 NVCC_SD2 提供稳定的 3.3V 电压,并且 3.3V 电源轨也会更新以适应新的 3.3V 或非 Flash。 请看一下,如果还有其他刷机设置需要调整,请告诉我。 Re: RT1176 Not able to program MT25QL256ABA8E12 flash 嗨,加文, 谢谢。 请查看附件,其中包含完整的 高效密码学标准\(SEC\) 日志中的 FCB 配置信息。请看一下,然后告诉我结果。 我想分享的一个数据点是,当我探测 或非 信号时,我注意到 RESET# 网络被拉高至 1.1-1.3V。这出乎我的意料,我目前还没有对此现象的合理解释。 Chris Re: RT1176 Not able to program MT25QL256ABA8E12 flash 谢谢。已确认该设计包含了所有3.3V电源轨的更新。 Re: RT1176 Not able to program MT25QL256ABA8E12 flash 除了SFDP之外,电源电压的变化可能会导致不同的原理图设计,因为1.8V需要改为3.3V。请将相关的或非 VCC 原理图和 PCB 布局中的电压从 1.8V 修改为 3.3V。 Re: RT1176 Not able to program MT25QL256ABA8E12 flash 嗨@chryao , 感谢您的联系! “完整 FCB”测试仅使用 FCB 内部的参数初始化 FlexSPI 控制器。没有对闪存执行擦除、编程或读取操作,因此不能确认闪存是否真的有响应。相比之下,简化选项 (0xC0000005) 需要从闪存读取 SFDP 表,这也是两个日志中唯一真正的闪存访问。它在 20107 年失败了。 请您在不使用 XMCD 的情况下,使用完整的 FCB 配置在 高效密码学标准\(SEC\) 中运行一次完整的写入操作,并分享完整的日志?此外,建议先在正常启动模式下进行测试,让 RAM 代码访问(读取/写入)闪存,以排除任何潜在的硬件相关问题。 此致, 加文 Re: RT1176 Not able to program MT25QL256ABA8E12 flash 附件是日志文件。 闪断故障日志 completeFCB 测试连接通过日志。 Re: RT1176 Not able to program MT25QL256ABA8E12 flash @Gavin_Jia请问NXP是否有RT1176 3.3V 或非 Flash(BGA-24封装)的认证供应商名单? Re: RT1176 Not able to program MT25QL256ABA8E12 flash 嗨@chryao , 感谢您提供的其他日志文件。 在日志中,我发现使用完整的 FCB 的 configure-memory 仅初始化 FlexSPI 控制器,因此它不会与闪存交换任何数据。第一次真正的闪存访问是 flash-erase-region ,并且失败了,错误代码为 20106 Command Failure 。 这与简化选项中早先出现的 20107 SFDP Not Found 相符。两种不同的配置方法在第一次真正访问闪存时都失败了,这说明闪存根本没有响应。这表明问题出在硬件上,而不是FCB或LUT设置上。   对于 3.3V 的闪存,RESET# 上的 1.1–1.3V 不是有效的逻辑高电平,因此闪存很可能处于复位状态或处于未定义状态。出于同样的原因,我预计从 SRAM 运行 flexspi_nor_polling_transfer 示例也无法访问闪存。 我建议先从原理图和PCB板入手。请先确保 RESET# 检测到干净有效的 3.3V 电平,然后再尝试启用和编程闪存。 关于认可供应商列表:NXP 没有维护外部 或非 闪存的官方 AVL,并且 RT EVK 中没有任何一款使用 3.3V BGA-24 或非。一般来说,支持JEDEC SFDP标准的串行NOR闪存应该可以与FlexSPI兼容。 此致, 加文 Re: RT1176 Not able to program MT25QL256ABA8E12 flash 根据这两款NOR门的数据手册,MT25QL256ABA 3.3V与MT25QU256ABA 1.8V共享相同的命令列表,但缺少如下所示的96H命令,请核对。 同时,MT25QU256ABA 的最大时钟频率比 MT25QL256ABA 更高,请检查软件设置并降低频率进行测试。
View full article
RT1176 Not able to program MT25QL256ABA8E12 flash Got  "20107 (0x4e8b) FlexSPINOR: SFDP Not Found." error when trying to program a new 3.3V NOR flash, MT25QL256ABA8E12. Previously, we were able to successfully program the NOR Flash over USB in our last rev hardware. The key difference in EV design is the NOR Flash device: we have moved to the MT25QL256ABA8E12-0AAT, which is from the same flash series but is a 3.3V, automotive-grade part. Old flash: MT25QU256ABA8E12-1SIT New flash: MT25QL256ABA8E12-0AAT A steady 3.3V is supplied to NVCC_SD2 for this change and 3.3V rail is updated for the new 3.3V NOR Flash as well. Please take a look and let me know if there is any other settings I need to do for flashing. Re: RT1176 Not able to program MT25QL256ABA8E12 flash Hi Gavin, Thanks. Please find attached full Write with the complete FCB configuration in SEC log. Please take a look and let me know. One datapoint that I want to share is when I probed the NOR signals, I noticed that the RESET# net is pulled to 1.1-1.3V, which is not expected and I do not have a good explanation for this observation yet. Chris Re: RT1176 Not able to program MT25QL256ABA8E12 flash thanks. Confirmed that the design includes all the 3.3V rail updates.  Re: RT1176 Not able to program MT25QL256ABA8E12 flash Beside SFDP, the supply voltage change may result in different schematics design since 1.8V need to change to 3.3V. Please modify the related NOR VCC schematics and PCB layout from 1.8V to 3.3V as well Re: RT1176 Not able to program MT25QL256ABA8E12 flash Hi @chryao , Thanks for your reaching out! The "complete FCB" test only initializes the FlexSPI controller using the parameters inside the FCB. No erase, program, or read was performed on the flash, so it does not confirm that the flash is actually responding. In contrast, the simplified option (0xC0000005) requires reading the SFDP table from the flash, and this was the only real flash access in both logs. It failed with 20107. Could you please run a full Write with the complete FCB configuration in SEC without XMCD and share the complete log? Additionally, it is advisable to first perform a test in normal boot mode where the RAM code accesses (reads/writes) the Flash memory, in order to rule out any potential hardware-related issues. Best regards, Gavin Re: RT1176 Not able to program MT25QL256ABA8E12 flash attached is the log. flashing failure log completeFCB test connection pass log. Re: RT1176 Not able to program MT25QL256ABA8E12 flash @Gavin_Jia Please provide me if NXP have approved vendor list for RT1176 3.3V NOR Flash, in BGA-24 package. Re: RT1176 Not able to program MT25QL256ABA8E12 flash Hi @chryao , Thanks for your additional log files. In the logs, I found that  configure-memory with the complete FCB only initializes the FlexSPI controller, so it doesn't exchange any data with the flash. The first real flash access is flash-erase-region , and it fails with 20106 Command Failure . That matches the earlier 20107 SFDP Not Found from the simplified option. Two different configuration methods both fail on the first real flash access, which tells us the flash isn't responding at all. This points to a hardware issue rather than an FCB or LUT setting.    For a 3.3V flash, 1.1–1.3V on RESET# is not a valid logic high, so the flash is most likely being held in reset or left in an undefined state. For the same reason, I'd expect that running the flexspi_nor_polling_transfer example from SRAM would also fail to access the flash. I'd suggest starting with the schematic and PCB. Please make sure RESET# sees a clean, valid 3.3V level first, and then try enabling and programming the flash again. About an approved vendor list: NXP doesn't maintain an official AVL for external NOR flash, and none of the RT EVKs uses a 3.3V BGA-24 NOR. In general, a serial NOR flash that supports the JEDEC SFDP standard should work with FlexSPI.  Best regards, Gavin Re: RT1176 Not able to program MT25QL256ABA8E12 flash According to these 2 NOR datasheet, MT25QL256ABA 3.3V share same command list compared with MT25QU256ABA 1.8V expect 96H command as below, please check Meanwhile MT25QU256ABA have higher maximum clock frequency compare with MT25QL256ABA , please check the software setting and lower the frequency to check
View full article
NXP Trimension® SR250で始めるUWB入門 第3回:UWB測距デモを試してみる (日本語ブログ) はじめに   第2回では、SR250評価ボード (SR250UWBSHIELD) のセットアップ方法として、A. PnP (Plug and Play) ルートとB. Zephyr SDKルートの2種類の環境構築手順を解説しました。 今回はいよいよ実際にUWB測距デモを動かします。デモの進め方も引き続きA/Bの2ルートに分けて解説します。まだ環境構築が終わっていない方は、先に第2回をご確認ください。 スマートフォンとのUWB測距はBルートで扱います。まず、Zephyr SDKでビルドせずにpre-builtバイナリを使って試す方法を紹介し、その後にZephyr SDKでNearbyデモをビルドする方法を説明します。pre-built版ではZephyr SDKのビルドは不要で、RW612へのFW書き込みは第2回のPnPルートで説明した手順と同じ流れで行えます。 第1回 UWBの基礎とSR250の概要 第2回 SR250評価ボード (SR250UWBSHIELD) のセットアップ 第3回(本記事) UWB測距 (Ranging) を試してみる 第4回 UWBレーダー (Radar) を試してみる デモの全体像  UWB測距では、通信相手となるデバイスが必要です。今回のデモでは、 一方のボードが Controller としてUWBセッションのスケジューリング・タイミング制御を担い、同時に Initiator として測距を開始します。 もう一方のボードは Controlee としてControllerの指示に従い、Responder として応答パケットを返します。 ボード2台を用意する代わりに、UWB対応スマートフォンを相手デバイスとして使うことも可能です (Bルート参照)。 「A. PnPルート」の方はこちら 「B. Zephyr SDKルート」の方はこちら A. PnPルート   GitHub: SR250 UWB Plug-and-Play Application Simple_demosフォルダの概要   PnPデモ用リポジトリの Simple_demos\ フォルダには、以下のファイルが含まれています。 ファイル名 内容 UartInterface.py シリアル通信の基本処理をまとめたモジュール。 各デモスクリプトから共通で使用されます。 UwbConfig.py UWBセッションのパラメータ (チャネル、タイミング等) を設定するモジュール。 第2回のZephyr SDKルートで書き込んだキャリブレーションデモと同様に、デバイスのキャリブレーション値の設定もこのファイルで行います。 デモスクリプト各種 demo_ranging.py :2台のボード間でDS-TWR (Double-Sided Two-Way Ranging) による距離計測を行うメインデモ。 demo_radar_ocpd.py :オンチップ存在検知 (OCPD: On-Chip Presence Detection) デモ。 demo_radar_raw.py :CIR (Channel Impulse Response) の生データ取得デモ。 ※レーダー関連 (ocpd/radar_raw) のデモについては次回の記事で詳しく紹介します。 viki_SR250.pl UCIパケットをデコードするPerlスクリプト。ログの詳細解析に使用します。 使用にはPerlのインストールが必要です。WindowsではStrawberry Perlなどをインストールし、コマンドプロンプトで perl -v を実行して、Perlのバージョンが表示されること(Perlがインストールされ、PATHが設定されていること)を確認してください。   今回は測距用デモの  demo_ranging.py  を試してみましょう。   COMポートの確認   ボードをPCのUSBポートに接続し、COMポート番号を確認してください。確認方法は第2回をご参照ください。   Ranging Demoの起動   今回も第2回と同様に、Windows PCのコマンドプロンプトを使用します。コマンドプロンプトを2つ起動し、それぞれのコマンド内のCOMポート番号を、各ボードのCOMポート番号に置き換えて実行してください。ボーレートはスクリプトが自動設定するため、指定する必要はありません。   Controller側 (例:COM3): python demo_ranging.py COM3 controller Controlee側 (例:COM4): python demo_ranging.py COM4 controlee   実行ログの確認   スクリプトを起動すると、ターミナルにログが流れ始めます。Ctrl+Cで止めることができます。 ログには16進数の文字列がたくさん流れてきて、測距できているのかいないのか、一見ちんぷんかんぷんに見えるかもしれません。これらはUWBデバイスとホスト間でやり取りされるUCIパケットの生データです。次のセクションでUCIについて説明します。   UCI (UWB Command Interface) とは?   UCIは、FiRa Consortiumが策定したホストとUWBデバイス間の標準コマンドインターフェースです。コマンド・レスポンス・通知 (Notification) の3種類のメッセージで構成されています。 先ほど動作させたPythonスクリプトはバックグラウンドでボードにUCIコマンドを送信し、ボードからのUCIレスポンスおよびNotificationを受信しています。測距結果はUCI Notificationとして返されますが、デフォルトのPythonスクリプトではデコードされず、送受信したUCIパケットがそのまま16進数の生データとして表示されます。   UCIログの読み方   まずは、測距結果を含むUCI Notificationを一例として見てみましょう。 NXPUCIR <= 62 00 00 38 30 00 00 00 01 00 00 80 00 c8 00 00 00 01 00 00 00 00 00 00 00 00 00 00 01 11 11 00 00 30 00 85 f9 00 09 fc 00 00 00 00 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00 00 UCIパケットでは、複数バイトの値をリトルエンディアンで読み取ります。この例の先頭4バイトはヘッダーです。 62 00 00 38 :Notificationであること、メッセージの種類、ペイロード長 (0x38 = 56バイト) を示します。 30 00 00 00 :セッションシーケンス番号です。 01 00 00 80 :UWBセッションを識別するセッションハンドルです。 c8 00 00 00 :測距間隔で、 0x000000C8 = 200 、200 msを示します。 01 :測距方式としてTwo-Way Ranging (TWR) が設定されています。 01 :このNotificationに含まれる測距結果が1件であることを示します。 続く測距結果のフィールドでは、 11 11 が相手デバイスの短いMACアドレス、続く 00 が測距成功、次の 00 が見通し (LoS) を示します。そして、 30 00 が距離のフィールドです。リトルエンディアンで読むと 0x0030 = 48 となるため、このパケットの測距結果は 48 cm です。   今回のように測距結果だけを確認したい場合は、次のセクションで説明するUCIパケット全体をデコードする viki_SR250.pl  を使わず、測距結果を取り出す関数をPythonスクリプトへ直接追加する方法もあります。例えば、 demo_ranging.py に以下のコールバック関数を追加します。 ntf[0] は測距ステータス、 ntf[2] と ntf[3] は距離データです。 def extract_ranging(id, ntf): if ntf[0] == 0: distance = int(ntf[2] + (ntf[3] << 8)) print(f"Device {id}: dist = {distance} cm")   次に、 demo_ranging.py の受信スレッドで extract_ranging をキーワード引数として渡します。 read_thread = Thread( target=UartIntf.read_from_serial_port, kwargs={"extract_ranging": extract_ranging} ) read_from_serial_port() は受信した測距Notificationをこの関数に渡すため、測距に成功するたびに、例えば Device 0: dist = 48 cm のように距離がリアルタイムで表示されます。   viki_SR250.pl  によるデコード   UCIパケット全体を詳しく解析したい場合は、 viki_SR250.pl  を使用します。 viki_SR250.pl  はUCIパケットの各フィールドをデコードし、セッション状態の遷移や各パケットの詳細を確認できます。使用にはPerlのインストールが必要です。 python -u demo_ranging.py COM3 controller | perl viki_SR250.pl   UCIの各フィールドがデコードされ、セッション状態の遷移や各パケットの詳細を確認できます。 B. Zephyr SDKルート   通常の測距デモ:ControllerとControleeデモ   Zephyr SDKルートでの測距デモも、Controller/Controlee構成で動作します。2台のボードにそれぞれ異なるファームウェアをビルドして書き込みます。 まず一つのボードだけ接続し、Controllerファームウェアのビルド、書き込みを行います。 west build -b frdm_rw612 -p auto uwbiot-top\demos\common\demo_ranging_controller\zephyr west flash 💡 前のビルドからビルドオプションを変更している場合、エラーが発生することがあります。sr250-uwbiot-zephyr\buildフォルダを消去するか、pristineビルドをまず試してみてください。 Controllerデモを書き込んだボードを一度外し、もう一つのボードを接続してControlee ファームウェアのビルド、書き込みを行います。 west build -b frdm_rw612 -p auto uwbiot-top\demos\common\demo_ranging_controlee\zephyr west flash   Controllerデモを書き込んでおいたボードを再度接続し、ターミナルソフトを2つ起動します。3Mbps設定で、それぞれのCOMポート番号を接続すると、以下のログのようにボード間の測距を開始します。 スマートフォンとの測距:Nearbyデモ   Bルートでは、BLEを接続の起点として使用し、UWB対応スマートフォンとの測距が可能です。このデモで使用するアプリケーション名は demo_nearby_interaction です。"Nearby" という名前は、AppleのiOS向け「Nearby Interaction」フレームワークと、Androidの「Nearby」APIに由来します。これらは、OSベンダーが提供するUWBを使った近距離インタラクション向けのAPIです。 Nearbyデモでは、最初からUWBで通信するのではなく、まずBLEを使って相手の発見・接続と、UWB測距に必要な情報交換を行います。スマートフォンのUWBは、このような事前の接続・設定を終えてから測距セッションを開始する設計になっているためです。また、BLEはUWBに比べて低消費電力で相手の発見や接続を行いやすいため、常時UWBを動作させず、必要なときだけUWB測距を開始することで消費電力を抑えられます。次の順序で測距を開始します。 BLEでSR250ボードとスマートフォンを接続します。 BLE経由で、UWB測距に必要なセッション情報や設定情報を交換し、双方の測距条件をそろえます。 交換した情報に基づいてUWBセッションを開始し、UWBでDS-TWR測距を行います。 つまり、BLEは接続とUWB測距の準備に使用し、実際の距離測定はUWBで行います。   Nearbyデモは、ボード1セットとUWB対応スマートフォンがあれば試せます。pre-builtバイナリで手軽に試す方法と、必要に応じてZephyr SDKでアプリケーションをビルド方法の2つを説明します。   方法1:pre-builtバイナリで試す   Zephyr SDKでビルドせず、あらかじめ用意されたpre-builtバイナリを使って手軽にNearbyデモを試すことができます。まずは動作確認をしたい場合に便利な方法です。 手順と必要なファイルは、GitHubのNXP Application Code Hub: UWB Nearby Interaction with phones を参照してください。リポジトリからUWB Trimension SR250 Nearby Interaction Demo application packageをダウンロードして展開し、 program_FRDM-RW612.bat を実行してファームウェアを書き込みます。書き込み操作は、第2回のPnPルートで説明した "Step 1: RW612 PnP用FWの書き込み" と同じ流れで、ボタン操作でISPモードへ入れてからバッチファイルを実行します。   方法2:Zephyr SDKでビルドする   ソースコードを変更したり、アプリケーションの動作を詳しく確認する場合は、Zephyr SDKでNearbyデモをビルドします。   Nearby Interactionファームウェアのビルド、書き込み: west build -b frdm_rw612 -p auto uwbiot-top\demos\SR2XX\demo_nearby_interaction\zephyr west flash   どちらの方法もFW書き込み後に、ターミナルソフトで接続すると以下のようなログが出力され、BLEアドバタイジングモードに入ります。スマートフォンのアプリを起動すると、BLE接続が確立され、UWB測距のログが流れ始めます。 スマートフォンアプリ   スマートフォン側では、パートナーである MobileKnowledgeが作成したMK UWB Connectを使用できます。AndroidスマートフォンではGoogle Playから、iPhoneではApp Storeから入手できます。アプリにはRanging、Distance Alert、Trackerなどのデモモードがあり、SR250 Nearby Interactionアクセサリとの測距を試すことができます。 iPhoneでは、MK UWB ConnectのほかにNXP Trimensions ARも使用できます。NXP Trimensions ARもMK UWB ConnectのTrackerデモも、UWB測距とARKit利用して、SR250アクセサリとの距離や位置関係をAR画面上で表示します。ARKitを使用するため、起動時にはアプリから姿勢キャリブレーションを案内されます。画面の指示に従って、スマートフォンを動かしてください。 Android:MK UWB Connect iPhone:MK UWB Connect または NXP Trimensions AR 対応端末:UWB対応スマートフォン iPhone:iPhone 11以降 (iPhone SE (第3世代)、iPhone 16eおよび17eを除く) Android:Google Pixel Proシリーズ、Samsung Galaxy S21+~S26シリーズ、AQUOS RシリーズのR8世代以降など その他の対応端末は、UWB対応モバイル端末一覧をご参照ください。   MK UWB Connectを動かしたときの画面は、NXP Application Code Hub: UWB Nearby Interaction with phonesで確認できます。 iPhoneでNXP Trimensions ARを動かしたときは以下のような画面で、SR250ボードまでの距離と方向が表示されます。 まとめ   今回は2つのルートでUWB測距デモを実際に動かしました。 Aルート (PnP):Pythonスクリプトを実行するだけで手軽にUWB測距が確認できます。 viki_SR250.pl  を使えばUCIログの詳細解析も可能です。 Bルート (Zephyr SDK):pre-builtバイナリを使えばビルドなしで、Zephyr SDKでビルドすればソースコードを変更しながら、BLEを活用したスマートフォンとの測距が可能です。スマートフォン側では、Android・iPhoneに対応した MK UWB Connect アプリを使用します。 次回はSR250のもう一つの機能、UWBレーダーによるオンチップ存在検知 (OCPD) デモを試してみます。 参考リンク Trimension SR250 製品ページ (日本語) SR250 評価ボード (TRIMENSION-SR250) SR250 UCI仕様書 (UM12508) SR250 UWBIoT for Zephyr OS (GitHub) Making UWB Plug and Play with Trimension SR250 (トレーニング動画) ========================= 本投稿の「Comment」欄にコメントをいただいても、現在返信に対応しておりません。 お手数をおかけしますが、お問い合わせの際には「NXPへの技術質問 - 問い合わせ方法 (日本語ブログ)」をご参照ください。 (既に弊社NXP代理店、もしくはNXPとお付き合いのある方は、直接担当者へご質問いただいてもかまいません。) 第3回では、第2回で構築した環境を使って、いよいよUWB測距デモを動かします。2台のSR250 UWB SHIELDによるボード間測距に加え、Zephyr SDKルートではBLEで接続したUWB対応スマートフォンとの測距も試します。PnPルートとZephyr SDKルートの2通りを解説します。 (作業時間:環境構築済みなら最短10分) 日本語ブログ
View full article
使用 NXP Trimension® SR250 开始使用 UWB - 第 3 部分:试用 UWB 距离演示(日语博客) 介绍   在第二部分中,我们将介绍 SR250 评估板( SR250UWBSHIELD )的设置方法,特别是 A。PnP(即插即用)Root 和 B。本文档介绍了设置 Zephyr SDK 根环境的两种方法。 这次,我们将正式进行UWB测距演示。我们将继续使用A、B两条不同的路径来讲解演示过程。如果您尚未完成环境设置,请先查看第二部分。 使用智能手机进行UWB距离测量将采用方案B。首先,我们将介绍如何在不使用Zephyr SDK的情况下尝试使用预编译的二进制文件,然后我们将解释如何使用Zephyr SDK构建Nearby演示程序。使用预编译版本时,无需构建Zephyr SDK,并且可以按照PnP方案第二部分中介绍的步骤,将固件写入RW612。 第一 UWB基础知识及SR250概述 第二次 设置 SR250 评估板 (SR250UWBSHIELD) 第三部分(本文) 我们来试试超宽带测距。 第四 试试超宽带雷达。 示威活动的总体情况 UWB测距需要通信伙伴设备。在本演示中, 其中一块板充当控制器,负责处理 UWB 会话的调度和定时控制,同时充当发起者来启动距离测量。 另一块板充当控制器接收方,遵循控制器的指令,并充当响应方,返回响应数据包。 除了使用两块电路板之外,您还可以使用支持 UWB 的智能手机作为另一台设备(参见路线 B)。 对于使用“A. PnP 途径”的用户,请点击此处。 对于使用“B. Zephyr SDK 途径”的用户,请点击此处。 A. PnP 路线   GitHub: SR250 UWB 即插即用应用程序 Simple_demos 文件夹概要   PnP 演示仓库中的 Simple_demos\ 文件夹包含以下文件: 文件名 内容 UartInterface.py 一个概括串行通信基本处理的模块。 这是所有演示脚本中通用的。 UwbConfig.py 用于配置 UWB 会话参数(信道、时间等)的模块。 与第二节课中使用 Zephyr SDK root 编写的校准演示类似,设备校准值也在此文件中设置。 各种演示脚本 demo_ranging.py 这是主要演示,演示如何使用 DS-TWR(双面双向测距)测量两个板之间的距离。 demo_radar_ocpd.py :片上存在检测 (OCPD) 演示。 demo_radar_raw.py :演示如何从 CIR(信道脉冲响应)获取原始数据。 *有关雷达相关(ocpd/radar_raw)演示的详细信息将在下一篇文章中介绍。 viki_SR250.pl 用于解码 UCI 数据包的 Perl 脚本。用于详细的日志分析。 要使用此功能,必须安装 Perl。在 Windows 系统上,请安装 Strawberry Perl 或类似程序,然后在命令提示符中运行 perl -v 以确认显示 Perl 版本(即 Perl 已安装且 PATH 环境变量已设置)。   这次,我们来尝试一下用于距离测量的 demo_ranging.py 演示。   检查 COM 端口   将开发板连接到电脑的 USB 端口,并检查 COM 端口号。有关如何检查端口号的说明,请参阅第 2 部分。   启动测距演示   与第二部分一样,我们将使用 Windows 电脑上的命令提示符。打开两个命令提示符窗口,并在执行命令前将每个命令中的 COM 端口号替换为您开发板的 COM 端口号。波特率将由脚本自动设置,因此您无需指定。   控制器端(例如,COM3): python demo_ranging.py COM3 controller 受控端(例如,COM4): python demo_ranging.py COM4 controlee   检查执行日志   运行脚本后,日志会开始输出到终端。你可以按 Ctrl+C 停止输出。 日志中可能充斥着十六进制字符串,乍一看很难判断距离测量是否正常工作。这些是UWB设备和主机之间交换的UCI数据包的原始数据。UCI将在下一节中进行解释。   什么是UCI (UWB命令接口) ?   UCI是由FiRa联盟开发的一种主机与UWB设备之间的标准命令接口。它包含三种类型的消息:命令、响应和通知。 我们刚刚运行的 Python 脚本会在后台向开发板发送 UCI 命令,并接收来自开发板的 UCI 响应和通知。距离测量结果以 UCI 通知的形式返回,但默认的 Python 脚本不会对其进行解码,因此发送和接收的 UCI 数据包会以原始十六进制数据的形式显示。   如何读取 UCI 日志   首先,我们来看一个包含距离测量结果的 UCI 通知示例。 NXPUCIR <= 62 00 00 38 30 00 00 00 01 00 00 80 00 c8 00 00 00 01 00 00 00 00 00 00 00 00 00 00 01 11 11 00 00 30 00 85 f9 00 09 FC 00 00 00 00 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00 00 UCI 数据包以小端序格式读取多字节值。在本例中,前四个字节是数据包头部。 62 00 00 38 这表明它是一条通知,消息类型为 0x38,有效载荷长度为 56 字节。 30 00 00 00 这是会话序列号。 01 00 00 80 这是用于标识 UWB 会话的会话句柄。 c8 00 00 00 :表示距离测量间隔为 0x000000C8 = 200 ,200毫秒。 01 采用双向测距(TWR)作为距离测量方法。 01 这表示该通知包含一个距离测量结果。 在以下测距结果字段中, 11 11 是另一台设备的短 MAC 地址, 00 表示测距成功, 00 表示视距 (LoS) 连接。最后, 30 00 是距离字段。以小端字节序读取时,它变为 0x0030 = 48 ,因此该数据包的测距结果为48 厘米。   如果您只想查看距离测量结果(如本例所示),也可以直接在 Python 脚本中添加一个函数来提取距离测量结果,而无需使用 viki_SR250.pl 来解码整个 UCI 数据包(如下一节所述)。例如,将以下回调函数添加到 demo_ranging.py 中。 ntf[0] 表示距离测量状态, ntf[2] 和 ntf[3] 表示距离数据。 def extract_ranging(id, ntf): 如果 ntf[0] == 0: distance = int(ntf[2] + (ntf[3] << 8)) print(f"设备 {id}:距离 = {distance} 厘米")   接下来,我们将 extract_ranging 作为关键字参数传递给接收线程 demo_ranging.py 。 read_thread = Thread( target=UartIntf.read_from_serial_port,kwargs={"extract_ranging": extract_ranging} ) read_from_serial_port() 接收到的距离测量通知会传递给该函数,因此每次距离测量成功时,距离都会实时显示,例如 Device 0: dist = 48 cm 。   viki_SR250.pl 解码   如果要详细分析整个 UCI 数据包,请使用 viki_SR250.pl 。 viki_SR250.pl 会解码 UCI 数据包的每个字段,使您可以查看会话状态转换和每个数据包的详细信息。使用此功能需要安装 Perl。 python -u demo_ranging.py COM3 controller | perl viki_SR250.pl   UCI 的每个字段都会被解码,从而可以查看会话状态转换和每个数据包的详细信息。 B. Zephyr SDK 路线   标准距离测量演示:控制器和被控制器演示   使用 Zephyr SDK 的距离测量演示程序也适用于控制器/被控对象配置。需要为两个开发板分别构建不同的固件并写入其中。 首先,只连接一块板子,并构建和烧录控制器固件。 west build -b frdm_rw612 -p auto uwbiot-top\demos\common\demo_ranging_controller\zephyr west flash 💡 如果您自上次构建以来更改了构建选项,则可能会遇到错误。请尝试删除 sr250-uwbiot-zephyr\build 文件夹,或者先尝试全新构建。 移除已写入 Controller demo 的电路板,连接另一块电路板,然后构建并写入 Controlee 固件。 west build -b frdm_rw612 -p auto uwbiot-top\demos\common\demo_ranging_controlee\zephyr west flash   将已写入控制器演示程序的开发板重新连接,并启动两个终端程序。将速率设置为 3Mbps,连接相应的 COM 端口,然后开始测量开发板之间的距离,如下方日志所示。 测量智能手机与目标距离:附近演示   方案 B 使用 BLE 作为连接起点,从而能够使用兼容 UWB 的智能手机进行距离测量。本演示中使用的应用程序名称为demo_nearby_interaction 。“Nearby”一词源自苹果公司为 iOS 开发的“ Nearby Interaction ”框架以及安卓系统的“ Nearby ”API。这些 API 由操作系统供应商提供,用于使用 UWB 进行短距离交互。 在 Nearby 演示中,并非一开始就使用 UWB 通信,而是首先使用 BLE 来发现并连接对方,并交换 UWB 测距所需的信息。这是因为智能手机的 UWB 功能设计为仅在完成这些初步连接和设置后才启动测距会话。此外,由于 BLE 在发现和连接对方方面比 UWB 更节能,因此可以通过不持续运行 UWB,仅在必要时才启动 UWB 测距来降低功耗。测距过程按以下顺序开始: 使用蓝牙低功耗技术将 SR250 板和您的智能手机连接起来。 通过 BLE 交换 UWB 测距所需的会话信息和配置信息,确保双方的测距条件一致。 根据交换的信息,将启动 UWB 会话,并使用 UWB 执行 DS-TWR 距离测量。 简而言之,BLE 用于连接和准备 UWB 测距,而实际的距离测量则使用 UWB 进行。   只需一套开发板和一部兼容 UWB 的智能手机即可体验 Nearby 演示。我们将介绍两种方法:一种是使用预编译二进制文件轻松体验,另一种是如果需要,如何使用 Zephyr SDK 构建应用程序。   方法一:尝试使用预编译的二进制文件。   您可以使用预编译的二进制文件轻松试用 Nearby 演示,而无需使用 Zephyr SDK 进行构建。如果您只是想检查它是否有效,这是一种便捷的方法。 有关说明和所需文件,请参阅 GitHub 上的NXP 应用代码中心:UWB 近距离交互(与手机交互) 。从代码库下载并解压 UWB Trimension SR250 近距离交互演示应用包,然后运行 program_FRDM-RW612.bat 来刷写固件。刷写操作与 PnP 路线第二部分中“步骤 1:刷写 RW612 PnP 固件”的步骤相同;使用按钮进入 ISP 模式,然后执行批处理文件。   方法二:使用 Zephyr SDK 构建   要修改源代码或更详细地检查应用程序的行为,请使用 Zephyr SDK 构建 Nearby 演示。   Nearby Interaction固件构建和刷写: west build -b frdm_rw612 -p auto uwbiot-top\demos\SR2XX\demo_nearby_interaction\zephyr west flash   两种方法写入固件后,通过终端软件连接设备都会输出类似如下的日志,设备将进入BLE广播模式。启动智能手机应用程序后,BLE连接建立,UWB距离测量日志将开始输出。 智能手机应用   在智能手机方面,合作伙伴是 您可以使用由MobileKnowledge开发的MK UWB Connect应用。该应用可在 Google Play(适用于安卓智能手机)和 App Store(适用于 iPhone)下载。该应用包含多种演示模式,例如测距、距离警报和追踪器,方便您使用 SR250 Nearby Interaction 配件体验距离测量功能。 在 iPhone 上,除了MK UWB Connect之外,您还可以使用NXP Trimensions AR。NXP Trimensions AR 和 MK UWB Connect Tracker 演示程序均使用 UWB 测距和 ARKit 技术,在 AR 屏幕上显示与 SR250 配件的距离和位置关系。由于使用了 ARKit,该应用程序会在启动时引导您进行姿态校准。请按照屏幕上的说明移动您的智能手机。 Android : MK UWB Connect iPhone : MK UWB Connect或NXP Trimensions AR 兼容设备:支持UWB的智能手机 iPhone :iPhone 11 及更新机型(不包括 iPhone SE(第三代)、iPhone 16e 和 17e) Android :Google Pixel Pro 系列、三星 Galaxy S21+ 至 S26 系列、 AQUOS R 系列 R8 代及更新机型等。 对于其他兼容设备,请参阅UWB 兼容移动设备列表。   您可以在NXP 应用代码中心运行 MK UWB Connect 时查看屏幕:UWB Nearby Interaction with phones 。 当您在 iPhone 上运行 NXP Trimensions AR 时,以下屏幕将显示到 SR250 板的距离和方向。 总结   这次,我们实际上使用了两条不同的路线进行 UWB 测距演示。 路线 A(即插即用) :您只需运行一个 Python 脚本即可轻松检查 UWB 距离测量结果。使用 viki_SR250.pl ,您还可以对 UCI 日志进行详细分析。 方案 B(Zephyr SDK) :使用预编译的二进制文件,无需自行编译即可通过智能手机使用 BLE 进行距离测量;而使用 Zephyr SDK 编译则允许修改源代码。在智能手机端,请使用 MK UWB Connect 应用,该应用兼容 Android 和 iPhone。 下次,我们将尝试 SR250 的另一个功能:使用 UWB 雷达进行片上存在检测 (OCPD) 演示。 参考链接 Trimension SR250 产品页面(日语) SR250 评估板 (TRIMENSION-SR250) SR250 UCI 规范 (UM12508) SR250 UWBIoT for Zephyr OS(GitHub) 使用 Trimension SR250 实现 UWB 即插即用(培训视频) ========================= 即使您在本文的“评论”栏留言,我们目前也无法回复。 给您带来不便,我们深感抱歉。请在询问时参阅“NXP技术问题-联系方式(日本博客)”。 (如果您已经是NXP的代理商或与其有合作关系,可以直接向负责人咨询。) 在第三节课中,我们将使用第二节课中搭建的环境,最终运行UWB距离测量演示。除了使用两个SR250 UWB扩展板测量电路板之间的距离外,我们还将尝试使用通过BLE连接的UWB兼容智能手机,并采用Zephyr SDK方案进行距离测量。我们将分别讲解即插即用(PnP)方案和Zephyr SDK方案。 (预计时间:如果环境已经设置好,最快只需 10 分钟) 日本博客
View full article
Getting Started with UWB Using NXP Trimension® SR250 - Part 3: Trying Out a UWB Distancing Demo (Japanese Blog) Introduction   In the second part, we will cover the setup method for the SR250 evaluation board ( SR250UWBSHIELD ), specifically A. PnP (Plug and Play) Root and B.This document explains the two methods for setting up the Zephyr SDK root environment. This time, we will finally run the UWB ranging demonstration. We will continue to explain the demonstration process using two separate routes, A and B. If you haven't finished setting up your environment yet, please check out Part 2 first. UWB distance measurement with a smartphone will be handled using Route B. First, we will introduce how to try using a pre-built binary without building with the Zephyr SDK, and then we will explain how to build the Nearby demo with the Zephyr SDK. With the pre-built version, building the Zephyr SDK is not necessary, and writing the firmware to the RW612 can be done in the same way as the procedure explained in the second part on the PnP route. 1st Basics of UWB and an overview of the SR250 2nd time Setting up the SR250 evaluation board (SR250UWBSHIELD) Third installment (this article) Let's try UWB ranging. 4th Try out UWB radar. The overall picture of the demonstration UWB ranging requires a communication partner device. In this demonstration, One board acts as the Controller , handling scheduling and timing control for the UWB session, while simultaneously acting as the Initiator to start distance measurement. The other board acts as the Controlleree , following the Controller's instructions, and as the Responder , it returns response packets. Instead of using two boards, you can also use a UWB-compatible smartphone as the other device (see Route B). For those using the "A. PnP route," please click here. For those using the "B. Zephyr SDK route," please click here. A. PnP Route   GitHub: SR250 UWB Plug-and-Play Application Summary of the Simple_demos folder   The Simple_demos\ folder in the PnP demo repository contains the following files: file name Content UartInterface.py A module that summarizes the basic processing of serial communication. This is used in common across all demo scripts. UwbConfig.py A module for configuring UWB session parameters (channel, timing, etc.). Similar to the calibration demo written using the Zephyr SDK root in the second session, the device calibration values are also set in this file. Various demo scripts demo_ranging.py This is the main demo, demonstrating distance measurement between two boards using DS-TWR (Double-Sided Two-Way Ranging). demo_radar_ocpd.py : On-Chip Presence Detection (OCPD) demo. demo_radar_raw.py : A demonstration of obtaining raw data from CIR (Channel Impulse Response). *Details about the radar-related (ocpd/radar_raw) demo will be covered in the next article. viki_SR250.pl A Perl script for decoding UCI packets. Used for detailed log analysis. Perl must be installed to use this feature. On Windows, install Strawberry Perl or a similar program, then run perl -v in the command prompt to confirm that the Perl version is displayed (that Perl is installed and the PATH is set).   This time, let's try demo_ranging.py demo for distance measurement.   Check COM port   Connect the board to your PC's USB port and check the COM port number. Please refer to Part 2 for instructions on how to check the port number.   Launching Ranging Demo   As with the second installment, we will be using the command prompt on a Windows PC. Open two command prompt windows and replace the COM port number in each command with the COM port number of your board before executing them. The baud rate will be set automatically by the script, so you do not need to specify it.   Controller side (e.g., COM3): python demo_ranging.py COM3 controller Controlee side (e.g., COM4): python demo_ranging.py COM4 controlee   Checking the execution log   When you run the script, logs will start flowing to the terminal. You can stop it with Ctrl+C. The log may appear filled with hexadecimal strings, making it difficult to tell at first glance whether distance measurement is working or not. These are the raw data of UCI packets exchanged between the UWB device and the host. UCI will be explained in the next section.   What is UCI (UWB Command Interface) ?   UCI is a standard command interface between a host and a UWB device, developed by the FiRa Consortium. It consists of three types of messages: commands, responses, and notifications. The Python script we just ran sends UCI commands to the board in the background and receives UCI responses and notifications from the board. The distance measurement results are returned as UCI notifications, but the default Python script does not decode them, and the sent and received UCI packets are displayed as raw hexadecimal data.   How to read UCI logs   First, let's look at a UCI Notification that includes distance measurement results as an example. NXPUCIR <= 62 00 00 38 30 00 00 00 01 00 00 80 00 c8 00 00 00 01 00 00 00 00 00 00 00 00 00 00 01 11 11 00 00 30 00 85 f9 00 09 fc 00 00 00 00 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00 00 UCI packets read multi-byte values in little-endian format. In this example, the first four bytes are the header. 62 00 00 38 This indicates that it is a notification, the message type, and the payload length (0x38 = 56 bytes). 30 00 00 00 This is the session sequence number. 01 00 00 80 This is the session handle that identifies the UWB session. c8 00 00 00 : Indicates a distance measurement interval of 0x000000C8 = 200 , 200 ms. 01 Two-Way Ranging (TWR) is set as the distance measurement method. 01 This indicates that this notification contains one distance measurement result. In the following range measurement result field, 11 11 is the short MAC address of the other device, followed by 00 which indicates successful range measurement, and then 00 which indicates line of sight (LoS). Finally, 30 00 is the distance field. When read in little-endian format, it becomes 0x0030 = 48 , so the range measurement result for this packet is 48 cm .   If you only want to check the distance measurement results, as in this case, you can also directly add a function to extract the distance measurement results into your Python script, instead of using viki_SR250.pl which decodes the entire UCI packet as explained in the next section. For example, add the following callback function to demo_ranging.py . ntf[0] is the distance measurement status, and ntf[2] and ntf[3] are the distance data. def extract_ranging(id, ntf): if ntf[0] == 0: distance = int(ntf[2] + (ntf[3] << 8)) print(f"Device {id}: dist = {distance} cm")   Next, we pass extract_ranging as a keyword argument to the receiving thread demo_ranging.py . read_thread = Thread( target=UartIntf.read_from_serial_port, kwargs={"extract_ranging": extract_ranging} ) read_from_serial_port() The received distance measurement notification is passed to this function, so each time the distance measurement is successful, the distance will be displayed in real time, for example, Device 0: dist = 48 cm .   viki_SR250.pl Decoded by   Use viki_SR250.pl if you want to analyze the entire UCI packet in detail. viki_SR250.pl decodes each field of the UCI packet, allowing you to see session state transitions and details of each packet. Perl must be installed to use this. python -u demo_ranging.py COM3 controller | perl viki_SR250.pl   Each field of the UCI is decoded, allowing you to view session state transitions and details of each packet. B. Zephyr SDK Route   Standard distance measurement demo: Controller and Controlleree demo   The distance measurement demo using the Zephyr SDK also works in a Controller/Controlee configuration. Different firmware is built and written to each of the two boards. First, connect only one board and build and flash the Controller firmware. west build -b frdm_rw612 -p auto uwbiot-top\demos\common\demo_ranging_controller\zephyr west flash 💡 If you have changed build options since the previous build, you may encounter errors. Try deleting the sr250-uwbiot-zephyr\build folder or try a pristine build first. Remove the board with the Controller demo written to it, connect the other board, and then build and write the Controlee firmware. west build -b frdm_rw612 -p auto uwbiot-top\demos\common\demo_ranging_controlee\zephyr west flash   Reconnect the board with the Controller demo written to it, and start two terminal programs. With the settings at 3Mbps, connect the respective COM port numbers, and the distance measurement between the boards will begin as shown in the log below. Measuring distance from a smartphone: Nearby demo   Route B uses BLE as the connection starting point, enabling distance measurement with UWB-compatible smartphones. The application name used in this demo is demo_nearby_interaction . The name "Nearby" comes from Apple's " Nearby Interaction " framework for iOS and Android's " Nearby " API. These are APIs provided by OS vendors for short-range interactions using UWB. In the Nearby demo, instead of communicating via UWB from the start, BLE is first used to discover and connect to the other party and exchange information necessary for UWB ranging. This is because smartphone UWB is designed to start the ranging session only after these preliminary connections and settings are completed. Also, since BLE is more power-efficient than UWB for discovering and connecting to the other party, power consumption can be reduced by not running UWB constantly and only starting UWB ranging when necessary. The ranging starts in the following order: Connect the SR250 board and your smartphone using BLE. Session information and configuration information necessary for UWB ranging are exchanged via BLE, ensuring that the ranging conditions are consistent for both parties. Based on the exchanged information, a UWB session will be started, and DS-TWR distance measurement will be performed using UWB. In short, BLE is used for connection and preparing for UWB ranging, while the actual distance measurement is performed using UWB.   The Nearby demo can be tried with just one board set and a UWB-compatible smartphone. We will explain two methods: an easy way to try it with a pre-built binary, and how to build an application using the Zephyr SDK if needed.   Method 1: Try with a pre-built binary.   You can easily try out the Nearby demo using pre-built binaries instead of building with the Zephyr SDK. This is a convenient method if you just want to check if it works. For instructions and required files, please refer to NXP Application Code Hub: UWB Nearby Interaction with phones on GitHub. Download and extract the UWB Trimension SR250 Nearby Interaction Demo application package from the repository, and run program_FRDM-RW612.bat to flash the firmware. The flashing operation follows the same procedure as "Step 1: Flashing RW612 PnP firmware" explained in Part 2 of the PnP route; enter ISP mode using the buttons and then execute the batch file.   Method 2: Build with Zephyr SDK   To modify the source code or examine the application's behavior in more detail, build the Nearby demo with the Zephyr SDK.   Nearby Interaction firmware build and flashing: west build -b frdm_rw612 -p auto uwbiot-top\demos\SR2XX\demo_nearby_interaction\zephyr west flash   In both methods, after writing the firmware, connecting with terminal software will output logs similar to the following, and the device will enter BLE advertising mode. When you launch the smartphone app, the BLE connection will be established, and UWB distance measurement logs will begin to flow. Smartphone app   On the smartphone side, the partner is You can use MK UWB Connect , created by MobileKnowledge . It's available from Google Play for Android smartphones and from the App Store for iPhones. The app includes demo modes such as Range, Distance Alert, and Tracker, allowing you to try out distance measurement with the SR250 Nearby Interaction accessory. On iPhones, you can use NXP Trimensions AR in addition to MK UWB Connect . Both NXP Trimensions AR and the MK UWB Connect Tracker demo use UWB ranging and ARKit to display the distance and positional relationship with SR250 accessories on the AR screen. Because ARKit is used, the app will guide you through attitude calibration upon startup. Please move your smartphone according to the on-screen instructions. Android : MK UWB Connect iPhone : MK UWB Connect or NXP Trimensions AR Compatible devices : UWB-compatible smartphones iPhone : iPhone 11 and later (excluding iPhone SE (3rd generation), iPhone 16e and 17e) Android : Google Pixel Pro series, Samsung Galaxy S21+ to S26 series, AQUOS R series R8 generation and later , etc. For other compatible devices, please refer to the list of UWB-compatible mobile devices .   You can view the screen when running MK UWB Connect at NXP Application Code Hub: UWB Nearby Interaction with phones . When you run NXP Trimensions AR on your iPhone, the following screen will display the distance and direction to the SR250 board. summary   This time, we actually ran the UWB ranging demonstration using two different routes. Route A (PnP) : You can easily check UWB distance measurement by simply running a Python script. Using viki_SR250.pl , you can also perform detailed analysis of UCI logs. Route B (Zephyr SDK) : Using the pre-built binary allows for distance measurement with a smartphone using BLE without building, while building with the Zephyr SDK allows for modification of the source code. On the smartphone side, use the MK UWB Connect app, which is compatible with Android and iPhone. Next time, we'll try out another feature of the SR250: an on-chip presence detection (OCPD) demonstration using UWB radar . Reference links Trimension SR250 Product Page (Japanese) SR250 Evaluation Board (TRIMENSION-SR250) SR250 UCI Specification (UM12508) SR250 UWBIoT for Zephyr OS (GitHub) Making UWB Plug and Play with Trimension SR250 (Training Video) ========================= We are currently unable to respond to comments left in the "Comment" section of this post. We apologize for the inconvenience, but please refer to " Technical Questions to NXP - How to Contact Us( Japanese Blog) " when making an inquiry. (If you are already an NXP distributor or have a relationship with NXP, you may ask your representative directly.) In the third session, we will finally run the UWB distance measurement demo using the environment we built in the second session. In addition to measuring distance between boards using two SR250 UWB SHIELDs, we will also try measuring distance with a UWB-compatible smartphone connected via BLE using the Zephyr SDK route. We will explain both the PnP route and the Zephyr SDK route. (Estimated time: as little as 10 minutes if the environment is already set up) Japanese Blog
View full article