Multi Source Translation Content

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

Multi Source Translation Content

Discussions

Sort by:
需要用于 PC 的软件工具,以加载 bin 文件,通过 Uart 测试固件升级 我在带有 MKM35Z512VLL7 控制器的智能电表项目中使用 AN12837SW 参考设计。我查看了"固件升级和引导加载程序代码( 通过 UART" ),但仍有一些疑问。请澄清以下几点: 我应该在电脑上使用哪个软件工具来测试固件升级过程? 我应该如何加载 .bin文件,将其分成 256 字节的区块,然后添加 CRC 数据进行传输? 我已经阅读了AN12829 号文件,但我无法清楚地理解 OTA 帧格式。能否请您详细解释一下? 是否有测试固件升级功能的特定软件工具或其他文档? Re: Need Software tool for PC to load bin file to test Firmware upgrade through Uart 请找到随附的 FWUpgradeClient.exe 源代码。它是在 Visual Studio IDE 中版本 的 C++ 代码。 BR, Omar Re: Need Software tool for PC to load bin file to test Firmware upgrade through Uart 我正在检查 AN 上引用的 Fwtransferclient 是否可供参考。以及软件中其他命令的详细信息。 只要符合 AN12829 中有关通信的详细规定,选择任何工具都可以。我对 DLMS 不熟悉,无法确认是否可以使用,这需要贵方验证。 BR, Omar Re: Need Software tool for PC to load bin file to test Firmware upgrade through Uart 亲爱的先生 感谢您的反馈, (i) 我查看了 AN12829 中 5.1.2.3 的描述。 但是在 AN12837SW 智能电表固件设计中,在 comportcommandprocessing.c 函数中还有更多 OTA 命令可用 k_cmdfwuinit、k_cmdfwu hdr 、 k_cmdfwutx。 此外,在接收固件代码(communication.cv)时,可以使用 1 字节的 Auth-Enc-Flag 和 AES-GCM-128 解密固件。因此,AN12829 文档与 AN12837SW 固件不正确匹配。这是我的困惑。 (ii) 如何准备 " PC 工具 " 用于通过 uart3 进行固件升级测试。恩智浦有任何参考工具/任何文档吗?恩智浦在 AN12829 中提到,它已经由 " FWtransferclient.exe " 进行了测试。我在哪里能得到这个工具?我们可以把电脑工具当作自己的工具安排吗? (iii) 能否使用DLMS总监进行固件测试? (iv) 哪种串行终端工具最适合编写C语言脚本。如何启动脚本 . 我期待您提供宝贵的解决方案。 Re: Need Software tool for PC to load bin file to test Firmware upgrade through Uart 1.目前还没有专门的工具。预计 PC 主机工具将由用户根据 5.1.2.3 的描述创建,其中详细说明了通信框架应如何设置。 2.您可以创建一个 python 脚本,将图像分割成 256 字节的块,但没有具体的方法。 3.能否请您更具体地说明您的疑问?哪部分不清楚?你是指图 10 中框架所在的流程吗? -命令 nxpfwutx。 文件大小/块大小 -固件按块划分。为了识别固件块,将随块一起传输 4 字节长的区块号。每次接收到新文件块并将其编程到目标闪存库时,都会更新并保存当前块计数。 -命令 nxpfwuact。 4.AN 中提到一个名为 FWUpgradeClient 的自定义工具,让我检查一下是否可用。 BR, Omar
View full article
S32K388 SMP example debugging Hello, I am tying the FreeRTOS SMP example using S32K388-EVB-Q289. Rev B I  am using PEMicro Debugger (interface : USB Multilink, port: embedded Multilink Rev A) and I don't have T32 But it seems that only the core master runs and the other smp core is not running if i only use the debug config given. So i add one more debug config, set core M7_2, try to attach but  "Break at address "0x20402400" with no debug information available, or outside of program code."    Re: S32K388 SMP example debugging Hi @chansookang, Sorry, talking with the internal team, it seems that FreeRTOS SMP code version running in SRAM does not meet customer requirements (multicore). Also, the FreeRTOS SMP version is a code drop version, so the code may have issues or problems. For now, FreeRTOS SMP is not working correctly in multicore. Could you help me by entering a support case to continue this internally? You can enter a support ticket through here: NXP Support. Best regards, Julián Re: S32K388 SMP example debugging Hi @chansookang, Sorry for the late reply. I have received an answer from the team, however, I am still discussing with them the debug configuration and functionality for SMP.  Re: S32K388 SMP example debugging Hello Would you be able to tell me when I can expect to know? Thank you Re: S32K388 SMP example debugging Hi @chansookang, I have raised a ticket to the internal team to ask for confirmation whether the example supports PEmicro configuration. As far as I know, the Lauterbach scripts included with the example are needed to start-up core2 and control the program's flow. I've shown how to run the project in this community post: Solved: S32K358 - freeRTOS SMP - NXP Community. Please wait until I get a response from the corresponding team.  Best regards, Julián
View full article
how to debug csec function use jlink gdbsever hi   we enable csec function and write key in CSEC_KEY_1,then debug the app use jlink gdbsever,so mcu is locked.   how to debug csec function use jlink gdbsever ,must be erase all csec key? Re: how to debug csec function use jlink gdbsever Hi @top  I just answered similar question here: https://community.nxp.com/t5/S32K/S32K142%E4%BD%BF%E7%94%A8CSEc%E5%8A%9F%E8%83%BD%E8%8A%AF%E7%89%87%E8%A2%AB%E9%94%81%E6%AD%BB/m-p/2162840/highlight/true#M52369 Yes, it's necessary to erase the keys (disable CSEc) by CMD_DBG_CHAL and CMD_DBG_AUTH commands with knowledge of MASTER_ECU_KEY. Or use different debug probe (like Pemicro) Regards, Lukas
View full article
FreeMASTERツール3.2 – 代替Windowsインストーラー みなさんこんにちは 当社では現在、製品の特定の機能をテストする手段として Freemaster を使用しています。Windows 10 のサポートが間もなく終了するため、当社の IT 部門は Freemaster ツールのインスタンスをいくつか再インストールする必要があります。 これまでは、通常のスタンドアロン インストーラーをそれほど問題なく使用していました。これは手動で処理されました。デバイス/インストールの数が多いため、当社の IT 担当者はこれらのインストールを自動的に展開することを検討しています。 これを行うための好ましい方法はありますか? .msiファイルだと言われたリモート展開の観点からは Windows 用のインストーラーが望ましいのですが、このようなものはありますか?Freemaster の通常のダウンロード ページを見つけることができませんでした。 サポートありがとうございます。 Re: FreeMASTER tool 3.2 – Alternative windows installer こんにちは@SteBu 、 あなたのシナリオでは、サイレント インストールを使用することをお勧めします。この機能は、ユーザーの介入なしにインストール プロセスを自動化するように設計されています。 現在の FreeMASTER インストーラーはすでにこの機能をサポートしており、実際にクライアント (IT 部門) によって使用されています。 このCASE、実行可能ファイルは「 -i silent」入力引数で起動する必要があります。これは IT チームによってCAN調整されます。オプションで、ユーザー入力なしでコンポーネントの選択やインストール フォルダーなどの構成オプションを渡すCAN。 このトピックの詳細については、FreeMASTER インストーラーの構築に使用されるツールである InstallAnywhere の公式ドキュメントを参照してください。
View full article
S32K144ボード間SPI通信における異常な動作 こんにちは、S32K144 ボードで SPI 割り込み通信を設定するときに問題が発生しています。このプロジェクトは PC33771B デバイスとの通信を目的としていますが、現時点では 33664EVB によって提供される一種のループバックになっています。 大部分は機能しているように見えますが、データが実際にバッファー内に保存される方法は奇妙です。5 バイトのメッセージがあり、一般的に次の順序に従います。 B5 0 0 0 B1 B2 B3 B4 LPSPI は単語単位で動作するので、これは正しいはずだと私は思います。しかし、何らかの理由で、常にその順序になるわけではありません。ボードを開始するとき、順序は次のようになる場合があります。 B1 B2 B3 B4 B5 0 0 0 そして時にはそれはただ: B1 B2 B3 B4 0 0 0 0 5番目のバイトが完全に失われます。 CAN を使用してデバッグできるように、小さなテスト コードを作成しました。必要なメッセージを SPI_1 に送信し、SPI_0 のバッファで終わるメッセージを受信します。何が起こっているかを確認するためにロジック アナライザーも使用しています。 最初のメッセージ: まず、 spi メッセージは S32K144 規則に従っているSO、5 番目のバイトは CRC になります。また、cmd で 4 番目のバイトにステップインしているので、都合よく 4 に設定しました。SPI_0 が再び準備完了するまで待っても、常にゼロが返されます。これは最初の場合にのみ発生します。 2番目のメッセージ: 最後のバイトはまったく表示されません。何らかの理由で失われたのかもしれませんが、その場合でも、MSB 順に並べられている場合、他の 4 バイトは最初のワードには含まれないはずです。 3番目のメッセージ: これは意図したとおりに機能しているようで、すべてのデータが取得され、予想どおりの順序で実行されます。落ち着いた後にすべてのメッセージで一貫して受け取るものなので、これは予想される順序だと思います。 これに関する問題は、必ずしも 3 番目のメッセージが適切であるとは限らず、5 番目または 6 番目のメッセージが適切である場合もあれば、5 番目のバイトがまったく表示されない場合や、2 番目のワードに表示される場合もあることです。一度正しく実行し始めると、一貫して動作します。この問題の原因について何かアイデアはありますか?コードと構成は以下の通りです。 void response420 ( zc_can_packet * パケット){ zc_spi_transfer(&spi_rx, &spi_to_can_packet); transfer_E2E_spi_packet(&E2E_spi, & can_to_spi_packet , &packet-> temp_data [0]); memcpy (&can_response. temp_data , spi_to_can_packet. rx_buffer , 8); zc_can_send(&can, &can_response, MAILBOX_0); } void zc_spi_transfer ( zc_spi_hw * hw_config, zc_spi_packet * パケット){ hw_config->転送されたパケット= パケット; hw_config-> hw_mode == MASTER の場合{ SPI_MasterTransfer (hw_config-> inst 、packet-> tx_buffer 、packet-> rx_buffer 、(packet-> message_bytes_length *NUMBER_OF_BITS_IN_BYTE)/hw_config-> master_config -> frameSize ); }それ以外{ SPI_SlaveTransfer (hw_config-> inst 、packet-> tx_buffer 、packet-> rx_buffer 、(packet-> message_bytes_length *NUMBER_OF_BITS_IN_BYTE)/hw_config-> slave_config -> frameSize ); } } void transfer_E2E_spi_packet ( E2E_spi_handler * E2E_spi, E2E_spi_packet * パケット, uint8_t * データ){ E2E_spi-> protector_handler -> protect_package (E2E_spi-> protector_handler 、データ、パケット-> packet_data . data_length_bytes 、 &(packet-> raw_spi_packet . tx_buffer [0]), packet-> packet_data . E2E_packet_id , packet-> packet_data . counter ); zc_spi_transfer(E2E_spi-> spi_handler 、&(packet-> raw_spi_packet )); packet-> packet_data . counter ++; //これは実際にはこのCRC形式では使用されませんが、この関数は複数のCRC形式で動作します if (packet-> packet_data . counter > E2E_spi-> protector_handler -> counter_overflow_number ){packet-> packet_data . counter = 0;} } response420 関数は、CAN コールバック自体によってフラグが立てられたときにメイン内部で呼び出される、CAN パケットを受信するための「コールバック」です。CAN 部分はそれほど重要ではありません。このバグは CAN がなくても発生するため、デバッガーでこのバグが表示された後、より多くの入力をテストできるように CAN を試しました。 一般的に、SPI_SlaveTransfer および SPI_Master 転送関数に見られるように、私は PAL を使用しています。これは PAL 構成です: SPI_1 設定: { .ボーレート = 2000000U、 .frameSize = 40U、 .bitOrder = SPI_TRANSFER_MSB_FIRST 、 .clockPolarity = SPI_ACTIVE_HIGH 、 .ssPolarity = SPI_ACTIVE_LOW 、 .clockPhase = READ_ON_EVEN_EDGE 、 .ssPin = 0, .transferType = SPI_USING_INTERRUPTS 、 .rxDMAChannel = 0U、 .txDMAチャネル = 0U、 .callback = NULL、 .callbackParam = NULL、 .拡張子 = NULL } SPI_0 設定: { .frameSize = 40U、 .bitOrder = SPI_TRANSFER_MSB_FIRST 、 .clockPolarity = SPI_ACTIVE_HIGH 、 .ssPolarity = SPI_ACTIVE_LOW 、 .clockPhase = READ_ON_EVEN_EDGE 、 .transferType = SPI_USING_INTERRUPTS 、 .rxDMAChannel = 0U、 .txDMAチャネル = 0U、 .callback = NULL、 .callbackParam = NULL、 .拡張子 = NULL } 同様の問題を発見した人はいますか? Re: Weird behavior in S32K144 board to board SPI communication わかりました。それはよかったです。@danielmartynekさん、本当にありがとう! Re: Weird behavior in S32K144 board to board SPI communication 素晴らしい。今は期待通りに動作しているようです。 HW はバイトスワッピングをサポートしていますが、SDK ドライバはサポートしていません。 Re: Weird behavior in S32K144 board to board SPI communication さて、コードを最大限に簡略化しました。 uint8_t送信データ[8] = {0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8}; uint8_t受信データ[8]; lpspi_state_t lpspiState; int main (){ zc_clock_init(); zc_start_scheduler(); const clock_names_tクロック名[LPSPI_INSTANCE_COUNT] = FEATURE_LPSPI_CLOCKS_NAMES; clock_names_tクロック名 = クロック名[1]; lpspi_master_config_t spiConfig = { .bitcount = 8U、 .bitsPerSec = 20000000, .callback = NULL、 .callbackParam = NULL、 .clkPhase = 1, .clkPolarity = 0, .isPcsContinuous = true 、 .lpspiSrcClk = クロック名、 .lsbFirst = false、 .pcsPolarity = 0, .rxDMAチャネル = 0, .transferType = LPSPI_USING_INTERRUPTS、 .txDMAチャネル = 0, .whichPcs = 0, }; LPSPI_DRV_MasterInit(1, &lpspiState, &spiConfig); config_spi_pinout(spi_pinoutconfigs[1] .pinout ); 一方、 (1){ LPSPI_DRV_MasterTransfer(1, &送信データ[0], &受信データ[0], 8); zc_delay_milliseconds(1000); } 0を返します。 } これを実行してビットカウントを 8 にすると、結果は次のようになります。 間隔が問題だが、少なくともほぼ期待通りに動作する。 ビットカウント32の場合も同様です。 各ワード内のバイトは逆順にされます... 最後に、bitcount 64 で同じことを実行して何が起こるかを確認します。 同じことです。 これを uint8_t 配列ではなく word 配列に配置するとどうなるでしょうか? uint32_t送信データ[2] = {0x01020304, 0x05060708}; uint8_t受信データ[8]; lpspi_state_t lpspiState; int main (){ zc_clock_init(); zc_start_scheduler(); const clock_names_tクロック名[LPSPI_INSTANCE_COUNT] = FEATURE_LPSPI_CLOCKS_NAMES; clock_names_tクロック名 = クロック名[1]; lpspi_master_config_t spiConfig = { .bitcount = 64U、 .bitsPerSec = 20000000, .callback = NULL、 .callbackParam = NULL、 .clkPhase = 1, .clkPolarity = 0, .isPcsContinuous = true、 .lpspiSrcClk = クロック名、 .lsbFirst = false、 .pcsPolarity = 0, .rxDMAチャネル = 0, .transferType = LPSPI_USING_INTERRUPTS、 .txDMAチャネル = 0, .whichPcs = 0, }; LPSPI_DRV_MasterInit(1, &lpspiState, &spiConfig); config_spi_pinout(spi_pinoutconfigs[1] .pinout ); 一方、 (1){ LPSPI_DRV_MasterTransfer(1, ( uint8_t *) &送信データ[0], &受信データ[0], 8); zc_delay_milliseconds(1000); } 0を返します。 } 実際に動作します... SO、フレーム サイズ 8 で作業していない場合は、リトルエンディアンのワード単位で送信されるようです。エンディアンを変更する方法はありますか? Re: Weird behavior in S32K144 board to board SPI communication こんにちは@danielmartynek 私はすでにuint8_t配列を使用しています Re: Weird behavior in S32K144 board to board SPI communication こんにちは@rchust 、 tx_buffer をどのように定義しますか? ドライバは、8 ビット配列への 8 ビット ポインターを必要とします (LPSPI_DRV_MasterTransfer() 内)。 SO、CANそこに単語を渡す代わりにuint8_t[5] tx_bufferを使用できますか? よろしくお願い申し上げます。 Re: Weird behavior in S32K144 board to board SPI communication こんにちは@danielmartynek 、 8 ビット フレームでテストしたところ、バイトを順番に送信して正常に動作しました。しかし、問題が 2 つあります。 1 つ目は、8 ビット フレームの場合、ハードウェアがデータをバイト単位で分割することです。これはフレームの定義なので当然のことですが、FUTURE に問題が発生する可能性があります。PC33771 がそのような間隔のメッセージを受け入れるかどうかはまだテストしていません。そうなるはずですが、期待通りのものではありません。 2 番目 (まだ PC33771 でテストしていない理由) は、PAL ライブラリでは連続モードを true に設定できないことです。PAL ライブラリの「方法」Master_init は、それをLPSPI_DRV_MasterInit に渡す前に、これを false に設定します。 status_t SPI_MasterInit ( const spi_instance_t * constインスタンス、 const spi_master_t *config) { status_tステータス = STATUS_ERROR ; uint8_tインデックス = 0; /* LPSPI 上で SPI PAL を定義する */ #if (定義済み (SPI_OVER_LPSPI)) /*! @brief LPSPIのクロック名 */ const clock_names_t g_lpspiClock[LPSPI_INSTANCE_COUNT] = FEATURE_LPSPI_CLOCKS_NAMES if (インスタンス-> instType == SPI_INST_TYPE_LPSPI ) { lpspi_master_config_t lpspiConfig; lpspiConfig. bitsPerSec = config-> baudRate ; lpspiConfig.whichPcs = ( lpspi_which_pcs_t )config-> ssPin ; lpspiConfig. pcsPolarity = ( lpspi_signal_polarity_t )(!(bool)(config-> ssPolarity )); lpspiConfig. bitcount = config-> frameSize ; ( void )CLOCK_SYS_GetFreq(g_lpspiClock[( uint32_t )instance-> instIdx ] ,&lpspiConfig.lpspiSrcClk ) ; lpspiConfig. clkPhase = ( lpspi_clock_phase_t )config-> clockPhase ; lpspiConfig. clkPolarity = ( lpspi_sck_polarity_t )config-> clockPolarity ; lpspiConfig. lsbFirst = config-> bitOrder ; lpspiConfig. transferType = ( lpspi_transfer_type )config-> transferType ; lpspiConfig. rxDMAChannel = config-> rxDMAChannel ; lpspiConfig. txDMAChannel = config-> txDMAChannel ; lpspiConfig.callback = config- > callback ; lpspiConfig. callbackParam = config-> callbackParam ; lpspiConfig.isPcsContinuous = false ; /* このインスタンスにLPSPI状態構造体の1つを割り当てます */ インデックス = SpiAllocateState (LpspiStateIsAllocated、LpspiStateInstanceMapping、インスタンス-> instIdx 、NO_OF_LPSPI_INSTS_FOR_SPI); ステータス = LPSPI_DRV_MasterInit(インスタンス-> instIdx 、( lpspi_state_t *)(&LpspiState[index])、&lpspiConfig); } そうでない場合、 #endif 連続モードでテストする前に、すべてのライブラリを変更して、PAL の使用を停止し、DRV の方法の使用を開始する必要があります。SOて結果を更新しますが、8 ビット フレームで正しい順序で送信されるようです。ただし、40 ビット フレームではそれが実現されないのはまだイライラします。 Re: Weird behavior in S32K144 board to board SPI communication こんにちは@rchust 、 更新ありがとうございます。 tx_buffer に 8 ビット配列を CAN 使用しますか? Re: Weird behavior in S32K144 board to board SPI communication はい、いくつかテストした後、問題の根本を見つけることができました。 どうやら、CAN を使用していないときでもピンを設定していたようで、1 つのピンがマスターの CS と衝突したようです。どうして 1 つのことが別のことに終わるのかはわかりませんが、CAN 構成を削除した後、ほとんどの問題は解消されましたが、1 つだけ問題がありました。 何らかの理由で、8 ビットを超えるフレームでデータを送信すると、各ワード内のバイトが入れ替わります。0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 というデータを含む 64 ビット フレームを配置すると、0x04 0x03 0x02 0x01 0x8 0x07 0x06 0x05 になります。これは、SPI が内部的にワードで動作し、データをバイトごとに入力しているためと思われます。あるいはそれはパルライブラリかもしれません。 Re: Weird behavior in S32K144 board to board SPI communication こんにちは@danielmartynek 、 まずおっしゃる通り、私の IDE バージョン、SDK は 4.0.2 です。申し訳ありません。 私が示しているコードは CAN コールバックであり、CAN データを SPI バッファにコピーします。このコードは、カスタム ライブラリに組み込もうとしているためこのようになっていますが、実際には、CAN から読み取った内容を SPI (SPI1) に送信し、スレーブ (SPI0) が読み取った内容を CAN に送信するだけです。 CAN は 4 バイトを送信し、次に保護によって CRC である最後のバイトが追加されます。SO SPI は 5 を送信し、次に 5 を読み取り、その後 CAN はバッファの最初の 8 バイト内にあるものをそのまま送信します。バッファ自体は実際にはもっと大きいのですが、 SPI_MasterTransfer はバッファの最初の 5 バイトだけを送信します。 デバッグモードで確認したところ、 SPI_MasterTransfer 内では送信中の SPI は常に期待通りの順序で、ギャップなくバイトが送信されています。常に正しく(少なくとも一貫性を持って)送信されているように見える、SO 問題はスレーブの受信にあるようです。 マスター ブロッキングでも同じ問題が発生するようです。スレーブをブロックするとマスターの送信がブロックされるため、スレーブをブロックして確認することはできません。また、マスターとスレーブの両方のクロック極性を低く設定すると、多くの上位ビットが失われることもわかりましたが、まずは最初のメッセージの受信が機能しない問題に取り組みましょう。 Re: Weird behavior in S32K144 board to board SPI communication こんにちは@rchust 、 SDKs ではなく IDEs (3.6.2) を指定したようです。 リリース番号がわかれば、報告されたバグを確認CANます。 非ブロッキング方法を使用しているようですが、ブロッキング転送関数でテストできますか? コードはあまり読みやすくありません。 伝達関数の引数としてどのような値を置きますか? バッファをどうやって埋めるのですか? SPI 通信で観察されるギャップは、ドライバのオーバーヘッドによって発生します。ドライバは送信 FIFO に十分な速さでデータを入れることができません。8 ビット モードでは、ドライバは FIFO にデータを 1 バイトずつ書き込むため、連続した書き込みの間にレイテンシが発生します。この遅延は、SPI クロック速度が高くなると顕著になります。この問題を軽減するには、DMA を使用することをお勧めします。 よろしくお願いいたします。 ダニエル Re: Weird behavior in S32K144 board to board SPI communication こんにちは、ダニエル。 私のSDKは3.6.2です。私は 33664EVB ボードとその TPL を介して SPI を使用しており、チップ セレクトは使用していません。チャネルはそれぞれ SPI1_clock、SPI1_tx、TPL1_data、TPL1_clock です。混乱を避けるために、FUTUREの画像では名前を付けます。後者の 2 つを SPI0_rx と SPI0_clock に直接入力してテストしたところ、同じ結果が示されたことを指摘しておきます。 8 ビット モードでテストしたところ、次の結果が得られました。 最初のメッセージ: 4番目のメッセージ: 最初に気づくのは、最初の単語と 2 番目の単語の間にある大きなギャップです。より大きなメッセージでもテストしましたが、8 ビットを使用すると各単語間にギャップが生じます。周波数を下げてみると、ギャップは減少し、500kHz あたりで消えます。それでも、33664EVB および 3771 のアプリケーション ノートでは 2MHz の使用が推奨されており、一般的に速度が低いことは望ましくありません。 まったく同じではありませんが、問題は依然として似ています。最初は最後のバイトはまったく表示されませんが、次にそれが最初に表示され、その後に他のバイトが正しい順序で表示されます。また、8 ビットではデータが入力した順序で送信されますが、40 ビット モードでは信号内のデータが交換され、その後スレーブによって再度交換されることも指摘しておく価値があります。 ワード間の大きなギャップがなければ 8 ビットの方が望ましいのですが、それでも問題は発生します。8ビット500kHzの場合: 最初のメッセージ: 2番目のメッセージ: 3 番目のメッセージSO: これは 2 つの問題を示しています。1 つ目は私が言及しているスレーブによって読み取られたデータの不一致に関する問題であり、次に TPL のクロックを見ると 2 つ目の問題がわかります。TPL はパルス幅を 2MHz のように維持します。それがそのスピードが必要な理由の一つです。 Re: Weird behavior in S32K144 board to board SPI communication こんにちは@rchust 、 ドライバのバージョンを指定できますか? どのようなプロトコルを使用していますか?チップセレクト信号を使用していますか? ロジック アナライザのキャプチャでチャネルにラベルを付けることはできますか? LPSPI ハードウェアは 8 ビット フレームの連続送信をサポートしており、当社のソフトウェア ドライバーはこれと互換性があります。 8 ビットのデータを FIFO に配置することで、40 ビットのフレームを連続モードで送信CAN。 また、タイミングや信号の整合性に関連する潜在的な問題を排除するために、より低いボー レートで SPI 通信をテストしてみてください。 よろしくお願いいたします。 ダニエル
View full article
适用于 ARM 的 S32 Design Studio v2.2 许可证已过期。 你好、 我的 S32DS ARM V2.2 许可证已过期。 您能帮我延长许可证的有效期吗? 激活码: E16E-385F-FB51-D063 非常感谢。
View full article
DCP レジスタにアクセスすると i.MX6 プロセッサがクラッシュ、ハードウェア デザインの欠陥が疑われる?助けを求める i.MX6 プロセッサで重大な問題が発生しており、コミュニティからの支援を期待しています。私たちが製造した一連の回路基板のうち、サンプルの約 20% が DCP レジスタにアクセスした後にプロセッサのクラッシュを引き起こします。詳細な背景と情報は以下の通りです。     # 問題の説明 一連の回路基板を製造したところ、サンプルの 20% に同じ欠陥があることが判明しました。 コードが DCP レジスタ (アドレス 0x02284000) にアクセスしようとすると、プロセッサは完全にクラッシュし、JTAG デバッガーでもコアにCANアクセスできなくなります。JTAG は次のエラーを報告します: 「エラー: 0x02284000 でデータが中止されました、dfsr = 0x00000008」。 このエラーが発生すると、プロセッサは実行を再開できません (続行するために「c」が入力されても)。 基板3番と6番に不良があります。これらのボードでは、他のボードと比較して VDD_SNVS_IN 電圧がわずかに高いことが一時的に観察されました。   Error data abortエラーデータ中止 can accessCAN アクセス # ハードウェア環境 回路の電圧ポイントの設計に違いがあるかどうかわからないSO、故障したボードと他のボードの電圧差を測定しました。 -プロセッサ: i.MX6ULL (MCIMX6Y2) -故障ボード番号: 3番と5番 (故障率約20%) -通常のボード番号: 残りの80%のボード     # コード複製 問題を再現するには次のコードを使用します。DCP アクセス部分のコメントが解除されると、LED の点滅が停止します (プロセッサがクラッシュします)。 JTAG 経由で DCP に手動でアクセスすると、次のエラーも発生します。   >>> set $R = 0x2284000 >>> p/x *$R     #include "MCIMX6Y2.h" #include "fsl_iomuxc.h" #include "pad_config.h" #define LED_PAD_CONFIG_DATA 0x13008 int main() { CCM_CCGR1_CG13(0x3); CCM_CCGR3_CG6(0x3); IOMUXC_SetPinMux(RGB_RED_LED_IOMUXC,0); IOMUXC_SetPinConfig(RGB_RED_LED_IOMUXC, LED_PAD_CONFIG_DATA); GPIO1->GDIR |= (1<<4); GPIO1->DR |= (1<<4); while(1) { GPIO1->DR &= ~(1<<4); // led on delay(0xFFFFF); GPIO1->DR |= (1<<4); // led off delay(0xFFFFF); #if 0 // Turn on the code, MCU will be crash int *ptr = 0x2284000; // This is DCP address UART1_PrintHex32(*(ptr)); #endif } return 0; }   # その他の発見 -通常のボードは、0x2284000 にアクセスすると 0x10000281 を返します (予想どおり)。 -マニュアルIMX6ULLRM.pdfによると、他のすべてのペリフェラルレジスタをテストしましたが、データアボートは発生しませんでした。問題はDCP領域に限定されています。   well (ADC1_HC0) set $R = 0x2198000 p/x *$R well (AIPSTZ1_MPR) set $R = 0x207C000 p/x *$R ...... well (TEMPMON_TEMPSENSE0) set $R = 0x20C8180 p/x *$R well (TSC_BASIC_SETTING) set $R = 0x2040000 p/x *$R ヘルプの要求 - DCPとクロックツリーの関係:DCPモジュールはどのクロックに依存していますか?特別なクロック設定は必要ですか? -ハードウェア設計上の欠陥:VDD_SNVS_IN 電圧がわずかに高いことが原因でしょうか?他に確認が必要な電圧や信号はありますか? -ソフトウェア構成: 特別な DCP 初期化手順や保護メカニズムはありますか? - JTAG デバッグ: DCP アクセス障害後に JTAG 接続を復元する方法はありますか?     Re: Accessing DCP Register Causes i.MX6 Processor Crash, Suspected Hardware Design Defect? Seeking H 私たちのガイドに記載されている必要性に従っていますか: Re: Accessing DCP Register Causes i.MX6 Processor Crash, Suspected Hardware Design Defect? Seeking H 1. タイミング要件 (2ms) が満たされます。 2. コイン型電池で電源を供給している場合でも、DCP レジスタにアクセスした後にクラッシュが発生します。 Re: Accessing DCP Register Causes i.MX6 Processor Crash, Suspected Hardware Design Defect? Seeking H 1. IMX6ULLIEC.pdf 表 10 の動作範囲は、VDD_SNVS_IN の動作範囲を 2.8 ~ 3.6 V で説明しています。 標準3.0V。 2. ただし手册并未说明,提前多长時間? 原理図では、VDD_SNVS_IN は VDD_HIGH_IN および VDD_SOC_IN よりも先に電圧がかかります。 ディスプレイの観測結果はこのように、1ms ほど前に、十分ですか? 上電流シーケンスの起動状態が一致していないためかどうか、次の手順を検討してください。     電源树 3. 合計 10 枚のパネルを共用したところ、2 枚に同様の障害が発生しました。 4. パネル子 uboot+linux 卡死。 uboot/arch/arm/mach-imx/mx6/soc.c 実験では、DCP モジュールからシーケンス番号として数値を取得すると、SOC がクラッシュします。 以降、试编写裸机LED程序、代価里读写DCP寄存器、同クラッシュ int arch_misc_init(void) { if (IS_ENABLED(CONFIG_FSL_DCP_RNG)) { struct udevice *dev; int ret; ret = uclass_get_device_by_driver(UCLASS_RNG, DM_DRIVER_GET(dcp_rng), &dev); if (ret) printf("Failed to initialize dcp rng: %d\n", ret); } setup_serial_number(); return 0; } 次来尝试: 1. すべてのパネルのタイムシーケンスが一致するかどうかを同時にテストし、VDD_SNVS_IN がどの程度動作するかをテストします。 2. パネルは、時系列の影響を避けるために、VDD_SNVS_IN を常に最後の電圧に保って、バッテリー 3.0V に接続します。 上記完了その後再回帖 Re: Accessing DCP Register Causes i.MX6 Processor Crash, Suspected Hardware Design Defect? Seeking H VDD_SNVS_IN電源は通常3.0Vを必要とします。回路基板を設計する際には、この電源をCPUに電力を供給する最初の出力にする必要があります。 ピンP12(VDD_SNVS_INピン)。これも要件を満たしています。 マニュアルでもご確認いただけます。 VDD_SNVS_INが直接供給される場合 コイン電池の場合、VDD_HIGH_INとVDD_SNVS_INの間にショットキーダイオードが必要です。 設計は要件を満たしていますか?また、合計10枚のボードを製作したのですが、そのうち2枚は正常に動作していませんか? ボード上ではどのようなソフトウェアが実行されていますか?
View full article
访问 DCP 寄存器导致 i.MX6 处理器崩溃,怀疑存在硬件设计缺陷?寻求帮助 我在使用 i.MX6 处理器时遇到了一个关键问题,希望得到社区的帮助。在我们生产的一批电路板中,大约20%的样本在访问DCP寄存器后导致处理器崩溃。以下是详细的背景和信息:     # 问题描述 生产了一批电路板,发现20%的样品表现出相同的缺陷。 当代码尝试访问 DCP 寄存器(地址 0x02284000)时,处理器完全崩溃,甚至 JTAG 调试器也无法再访问内核。JTAG 报告错误: "错误:数据在 0x02284000 终止,dfsr = 0x00000008"。 一旦发生此错误,处理器将无法继续执行(即使输入"c" 继续执行)。 3 号和 6 号板有缺陷。暂时观察到,与其他板相比,这些板上的 VDD_SNVS_IN 电压略高。   Error data abort错误数据中止 can access可以访问 # 硬件环境 我不确定电路电压点设计是否存在差异,所以我测量了故障电路板与其他板之间的电压差。 -处理器:i.MX6ULL (MCIMX6Y2) - 故障板编号:3 号和 5 号(故障率约 20%) - 普通板数量:剩余的 80% 的板     # 代码复制 以下代码用于重现该问题。如果未注释 DCP 访问部分,则 LED 停止闪烁(处理器崩溃): 通过 JTAG 手动访问 DCP 也会触发信号错误:   >>> set $R = 0x2284000 >>> p/x *$R     #include "MCIMX6Y2.h" #include "fsl_iomuxc.h" #include "pad_config.h" #define LED_PAD_CONFIG_DATA 0x13008 int main() { CCM_CCGR1_CG13(0x3); CCM_CCGR3_CG6(0x3); IOMUXC_SetPinMux(RGB_RED_LED_IOMUXC,0); IOMUXC_SetPinConfig(RGB_RED_LED_IOMUXC, LED_PAD_CONFIG_DATA); GPIO1->GDIR |= (1<<4); GPIO1->DR |= (1<<4); while(1) { GPIO1->DR &= ~(1<<4); // led on delay(0xFFFFF); GPIO1->DR |= (1<<4); // led off delay(0xFFFFF); #if 0 // Turn on the code, MCU will be crash int *ptr = 0x2284000; // This is DCP address UART1_PrintHex32(*(ptr)); #endif } return 0; }   # 其他调查结果 - 访问 0x2284000 时,普通板返回 0x10000281(如预期)。 -根据手册 IMX6ULLRM.pdf,我们测试了所有其他外设寄存器,没有一个触发信号数据中止。该问题仅限于 DCP 区域。   well (ADC1_HC0) set $R = 0x2198000 p/x *$R well (AIPSTZ1_MPR) set $R = 0x207C000 p/x *$R ...... well (TEMPMON_TEMPSENSE0) set $R = 0x20C8180 p/x *$R well (TSC_BASIC_SETTING) set $R = 0x2040000 p/x *$R 请求帮助 -DCP 与时钟树之间的关系:DCP 模块依赖哪些时钟?是否需要任何特殊的时钟配置? -硬件设计缺陷:VDD_SNVS_IN 电压稍高可能是原因吗?是否还有其他电压或信号需要检查? -软件配置:是否有任何特殊的 DCP 初始化步骤或保护机制? -JTAG 调试:是否有办法在 DCP 访问失败后恢复 JTAG 连接?     Re: Accessing DCP Register Causes i.MX6 Processor Crash, Suspected Hardware Design Defect? Seeking H 您是否遵循了我们指南中的需求: Re: Accessing DCP Register Causes i.MX6 Processor Crash, Suspected Hardware Design Defect? Seeking H 1. 时序上满足的,2MS。 2. 采用纽扣电池供电,依旧在访问DCP寄存器后Crash Re: Accessing DCP Register Causes i.MX6 Processor Crash, Suspected Hardware Design Defect? Seeking H 1.IMX6ULLIEC.pdf 表 10 工作范围描述 VDD_SNVS_IN,工作范围在 2.8~3.6V。 典型 3.0V。 2.但是手册并未说明,提前多长时间? 原理图设计上,vdd_snvs_in 的确比vdd_high_in 和vdd_soc_in 先上电。 示波器观察的确如此,大约提前 1ms,是否足够? 是否因上电时序引起状态不一致,下面的实验很好验证。     电源树 3.的确总共做了 10 套板子,2 块存在相同故障。 4.板子跑uboot+linux卡死。 uboot/arch/arm/mach-imx/mx6/soc.c 试图从 DCP 模块获取随机数作为序列号时,SOC Crash。 于是尝试编写裸机LED程序,在代码里读写DCP寄存器,同样崩溃 int arch_misc_init(void) { if (IS_ENABLED(CONFIG_FSL_DCP_RNG)) { struct udevice *dev; int ret; ret = uclass_get_device_by_driver(UCLASS_RNG, DM_DRIVER_GET(dcp_rng), &dev); if (ret) printf("Failed to initialize dcp rng: %d\n", ret); } setup_serial_number(); return 0; } 接下来的尝试: 1.将所有板子时序一同测试时序是否一致,测试vdd_snvs_in 究竟有多少抖动。 2.板子接入纽扣电池 3.0v,保证 vdd_snvs_in一定处于最先上电,避免时序影响。 完成上述之后再回帖 Re: Accessing DCP Register Causes i.MX6 Processor Crash, Suspected Hardware Design Defect? Seeking H VDD_SNVS_IN这个电源一般要求为3.0V,设计电路板时,这个电源需要第一个输出出来,给到CPU 的 P12 引脚(VDD_SNVS_IN 脚)。你这里也是符合要求的这里。 还有在手册里你也可以看到 If VDD_SNVS_IN is directly supplied by a coin cell, a schottky diode is required between VDD_HIGH_IN and VDD_SNVS_IN 你这里的设计都符合要求吗?还有,你这里总共做了10块板子, 有两块是不好使的? 你板子上跑的是什么软件?
View full article
FreeMASTER tool 3.2 – Alternative windows installer Hello everybody, we are currently using Freemaster as a means of testing certain features of our products. Due to the upcoming end of support for windows 10 our IT department will have to reinstall several instance of the Freemaster tool.  In the past, we had just used the regular standalone installer without too many issues. This was handled manually. Due to the number of devices/insatallations our IT guys are looking into deploying these installations automatically. Is there a preferred way of doing this? I was told a .msi installer for windows would be preferable in terms of remote deployment - is something like this available? I could not find on the regular downloads page for Freemaster. Thanks four your support. Re: FreeMASTER tool 3.2 – Alternative windows installer Hi @SteBu, In your scenario I would recommend using silent installation - this functionality is designed to automate installation process without user interactions. Current FreeMASTER installer already supports this functionality and is actually being used by our clients (by their IT). In this case, the executable should be launched with "-i silent" input argument. This can be orchestrated by the IT team. Optionally, they can pass configuration options, such as component selection or installation folder without user input. For more details on the topic, please refer to official documentation from InstallAnywhere - the tool used to build FreeMASTER installer.
View full article
jlink gdbseverを使用してcsec関数をデバッグする方法 hi csec 機能を有効にして CSEC_KEY_1 にキーを書き込み、jlink gdbsever を使用してアプリをデバッグすると、MCU がロックされます。 jlink gdbsever を使用して csec 機能をデバッグするには、すべての csec キーを消去する必要がありますか? Re: how to debug csec function use jlink gdbsever こんにちは@top 私はちょうどここで同様の質問に答えました: https://community.nxp.com/t5/S32K/S32K142 %E4% BD %BF% E7 %94% A8CSEc %E5% 8A %9F% E8 %83% BD %E8% 8A %AF% E7 %89% 87 %E8% A2 %AB% E9 %94% 81 %E6% AD%BB/mp/2162840/ハイライト/true#M52369 はい、MASTER_ECU_KEY を認識した上で、CMD_DBG_CHAL コマンドと CMD_DBG_AUTH コマンドでキーを消去 (CSEc を無効にする) する必要があります。または別のデバッグプローブ(Pemicroなど)を使用する よろしくお願いいたします。 ルーカス
View full article
S32K144 板对板 SPI 通信中的奇怪行为 大家好,我在 S32K144 板中设置 SPI 中断通信时遇到了一些问题。该项目旨在与 PC33771B 设备通信,但目前处于一种由 33664EVB 提供的环回通信中。 在大多数情况下,它似乎是有效的,但数据在我的缓冲区内的实际存储方式却很奇怪。我有一条 5 字节的消息,一般来说它遵循以下顺序: B5 0 0 0 B1 B2 B3 B4 鉴于 LPSPI 是以单词为单位工作的,我想这应该是正确的。但出于某种原因,并非每次都是这样。启动董事会时,有时顺序是: B1 B2 B3 B4 B5 0 0 0 有时只是 B1 B2 B3 B4 0 0 0 0 完全丢失第五个字节。 我做了一个小的测试代码,以便使用 CAN 进行调试。我向 SPI_1 发送我想要的信息,并接收回 SPI_0 缓冲区中结束的信息。我还在使用逻辑分析仪查看发生了什么: 第一条信息 首先,spi 消息遵循 S32K144 惯例,因此第五个字节将是 CRC。它还使用 cmd 进入第四个字节,我很方便地把它改成了四字节。即使我等待 SPI_0 再次准备就绪,它也会产量零的结果。这种情况只发生在第一次。 第二条信息 最后一个字节根本不显示。也许它不知何故丢失了,但即便如此,如果其他四个字节是由 MSB 排序的,也不应该出现在第一个单词中。 第三条信息 这似乎与预期的一样,能获取所有数据,而且我猜是按照预期的顺序。我说,我猜这是预期的顺序,因为在结算后,我收到的所有信息都是如此。 问题在于,它并不总是第三条消息,一条是好消息,有时是第五或第六条消息,有时第五个字节根本不出现,有时它出现在第二个单词上。一旦开始正确操作,它就会持续工作。有什么办法可以解决这个问题?下面是代码和配置: 无效 响应420(数据包* 数据包){ zc_spi_transfer(&spi_rx,&spi_to_can_packet); transfer_E2E_spi_packet(&E2E_spi、&包,&packet->temp_data[0]); memcpy(&can_response.temp_data, spi_too_can_packet.rx_buffer, 8); zc_can_send(&can,&can_response, MAILBOX_0); } void zc_spi_transfer(zc_spi_hw* hw_config、数据包* 数据包){ hw_config->数据包= 数据包; 如果(hw_config->hw_mode== 主模式){ SPI_MasterTransfer(hw_config->实例数据包>tx_buffer数据包>数据包数据包>信息字节长度*NUMBER_OF_BITS_IN_BYTE)/hw_config->主配置->帧大小); }否则{ SPI_SlaveTransfer(hw_config->实例数据包>tx_buffer数据包>数据包数据包>信息字节长度*NUMBER_OF_BITS_IN_BYTE)/hw_config->从配置->帧大小); } } void transfer_E2E_spi_packet(E2E_spi_handler* E2E_spi_handler E2E_spi_packet* 数据包、 uint8_t* 数据){ E2E_spi->保护器处理程序->保护包(E2E_spi->保护器处理程序,数据,数据包->数据包.data_length_bytes, &(数据包>raw_spi_packet.tx_buffer[0]), packet->数据包.E2E_packet_id,数据包>数据包.计数器); zc_spi_transfer(E2E_spi-)>处理程序&(packet->raw_spi_packet)); 数据包>数据包.计数器++; // 在此 CRC 格式中实际上并未使用此函数,但此函数可用于多种 CRC 格式 如果(packet->数据包.计数器> E2E_spi->保护器处理程序->溢出计数器){数据包->数据包.计数器= 0;} } response420 函数是接收 CAN 数据包的"回调" ,当 CAN 回调本身的标志上升时,主程序内部会调用该函数。CAN 部分其实并不重要,因为这个错误是在没有 CAN 的情况下发生的,我在调试器出现这个错误后尝试了 CAN,以便测试更多的输入。 一般来说,我使用的是 PAL,从函数 SPI_SlaveTransfer 和 SPI_Master 传输中可以看出这一点。这是 PAL 配置: SPI_1 config: { .baudRate = 2000000U、 .frameSize = 40U、 .bitOrder = spi_transfer_msb_first, .clockPolarity = .spi_active_high, .ssPolarity = SPI_ACTIVE_LOW, .clockPhase = 读取偶数边沿, .ssPin = 0、 .transferType = 传输类型, .rxDMAChannel = 0U、 .txDMAChannel = 0U、 .callback = NULL、 .callbackParam = NULL、 .extension = NULL } SPI_0 配置: { .frameSize = 40U、 .bitOrder = spi_transfer_msb_first, .clockPolarity = .spi_active_high, .ssPolarity = SPI_ACTIVE_LOW, .clockPhase = 读取偶数边沿, .transferType = 传输类型, .rxDMAChannel = 0U、 .txDMAChannel = 0U、 .callback = NULL、 .callbackParam = NULL、 .extension = NULL } 有人发现过类似问题吗? Re: Weird behavior in S32K144 board to board SPI communication 好的,很高兴知道。非常感谢@danielmartynek! Re: Weird behavior in S32K144 board to board SPI communication 很好,看来现在可以正常工作了。 硬件支持字节交换,但是 SDK 驱动程序不支持。 Re: Weird behavior in S32K144 board to board SPI communication 好的,我最大限度地简化了代码: uint8_tdata_too_send[8] = {0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8}; uint8_tdata_received[8]; lpspi_state_tlpspiState; int main(){ zc_clock_init(); zc_start_scheduler(); const clock_names_tclocknames[LPSPI_INSTANCE_COUNT] = FEATURE_LPSPI_CLOCKS_NAMES; clock_names_tclockname = clocknames[1]; lpspi_master_config_tspiConfig = { .bitcount = 8U、 .bitsPerSec = 20000000、 .callback = NULL、 .callbackParam = NULL、 .clkPhase = 1、 .clkPolarity = 0、 .isPcsContinuous = true, .lpspiSrcClk = 时钟名、 .lsbFirst = false、 .pcsPolarity = 0、 .rxDMAChannel = 0、 .transferType = LPSPI_USING_INTERRUPTS、 .txDMAChannel = 0、 .whichPcs = 0、 }; LPSPI_DRV_MasterInit(1,&lpspiState,&spiConfig); config_spi_pinout(spi_pinoutconfigs[1].引脚输出); 而(1){ LPSPI_DRV_MasterTransfer(1,&data_too_send[0],&data_received[0], 8); zc_delay_milliseconds(1000); } 返回0; } 如果我这样做,并将比特数设为 8,结果就是这样: 间距是这里的问题所在,但至少与预期的效果差不多 位数 32 也是如此: 每个单词中的字节都会反转... 最后,同样使用 64 位,看看会发生什么: 一样的。 如果我把它放在字数组而不是 uint8_t 数组中,会发生什么情况? uint32_tdata_too_send[2] = {x001020304, 0x05060708}; uint8_tdata_received[8]; lpspi_state_tlpspiState; int main(){ zc_clock_init(); zc_start_scheduler(); const clock_names_tclocknames[LPSPI_INSTANCE_COUNT] = FEATURE_LPSPI_CLOCKS_NAMES; clock_names_tclockname = clocknames[1]; lpspi_master_config_tspiConfig = { .bitcount = 64U、 .bitsPerSec = 20000000、 .callback = NULL、 .callbackParam = NULL、 .clkPhase = 1、 .clkPolarity = 0、 .isPcsContinuous = true、 .lpspiSrcClk = 时钟名、 .lsbFirst = false、 .pcsPolarity = 0、 .rxDMAChannel = 0、 .transferType = LPSPI_USING_INTERRUPTS、 .txDMAChannel = 0、 .whichPcs = 0、 }; LPSPI_DRV_MasterInit(1,&lpspiState,&spiConfig); config_spi_pinout(spi_pinoutconfigs[1].引脚输出); 而(1){ LPSPI_DRV_MasterTransfer(1, (uint8_t*)&data_to_send[0],&data_received[0], 8); zc_delay_milliseconds(1000); } 返回0; } 它确实有效... 这样看来,如果不使用帧大小 8,就会按字发送,而字是 Little endian 的。有办法更改字节序吗? Re: Weird behavior in S32K144 board to board SPI communication 你好@danielmartynek 我已经使用了 uint8_t 数组 Re: Weird behavior in S32K144 board to board SPI communication 嗨,@rchust、 如何定义 tx_buffer? 驱动程序希望得到一个指向 8 位数组的 8 位指针(在 LPSPI_DRV_MasterTransfer()中)。 那么,能否使用 uint8_t[5] tx_buffer 代替在此处传递字? 谢谢 Re: Weird behavior in S32K144 board to board SPI communication 你好@danielmartynek、 我使用8位帧进行了测试,它可以正常工作,按顺序发送字节。但有两个问题。 首先,在 8 位帧中,硬件按字节拆分数据,这应该是帧的定义,但将来这可能会给我带来问题,我还没有测试 PC33771 是否接受具有这些间距的消息。它应该这样做,但并不完全符合预期。 第二个问题(也是我尚未使用 PC33771 进行测试的原因)是,pal 库不允许我将连续模式设置为 true,pal 库中的 Master_init 方法只是在将其传递给LPSPI_DRV_MasterInit之前将其硬设置为 false: status_t SPI_MasterInit(态 spi_instance_t* const实例、 (const)、(const) 配置*config) { status_tstatus = STATUS_ERROR; uint8_tindex = 0; /* 通过 LPSPI 定义 SPI PAL */ #if(定义了 (SPI_OVER_LPSPI) /*!用于 LPSPI 的简短时钟名称 */ const 时钟名称g_lpspiClock[LPSPI_INSTANCE_COUNT] = FEATURE_LPSPI_CLOCKS_NAMES 如果(instance->instType== spi_inst_type_lpspi) { lpspi_master_config_tlpspiConfig; lpspiConfig.比特每秒= 配置->波特率; lpspiConfig.whichPcs= (lpspi_which_pcs_t) config->ssPin; lpspiConfig.pcsPolarity= (lpspi_signal_polarity_t)(!(bool)(config->ssPolarity)); lpspiConfig.比特数= config->帧大小; (void)CLOCK_SYS_GetFreq(g_lpspiClock[(uint32_t)实例->instIdx]&lpspiConfig.lpspiSrcClk); lpspiConfig.clkPhase= (lpspi_clock_phase_t) config->时钟相位; lpspiConfig.clkPolarity= (lpspi_sck_polarity_t) config->时钟极性; lpspiConfig.lsbFirst= config->位顺序; lpspiConfig.传输类型= (传输类型) config->传输类型; lpspiConfig.rxDMAChannel= config->rxDMAChannel; lpspiConfig.txDMAChannel= config->txDMAChannel; lpspiConfig.回调= config->回调; lpspiConfig.回调参数= config->回调参数; lpspiConfig.isPcsContinuous= false; /* 为该实例分配一个 LPSPI 状态结构 */ 索引 = SpiAllocateState(LpspiStateIsAllocated,LpspiStateInstanceMapping,instance->instIdx,no_of_lpspi_insts_for_spi); status = LPSPI_DRV_MasterInit(instance-)>instIdx, (lpspi_state_t*)(&LpspiState[index]),&lpspiConfig); } else #endif 我需要更改所有库,停止使用 pal,开始使用 DRV 方法,然后才能在连续模式下进行测试。我将这样做并更新结果,但在 8 位帧时,它似乎确实是按正确的顺序发送的。不过,没有 40 位帧仍然令人沮丧。 Re: Weird behavior in S32K144 board to board SPI communication 嗨,@rchust、 感谢您的更新。 能否使用 8 位数组作为 tx_buffer? Re: Weird behavior in S32K144 board to board SPI communication 好了,经过一些测试,我找到了问题的根源。 看来,即使我不使用 CAN,我也在配置它的引脚,其中一个引脚确实与主站的 CS 相撞。我不知道为什么会出现这样那样的问题,但在移除 CAN 配置后,大部分问题都消失了,只有一个问题除外。 出于某种原因,当我以高于 8 位的帧发送数据时,每个字中的字节会互换。如果我将一个 64 位帧的数据 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 -> 0x04 0x03 0x02 0x01 0x8 0x07 0x06 0x05。这似乎是因为 spi 在内部使用单词而我正在逐字节放置数据。也可能是 Pal 图书馆。 Re: Weird behavior in S32K144 board to board SPI communication 你好@danielmartynek、 首先你是对的,我说了我的集成开发环境版本,SDK 是 4.0.2;对不起。 我展示的代码是 CAN 回调,我将 CAN 数据复制到 SPI 缓冲区。代码是这样的,因为我们试图将其嵌入到一个自定义库中,但实际上它只是将从 CAN 读取的内容发送到 SPI(SPI1),然后再将从属设备(SPI0)读取的内容发送到 CAN。 CAN 发送 4 个字节,然后 protect 添加最后一个字节,即 CRC,因此 SPI 发送 5 个字节,然后读取 5 个字节,然后 CAN 只发送缓冲区前 8 个字节内的任何内容。缓冲区本身实际上更大,但是 SPI_MasterTransfer 只发送其中的前 5 个字节。 我检查了调试模式,发送时SPI的字节在 SPI_MasterTransfer中总是按预期顺序排列,没有间隔。它似乎总是能正确发送(或者至少保持一致性),所以问题似乎在于从属的接收。 在主拦截系统中,似乎也会出现同样的问题。我不能用从站阻塞来检查,因为这样会阻止主站发送。我还发现,把主站和从站的时钟极性都设置为低电平会使它错过很多高比特,但还是先解决接收第一条信息失灵的问题吧。 Re: Weird behavior in S32K144 board to board SPI communication 嗨,@rchust、 看来您指定的是集成开发环境(3.6.2),而不是 SDK/RTD。 如果我有版本的编号,我可以检查是否有报告的错误。 我看到您使用了非阻塞方法,能否用阻塞传递函数进行测试? 代码的可读性不强。 您在传递函数中将哪些值作为参数? 如何填充缓冲区? 在 SPI 通信中观察到的间隙是由驱动程序开销造成的--驱动程序无法足够快地填充发送 FIFO。 在 8 位模式下,驱动程序一次向 FIFO 写入一个字节的数据,这会导致连续写入之间的延迟。SPI 时钟速度越高,这种延迟越明显。 为减少这一问题,建议使用 DMA。 此致, 丹尼尔 Re: Weird behavior in S32K144 board to board SPI communication 你好,丹尼尔、 我的 SDK 是 3.6.2 版、我通过 33664EVB 板及其 TPL 使用 SPI,我没有使用芯片选择,通道分别是 SPI1_clock、SPI1_tx、TPL1_Data 和 TPL1_clock。为了避免混淆,我将在今后的图片中为它们命名。我要指出的是,我测试过将后两者直接接入 SPI0_rx 和 SPI0_clock,结果显示相同。 我在 8 位模式下进行了测试,结果如下: 第一条信息 第四条信息 首先值得注意的是,第一个词与第二个词之间的巨大差距。我还用更大的信息进行了测试,当使用 8 位时,每个字之间会出现间隙。如果我试着降低频率,间隙就会减小,直到 500 千赫左右才消失。尽管如此,33664EVB和3771应用笔记仍建议使用2MHz,通常不希望降低速度。 那么,问题虽然不完全相同,但仍然类似。起初最后一个字节根本不出现,然后它首先出现,然后是按正确顺序出现的其他字节。还需要指出的是,在 8 位模式下,数据是按照我输入的顺序发送的,而在 40 位模式下,数据在信号中交换,然后由从属设备再次交换。 如果不是因为字与字之间的巨大差距,8 位会更受欢迎,但问题依然存在。8 位 500kHz: 第一条信息: 第二条信息 第三条信息,以此类推: 这显示了两个问题,第一个是我所说的从机读取的数据不一致,然后看到TPL的时钟我们可以看到第二个问题;TPL保持脉冲宽度就好像是2MHz一样。这也是我需要这种速度的原因之一。 Re: Weird behavior in S32K144 board to board SPI communication 嗨,@rchust、 能否说明驱动程序的版本? 您使用的是什么协议?您使用芯片选择信号吗? 你能在逻辑分析器捕获中标记通道吗? LPSPI 硬件支持连续发送 8 位帧,我们的软件驱动程序与之兼容。 您可以通过将 8 位数据放入 FIFO,在连续模式下传输 40 位帧。 此外,请尝试以较低的波特率测试 SPI 通信,以消除与定时或信号完整性有关的任何潜在问题。 此致, 丹尼尔
View full article
S32K388 SMPの例のデバッグ こんにちは、 S32K388-EVB-Q289を使用したFreeRTOS SMPサンプルをテストしています。Rev B 私はPEMicroデバッガ(インターフェース:USBマルチリンク、ポート:組み込みマルチリンクRev A)を使用していますが、T32を持っていません。 しかし、指定されたデバッグ構成のみを使用すると、コア マスターのみが実行し、他の smp コアは実行されないようです。 SO、もう 1 つのデバッグ構成を追加し、コア M7_2 を設定し、アタッチを試みましたが、「デバッグ情報が利用できないか、プログラム コード外で、アドレス "0x20402400" で中断します。」    Re: S32K388 SMP example debugging こんにちは@chansookang 、 申し訳ございませんが、社内チームと協議したところ、SRAMで動作するFreeRTOS SMPコードバージョンはお客様の要件(マルチコア)を満たしていないようです。また、 FreeRTOS SMPバージョンはコードドロップバージョンであるため、コードに問題や不具合がある可能性があります。 現時点では、FreeRTOS SMP はマルチコアでは正しく動作しません。これを社内で継続するには、サポート CASE を入力してサポートしてもらえますか? サポートチケットは、こちらから入力できます: NXP サポート。 よろしくお願いします、 ジュリアン Re: S32K388 SMP example debugging こんにちは@chansookang 、 返信が遅くなり申し訳ありません。チームからは回答を受け取りましたが、SMP のデバッグ構成と機能についてはまだ話し合っているところです。 Re: S32K388 SMP example debugging こんにちは いつ頃わかるか教えていただけますか? ありがとう Re: S32K388 SMP example debugging こんにちは@chansookang 、 この例が PEmicro 構成をサポートしているかどうかを確認するために、社内チームにチケットを発行しました。私の知る限り、core2 を起動し、プログラムのフローを制御するには、例に含まれている Lauterbach スクリプトが必要です。このコミュニティ投稿でプロジェクトの実行方法を示しました: Solved: S32K358 - freeRTOS SMP - NXPコミュニティ 。 担当チームからの返信が届くまでお待ちください。 よろしくお願いします、 ジュリアン
View full article
Accessing DCP Register Causes i.MX6 Processor Crash, Suspected Hardware Design Defect? Seeking Help I am encountering a critical issue with the i.MX6 processor and hope to get help from the community. In a batch of circuit boards we produced, about 20% of the samples cause the processor to crash after accessing the DCP register. Below are the detailed background and information:     # Issue Descript A batch of circuit boards was produced, and it was found that 20% of the samples exhibit the same defect. When the code attempts to access the DCP register (address 0x02284000), the processor completely crashes, and even the JTAG debugger can no longer access the core. JTAG reports the error: “Error: data abort at 0x02284000, dfsr = 0x00000008”. Once this error occurs, the processor cannot resume execution (even if "c" is entered to continue). Boards No. 3 and No. 6 are defective. It was temporarily observed that the VDD_SNVS_IN voltage is slightly higher on these boards compared to others.   Error data abortError data abort can accesscan access # Hardware Environment I am unsure if there are differences in the circuit voltage point design, so I measured the voltage differences between the faulty boards and the others. - Processor: i.MX6ULL (MCIMX6Y2) - Faulty Board Numbers: No. 3 and No. 5 (failure rate ~20%) - Normal Board Numbers: The remaining 80% of boards     # Code Reproducti The following code is used to reproduce the issue. If the DCP access part is uncommented, the LED stops blinking (processor crashes): Manually accessing DCP via JTAG also triggers the error:   >>> set $R = 0x2284000 >>> p/x *$R     #include "MCIMX6Y2.h" #include "fsl_iomuxc.h" #include "pad_config.h" #define LED_PAD_CONFIG_DATA 0x13008 int main() { CCM_CCGR1_CG13(0x3); CCM_CCGR3_CG6(0x3); IOMUXC_SetPinMux(RGB_RED_LED_IOMUXC,0); IOMUXC_SetPinConfig(RGB_RED_LED_IOMUXC, LED_PAD_CONFIG_DATA); GPIO1->GDIR |= (1<<4); GPIO1->DR |= (1<<4); while(1) { GPIO1->DR &= ~(1<<4); // led on delay(0xFFFFF); GPIO1->DR |= (1<<4); // led off delay(0xFFFFF); #if 0 // Turn on the code, MCU will be crash int *ptr = 0x2284000; // This is DCP address UART1_PrintHex32(*(ptr)); #endif } return 0; }   # Other Finding - Normal boards return 0x10000281 when accessing 0x2284000 (as expected). - According to the manual IMX6ULLRM.pdf, we tested all other peripheral registers, and none triggered a data abort. The issue is limited to the DCP region.   well (ADC1_HC0) set $R = 0x2198000 p/x *$R well (AIPSTZ1_MPR) set $R = 0x207C000 p/x *$R ...... well (TEMPMON_TEMPSENSE0) set $R = 0x20C8180 p/x *$R well (TSC_BASIC_SETTING) set $R = 0x2040000 p/x *$R Request Help - Relationship between DCP and the clock tree: Which clocks does the DCP module depend on? Is any special clock configuration required? - Hardware design defect: Could the slightly higher VDD_SNVS_IN voltage be the cause? Are there other voltages or signals that need to be checked? - Software configuration: Are there any special DCP initialization steps or protection mechanisms? - JTAG debugging: Is there a way to restore JTAG connection after a DCP access failure?     Re: Accessing DCP Register Causes i.MX6 Processor Crash, Suspected Hardware Design Defect? Seeking H Have you followed the need in our guide: Re: Accessing DCP Register Causes i.MX6 Processor Crash, Suspected Hardware Design Defect? Seeking H 1. Timing satisfied, 2 MS. 2. Using coin cell battery power supply, still crashes after accessing the DCP registers. Re: Accessing DCP Register Causes i.MX6 Processor Crash, Suspected Hardware Design Defect? Seeking H 1. IMX6ULLIEC.pdf Table 10 Operating Ranges描述VDD_SNVS_IN工作范围在2.8~3.6V, 典型3.0V. 2. 但是手册并未说明,提前多长时间? 原理图设计上,VDD_SNVS_IN 的确比VDD_HIGH_IN和VDD_SOC_IN 先上电。 示波器观察的确如此,大约提前1ms,是否足够? 是否因上电时序引起状态不一致,下面的实验很好验证。     电源树 3. 的确总共做了10套板子,2块存在相同故障。 4. 板子跑uboot+linux卡死。 uboot/arch/arm/mach-imx/mx6/soc.c 试图从DCP模块获取随机数作为序列号时,SOC Crash。 于是尝试编写裸机LED程序,在代码里读写DCP寄存器,同样 Crash int arch_misc_init(void) { if (IS_ENABLED(CONFIG_FSL_DCP_RNG)) { struct udevice *dev; int ret; ret = uclass_get_device_by_driver(UCLASS_RNG, DM_DRIVER_GET(dcp_rng), &dev); if (ret) printf("Failed to initialize dcp rng: %d\n", ret); } setup_serial_number(); return 0; } 接下来尝试: 1. 将所有板子时序一同测试时序是否一致,测试VDD_SNVS_IN究竟有多少抖动。 2. 板子接入纽扣电池3.0V,保证VDD_SNVS_IN一定处于最先上电,避免时序影响。 完成上述之后再回帖 Re: Accessing DCP Register Causes i.MX6 Processor Crash, Suspected Hardware Design Defect? Seeking H VDD_SNVS_IN This power supply is generally required to be 3.0V, and when designing the board, this power supply needs to be the first one to be output out to the CPU's P12 pin (VDD_SNVS_IN pin). You are also meeting the requirement here here. And you can see it in the manual. If VDD_SNVS_IN is directly supplied by a coin cell, a schottky diode is required between VDD_HIGH_IN and VDD_SNVS_IN Do all your designs here meet the requirements? Also, you've made a total of 10 boards here, and two of them don't work well? What software are you running on your board?
View full article
S32 Design Studio for ARM v2.2 ライセンスの有効期限が切れました。 こんにちは、 S32DS ARM V2.2 ライセンスの有効期限が切れました。 ライセンスを延長していただけますか? アクティベーションID: E16E-385F-FB51-D063 どうもありがとう。
View full article
Weird behavior in S32K144 board to board SPI communication Hello folks, I am having some problems at setting up SPI Interrupt communication in the S32K144 board. The project aims to communicate with a PC33771B device, but for now is in a kind of loopback provided by the 33664EVB. For the most part it seems to work, but how the data is actually stored inside my buffer is funky. I have a 5 bytes message, and in general it obeys this order: B5 0 0 0 B1 B2 B3 B4 which I assume should be correct given that the LPSPI works in words. But that is not the order all the times for some reason. When starting the board, sometimes the order is: B1 B2 B3 B4 B5 0 0 0 And sometimes its just: B1 B2 B3 B4 0 0 0 0 Losing the fifth byte completely. I made a small testing code to be able to debug it using CAN. I send the message i want from it into SPI_1, and receive back the message that ends in the buffer on SPI_0. I also am using the logic analyzer to see whats happening: First message:  First of all, the spi messages are following the S32K144 convention, so the fifth byte would be the CRC. It is also stepping into the fourth byte with the cmd, I just conviniently put it to four. It yields zero always even if I wait the SPI_0 to be ready again. This only happens on the first. Second message: Last byte doesn t show at all. Maybe it was lost somehow, but even then the other four bytes shouldn t be in the first word if it is ordered by MSB. Third message: This seems to work as intended, getting all the data and what I guess its the expected order. I say I guess it is the expected order as its what i consistently get in all messages after it settles.  The problem with this is that its not always the third message the one is good, sometimes its the fifth or the sixth, sometimes the fifth byte doesn t appear at all, and other times it appears on the second word. Once it starts doing it correctly, it works consistently. Any ideas of what may cause this issue? Below the code and configuration: void response420(zc_can_packet* packet){ zc_spi_transfer(&spi_rx, &spi_to_can_packet); transfer_E2E_spi_packet(&E2E_spi, &can_to_spi_packet, &packet->temp_data[0]); memcpy(&can_response.temp_data, spi_to_can_packet.rx_buffer, 8); zc_can_send(&can, &can_response, MAILBOX_0); } void zc_spi_transfer(zc_spi_hw* hw_config,zc_spi_packet* packet){ hw_config->transfered_packet = packet; if(hw_config->hw_mode == MASTER){ SPI_MasterTransfer(hw_config->inst,packet->tx_buffer,packet->rx_buffer,(packet->message_bytes_length*NUMBER_OF_BITS_IN_BYTE)/hw_config->master_config->frameSize); }else{ SPI_SlaveTransfer(hw_config->inst,packet->tx_buffer,packet->rx_buffer,(packet->message_bytes_length*NUMBER_OF_BITS_IN_BYTE)/hw_config->slave_config->frameSize); } } void transfer_E2E_spi_packet(E2E_spi_handler* E2E_spi, E2E_spi_packet* packet, uint8_t* data){ E2E_spi->protector_handler->protect_package(E2E_spi->protector_handler, data, packet->packet_data.data_length_bytes, &(packet->raw_spi_packet.tx_buffer[0]), packet->packet_data.E2E_packet_id, packet->packet_data.counter); zc_spi_transfer(E2E_spi->spi_handler, &(packet->raw_spi_packet)); packet->packet_data.counter++; //This one is not actually used in this CRC format, but this function works with multiple CRC formats if(packet->packet_data.counter > E2E_spi->protector_handler->counter_overflow_number){packet->packet_data.counter = 0;} } The response420 function is the "callback" of receiving the CAN packet, which is called inside the main when a flag is risen by the CAN callback itself. The CAN part isn t really important, as this bug happens without CAN, I tried CAN after this bug showed in the debugger to be able to test more inputs.  In general, I am using PAL, as it can be seen in the functions SPI_SlaveTransfer and SPI_Master transfer. This is the PAL configuration: SPI_1 config: { .baudRate = 2000000U, .frameSize = 40U, .bitOrder = SPI_TRANSFER_MSB_FIRST, .clockPolarity = SPI_ACTIVE_HIGH, .ssPolarity = SPI_ACTIVE_LOW, .clockPhase = READ_ON_EVEN_EDGE, .ssPin = 0, .transferType = SPI_USING_INTERRUPTS, .rxDMAChannel = 0U, .txDMAChannel = 0U, .callback = NULL, .callbackParam = NULL, .extension = NULL } SPI_0 config: { .frameSize = 40U, .bitOrder = SPI_TRANSFER_MSB_FIRST, .clockPolarity = SPI_ACTIVE_HIGH, .ssPolarity = SPI_ACTIVE_LOW, .clockPhase = READ_ON_EVEN_EDGE, .transferType = SPI_USING_INTERRUPTS, .rxDMAChannel = 0U, .txDMAChannel = 0U, .callback = NULL, .callbackParam = NULL, .extension = NULL } Anyone found a similar problem? Re: Weird behavior in S32K144 board to board SPI communication Okay, great to know. Thanks a lot @danielmartynek! Re: Weird behavior in S32K144 board to board SPI communication Great, it seems to be working as expected now. The HW support byte swapping, but the SDK drivers don't. Re: Weird behavior in S32K144 board to board SPI communication Okay, i simplified the code to the maximum: uint8_t data_to_send[8] = {0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8}; uint8_t data_received[8]; lpspi_state_t lpspiState; int main(){ zc_clock_init(); zc_start_scheduler(); const clock_names_t clocknames[LPSPI_INSTANCE_COUNT] = FEATURE_LPSPI_CLOCKS_NAMES; clock_names_t clockname = clocknames[1]; lpspi_master_config_t spiConfig = { .bitcount = 8U, .bitsPerSec = 20000000, .callback = NULL, .callbackParam = NULL, .clkPhase = 1, .clkPolarity = 0, .isPcsContinuous = true, .lpspiSrcClk = clockname, .lsbFirst = false, .pcsPolarity = 0, .rxDMAChannel = 0, .transferType = LPSPI_USING_INTERRUPTS, .txDMAChannel = 0, .whichPcs = 0, }; LPSPI_DRV_MasterInit(1, &lpspiState, &spiConfig); config_spi_pinout(spi_pinoutconfigs[1].pinout); while(1){ LPSPI_DRV_MasterTransfer(1, &data_to_send[0], &data_received[0], 8); zc_delay_milliseconds(1000); } return 0; } If i do this and put the bitcount on 8 this is the result:  The spacings are the problem here, but at least it works more or less as expected  The same with bitcount 32: The bytes get reversed inside each word... And at last, same with bitcount 64 to check what would happen: Same thing.  And what happens if i put it in a word array instead of an uint8_t array? uint32_t data_to_send[2] = {0x01020304, 0x05060708}; uint8_t data_received[8]; lpspi_state_t lpspiState; int main(){ zc_clock_init(); zc_start_scheduler(); const clock_names_t clocknames[LPSPI_INSTANCE_COUNT] = FEATURE_LPSPI_CLOCKS_NAMES; clock_names_t clockname = clocknames[1]; lpspi_master_config_t spiConfig = { .bitcount = 64U, .bitsPerSec = 20000000, .callback = NULL, .callbackParam = NULL, .clkPhase = 1, .clkPolarity = 0, .isPcsContinuous = true, .lpspiSrcClk = clockname, .lsbFirst = false, .pcsPolarity = 0, .rxDMAChannel = 0, .transferType = LPSPI_USING_INTERRUPTS, .txDMAChannel = 0, .whichPcs = 0, }; LPSPI_DRV_MasterInit(1, &lpspiState, &spiConfig); config_spi_pinout(spi_pinoutconfigs[1].pinout); while(1){ LPSPI_DRV_MasterTransfer(1, (uint8_t*) &data_to_send[0], &data_received[0], 8); zc_delay_milliseconds(1000); } return 0; } It actually works... So it seems that if you are not working with frame size 8, it sends it by words, which are on Little endian. Is there a way to change the endianess? Re: Weird behavior in S32K144 board to board SPI communication Hello @danielmartynek  I already use a uint8_t array Re: Weird behavior in S32K144 board to board SPI communication Hi @rchust, How do you define the tx_buffer? The driver expects an 8bit pointer to an 8bit array (in LPSPI_DRV_MasterTransfer()). So, can you use uint8_t[5] tx_buffer instead of passing words there? Thank you Re: Weird behavior in S32K144 board to board SPI communication Hello @danielmartynek , I tested with 8 bit frames and it works properly, sending the bytes in order. There are two problems though. The first is that with 8 bit frames the hardware splits the data by byte, which it should as that is the definition of the frames, but that may give me problems in the future, I have yet to test if the PC33771 accepts messages with those spacings. It should, but its not exactly what it expects.  The second one (and the reason i haven t tested with PC33771 yet) is that pal library doesn t let me set Continuous mode in true, the method Master_init in the pal library just hard sets it to false before passing it to the LPSPI_DRV_MasterInit: status_t SPI_MasterInit(const spi_instance_t * const instance, const spi_master_t *config) { status_t status = STATUS_ERROR; uint8_t index = 0; /* Define SPI PAL over LPSPI */ #if (defined (SPI_OVER_LPSPI)) /*! @brief Clock names for LPSPI */ const clock_names_t g_lpspiClock[LPSPI_INSTANCE_COUNT] = FEATURE_LPSPI_CLOCKS_NAMES if (instance->instType == SPI_INST_TYPE_LPSPI) { lpspi_master_config_t lpspiConfig; lpspiConfig.bitsPerSec = config->baudRate; lpspiConfig.whichPcs = (lpspi_which_pcs_t)config->ssPin; lpspiConfig.pcsPolarity = (lpspi_signal_polarity_t)(!(bool)(config->ssPolarity)); lpspiConfig.bitcount = config->frameSize; (void)CLOCK_SYS_GetFreq(g_lpspiClock[(uint32_t)instance->instIdx] ,&lpspiConfig.lpspiSrcClk); lpspiConfig.clkPhase = (lpspi_clock_phase_t)config->clockPhase; lpspiConfig.clkPolarity = (lpspi_sck_polarity_t)config->clockPolarity; lpspiConfig.lsbFirst = config->bitOrder; lpspiConfig.transferType = (lpspi_transfer_type)config->transferType; lpspiConfig.rxDMAChannel = config->rxDMAChannel; lpspiConfig.txDMAChannel = config->txDMAChannel; lpspiConfig.callback = config->callback; lpspiConfig.callbackParam = config->callbackParam; lpspiConfig.isPcsContinuous = false; /* Allocate one of the LPSPI state structure for this instance */ index = SpiAllocateState(LpspiStateIsAllocated, LpspiStateInstanceMapping, instance->instIdx, NO_OF_LPSPI_INSTS_FOR_SPI); status = LPSPI_DRV_MasterInit(instance->instIdx, (lpspi_state_t*)(&LpspiState[index]), &lpspiConfig); } else #endif I will need to change all the library to stop using pal and start using the DRV methods before i can test it in continuous mode. I will do so and update with the results, but it seems that it does send it in the correct order at 8 bit frames. Its still frustrating that it does not at 40 bit frames though. Re: Weird behavior in S32K144 board to board SPI communication Hi @rchust, Thank you for the update. Can you use an 8bit array for the tx_buffer? Re: Weird behavior in S32K144 board to board SPI communication Okay, after some testing i could find the root of the problem.  It seems that even when i wasn t using the CAN i was configuring its pins, and one pin did collide with the CS of the master. I am not sure how come one thing ends in the other, but after removing the CAN configuration most of the problems dissapeared, but one.  For some reason when i send data in higher than 8 bit frames the bytes inside each word swap. If i put a 64 bit frame with the data 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 -> 0x04 0x03 0x02 0x01 0x8 0x07 0x06 0x05. It seems to be because the spi works internally with words and i am putting the data byte by byte. That or it may be the pal library.  Re: Weird behavior in S32K144 board to board SPI communication Hello @danielmartynek , First you are right, i said my IDE version, SDK is 4.0.2; sorry about that. The code I am showing is a CAN callback, and i copy the CAN data into the SPI buffer. The code is like that because we are trying to embed it into a custom library, but in reality it just sends what it reads from CAN into SPI (SPI1), and then what the slave (SPI0) reads into CAN.  CAN sends 4 bytes, then protect adds the last byte which is the CRC so SPI sends 5, then it reads 5, and then CAN just sends whatever it is inside the first 8 bytes of the buffer. The buffer itself is actually bigger, but the SPI_MasterTransfer is sending just the first 5 bytes of it.  I checked in debug mode and the SPI while sending always has the bytes in the expected order without gaps when inside SPI_MasterTransfer. It always seems to send it properly (or at least with consistency), so it seems that the problem is the reception of the slave.  With master blocking it seems that the same problem arises. I cannot check with slave blocking because then i block the master from sending. I also found that setting both master and slave to clock polarity low makes it miss a lot of high bits, but lets tackle the reception of first messages not working first.  Re: Weird behavior in S32K144 board to board SPI communication Hi @rchust, It seems you specified the IDE (3.6.2) not the SDK/RTD. If I have the number of the release I can check for reported bugs. I see you use the non-blocking method, can you test it with the blocking transfer function? The code is not very readable. What values do you place as arguments in the transfer function? How do you fill the buffer? The observed gap in SPI communication is caused by driver overhead - the driver is unable to populate the transmit FIFO quickly enough. In 8-bit mode, the driver writes data to the FIFO one byte at a time, which introduces latency between successive writes. This delay becomes more noticeable at higher SPI clock speeds. To mitigate this issue, using DMA is recommended.  Regards, Daniel Re: Weird behavior in S32K144 board to board SPI communication Hello daniel, My SDK is 3.6.2, I am using SPI through the 33664EVB board and its TPL, I am not using chip select, and the channels are SPI1_clock, SPI1_tx, TPL1_data and TPL1_clock respectively. I will name them in future images to avoid confusion. I will point it out that i tested putting the latter two directly into the SPI0_rx and SPI0_clock and same results show. I tested it in 8 bit mode and these are the results: First message: Fourth message: First noticeable thing, the enormous gap between first word and second. I also tested with bigger messages and the gap arises between each word when using 8 bit. If I try lower frequency, the gap lowers, until around 500kHz, in which it dissapears. Still, the 33664EVB and 3771 application notes recommends using 2MHz, and generally having less speed is not desirable.  Then the problem is still similar, although not exactly the same. At first the last byte doesn t appear at all, then it appears first, followed by the other bytes in correct order. It is also worth pointing out that with 8 bit the data is sent in the order I put it, while with 40 bit mode it swaps the data in the signal, then it is swapped again by the slave.  If it wasn t for the huge gap between words 8 bit would be more desirable, but the problem still arises. With 8 bit 500kHz: First message: Second message: Third message and so on: This shows two problems, first the one of inconsistencies on the data read by the slave that i am talking about, and then seeing the clock of the TPL we can see a second problem; TPL keeps the pulses width as if it was 2MHz. Thats one of the reasons why I need that speed.  Re: Weird behavior in S32K144 board to board SPI communication Hi @rchust, Can you specify the version of the drivers? What protocol are you using? Do you use the chip select signal? Can you label the channels in the logic analyzer capture? The LPSPI hardware supports sending 8-bit frames continuously, and our software drivers are compatible with that. You can transmit 40-bit frames in continuous mode by placing 8-bit data into the FIFO. Also, please try testing the SPI communication at lower baud rates to eliminate any potential issues related to timing or signal integrity. Regards, Daniel
View full article
FreeMASTER 工具 3.2 - 其他 Windows 安装程序 大家好 我们目前使用 Freemaster 作为测试产品某些功能的手段。由于 Windows 10 支持即将结束,我们的 IT 部门将不得不重新安装 Freemaster 工具的多个实例。 过去,我们只是使用普通的独立组网 (SA) 安装程序,没有出现太多问题。这是手动处理的。由于设备/安装的数量众多,我们的 IT 人员正在考虑自动部署这些装置。 有没有首选的方法? 我被告知 .msi就远程部署而言,最好是使用 Windows 的安装程序 - 是否有类似的程序?我在常规下载页面上找不到 Freemaster。 感谢您的支持。 Re: FreeMASTER tool 3.2 – Alternative windows installer 你好@SteBu、 在您的情况下,我建议您使用静默安装--该功能旨在自动执行安装过程,无需用户交互。 当前的 FreeMASTER 安装程序已经支持这一功能,我们的客户(他们的 IT 部门)正在实际使用这一功能。 在这种情况下,应使用 " -i silent " 输入参数用上市可执行文件。这可以由 IT 团队来协调。或者,他们可以在没有用户输入的情况下传递配置选项,例如元器件选择或安装文件夹。 有关该主题的更多详细信息,请参阅 InstallAnywhere 的官方文档,该工具用于版本 FreeMASTER 安装程序。
View full article
如何使用 jlink gdbsever 调试 csec 函数 hi 我们启用 csec 功能并将密钥写入 CSEC_KEY_1,然后使用 jlink gdbsever 调试应用程序,这样 mcu 就被锁定了。 如何使用 jlink gdbsever 调试 csec 功能,必须清除所有 csec 密钥吗? Re: how to debug csec function use jlink gdbsever 你好@top 我刚刚在这里回答了类似的问题: https://community.nxp.com/t5/S32K/S32K142%E4%BD%BF%E7%94%A8CSEc%E5%8A%9F%E8%83%BD%E8%8A%AF%E7%89%87%E8%A2%AB%E9%94%%E6% 81%AD BB/m-p/2162840/highlight/true#M52369 是的,必须通过 CMD_DBG_CHAL 和 CMD_DBG_AUTH 命令,在了解 MASTER_ECU_KEY 的情况下擦除按键(禁用 CSEc)。或者使用不同的调试探针(如 Pemicro) 此致, Lukas
View full article
S32 Design Studio for ARM v2.2 License has expired. Hi,  My S32DS ARM V2.2 license has expired.  Could you please extend the license for me? ActivationId: E16E-385F-FB51-D063 Thank you so much.
View full article
S32K388 SMP 示例调试 你好 我正在使用S32K388-EVB-Q289绑定 FreeRTOS SMP 示例。B 版 我使用的是 PEMicro 调试器(接口:USB Multilink,端口:嵌入式 Multilink Rev A),没有 T32。 但如果我只使用给出的调试配置,似乎只有主控核心在运行,其他的 smp 核心没有运行。 因此,我又添加了一个调试配置,设置内核为 M7_2,尝试连接,但"在地址"0x20402400" 处中断,没有调试信息可用,或在程序代码之外。"   Re: S32K388 SMP example debugging 嗨,@chansookang、 对不起,经与内部团队沟通,在 SRAM 中运行的 FreeRTOS SMP 代码版本似乎不符合客户的要求(多核)。另外FreeRTOS SMP 版本是代码删除版本,因此代码可能存在问题。 目前,FreeRTOS SMP 无法在多核环境下正常工作。您能帮我输入一个支持案例来继续内部处理吗? 您可以在此处输入支持票据:恩智浦支持。 致以最诚挚的问候, Julián Re: S32K388 SMP example debugging 嗨,@chansookang、 对不起,我的回复晚了。我已收到团队的答复,但我仍在与他们讨论 SMP 的调试配置和功能。 Re: S32K388 SMP example debugging 您好 ,能否告诉我什么时候可以知道? 谢谢 Re: S32K388 SMP example debugging 嗨,@chansookang、 我已向内部团队提交了一份报告,要求确认示例是否支持 PEmicro 配置。据我所知,例子中包含的 Lauterbach 脚本是启动 core2 和控制程序流程所必需的。我在这篇社区文章中介绍了如何运行该项目:已解决:S32K358 - freeRTOS SMP - NXP 社区。 请等待相应团队的回复。 致以最诚挚的问候, Julián
View full article
如何将.a静态库文件链接到固定地址 MPC5746R S32 Design Studio for Power Architecture Version 2017.R1 我使用了一个.a静态库文件,现在我想把.a库文件内的函数链接到固定地址,如何实现? 以下方式失败了。 MEMORY {  m2_text : org = 0x01280000+0x10, len = 768K-0x30 } SECTIONS { .lib_section :  {     libK12LM_SCR.a:*(.text*)     libK12LM_SCR.a:*(.text.*)      libK12LM_SCR.a:*(.rodata)      libK12LM_SCR.a:*(.rodata.*)  } > m2_text } Re: 如何将.a静态库文件链接到固定地址 Hello, General recommended steps to link functions to fixed addresses: 1. Use a Custom Linker File (.ld): Modify the default linker script to define specific memory sections and place functions at fixed addresses. .my_fixed_section 0x10000000 : { KEEP(*(.my_fixed_func)) } > m_text 2. Tag Functions in Code: Use GCC attributes to place functions in custom sections: void __attribute__((section(".my_fixed_func"))) my_function(void) { // Your code } 3. Ensure the .a Library is Built with Section Attributes: If you don’t control the source of the .a file, you may need to wrap or recompile the library with section attributes. Alternatively, use objcopy to extract and reassign sections manually. 4. Update the Linker Command in Project Settings: Go to Project Properties > C/C++ Build > Settings > Tool Settings > Cross Linker. Add flags like: -T your_custom_linker.ld 5. Verify with Map File: After build, inspect the .map file to confirm that functions are placed at the intended addresses. Best regards, Peter
View full article