Multi Source Translation Content

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Multi Source Translation Content

ディスカッション

ソート順:
CodeWarrior licensing and limitations What are the differences between the Special Editions/Suites of CodeWarrior and the evaluation versions of CodeWarrior?   The license and registration FAQ is a bit vague Licensing and Registration FAQ >Freescale makes it easy to evaluate products by offering free trial versions that offer all features of the product to use for a specified time period. We also offer Special Editions for key Freescale architectures that offer limited feature tools that are free to use for all Freescale customers.   Is the "free to use" in the Special Editions perpetually as long as you comply to the e.g. code size limitations or are they also time limited e.g. 30 days?   On this page CodeWarrior Development Tools the special edition is listed as a "free trial" version. Is that "free trial" perpetually or time limited as well as restricted with e.g. codesize? "Development Studio - Special Suite (free trial)"   Is a version of CodeWarrior offered for free perpetually (with or without limitations, not considering evaluations that are time limited)?   Thanks! General Re: CodeWarrior licensing and limitations UPDATED LINK: https://www.nxp.com/docs/en/fact-sheet/950-00437.pdf Re: CodeWarrior licensing and limitations Both Evaluation Edition and Special Edition are free. Evaluation Edition works same as professional edition, but it has 30-day time restriction. Special Edition has no time limit, but it has code size and feature restriction. For details, please refer to this document: http://www.freescale.com/files/soft_dev_tools/doc/fact_sheet/950-00437.pdf Re: CodeWarrior licensing and limitations Hi Lo, please see this review you will get everything http://mcuoneclipse.com/2013/05/04/review-of-codewarrior-for-mcu10-4/ Thanks and Regards, Robin
記事全体を表示
sja1110の動的構成 こんにちは、 L2 ルックアップ テーブルを動的に構成したいのですが、どのように CAN 構成すればよいでしょうか? ECT ツールを使用せずに、L2 ルックアップ テーブルをどのように構成できますか? 例はありますか? 敬具 アトキンソン Re: Dynamic configuration in sja1110 こんにちは@PavelL 「あなたのコードでは、エントリ[3]のシフト値が欠落しており、エントリ[3]、エントリ[4]、エントリ[5]の括弧が欠落しているか、位置が間違っています。」 私はこれを Python コードと同じように実装しましたが、括弧とシフト値がどこに欠けているかわかりません。もっとわかりやすいように、揃えたコードを教えていただけますか?括弧とシフトが抜けていてすみません。 正確なエントリ[3]、エントリ[4]、エントリ[5]を提供していただければ、より役立ち、明確になります。 Re: Dynamic configuration in sja1110 こんにちは@Atkinson 、 コードでは、エントリ[3]のシフト値が欠落しており、エントリ[3]、エントリ[4]、エントリ[5]の括弧が欠落しているか、位置が間違っています。 L2 ルックアップ構成を確認するには、エントリを動的ではなく静的に設定することを検討してください。これにより、問題がエントリ形式にあるのか、動的更新メカニズムにあるのかを切り分けるCAN。 また、Python スクリプト内の「きれいなテーブル」は、コマンド ウィンドウの出力をフォーマットするためにのみ使用され、機能やレジスタ構成には影響しないことに注意してください。 よろしくお願いいたします。 パベル Re: Dynamic configuration in sja1110 こんにちは@PavelL int WriteL2LookupEntry(int cs) { const uint32_t DESTPORTS = 0x004; const uint32_t インデックス = 2; 定数 uint64_t MACADDR = 0x112233445566; const uint64_t MACADDR_MASK = 0xffffffffffff; const uint32_t VLANID = 0; 定数 uint32_t VLANID_MASK = 0x0; const uint32_t IOTAG = 0; 定数 uint32_t IOTAG_MASK = 0; const uint32_t SRCPORT = 0x6; const uint32_t SRCPORT_MASK = 0xF; const uint32_t ENFPORT = 0; const uint32_t RETAG = 0; const uint32_t ミラー = 0; const uint32_t テイク = 0; const uint32_t MIRR_VLAN = 0xFFF; const uint32_t TRAPTOHOST = 0; const uint32_t CBSIDIN = 0x3F; const uint32_t CBENONDA = 0; 定数 uint32_t VLIDX = 0xFFF; 定数 uint32_t SA_POLICE = 0; 定数 uint32_t DA_POLICE = 0; uint32_t L2_OFFSET = 0x23; uint32_t L2CTRL_OFFSET = 0x29; 定数 uint32_t SWREG_BASE = 0x00000000; const uint32_t VALID = 1U; const uint32_t RDWRSET = 1U; const uint32_t 有効 = 1U; const uint32_t HOSTCMD = 3U; const uint32_t MGMTROUTE = 0U; const uint32_t ロック = 1U; const uint32_t ERROR = 0U; uint32_t L2_ADDRESS = SWREG_BASE + L2_OFFSET; uint32_t L2_ADDRESS_CTL = SWREG_BASE + L2CTRL_OFFSET; uint32_t l2Entry[ADDRESS_RANGE] = {0}; l2Entry[0] = (((INDEX & 0x03ff) << (1 % 32)) + ((ENFPORT & 1) << (11 % 32)) + ((宛先ポート & 0x7FF) << (12 % 32)) + ((送信元ポート & 0xF) << (23 % 32)) + ((MACADDR & 0x1F) << (27 % 32))); l2Entry[1] = (((MACADDR >> 5) & 0xFFFFFFFF)); l2Entry[2] = ((((MACADDR >> 37) & 0x7FF) << (64 % 32)) + ((VLANID & 0xFFF) << (75 % 32)) + ((IOTAG & 1) << (87 % 32)) + ((MACADDR_MASK & 0xFF) << (88 % 32))); l2Entry[3] = (((MACADDR_MASK >> 😎 & 0xFFFFFFFF)); l2Entry[4] = (((MACADDR_MASK >> 40) & 0xFF << (128 % 32)) + ((VLANID_MASK & 0xfff) << (136 % 32)) + ((IOTAG_MASK & 1) << (148 % 32)) + ((SRCPORT_MASK & 0xF) << (149 % 32)) + ((RETAG & 0x1) << (153 % 32)) + ((MIRROR & 0x1) << (154 % 32)) + ((TAKETS & 0x1) << (155 % 32)) + ((MIRR_VLAN & 0xF) << (156 % 32))); l2Entry[5] = (((MIRR_VLAN >> 4) & 0xFF << (160 % 32)) + ((TRAPTOHOST & 0x1) << (168 % 32)) + ((CBSIDIN & 0x3F) << (169 % 32)) + ((CBENONDA & 0x1) << (175 % 32)) + ((VLIDX & 0xFFF) << (177 % 32)) + ((SA_POLICE & 0x1) << (189 % 32)) + ((DA_POLICE & 0x1) << (190 % 32))); uint32_t ステータス = 0; する { Std_ReturnType ret = spi_read_reg(L2_ADDRESS_CTL、&status); if (ret != E_OK) { -1 を返します。 } } while ((ステータス >> VALID_BIT_SHIFT) & 1U); (int i = 0; i < ADDRESS_RANGE; i++) の場合 { Std_ReturnType ret = spi_write_reg(L2_ADDRESS + i, l2Entry[i]); if (ret != E_OK) { -2 を返します。 } uint32_t 読み取りバック = 0; ret = spi_read_reg(L2_ADDRESS + i, &readBack); if (ret != E_OK || readBack != l2Entry[i]) { -3 を返します。 } } uint32_t コントロールL2エントリ = 0; controlL2Entry = ((有効 << 31) + (RDWRSET << 30) + (エラー << 29) + (ロック済み << 28) + (有効 << 27) + (MGMTROUTE << 26) + (HOSTCMD << 23)); Std_ReturnType ret = spi_write_reg(L2_ADDRESS_CTL、controlL2Entry); if (ret != E_OK) { -4 を返します。 } する { ret = spi_read_reg(L2_ADDRESS_CTL、&ステータス); if (ret != E_OK) { -5 を返します。 } } while ((ステータス >> VALID_BIT_SHIFT) & 1U); 0を返します。 } Python スクリプトに似た実装に変更しました。何か間違いを見つけたら、変更したものを送ってください。 Pythonスクリプト         # 書き込み制御         プラットフォーム.spi_write ( L2_ADDRESS_CTL , controlL2Entry , cs )​         テーブル= prettytable . PrettyTable ( ( "INDEX" 、 "DESTPORTS" 、 "MACADDR" 、 "VLANID" 、 "ENFPORT" 、 "IOTAG" ))         エントリー= (             str (インデックス), ' {0:11b} ' . format (宛先ポート), mac_to_str ( MACADDR ), str ( VLANID ),             str ( ENFPORT )、 str ( IOTAG ))         テーブル.add_row (エントリ)​         print (テーブル.get_string ( ))       「書き込み後、エントリのMAC/VLAN/ポート基準に一致するフレームを送信し、DESTPORTSフィールドに従って転送されるかどうかを確認します。」 あなたが言ったように、この方法で送信しようとしていますが、この反射は見られません 自分のエントリーが反映されているのが分かりません。 他に設定する必要があるものはありますか? Pythonスクリプトで、controll2entryのレジスタ値をL2_ADDRESS_CTLに書き込んだ後 「prettytable」にエントリを追加するコードは数行しかありませんでした。 これも同様に行う必要がありますか? また、これを行うための規定はありますか? Re: Dynamic configuration in sja1110 こんにちは@Atkinson 、 エントリ[3]、エントリ[4]、およびエントリ[5]には、シフト値が欠落しており、式が不完全です。これにより、レジスタ値が不正確になる可能性があります。L2 エントリを正しく構築する Python リファレンス スクリプトとロジックを比較することをお勧めします。 書き込み後、エントリの MAC/VLAN/ポート基準に一致するフレームを送信し、DESTPORTS フィールドに従って転送されるかどうかを確認します。 よろしくお願いいたします。 パベル Re: Dynamic configuration in sja1110 こんにちは@PavelL int WriteL2LookupEntry(int cs) { const uint32_t DESTPORTS = 0x002; const uint32_t インデックス = 8; 定数 uint64_t MACADDR = 0x661122334455; const uint64_t MACADDR_MASK = 0xffffffffffff; const uint32_t VLANID = 0; const uint32_t VLANID_MASK = 0xfff; const uint32_t IOTAG = 0; const uint32_t IOTAG_MASK = 0; const uint32_t SRCPORT = 0x5; const uint32_t SRCPORT_MASK = 0xF; const uint32_t ENFPORT = 0; const uint32_t RETAG = 0; const uint32_t ミラー = 0; const uint32_t テイク = 0; const uint32_t MIRR_VLAN = 0xFFF; const uint32_t TRAPTOHOST = 0; const uint32_t CBSIDIN = 0x3F; const uint32_t CBENONDA = 0; 定数 uint32_t VLIDX = 0xFFF; 定数 uint32_t SA_POLICE = 0; 定数 uint32_t DA_POLICE = 0; uint32_t L2_OFFSET = 0x23; uint32_t L2CTRL_OFFSET = 0x29; 定数 uint32_t SWREG_BASE = 0x00000000; const uint32_t VALID = 1U; const uint32_t RDWRSET = 1U; const uint32_t 有効 = 1U; const uint32_t HOSTCMD = 3U; const uint32_t MGMTROUTE = 0U; const uint32_t ロック = 1U; const uint32_t ERROR = 0U; uint32_t L2_ADDRESS = SWREG_BASE + L2_OFFSET; uint32_t L2_ADDRESS_CTL = SWREG_BASE + L2CTRL_OFFSET; uint32_t l2Entry[ADDRESS_RANGE] = {0}; l2Entry[0] = ((インデックス & 0x03FF) << 1) | ((ENFPORT & 0x1) << 11) | ((宛先ポート & 0x7FF) << 12) | ((SRCPORT & 0xF) << 23) | ((uint32_t)(MACADDR & 0x1F) << 27); l2Entry[1] = (uint32_t)((MACADDR >> 5) & 0xFFFFFFFF); l2Entry[2] = (uint32_t)(((MACADDR >> 37) & 0x7FF) << 0) | ((VLANID & 0xFFF) << 11) | ((IOTAG & 0x1) << 23) | ((uint32_t)(MACADDR_MASK & 0xFF) << 24); l2Entry[3] = (uint32_t)((MACADDR_MASK >> 😎 & 0xFFFFFFFF); l2Entry[4] = ((uint32_t)((MACADDR_MASK >> 40) & 0xFF) << 0) | ((VLANID_MASK & 0xFFF) << 😎 | ((IOTAG_MASK & 0x1) << 20) | ((SRCPORT_MASK & 0xF) << 21) | ((再タグ & 0x1) << 25) | ((ミラー & 0x1) << 26) | ((テイク& 0x1) << 27) | ((MIRR_VLAN & 0xF) << 28); l2Entry[5] = (((MIRR_VLAN >> 4) & 0xFF) << 0) | ((TRAPTOHOST & 0x1) << 😎 | ((CBSIDIN & 0x3F) << 9) | ((CBENONDA & 0x1) << 15) | ((VLIDX & 0xFFF) << 17) | ((SA_POLICE & 0x1) << 29) | ((DA_POLICE & 0x1) << 30); uint32_t ステータス = 0; する { Std_ReturnType ret = spi_read_reg(L2_ADDRESS_CTL、&status); if (ret != E_OK) { -1 を返します。 } } while ((ステータス >> VALID_BIT_SHIFT) & 1U); (int i = 0; i < ADDRESS_RANGE; i++) の場合 { Std_ReturnType ret = spi_write_reg(L2_ADDRESS + i, l2Entry[i]); if (ret != E_OK) { -2 を返します。 } uint32_t 読み取りバック = 0; ret = spi_read_reg(L2_ADDRESS + i, &readBack); if (ret != E_OK || readBack != l2Entry[i]) { -3 を返します。 } } uint32_t コントロールL2エントリ = 0; controlL2Entry |= (有効 << VALID_BIT_SHIFT); controlL2Entry |= (RDWRSET << RDWRSET_BIT_SHIFT); controlL2Entry |= (エラー << ERROR_BIT_SHIFT); controlL2Entry |= (ロック済み << ロック済み_ビットシフト); controlL2Entry |= (VALIDENT << VALIDENT_BIT_SHIFT); controlL2Entry |= (MGMTROUTE << MGMTROUTE_BIT_SHIFT); controlL2Entry |= (HOSTCMD << HOSTCMD_BIT_SHIFT); Std_ReturnType ret = spi_write_reg(L2_ADDRESS_CTL、controlL2Entry); if (ret != E_OK) { -4 を返します。 } する { ret = spi_read_reg(L2_ADDRESS_CTL、&ステータス); if (ret != E_OK) { -5 を返します。 } } while ((ステータス >> VALID_BIT_SHIFT) & 1U); 0を返します。 } これは私が修正したコード実装です この実装によって動的エントリが導入されるかCAN確認できますか。SO、レジスタ値を読み戻して、値がレジスタに書き込まれているかどうかを調べてデバッグしてみましたが、値がレジスタに書き込まれていることは確認できましたが、エントリが作成されたかどうかはわかりません。 また、L2 ルックアップ テーブルの動的エントリの反映も反映されませんか? SO、L2 ルックアップ テーブル エントリが作成されたかどうかをどのように確認すればよいでしょうか? Re: Dynamic configuration in sja1110 こんにちは@Atkinson 、 1. ビットシフト構文 (<<, >>) コード内のビット シフト演算子の一部が << や >> などの HTML エンティティに置き換えられたようです。これは通常、コードが Web ベースのプラットフォームにコピーされたときに発生します。とにかく、コード内で直接確認してください。 #define L2_CTRL_VALID_BIT (1U << 31) 次のようにする必要があります。 #L2_CTRL_VALID_BIT を定義します (1U << 31) 2. 入国審査 CreateL2Entry()関数、特にentry[3]、entry[4]、entry[5]に、いくつかの構文エラーとシフト値の欠落があります。これにより、レジスタ書き込みが不完全または無効になる可能性があります。 例えば ( (トラップホスト& 0x1 ) < < | L2 エントリの 6 つの 32 ビット ワードすべてを正しく構築する Python リファレンス スクリプトと実装を比較することをお勧めします。 よろしくお願いいたします。 パベル Re: Dynamic configuration in sja1110 こんにちは@PavelL 3.)レジスタアドレスを#define L2_ENTRY0_ADDR 0x00000023に変更しました。 しかし、メッセージを送信するときに反映される追加しようとしているテーブルをまだ識別できません 「私の理解が正しければ、UM11107の表1182に記載されているL2ルックアップテーブルについて言及されていると思います。このテーブルは、エントリごとに6つの32ビットレジスタで構成されています。この構造は、Pythonスクリプトのデバッグ出力に反映されています。 」 SO、L2ルックアップテーブルに動的エントリを作成する必要があるアドレスにデータを書き込もうとしているのですが、動的エントリが作成されないという問題に直面しています。 #L2_ENTRY0_ADDR 0x00000023 を定義します #L2_ENTRY1_ADDR 0x00000024 を定義します #L2_ENTRY2_ADDR 0x00000025 を定義します #L2_ENTRY3_ADDR 0x00000026 を定義します #L2_ENTRY4_ADDR 0x00000027 を定義します #L2_ENTRY5_ADDR 0x00000028 を定義します #L2_CTRL_ADDR 0x00000029 を定義します #L2_CTRL_VALID_BIT を定義します (1U << 31) #L2_CTRL_WR_RDB_BIT を定義します (1U << 30) #L2_CTRL_VALIDENTRY_BIT を定義します (1U << 28) #define L2_CTRL_HOSTCMD_SHIFT 23 #define L2_CTRL_HOSTCMD_WRITE (0b011U << L2_CTRL_HOSTCMD_SHIFT) Std_ReturnType CreateL2Entry(uint32_t エントリ[6]) { uint16_t インデックス = 11; uint64_t MACADDDR = 0x661122334455; uint64_t MACADDR_MASK = 0xFFFFFFFFFFFF; uint16_t VLANID = 3; uint16_t VLANID_MASK = 0xFFF; uint8_t IOTAG = 0; uint8_t IOTAG_MASK = 0; uint8_t SRCPORT = 5; uint8_t SRCPORT_MASK = 0xF; uint8_t 宛先ポート = 0x02; uint8_t ENFPORT = 1; uint8_t RETAG = 0; uint8_t ミラー = 0; uint8_t テイク = 0; uint16_t MIRR_VLAN = 0xFFF; uint8_t トラップホスト = 0; uint8_t CBSIDIN = 0x3F; uint8_t CBENONDA = 0; uint16_t VLIDX = 0xFFF; uint8_t SA_POLICE = 0; uint8_t DA_POLICE = 0; エントリ[0] = ((インデックス & 0x03FF) << 1) | ((ENFPORT & 0x1) << 11) | ((DESTPORTS & 0x7FF) << 12) | ((SRCPORT & 0xF) << 23) | ((MACADDR & 0x1F) << 27); エントリ[1] = (uint32_t)((MACADDR >> 5) & 0xFFFFFFFF); エントリ[2] = (((MACADDR >> 37) & 0x7FF) << 0) | ((VLANID & 0xFFF) << 11) | ((IOTAG & 0x1) << 23) | ((MACADDR_MASK & 0xFF) << 24); エントリ[3] = (uint32_t)((MACADDR_MASK >> 😎 & 0xFFFFFFFF); エントリ[4] = (((MACADDR_MASK >> 40) & 0xFF) << 0) | ((VLANID_MASK & 0xFFF) << 😎 | ((IOTAG_MASK & 0x1) << 20) | ((SRCPORT_MASK & 0xF) << 21) | ((RETAG & 0x1) << 25) | ((ミラー & 0x1) << 26) | ((テイク& 0x1) << 27) | ((MIRR_VLAN & 0xF) << 28); エントリ[5] = (((MIRR_VLAN >> 4) & 0xFF) << 0) | ((TRAPTOHOST & 0x1) << 😎 | ((CBSIDIN & 0x3F) << 9) | ((CBENONDA & 0x1) << 15) | ((VLIDX & 0xFFF) << 17) | ((SA_POLICE & 0x1) << 29) | ((DA_POLICE & 0x1) << 30); E_OK を返します。 } Std_ReturnType WriteL2LookupEntry(uint8_t swt) { swt > 0 の場合、E_NOT_OK を返します。 Std_ReturnType ret; uint32_t ctrlReg = 0; uint32_t エントリ[6]; // ステップ1: エントリを作成する ret = CreateL2Entry(エントリ); if (ret != E_OK) ret を返します。 // ステップ2: VALIDビットがクリアされるのを待つ する { ret = spi_read_reg(L2_CTRL_ADDR, &ctrlReg); if (ret != E_OK) ret を返します。 } while (ctrlReg & L2_CTRL_VALID_BIT); // ステップ3: エントリデータをレジスタに書き込む ret = spi_write_reg(L2_ENTRY0_ADDR, entry[0]); if (ret != E_OK) return ret; ret = spi_write_reg(L2_ENTRY1_ADDR, entry[1]); if (ret != E_OK) return ret; ret = spi_write_reg(L2_ENTRY2_ADDR, entry[2]); if (ret != E_OK) return ret; ret = spi_write_reg(L2_ENTRY3_ADDR, entry[3]); if (ret != E_OK) return ret; ret = spi_write_reg(L2_ENTRY4_ADDR, entry[4]); if (ret != E_OK) return ret; ret = spi_write_reg(L2_ENTRY5_ADDR, entry[5]); if (ret != E_OK) return ret; // ステップ4: 書き込みをトリガーするように制御レジスタを設定する uint32_t ctrlValue = (1U << 31) | (1U << 30) | (1U << 28) | (1U << 27) | (3U << 23); ret = spi_write_reg(L2_CTRL_ADDR、ctrlValue); if (ret != E_OK) ret を返します。 する { ret = spi_read_reg(L2_CTRL_ADDR, &ctrlReg); if (ret != E_OK) ret を返します。 } while (ctrlReg & L2_CTRL_VALID_BIT); E_OK を返します。 } L2 ルックアップ テーブルに動的エントリが作成されないため、問題が発生しているかどうかを一度確認できますか? Re: Dynamic configuration in sja1110 こんにちは@Atkinson 、 1. はい、ホスト ツールはもともと SJA1110-EVM ボード用に開発されました。私は個人的に、レジスタ アクセスの理解を確認するために、デバッグ プリントでこれらのスクリプトを使用しています。S32G-VNP-RDB2 プラットフォーム上で直接実行することはできませんが、S32G は SPI 経由で SJA1110 にアクセスするため、基礎となるロジックを適応させることができます。 2. S32G プラットフォーム用の SPI 読み取り/書き込み実装を探している場合、主に 2 つの選択肢があります。 S32G RTD 4.0.0 パッケージに提供されている SPI の例を参照してください。 あるいは、NXP S32G コミュニティ フォーラムに専用の質問を投稿することをお勧めします。そこでは、S32G サポート チームがさらにサポートを提供します。私は主にオートモーティブ イーサネットのトピックに焦点を当てており、プラットフォーム固有のドライバとの重複は限定されています。 3. 私の理解が正しければ、UM11107 の表 1182 に記載されている L2 ルックアップ テーブルを参照していることになります。このテーブルは、エントリごとに 6 つの 32 ビット レジスタで構成されます。この構造は、Python スクリプトのデバッグ出力に反映されています。 よろしくお願いいたします。 パベル Re: Dynamic configuration in sja1110 こんにちは@PavelL いくつか質問があります 1.)この l2_write_lookup_table.py のデバッグ出力は SJA1110 EVM ボード実装から取得されましたが、S32G-VNP RDB ボードからのものではないのでしょうか? また、S32G-VNP-RDB32 ボードに l2_write_lookup_table.py を直接実装することはできません。 2.) 上記のコードと統合するための SPI_read と Spi_write のコードを提供していただけますか? S32Gの実装ではSPI_ReadとSPI_write経由で書き込み操作は行われているが、動的エントリが追加されるのを見ることができないため Std_ReturnType spi_read_reg(uint32_t regAddress, uint32_t* regValue) { Std_ReturnType ret; uint32_t TxChBuf[65] = {0}; uint32_t RxChBuf[65] = {0}; uint16_t regCount = 1; Siul2_Dio_Ip_WritePin(SPI_MCU_ES1_CS_AP_PORT、SPI_MCU_ES1_CS_AP_PIN、0U); ret = getSpiAPCommand(false, regAddress, regCount, TxChBuf, regValue); if (ret != E_OK) { Siul2_Dio_Ip_WritePin(SPI_MCU_ES1_CS_AP_PORT、SPI_MCU_ES1_CS_AP_PIN、1U); ret を返します。 } ret=Spi_SetupEB(5u, (uint8_t*)TxChBuf, (uint8_t*)RxChBuf, 8u); if (ret == E_OK) { ret=Spi_SyncTransmit(SpiConf_SpiSequence_SpiSequence_sja); if (ret == E_OK) { *regValue = RxChBuf[1]; } } Siul2_Dio_Ip_WritePin(SPI_MCU_ES1_CS_AP_PORT、SPI_MCU_ES1_CS_AP_PIN、1U); ret を返します。 } Std_ReturnType spi_write_reg(uint32_t regAddress, uint32_t regValue) { Std_ReturnType ret; uint32_t TxChBuf[65] = {0}; uint32_t RxChBuf[65] = {0}; uint16_t regCount = 1; uint32_t regValArray[1] = { regValue }; // チップセレクトをLOWにする Siul2_Dio_Ip_WritePin(SPI_MCU_ES1_CS_AP_PORT、SPI_MCU_ES1_CS_AP_PIN、0U); ret = getSpiAPCommand(true, regAddress, regCount, TxChBuf, regValArray); if (ret != E_OK) { Siul2_Dio_Ip_WritePin(SPI_MCU_ES1_CS_AP_PORT、SPI_MCU_ES1_CS_AP_PIN、1U); ret を返します。 } ret=Spi_SetupEB(5u, (uint8_t*)TxChBuf, (uint8_t*)RxChBuf, 8u); if (ret == E_OK) { ret=Spi_SyncTransmit(SpiConf_SpiSequence_SpiSequence_sja); } Siul2_Dio_Ip_WritePin(SPI_MCU_ES1_CS_AP_PORT、SPI_MCU_ES1_CS_AP_PIN、1U); ret を返します。 } 間違っていたら訂正してください!! 3.)レジスタアドレスを#define L2_ENTRY0_ADDR 0x00000023に変更しました。 しかし、メッセージを送信するときに反映される追加しようとしているテーブルをまだ識別できません Re: Dynamic configuration in sja1110 こんにちは@Atkinson 、 あなたのコードは良さそうです。ただし、SPI で動的テーブルにアクセスする場合、エントリ アドレスは FF なしで、2 だけ右にシフトされます。これは、以前の投稿のいくつかで既に述べたとおりです。 SO、 #define L2_ENTRY0_ADDR 0xFF00008cは #define L2_ENTRY0_ADDR 0x00000023にする必要があります。 ただし、ルーチンspi_write_reg が実際に何を行うかによって異なります。 以下は write_l2_lookup_table.py の出力です。私のデバッグ出力(tx/rx は、オシロスコープまたはロジック アナライザによって SPI ワイヤ上に表示されるデータを指します): DBG spi_tx: ['0x02000290', '0xAABBCCDD'] DBG spi_rx: ['0x02000290', '0x00000000'] DBG spi_read 0x0029 -> 0x00000000 DBG spi_write 0x0023 <- 0x37FFFA00 DBG spi_tx: ['0x80000230', '0x37FFFA00'] DBG spi_write 0x0024 <- 0x119A22AB DBG spi_tx: ['0x80000240', '0x119A22AB'] DBG spi_write 0x0025 <- 0xFF807089 DBG spi_tx: ['0x80000250', '0xFF807089'] DBG spi_write 0x0026 <- 0xFFFFFFFF DBG spi_tx: ['0x80000260', '0xFFFFFFFF'] DBG spi_write 0x0027 <- 0xF1FFFFFF DBG spi_tx: ['0x80000270', '0xF1FFFFFF'] DBG spi_write 0x0028 <- 0x1FFE7EFF DBG spi_tx: ['0x80000280', '0x1FFE7EFF'] DBG spi_write 0x0029 <- 0xD9800000 DBG spi_tx: ['0x80000290', '0xD9800000'] +-------+-------------+-------------------+---------+--------+--------+ |インデックス |デスポート |マカドル |ヴラニド |エンポート | IOタグ | +-------+-------------+-------------------+---------+--------+--------+ | 256 | 11111111111 | 11:22:33:44:55:66 | 14 | 1 | 1 | +-------+-------------+-------------------+---------+--------+--------+ L2ルックアップテーブルエントリ書き込み(SW1) FAE リクエストに関しては、FAE は私のエスカレーション パスに含まれていません。NXPについてでは FAE が割り当てられている、SO FAE に直接お問い合わせすることができます。 よろしくお願いいたします。 パベル Re: Dynamic configuration in sja1110 こんにちは@PavelL #L2_ENTRY0_ADDR 0xFF00008c を定義します #L2_ENTRY1_ADDR 0xFF000090 を定義します #L2_ENTRY2_ADDR 0xFF000094 を定義します #L2_ENTRY3_ADDR 0xFF000098 を定義します #L2_ENTRY4_ADDR 0xFF00009C を定義します #L2_ENTRY5_ADDR 0xFF0000A0 を定義します #L2_CTRL_ADDR 0xFF0000A4 を定義します Std_ReturnType CreateL2Entry(uint32_t エントリ[6]) { uint16_t インデックス = 11; uint64_t MACADDDR = 0x661122334455; uint64_t MACADDR_MASK = 0xFFFFFFFFFFFF; uint16_t VLANID = 3; uint16_t VLANID_MASK = 0xFFF; uint8_t IOTAG = 0; uint8_t IOTAG_MASK = 0; uint8_t SRCPORT = 5; uint8_t SRCPORT_MASK = 0xF; uint8_t 宛先ポート = 0x02; uint8_t ENFPORT = 1; uint8_t RETAG = 0; uint8_t ミラー = 0; uint8_t テイク = 0; uint16_t MIRR_VLAN = 0xFFF; uint8_t トラップホスト = 0; uint8_t CBSIDIN = 0x3F; uint8_t CBENONDA = 0; uint16_t VLIDX = 0xFFF; uint8_t SA_POLICE = 0; uint8_t DA_POLICE = 0; エントリ[0] = ((インデックス & 0x03FF) << 1) | ((ENFPORT & 0x1) << 11) | ((DESTPORTS & 0x7FF) << 12) | ((SRCPORT & 0xF) << 23) | ((MACADDR & 0x1F) << 27); エントリ[1] = (uint32_t)((MACADDR >> 5) & 0xFFFFFFFF); エントリ[2] = (((MACADDR >> 37) & 0x7FF) << 0) | ((VLANID & 0xFFF) << 11) | ((IOTAG & 0x1) << 23) | ((MACADDR_MASK & 0xFF) << 24); エントリ[3] = (uint32_t)((MACADDR_MASK >> 😎 & 0xFFFFFFFF); エントリ[4] = (((MACADDR_MASK >> 40) & 0xFF) << 0) | ((VLANID_MASK & 0xFFF) << 😎 | ((IOTAG_MASK & 0x1) << 20) | ((SRCPORT_MASK & 0xF) << 21) | ((RETAG & 0x1) << 25) | ((ミラー & 0x1) << 26) | ((テイク& 0x1) << 27) | ((MIRR_VLAN & 0xF) << 28); エントリ[5] = (((MIRR_VLAN >> 4) & 0xFF) << 0) | ((TRAPTOHOST & 0x1) << 😎 | ((CBSIDIN & 0x3F) << 9) | ((CBENONDA & 0x1) << 15) | ((VLIDX & 0xFFF) << 17) | ((SA_POLICE & 0x1) << 29) | ((DA_POLICE & 0x1) << 30); E_OK を返します。 } Std_ReturnType WriteL2LookupEntry(uint8_t swt) { swt > 0 の場合、E_NOT_OK を返します。 Std_ReturnType ret; uint32_t ctrlReg = 0; uint32_t エントリ[6]; ret = CreateL2Entry(エントリ); if (ret != E_OK) ret を返します。 する { ret = spi_read_reg(L2_CTRL_ADDR, &ctrlReg); if (ret != E_OK) ret を返します。 } while (ctrlReg & (1U << 31)); ret = spi_write_reg(L2_ENTRY0_ADDR, entry[0]); if (ret != E_OK) return ret; ret = spi_write_reg(L2_ENTRY1_ADDR, entry[1]); if (ret != E_OK) return ret; ret = spi_write_reg(L2_ENTRY2_ADDR, entry[2]); if (ret != E_OK) return ret; ret = spi_write_reg(L2_ENTRY3_ADDR, entry[3]); if (ret != E_OK) return ret; ret = spi_write_reg(L2_ENTRY4_ADDR, entry[4]); if (ret != E_OK) return ret; ret = spi_write_reg(L2_ENTRY5_ADDR, entry[5]); if (ret != E_OK) return ret; uint32_t ctrlValue = (1U << 31) | (1U << 30) | (1U << 28) | (1U << 27) | (3U << 23); ret = spi_write_reg(L2_CTRL_ADDR、ctrlValue); if (ret != E_OK) ret を返します。 する { ret = spi_read_reg(L2_CTRL_ADDR, &ctrlReg); if (ret != E_OK) ret を返します。 } while (ctrlReg & (1U << 31)); E_OK を返します。 } これは、動的エントリを作成するための現在の実装です。この実装が正しいかどうかを FAE とクロス検証できますか。 その他の変更が必要な場合は Re: Dynamic configuration in sja1110 こんにちは@Atkinson 、 質問への回答は、アプリケーションの利用CASEに関連しています。 S32G でも SJA1110 でも、どこにでも動的エントリを作成できます。 サポートされている方法でエントリをS32Gに転送し、SPIまたはイーサネット経由でSJA1110に書き込みます。 または、イーサネット経由でSJA1110にエントリを転送し、内部AHBアクセスを使用する または、カスタムトリガーイベント(GPIO、イーサネットフレームなど)をSJA1110に送信し、そこに動的エントリを作成し、AHBアクセスを介してエントリを書き込みます。 または、 .... または、 .... SJA1110 のスイッチコアに動的エントリを書き込む方法の例を次に示します。 SPI経由 - Pythonスクリプトwrite_l2_lookup_table.py AHB経由 - ECTサーバーのソースコード よろしくお願いいたします、 パベル Re: Dynamic configuration in sja1110 こんにちは@PavelL 1.)SO、動的構成のレジスタへのアクセスに関するこの変更は、S32G または SJA1110 スイッチで行う必要がありますか? 2.) SJA1110 スイッチ経由の場合、SPI によるレジスタの読み取りと書き込みを実行する必要があるかどうか、またこの実装は SWITCH_DRV 間でどこに実行する必要があるか? 3.) スイッチで追加されるSO動的エントリを作成できます さらに詳しい説明があると助かります!! Re: Dynamic configuration in sja1110 こんにちは@Atkinson 、 現在仕事が忙しくて返信が遅れたことをお詫び申し上げます。 最初は簡単ではないと思われるかもしれませんが、コンセプトは実際には非常にシンプルです。 最終的なレジスタ アドレスは、アクセス方法 (AHB 経由の M7 コア経由で内部的にアクセスしているか、SPI_AP インターフェース経由で外部的にアクセスしているか) によって異なります。ベース アドレスはアクセス ポイントによって異なります。 レジスタ アドレスは、UM11107 の表 2 に示されているベース アドレスを使用して計算されます。たとえば、スイッチ サブシステムの場合、ベース アドレスは SPI_AP アクセスの場合は0x00000000 、AHB アクセスの場合は0xFF000000です。 あなたのCASE、レジスタ0x8C (DYN_BE_LKP_ENTRY0) は、AHB 経由でアクセスすると0xFF00008Cになります。 ここで混乱が生じる可能性があります。SDK ドライバは次のように定義します。 #define SJA1110_L2_ART_LE_ADDR ( 0x3fc00023 ) /**< l2ArtLockedEntryレジスタのアドレス *   SWITCH_DRV_Write ルーチンは、内部 (AHB) アクセスのためにアドレスを 2 ビット (<< 2) 左にシフトします。SPI 転送 (カスケード スイッチ セットアップで使用される) の場合、シフトは適用されません。SO、 0x3fc00023 << 2 は0xFF00008Cになります。   上記の説明で理解が深まったかと思います。   よろしくお願いいたします。 パベル Re: Dynamic configuration in sja1110 こんにちは@PavelL 読み書きの完全な住所を教えていただけますか? 住所 名前 アクセス リセット 説明 8Ch DYN_BE_LKP_ エントリー0 読み取り/書き込み 0h (FFFFFFFEh) 8chより前のベースアドレスは何でしたか? 例えば0x3fc0008cになりますので、この動的エントリテーブルには完全なアドレスがあります。完全なアドレスを教えていただけますか? 8Ch DYN_BE_LKP_ エントリー0 読み取り/書き込み 0h (FFFFFFFEh) 90時間 DYN_BE_LKP_ エントリー1 読み取り/書き込み 0h 94時間 DYN_BE_LKP_ エントリー2 読み取り/書き込み 0h 98時間 DYN_BE_LKP_ エントリー3 読み取り/書き込み 0h 9Ch DYN_BE_LKP_ エントリー4 読み取り/書き込み 0h A0h DYN_BE_LKP_ エントリー5 読み取り/書き込み 0h A4h DYN_BE_LKP_CTRL 読み取り/書き込み 0h (FF800000h) Re: Dynamic configuration in sja1110 こんにちは@Atkinson 、 裏付けとなる文書は知りません。これは一般的な知識であり、デバイスに依存しません。このトピックについて Copilot に相談したところ、FTDI の代わりに DSPI5 を使用するように sja11xx_ftdi4232.py を変更できるはずです。 よろしくお願いいたします。 パベル Re: Dynamic configuration in sja1110 こんにちは@PavelL このスクリプトを S32G-VNP-RDB2 または RDB3 ボードで使用するには、S32G プロセッサ上の DSPI5 を介して通信するように FTDI レイヤーを変更する必要があります。 どうすればいいですか? 裏付けとなる書類はありますか? Re: Dynamic configuration in sja1110 こんにちは@Atkinson 、 Q1: 「Linux BSP が SD カードにプリインストールされているので、動的構成が自動的に有効になりますか?」 A1: いいえ、BSP には動的構成をサポートする DSA ドライバが含まれていますが、すべてのユースケースで自動的に有効になるわけではありません。 Q2: write_l2_lookup.py (python evm ホストツール) を使用して動的に L2 ルックアップエントリを構成する場合、そのプロセスは同じままですか?S32G-VNP-RDBボードの場合は変更されます。 A2: 動的エントリを作成してアップロードするための一般的なフローは、UM11107 および AN12925 で説明されているとおりです。 ただし、write_l2_lookup_table.py スクリプトは FTDI ドライバを使用して USB 経由で SJA1110-EVM にアクセスします。 このスクリプトを S32G-VNP-RDB2 または RDB3 ボードで使用するには、S32G プロセッサ上の DSPI5 を介して通信するように FTDI レイヤーを変更する必要があります。 Q3: 「ノートPCと S32G-VNP_RDB32 ボードをインターフェースして動的エントリを作成することは可能ですか?」 A3: はい、可能です。Linux 上で実行されるカスタム ソフトウェアを自由に開発し、SPI または イーサネット 経由で独自のプロトコルを処理して動的なエントリを構成できます。 Q4: 「もう1つ、SJA1110_SDK_1.0.2はRTM1.0.0の実装に必要な主なものであるかどうかは問題ありませんか?」 A4: いいえ、互換性と安定性のために、最新バージョンの SJA1110 SDK 1.0.2 を使用することをお勧めします。 さらにサポートが必要な場合は、FAE にお問い合わせいただくか、 https://support.nxp.com/s/?language =en_US からチケットを送信してください。 ご理解のほどよろしくお願いいたします。 よろしくお願いいたします。 パベル Re: Dynamic configuration in sja1110 こんにちは@PavelL SO、SD カードを S32G-VNP-RDB ボードに挿入する場合、Linux BSP は SD カードにプリインストールされます。SDカードに存在するBSPが動的構成を自動的に有効にするSO write_l2_lookup.py (python evm ホスト ツール) を使用して動的に L2 ルックアップ エントリを構成する場合、そのプロセスは同じままですか?S32G-VNP-RDBボードの場合は変更されます プロセスが同じままであれば、ノートPCと RDB32 ボードをインターフェースする方法は、ノートPCと SJA1110 EVM ボードを介してインターフェースする場合、USBインターフェースを使用して接続され、動的エントリを構成するのに役立ちます。では、S32G-VNP-RDB32 ボードのCASE、インターフェースはどのようになるのでしょうか。 動的エントリを作成してノートPCと S32G-VNP_RDB32 ボードをインターフェースすることは可能ですか? もう 1 つ、SJA1110_SDK_1.0.2 が RTM1.0.0 を実装するために必要な主なものであるかどうかは問題ありませんか? Re: Dynamic configuration in sja1110 こんにちは@Atkinson 、 Linux BSP は、S32G-VNP-RDB3 ボードに付属の SD カードにすでにプリインストールされているSO、この点に関しては追加の操作は必要ありません。 ボードを正常に起動できたと思います (以前のメッセージで既に言及していた場合は申し訳ありません)。 BSP には、動的な L2 ルックアップ テーブル構成のサポートを含む、さまざまな便利な機能を提供する SJA1110 DSA ドライバが含まれています。 DSA ドライバはデフォルトで有効になっています。 このCASEは複数の分野にまたがるトピックに発展したため、今後の進め方について FAE と協議しました。 よろしくお願いいたします。 パベル Re: Dynamic configuration in sja1110 こんにちは@PavelL 現在、S32G-VNP-RDB32 -- SJA1110スイッチに実装しようとしています。 現在、私は独自のファームウェアを持っていません どのLinux BSPを利用する必要があるか どのような変更が必要か Re: Dynamic configuration in sja1110 こんにちは@Atkinson 、 S32G-VNP-RDB3 ボードからこれを実行する予定の場合、状況は大きく変わります。ボード上で Linux BSP を実行しますか、それとも独自のファームウェアを使用する予定ですか? よろしくお願いいたします。 パベル Re: Dynamic configuration in sja1110 こんにちは@PavelL  3. SPI_HAP(ホストアクセスプロトコル) ホストツールのwrite_l2_lookup_table.pyスクリプトは、SPI経由でL2テーブルを動的に設定する方法を示しています。このアプローチは、任意の外部MCUまたはホストプロセッサで使用できます。このスクリプトのロジックは、必要に応じてM7コア内部で直接実行できるように移植することもできます。 write_l2_lookup_table.py 経由でエントリを設定したいと考えています write_l2_lookup_table.pyファイルに記述した設定がRDB32ボードにどのように移行されるか ノートPCから RDB32Board にどのようなインターフェースが必要ですか? L2ルックアップエントリをデバイス(RDB32ボード)に渡すための通信メカニズムは何ですか? 手順を教えていただけますか、または実装手順はどこで確認できますか Re: Dynamic configuration in sja1110 こんにちは@Atkinson 、 はい、その通りです。システムが起動すると、静的構成が外部フラッシュから自動的に読み込まれます。 動的構成の概念をもう少し詳しく説明します。 動的構成のタスクは、次の 2 つの部分に CAN 分けられます。 有効なエントリの組み立て — UM11107、第5.6章「動的構成」を参照 このエントリをスイッチに書き込む方法については、AN12925、第5.1.3.2章「L2ルックアップテーブルエントリの書き込み」を参照してください。 これに使用できるインターフェースは 3 つあります。 AHB — 内部 M7 コア経由。SDK サポートが利用可能であり、ECT サーバーのソース コードを出発点として使用できます。 SPI_HAP — ホスト プロセッサは有効なエントリを組み立て、スイッチに書き込みます。これが write_l2_lookup_table.py が行うことです。 イーサネット - ホスト プロセッサはユーザー定義のメッセージ (UDP、TCP など) を送信し、内部の M7 コアによって処理されます。M7 はメッセージをデコードし、有効なエントリを組み立ててスイッチに書き込みます。SO、実質的にポイント 1 に戻ります。ECT は内部的にこのように動作します。 よろしくお願いいたします。 パベル Re: Dynamic configuration in sja1110 こんにちは@PavelL 3. SPI_HAP(ホストアクセスプロトコル) ホストツールのwrite_l2_lookup_table.pyスクリプトは、SPI経由でL2テーブルを動的に設定する方法を示しています。このアプローチは任意の外部MCUまたはホストプロセッサで使用できます。このスクリプトのロジックは、必要に応じて内部M7コアで直接実行できるように移植することもできます。 write_l2_lookup_table.py 経由でエントリを設定したいと考えています write_l2_lookup_table.pyファイルに記述した設定がRDB32ボードにどのように移行されるか ノートPCから RDB32Board にどのようなインターフェースが必要ですか? L2ルックアップエントリをデバイス(RDB32ボード)に渡すための通信メカニズムは何ですか? 手順を教えていただけますか、または実装手順はどこで確認できますか Re: Dynamic configuration in sja1110 こんにちは@PavelL おっしゃるとおり、switch_coreの設定を動的に行いたいのですが システムが起動すると、ペリフェラルで設定した静的構成がロードされます。 静的に設定されているテーブル エントリを動的に構成する方法を探しています。 どちらのCASEでも、スイッチ構成を動的に更新する方法は通常 3 つあります。 内部のM7コアから SPI_HAP経由でホストプロセッサから ホストプロセッサからイーサネット経由で SO、これらがシステムを動的に更新する唯一の方法だと言うのですか? これらが唯一可能な方法である場合、私が提供したコードとして設定すると、機能しますか、それとも機能しませんか? また、ここで言及されている 3 つのプロセスは、ECT および write_l2_lookup_table.py と同じですか? それとも異なるものですか? Re: Dynamic configuration in sja1110 こんにちは@Atkinson 、 動的 L2 ルックアップ テーブルを使用するCASEを明確にしていただけますか? 個人的には、次の 2 つの典型的なシナリオで動的エントリの使用を検討します。 複数のデバイス間で共通のスイッチ構成を維持し、電源投入後に各スイッチを動的に「パーソナライズ」したい場合。 アプリケーション固有の要件に基づいて、実行時にスイッチ構成を変更する必要がある場合。 どちらのCASEでも、スイッチ構成を動的に更新する方法は通常 3 つあります。 内部のM7コアから SPI_HAP経由でホストプロセッサから ホストプロセッサからイーサネット経由で あなたのユースCASEはこれらのカテゴリのいずれかに該当しますか、それとも何か違うものを目指していますか? よろしくお願いいたします。 パベル Re: Dynamic configuration in sja1110 こんにちは@PavelL あなたが言ったように、コードを組み込んでみました エントリの作成に役立つコードをどこに配置すればよいか教えていただけますか? 以前のメッセージでは、ECT(イーサネット構成ツール)とSPI_HAPを使用する2つの方法があると述べていました。 したがって、これらのツールとファイルは実行時 ryt で処理する必要がありますか? 私が共有したコードは、これらのツールなしで実装しようとしているものです 動的 L2 ルックアップ エントリを作成したいと考えていますが、これは問題ないでしょうか? よろしく アトキンソン Re: Dynamic configuration in sja1110 こんにちは@Atkinson 、 祝日のため返信が遅れましたことをお詫び申し上げます。 コードを共有していただきありがとうございます。ざっと見たところ、一見すると、AN12925の5.1.3.2章に概説されている原則と一致しているように見えます。L2 ルックアップ テーブル エントリを書き込みます。また、#define ステートメントが SJA1110.h から再利用されているように見えることにも気付きました。これは標準的な方法です。 ただし、徹底的なカスタム コード レビューは、弊社の無料オンライン サポートの範囲外となることにご注意ください。さらに、この関数を呼び出すタイミングとコンテキストはアプリケーションに大きく依存し、システムのアーキテクチャと要件によって異なる場合があります。 よろしくお願いいたします。 パベル Re: Dynamic configuration in sja1110 こんにちは@PavelL 静的 status_t wait_for_valid_clear(uint8_t swt) { status_t ステータス; uint32_t ctrl = 0; する { ステータス = SWITCH_DRV_Read(swt, 1, DYN_BE_LKP_CTRL, &ctrl); if (status != STATUS_SUCCESS) ステータスを返します。 } while (ctrl & DYN_BE_LKP_CTRL_VALID_MASK); if (ctrl & DYN_BE_LKP_CTRL_ERROR_MASK) STATUS_ERROR を返します。 STATUS_SUCCESS を返します。 } status_t SJA1110_AddL2LookupEntry_Dynamic(uint8_t swt) { status_t ステータス; // MAC = 66:11:22:33:44:55 uint8_t mac[6] = {0x66, 0x11, 0x22, 0x33, 0x44, 0x55}; uint64_t mac64 = ((uint64_t)mac[0] << 40) | ((uint64_t)mac[1] << 32) | ((uint64_t)mac[2] << 24) | ((uint64_t)mac[3] << 16) | ((uint64_t)mac[4] << 😎 | (uint64_t)mac[5]; // L2ルックアップ入力フィールドを準備する uint32_t エントリ[WORD_COUNT] = {0}; entry[0] = ((5 & 0xF) << 24) | (1 << 11); // SrcPort、DestPorts 1 & 2 エントリ[1] = (uint32_t)(mac64 & 0xFFFFFFFF); エントリ[2] = (uint32_t)((mac64 >> 32) & 0xFFFF); エントリ[2] |= (3 << 16); // VLAN ID = 3 entry[3] = 0; // オプションのマスク エントリ[4] = 0; エントリ[5] = (8 << 4) | (1 << 10); // CB_SID_IN = 8, CB_ON_DA = 1 // 前の操作が完了するまで待機します ステータス = wait_for_valid_clear(swt); if (status != STATUS_SUCCESS) ステータスを返します。 // L2エントリデータをレジスタに書き込む ステータス = SWITCH_DRV_Write(swt, WORD_COUNT, DYN_BE_LKP_ENTRY0, エントリ); if (status != STATUS_SUCCESS) ステータスを返します。 // 制御レジスタ値を構築する uint32_t ctrl = DYN_BE_LKP_CTRL_VALID_MASK | DYN_BE_LKP_CTRL_RDWRSET_MASK | (HOSTCMD_WRITE << DYN_BE_LKP_CTRL_HOSTCMD_SHIFT); // トリガー書き込み ステータス = SWITCH_DRV_Write(swt, 1, DYN_BE_LKP_CTRL, &ctrl); if (status != STATUS_SUCCESS) ステータスを返します。 // 操作が完了するまで待機します wait_for_valid_clear(swt) を返します。 } このコードは動的エントリの生成に利用CANますか? このコードが正しい場合、関数をどこで呼び出す必要がありますか? よろしく アトキンソン Re: Dynamic configuration in sja1110 こんにちは@PavelL #include #include // SoCマッピングに従ってレジスタアドレスを定義します #define DYN_BE_LKP_ENTRY0 0x000 // 実際のアドレスに置き換えます #定義 DYN_BE_LKP_ENTRY1 0x004 #DYN_BE_LKP_ENTRY2 0x008 を定義します #定義 DYN_BE_LKP_ENTRY3 0x00C #define DYN_BE_LKP_ENTRY4 0x010 #define DYN_BE_LKP_ENTRY5 0x014 #DYN_BE_LKP_CTRL 0x018 を定義します void insert_l2_unicast_entry(void) { // === 入力 === uint64_t mac = 0x021122334455ULL; // MACアドレス uint16_t vlan_id = 3; uint8_t dest_port = 3; // ポート3 uint16_t dest_ports_mask = (1 << dest_port); uint16_t インデックス = 5; // === ステップ 1: 前の操作が完了するまで待機します === read_register(DYN_BE_LKP_CTRL) と ETHSW_DYN_BE_LKP_CTRL_bValid_MASK が有効な間、 // === ステップ 2: 入力フィールドを準備する === uint32_t mac_lo = (uint32_t)(mac & 0xFFFFFFFF); // 下位32ビット uint32_t mac_hi = (uint32_t)((mac >> 32) & 0xFFFF); // 上位16ビット uint32_t エントリ0 = ETHSW_DYN_BE_LKP_ENTRY0_uvEntry_30__0_(0x00000000); uint32_t エントリ1 = ETHSW_DYN_BE_LKP_ENTRY1_uvEntry_62__31_(mac_lo); uint32_t エントリ 2 = ETHSW_DYN_BE_LKP_ENTRY2_uvEntry_94__63_(mac_hi); uint32_t エントリ3 = ETHSW_DYN_BE_LKP_ENTRY3_uvEntry_126__95_( ((vlan_id & 0xFFF) << 16) | (dest_ports_mask & 0xFFFF)); uint32_t entry4 = ETHSW_DYN_BE_LKP_ENTRY4_uvEntry_158__127_(0x00000000); // オプションフラグ/予約済み uint32_t エントリ5 = ETHSW_DYN_BE_LKP_ENTRY5_uvEntry_190__159_(インデックス); // === ステップ3: DYNレジスタにエントリを書き込む === write_register(DYN_BE_LKP_ENTRY0、エントリ0); write_register(DYN_BE_LKP_ENTRY1、エントリ1); write_register(DYN_BE_LKP_ENTRY2、エントリ2); write_register(DYN_BE_LKP_ENTRY3、エントリ3); write_register(DYN_BE_LKP_ENTRY4、エントリ4); write_register(DYN_BE_LKP_ENTRY5、エントリ5); // === ステップ 4: 制御レジスタを介して書き込みをトリガーする === uint32_t ctrl_val = 0; ctrl_val |= ETHSW_DYN_BE_LKP_CTRL_b有効(1); ctrl_val |= ETHSW_DYN_BE_LKP_CTRL_bWrRdB(1); // 書き込み操作 ctrl_val |= ETHSW_DYN_BE_LKP_CTRL_uvHostCommand(0b011); // ホスト書き込み ctrl_val |= ETHSW_DYN_BE_LKP_CTRL_bValidEntry(1); // 有効なエントリ write_register(DYN_BE_LKP_CTRL、ctrl_val); // === ステップ 5: 操作が完了するまで待機します === read_register(DYN_BE_LKP_CTRL) と ETHSW_DYN_BE_LKP_CTRL_bValid_MASK を読み取りながら実行します。 // === ステップ 6: エラーの確認 === uint32_t ステータス = read_register(DYN_BE_LKP_CTRL); if (ステータス & ETHSW_DYN_BE_LKP_CTRL_bError_MASK) { // エラーを処理する // 必要に応じてこれを印刷またはログに記録できます } } L2ルックアップテーブルにデータを動的に書き込むためのコードをCAN挿入できるかどうか テストするにはこのコードをどこに挿入すればよいですか? ご返信をお待ちしております よろしく アトキンソン Re: Dynamic configuration in sja1110 こんにちは@PavelL SPI_HAP経由で設定する方法 write_l2_lookup_table.py はどこにありますか? これを SPI_HAP 経由でどのように通信する必要がありますか?デバイスの起動後 以前の静的構成では、各インデックスを介して各データを構成しましたか? SO、最初に静的に構成されたデータは問題ないか、または静的構成のいずれもコネクテッドすべきではないということですか? この write_l2_lookup_table.py を CAN 共有できますか? このスクリプトをどこから実行すると (データを渡すためにどのポートにコネクテッドする必要があるか)、スクリプトはデータをポーリングしますか? よろしく アトキンソン Re: Dynamic configuration in sja1110 こんにちは@Atkinson 、 動的構成の**方法**はユース**CASE**によって異なり、内部の M7 コアによって実行することも、SPI を介して外部で実行することも**CAN**。以下に考えられる解決策のリストを示します。 1. ECT(イーサネット制御ツール) 外部イーサネット (UDP) フレームを介した動的構成。M7 コア上で実行されている内部ファームウェアは構成を受信し、それをスイッチ コアに適用します。 2. 修正ECT ECT ソース コードは、あらゆる イーサネット フレーム形式 (UDP だけでなく) を受け入れるように適応できます。これにより、カスタム プロトコルまたはシステムへの統合が可能になります。内部ロジックは同じままで、実際のレジスタの更新は M7 コアが実行します。 3. SPI_HAP(ホストアクセスプロトコル) ホスト ツールの write_l2_lookup_table.py スクリプトは、SPI を介して L2 テーブルを動的に構成する方法を示しています。このアプローチは、任意の外部MCUまたはホスト プロセッサで使用できます。必要に応じて、このスクリプトのロジックを移植して内部 M7 コア上で直接実行することもCAN。 上記の方法はすべて、AN12925 のセクション 5.1.3.2 で説明されているのと同じ原則に従います。レジスタ レベルのフローは同一であり、制御レジスタのポーリング、エントリ レジスタへの書き込み、および制御レジスタを介した更新のトリガーが含まれます。 よろしくお願いいたします。 パベル
記事全体を表示
PT2000自動診断の問題について 自動を有効にすると、シミュレートされたノズルが故障し、回復後に動作を継続できませんでした。ソフトウェア割り込みを使用してノズルの故障をシミュレートすると、ノズルは回復後に動作を継続できます。 HS|LS 構成可能ドライバ 回复: Regarding PT2000 automatic diagnostic issues ありがとうございます。この問題は解決しました。 しかし、新たな疑問があります。下の画像の D_LS1 ピンと G_LS1 ピンがフローティング状態の場合、なぜジェッティング機能が正常に動作しないのでしょうか? Re: Regarding PT2000 automatic diagnostic issues こんにちは、 自動診断を使用する場合は、障害の検出後にノズルまたはシステム コンポーネントを再初期化する手順が回復プロセスに含まれているかどうかを確認します。システムがリセットされない場合、またはエラー状態から適切に移行しない場合、回復後にノズルが機能しなくなる可能性があります。 ソフトウェア割り込み方法が機能する場合は、手動割り込み処理と自動診断機能の構成の違いを確認します。自動診断のCASEにクリアする必要がある、エラー フラグやステータス レジスタなどの微妙な違いがある場合があります。 BRs、トーマス
記事全体を表示
关于 PT2000 自动诊断问题 启用自动后,模拟喷嘴出现故障,恢复后无法继续工作;使用软件中断模拟喷嘴故障,恢复后喷嘴可以继续工作。 HS|LS 可配置驱动器 回复: Regarding PT2000 automatic diagnostic issues 谢谢,这个问题已经解决。 但我有一个新问题。当下图中的 D_LS1 和 G_LS1 引脚处于浮空状态时,为什么我的喷射无法正常运行? Re: Regarding PT2000 automatic diagnostic issues 您好, 使用自动诊断时,检查恢复过程是否包括检测到故障后重新初始化喷嘴或系统元器件的任何步骤。如果系统未 RESET 或无法正确过渡到错误状态,则可能会导致喷嘴在恢复后无法正常工作。 如果软件中断方法有效,请检查手动中断处理和自动诊断功能之间的配置差异。在自动诊断的情况下,可能会有一些细微的差别,如错误标志或状态寄存器需要清除。 BRs, Tomas
記事全体を表示
CARD emulation PN7160 Serial number Hello, I am currently working on card emulation with PN7160, connected to an ESP32. When I tap the PN7160 to an Android NFC reader (using NFC Tools), the emulated card is detected. However, I notice that the UID changes on each tap, except for the first byte, which is always 08. Example UIDs I observed: 08467004 0886036e 08c7351f 0831fb0d ... My question is: Is it possible to configure a fully custom static UID (e.g., fixed 4-byte UID like "0456789A") when using card emulation mode on the PN7160? Any insights or guidance would be greatly appreciated! Communication & Control(I3C | I2C | SPI | FlexCAN | Ethernet | FlexIO) Re: CARD emulation PN7160 Serial number Hi @EduardoZamora , Thank you very much for your explanation and for pointing me to the NXP_HCE_RNDM_UID_ENB configuration. That clarifies the behavior I observed during testing. I appreciate your support! Best regards, AWN Re: CARD emulation PN7160 Serial number Hi @awn, Hope you are doing well. In Card Emulation mode, UID can be a random number, and only one byte would be fixed. In this configuration, UID will change every time there is an RF Off -> RF On transition (each tap). I will recommend you checking PN7160/PN7220 configuration files, Section 5.8 NXP_HCE_RNDM_UID_ENB for more information. Regards, Eduardo.
記事全体を表示
Dynamic configuration in sja1110 Hi,  I would like to configure l2 lookup table dynamically how can I configure it ? Without using ECT tool how can I configure the l2 lookup table ?  Any examples? Regards  Atkinson Re: Dynamic configuration in sja1110 Hi @PavelL  "In your code, there are missing shift values in entry[3], and missing or misplaced brackets in entry[3], entry[4], and entry[5]." I have implemented it as same as the python code sorry i am nots sure where i am missing the brackets and shift values. can you kindly provide me the aligned code which might be more clear sorry for missing out the brackets and shift It would be more helpful and clear if you provide me the exact entry[3],entry[4], entry[5] Re: Dynamic configuration in sja1110 Hello @Atkinson , In your code, there are missing shift values in entry[3], and missing or misplaced brackets in entry[3], entry[4], and entry[5]. To verify your L2 lookup configuration, you may consider setting the entry as a static one instead of dynamic — this can help isolate whether the issue is with the entry format or the dynamic update mechanism. Also, please note that the "pretty tables" in the Python script are used only for formatting output in the command window — they do not affect the functionality or register configuration. Best regards, Pavel Re: Dynamic configuration in sja1110 Hi @PavelL  int WriteL2LookupEntry(int cs) { const uint32_t DESTPORTS = 0x004; const uint32_t INDEX = 2; const uint64_t MACADDR = 0x112233445566; const uint64_t MACADDR_MASK = 0xffffffffffff; const uint32_t VLANID = 0; const uint32_t VLANID_MASK = 0x0; const uint32_t IOTAG = 0; const uint32_t IOTAG_MASK = 0; const uint32_t SRCPORT = 0x6; const uint32_t SRCPORT_MASK = 0xF; const uint32_t ENFPORT = 0; const uint32_t RETAG = 0; const uint32_t MIRROR = 0; const uint32_t TAKETS = 0; const uint32_t MIRR_VLAN = 0xFFF; const uint32_t TRAPTOHOST = 0; const uint32_t CBSIDIN = 0x3F; const uint32_t CBENONDA = 0; const uint32_t VLIDX = 0xFFF; const uint32_t SA_POLICE = 0; const uint32_t DA_POLICE = 0; uint32_t L2_OFFSET = 0x23; uint32_t L2CTRL_OFFSET = 0x29; const uint32_t SWREG_BASE = 0x00000000; const uint32_t VALID = 1U; const uint32_t RDWRSET = 1U; const uint32_t VALIDENT = 1U; const uint32_t HOSTCMD = 3U; const uint32_t MGMTROUTE = 0U; const uint32_t LOCKED = 1U; const uint32_t ERROR = 0U; uint32_t L2_ADDRESS = SWREG_BASE + L2_OFFSET; uint32_t L2_ADDRESS_CTL = SWREG_BASE + L2CTRL_OFFSET; uint32_t l2Entry[ADDRESS_RANGE] = {0}; l2Entry[0] = (((INDEX & 0x03ff) << (1 % 32)) + ((ENFPORT & 1) << (11 % 32)) + ((DESTPORTS & 0x7FF) << (12 % 32)) + ((SRCPORT & 0xF) << (23 % 32)) + ((MACADDR & 0x1F) << (27 % 32))); l2Entry[1] = (((MACADDR >> 5) & 0xFFFFFFFF)); l2Entry[2] = ((((MACADDR >> 37) & 0x7FF) << (64 % 32)) + ((VLANID & 0xFFF) << (75 % 32)) + ((IOTAG & 1) << (87 % 32)) + ((MACADDR_MASK & 0xFF) << (88 % 32))); l2Entry[3] = (((MACADDR_MASK >> 😎 & 0xFFFFFFFF)); l2Entry[4] = (((MACADDR_MASK >> 40) & 0xFF << (128 % 32)) + ((VLANID_MASK & 0xfff) << (136 % 32)) + ((IOTAG_MASK & 1) << (148 % 32)) + ((SRCPORT_MASK & 0xF) << (149 % 32)) + ((RETAG & 0x1) << (153 % 32)) + ((MIRROR & 0x1) << (154 % 32)) + ((TAKETS & 0x1) << (155 % 32)) + ((MIRR_VLAN & 0xF) << (156 % 32))); l2Entry[5] = (((MIRR_VLAN >> 4) & 0xFF << (160 % 32)) + ((TRAPTOHOST & 0x1) << (168 % 32)) + ((CBSIDIN & 0x3F) << (169 % 32)) + ((CBENONDA & 0x1) << (175 % 32)) + ((VLIDX & 0xFFF) << (177 % 32)) + ((SA_POLICE & 0x1) << (189 % 32)) + ((DA_POLICE & 0x1) << (190 % 32))); uint32_t status = 0; do { Std_ReturnType ret = spi_read_reg(L2_ADDRESS_CTL, &status); if (ret != E_OK) { return -1; } } while ((status >> VALID_BIT_SHIFT) & 1U); for (int i = 0; i < ADDRESS_RANGE; i++) { Std_ReturnType ret = spi_write_reg(L2_ADDRESS + i, l2Entry[i]); if (ret != E_OK) { return -2; } uint32_t readBack = 0; ret = spi_read_reg(L2_ADDRESS + i, &readBack); if (ret != E_OK || readBack != l2Entry[i]) { return -3; } } uint32_t controlL2Entry = 0; controlL2Entry = ((VALID << 31) + (RDWRSET << 30) + (ERROR << 29) + (LOCKED << 28) + (VALIDENT << 27) + (MGMTROUTE << 26) + (HOSTCMD << 23)); Std_ReturnType ret = spi_write_reg(L2_ADDRESS_CTL, controlL2Entry); if (ret != E_OK) { return -4; } do { ret = spi_read_reg(L2_ADDRESS_CTL, &status); if (ret != E_OK) { return -5; } } while ((status >> VALID_BIT_SHIFT) & 1U); return 0; } I have changed the implementation similar to Python script. if you found any errors can you send me the changes please Python script         # Write Control         platform.spi_write(L2_ADDRESS_CTL, controlL2Entry, cs)         table = prettytable.PrettyTable(             ("INDEX", "DESTPORTS", "MACADDR", "VLANID", "ENFPORT", "IOTAG"))         entry = (             str(INDEX), '{0:11b}'.format(DESTPORTS), mac_to_str(MACADDR), str(VLANID),             str(ENFPORT), str(IOTAG))         table.add_row(entry)         print(table.get_string())       "After writing, try sending a frame that matches the MAC/VLAN/port criteria of the entry and observe whether it is forwarded according to the DESTPORTS field" I am trying to send in this way as you mentioned but this reflection is not seen  I am unable to see my entry is getting reflected ? is there any other things need to be setted up ?? In Python script after writing the register value for controll2entry into L2_ADDRESS_CTL there were few lines of code which does adding a entry into "prettytable" Do we need to this also same and whether we have provision to do this ??   Re: Dynamic configuration in sja1110 Hello @Atkinson , There are missing shift values and incomplete expressions in entry[3], entry[4], and entry[5]. These may result in incorrect register values. I recommend comparing your logic against the Python reference script, which constructs the L2 entry correctly. After writing, try sending a frame that matches the MAC/VLAN/port criteria of the entry and observe whether it is forwarded according to the DESTPORTS field. Best regards, Pavel Re: Dynamic configuration in sja1110 Hi @PavelL  int WriteL2LookupEntry(int cs) { const uint32_t DESTPORTS = 0x002; const uint32_t INDEX = 8; const uint64_t MACADDR = 0x661122334455; const uint64_t MACADDR_MASK = 0xffffffffffff; const uint32_t VLANID = 0; const uint32_t VLANID_MASK = 0xfff; const uint32_t IOTAG = 0; const uint32_t IOTAG_MASK = 0; const uint32_t SRCPORT = 0x5; const uint32_t SRCPORT_MASK = 0xF; const uint32_t ENFPORT = 0; const uint32_t RETAG = 0; const uint32_t MIRROR = 0; const uint32_t TAKETS = 0; const uint32_t MIRR_VLAN = 0xFFF; const uint32_t TRAPTOHOST = 0; const uint32_t CBSIDIN = 0x3F; const uint32_t CBENONDA = 0; const uint32_t VLIDX = 0xFFF; const uint32_t SA_POLICE = 0; const uint32_t DA_POLICE = 0; uint32_t L2_OFFSET = 0x23; uint32_t L2CTRL_OFFSET = 0x29; const uint32_t SWREG_BASE = 0x00000000; const uint32_t VALID = 1U; const uint32_t RDWRSET = 1U; const uint32_t VALIDENT = 1U; const uint32_t HOSTCMD = 3U; const uint32_t MGMTROUTE = 0U; const uint32_t LOCKED = 1U; const uint32_t ERROR = 0U; uint32_t L2_ADDRESS = SWREG_BASE + L2_OFFSET; uint32_t L2_ADDRESS_CTL = SWREG_BASE + L2CTRL_OFFSET; uint32_t l2Entry[ADDRESS_RANGE] = {0}; l2Entry[0] = ((INDEX & 0x03FF) << 1) | ((ENFPORT & 0x1) << 11) | ((DESTPORTS & 0x7FF) << 12) | ((SRCPORT & 0xF) << 23) | ((uint32_t)(MACADDR & 0x1F) << 27); l2Entry[1] = (uint32_t)((MACADDR >> 5) & 0xFFFFFFFF); l2Entry[2] = (uint32_t)(((MACADDR >> 37) & 0x7FF) << 0) | ((VLANID & 0xFFF) << 11) | ((IOTAG & 0x1) << 23) | ((uint32_t)(MACADDR_MASK & 0xFF) << 24); l2Entry[3] = (uint32_t)((MACADDR_MASK >> 😎 & 0xFFFFFFFF); l2Entry[4] = ((uint32_t)((MACADDR_MASK >> 40) & 0xFF) << 0) | ((VLANID_MASK & 0xFFF) << 😎 | ((IOTAG_MASK & 0x1) << 20) | ((SRCPORT_MASK & 0xF) << 21) | ((RETAG & 0x1) << 25) | ((MIRROR & 0x1) << 26) | ((TAKETS & 0x1) << 27) | ((MIRR_VLAN & 0xF) << 28); l2Entry[5] = (((MIRR_VLAN >> 4) & 0xFF) << 0) | ((TRAPTOHOST & 0x1) << 😎 | ((CBSIDIN & 0x3F) << 9) | ((CBENONDA & 0x1) << 15) | ((VLIDX & 0xFFF) << 17) | ((SA_POLICE & 0x1) << 29) | ((DA_POLICE & 0x1) << 30); uint32_t status = 0; do { Std_ReturnType ret = spi_read_reg(L2_ADDRESS_CTL, &status); if (ret != E_OK) { return -1; } } while ((status >> VALID_BIT_SHIFT) & 1U); for (int i = 0; i < ADDRESS_RANGE; i++) { Std_ReturnType ret = spi_write_reg(L2_ADDRESS + i, l2Entry[i]); if (ret != E_OK) { return -2; } uint32_t readBack = 0; ret = spi_read_reg(L2_ADDRESS + i, &readBack); if (ret != E_OK || readBack != l2Entry[i]) { return -3; } } uint32_t controlL2Entry = 0; controlL2Entry |= (VALID << VALID_BIT_SHIFT); controlL2Entry |= (RDWRSET << RDWRSET_BIT_SHIFT); controlL2Entry |= (ERROR << ERROR_BIT_SHIFT); controlL2Entry |= (LOCKED << LOCKED_BIT_SHIFT); controlL2Entry |= (VALIDENT << VALIDENT_BIT_SHIFT); controlL2Entry |= (MGMTROUTE << MGMTROUTE_BIT_SHIFT); controlL2Entry |= (HOSTCMD << HOSTCMD_BIT_SHIFT); Std_ReturnType ret = spi_write_reg(L2_ADDRESS_CTL, controlL2Entry); if (ret != E_OK) { return -4; } do { ret = spi_read_reg(L2_ADDRESS_CTL, &status); if (ret != E_OK) { return -5; } } while ((status >> VALID_BIT_SHIFT) & 1U); return 0; } This is my revised code implementation  can you verify once this implementation will bring a Dynamic Entry. so i tried debugging it by readingback the register value whether the values are getting written into the register i could able to see the values are written into the register but i am not sure whether the enrty is created or not ? and also the reflection of Dynamic entry of L2 lookup table is not getting reflected ? so how can i verify the L2 lookup table enrty is created ? Re: Dynamic configuration in sja1110 Hello @Atkinson , 1. Bit Shift Syntax (<<, >>) It appears that some of the bit shift operators in your code were replaced with HTML entities like << and >>. This typically happens when code is copied into web-based platforms. Anyway, please check it directly in your code. #define L2_CTRL_VALID_BIT (1U << 31) should be: #define L2_CTRL_VALID_BIT (1U << 31) 2. Entry Issue There are several syntax errors and missing shift values in the CreateL2Entry() function, particularly in entry[3], entry[4], and entry[5]. These may result in incomplete or invalid register writes.  e.g.  ((TRAPTOHOST & 0x1) << | I recommend comparing your implementation against the Python reference script, which correctly constructs all six 32-bit words of the L2 entry. Best regards, Pavel Re: Dynamic configuration in sja1110 Hi @PavelL  3.)I have changed the Register address to #define L2_ENTRY0_ADDR 0x00000023 but still i am not able to identify the table which i am trying to add getting reflected when i transmit the message  "If I understand correctly, you're referring to the L2 Lookup Table described in Table 1182 of UM11107. This table consists of six 32-bit registers per entry. You can see this structure reflected in the debug output from the Python script." So i am facing up with the issue in a way where i am trying to write the data into address which need to create a Dynamic Entry in L2 lookup table but its not creating a Dynamic Entry  #define L2_ENTRY0_ADDR 0x00000023 #define L2_ENTRY1_ADDR 0x00000024 #define L2_ENTRY2_ADDR 0x00000025 #define L2_ENTRY3_ADDR 0x00000026 #define L2_ENTRY4_ADDR 0x00000027 #define L2_ENTRY5_ADDR 0x00000028 #define L2_CTRL_ADDR 0x00000029 #define L2_CTRL_VALID_BIT (1U << 31) #define L2_CTRL_WR_RDB_BIT (1U << 30) #define L2_CTRL_VALIDENTRY_BIT (1U << 28) #define L2_CTRL_HOSTCMD_SHIFT 23 #define L2_CTRL_HOSTCMD_WRITE (0b011U << L2_CTRL_HOSTCMD_SHIFT) Std_ReturnType CreateL2Entry(uint32_t entry[6]) { uint16_t INDEX = 11; uint64_t MACADDR = 0x661122334455; uint64_t MACADDR_MASK = 0xFFFFFFFFFFFF; uint16_t VLANID = 3; uint16_t VLANID_MASK = 0xFFF; uint8_t IOTAG = 0; uint8_t IOTAG_MASK = 0; uint8_t SRCPORT = 5; uint8_t SRCPORT_MASK = 0xF; uint8_t DESTPORTS = 0x02; uint8_t ENFPORT = 1; uint8_t RETAG = 0; uint8_t MIRROR = 0; uint8_t TAKETS = 0; uint16_t MIRR_VLAN = 0xFFF; uint8_t TRAPTOHOST = 0; uint8_t CBSIDIN = 0x3F; uint8_t CBENONDA = 0; uint16_t VLIDX = 0xFFF; uint8_t SA_POLICE = 0; uint8_t DA_POLICE = 0; entry[0] = ((INDEX & 0x03FF) << 1) | ((ENFPORT & 0x1) << 11) | ((DESTPORTS & 0x7FF) << 12) | ((SRCPORT & 0xF) << 23) | ((MACADDR & 0x1F) << 27); entry[1] = (uint32_t)((MACADDR >> 5) & 0xFFFFFFFF); entry[2] = (((MACADDR >> 37) & 0x7FF) << 0) | ((VLANID & 0xFFF) << 11) | ((IOTAG & 0x1) << 23) | ((MACADDR_MASK & 0xFF) << 24); entry[3] = (uint32_t)((MACADDR_MASK >> 😎 & 0xFFFFFFFF); entry[4] = (((MACADDR_MASK >> 40) & 0xFF) << 0) | ((VLANID_MASK & 0xFFF) << 😎 | ((IOTAG_MASK & 0x1) << 20) | ((SRCPORT_MASK & 0xF) << 21) | ((RETAG & 0x1) << 25) | ((MIRROR & 0x1) << 26) | ((TAKETS & 0x1) << 27) | ((MIRR_VLAN & 0xF) << 28); entry[5] = (((MIRR_VLAN >> 4) & 0xFF) << 0) | ((TRAPTOHOST & 0x1) << 😎 | ((CBSIDIN & 0x3F) << 9) | ((CBENONDA & 0x1) << 15) | ((VLIDX & 0xFFF) << 17) | ((SA_POLICE & 0x1) << 29) | ((DA_POLICE & 0x1) << 30); return E_OK; } Std_ReturnType WriteL2LookupEntry(uint8_t swt) { if (swt > 0) return E_NOT_OK; Std_ReturnType ret; uint32_t ctrlReg = 0; uint32_t entry[6]; // Step 1: Create the entry ret = CreateL2Entry(entry); if (ret != E_OK) return ret; // Step 2: Wait for VALID bit to clear do { ret = spi_read_reg(L2_CTRL_ADDR, &ctrlReg); if (ret != E_OK) return ret; } while (ctrlReg & L2_CTRL_VALID_BIT); // Step 3: Write entry data to registers ret = spi_write_reg(L2_ENTRY0_ADDR, entry[0]); if (ret != E_OK) return ret; ret = spi_write_reg(L2_ENTRY1_ADDR, entry[1]); if (ret != E_OK) return ret; ret = spi_write_reg(L2_ENTRY2_ADDR, entry[2]); if (ret != E_OK) return ret; ret = spi_write_reg(L2_ENTRY3_ADDR, entry[3]); if (ret != E_OK) return ret; ret = spi_write_reg(L2_ENTRY4_ADDR, entry[4]); if (ret != E_OK) return ret; ret = spi_write_reg(L2_ENTRY5_ADDR, entry[5]); if (ret != E_OK) return ret; // Step 4: Set control register to trigger write uint32_t ctrlValue = (1U << 31) | (1U << 30) | (1U << 28) | (1U << 27) | (3U << 23); ret = spi_write_reg(L2_CTRL_ADDR, ctrlValue); if (ret != E_OK) return ret; do { ret = spi_read_reg(L2_CTRL_ADDR, &ctrlReg); if (ret != E_OK) return ret; } while (ctrlReg & L2_CTRL_VALID_BIT); return E_OK; } can you check once whether any issues is there because its not creating Dynamic Entry for the L2 lookup Table ? Re: Dynamic configuration in sja1110 Hello @Atkinson , 1. Yes, the host tools were originally developed for the SJA1110-EVM board. I personally use these scripts with debug prints to verify my understanding of register access. While you cannot run them directly on the S32G-VNP-RDB2 platform, the underlying logic can be adapted, since the S32G accesses the SJA1110 via SPI. 2. If you're looking for SPI read/write implementations for the S32G platform, you have two main options: Refer to the SPI examples provided in the S32G RTD 4.0.0 package. Alternatively, I recommend posting a dedicated question on the NXP S32G Community Forum, where the S32G support team can assist you further. I focus primarily on Automotive Ethernet topics, with limited overlap into platform-specific drivers. 3. If I understand correctly, you're referring to the L2 Lookup Table described in Table 1182 of UM11107. This table consists of six 32-bit registers per entry. You can see this structure reflected in the debug output from the Python script. Best regards, Pavel Re: Dynamic configuration in sja1110 Hi @PavelL  I am having some certain questions 1.) This Debug print of l2_write_lookup_table.py was taken from SJA1110 EVM Board Implementation ryt its not from S32G-VNP RDB Board? and we can't implement l2_write_lookup_table.py in S32G-VNP-RDB32 Board directly  2.)can you provide me the code of SPI_read and Spi_write for integrating with the above code? because in through the implementation in S32G writing it via SPI_Read and SPI_write is doing the operation but unable to see the Dynamic Entry getting added Std_ReturnType spi_read_reg(uint32_t regAddress, uint32_t* regValue) { Std_ReturnType ret; uint32_t TxChBuf[65] = {0}; uint32_t RxChBuf[65] = {0}; uint16_t regCount = 1; Siul2_Dio_Ip_WritePin(SPI_MCU_ES1_CS_AP_PORT, SPI_MCU_ES1_CS_AP_PIN, 0U); ret = getSpiAPCommand(false, regAddress, regCount, TxChBuf, regValue); if (ret != E_OK) { Siul2_Dio_Ip_WritePin(SPI_MCU_ES1_CS_AP_PORT, SPI_MCU_ES1_CS_AP_PIN, 1U); return ret; } ret=Spi_SetupEB(5u, (uint8_t*)TxChBuf, (uint8_t*)RxChBuf, 8u); if (ret == E_OK) { ret=Spi_SyncTransmit(SpiConf_SpiSequence_SpiSequence_sja); if (ret == E_OK) { *regValue = RxChBuf[1]; } } Siul2_Dio_Ip_WritePin(SPI_MCU_ES1_CS_AP_PORT, SPI_MCU_ES1_CS_AP_PIN, 1U); return ret; } Std_ReturnType spi_write_reg(uint32_t regAddress, uint32_t regValue) { Std_ReturnType ret; uint32_t TxChBuf[65] = {0}; uint32_t RxChBuf[65] = {0}; uint16_t regCount = 1; uint32_t regValArray[1] = { regValue }; // Pull chip select LOW Siul2_Dio_Ip_WritePin(SPI_MCU_ES1_CS_AP_PORT, SPI_MCU_ES1_CS_AP_PIN, 0U); ret = getSpiAPCommand(true, regAddress, regCount, TxChBuf, regValArray); if (ret != E_OK) { Siul2_Dio_Ip_WritePin(SPI_MCU_ES1_CS_AP_PORT, SPI_MCU_ES1_CS_AP_PIN, 1U); return ret; } ret=Spi_SetupEB(5u, (uint8_t*)TxChBuf, (uint8_t*)RxChBuf, 8u); if (ret == E_OK) { ret=Spi_SyncTransmit(SpiConf_SpiSequence_SpiSequence_sja); } Siul2_Dio_Ip_WritePin(SPI_MCU_ES1_CS_AP_PORT, SPI_MCU_ES1_CS_AP_PIN, 1U); return ret; } Correct me if i am wrong !! 3.)I have changed the Register address to #define L2_ENTRY0_ADDR 0x00000023 but still i am not able to identify the table which i am trying to add getting reflected when i transmit the message  Re: Dynamic configuration in sja1110 Hello @Atkinson , your code looks good. However, if you want to access dynamic tables by SPI, the entry addresses are without FF and shifted right by 2. As I already mentioned in some of my previous post. So, #define L2_ENTRY0_ADDR 0xFF00008c should be #define L2_ENTRY0_ADDR 0x00000023 But it depends, what your routine spi_write_reg actually does. Here is output of the write_l2_lookup_table.py , incl. my debug prints (tx/rx refers to data what would be seen on SPI wires by oscilloscope or by logic analyzer): DBG spi_tx: ['0x02000290', '0xAABBCCDD'] DBG spi_rx: ['0x02000290', '0x00000000'] DBG spi_read 0x0029 -> 0x00000000 DBG spi_write 0x0023 <- 0x37FFFA00 DBG spi_tx: ['0x80000230', '0x37FFFA00'] DBG spi_write 0x0024 <- 0x119A22AB DBG spi_tx: ['0x80000240', '0x119A22AB'] DBG spi_write 0x0025 <- 0xFF807089 DBG spi_tx: ['0x80000250', '0xFF807089'] DBG spi_write 0x0026 <- 0xFFFFFFFF DBG spi_tx: ['0x80000260', '0xFFFFFFFF'] DBG spi_write 0x0027 <- 0xF1FFFFFF DBG spi_tx: ['0x80000270', '0xF1FFFFFF'] DBG spi_write 0x0028 <- 0x1FFE7EFF DBG spi_tx: ['0x80000280', '0x1FFE7EFF'] DBG spi_write 0x0029 <- 0xD9800000 DBG spi_tx: ['0x80000290', '0xD9800000'] +-------+-------------+-------------------+--------+---------+-------+ | INDEX | DESTPORTS | MACADDR | VLANID | ENFPORT | IOTAG | +-------+-------------+-------------------+--------+---------+-------+ | 256 | 11111111111 | 11:22:33:44:55:66 | 14 | 1 | 1 | +-------+-------------+-------------------+--------+---------+-------+ L2 Lookup Table Entry Written (SW1) Regarding the FAE request, FAE is not on my escalation path. Your company has assigned FAE, so you can contact FAE directly. Best regards, Pavel Re: Dynamic configuration in sja1110 Hi @PavelL  #define L2_ENTRY0_ADDR 0xFF00008c #define L2_ENTRY1_ADDR 0xFF000090 #define L2_ENTRY2_ADDR 0xFF000094 #define L2_ENTRY3_ADDR 0xFF000098 #define L2_ENTRY4_ADDR 0xFF00009C #define L2_ENTRY5_ADDR 0xFF0000A0 #define L2_CTRL_ADDR 0xFF0000A4 Std_ReturnType CreateL2Entry(uint32_t entry[6]) { uint16_t INDEX = 11; uint64_t MACADDR = 0x661122334455; uint64_t MACADDR_MASK = 0xFFFFFFFFFFFF; uint16_t VLANID = 3; uint16_t VLANID_MASK = 0xFFF; uint8_t IOTAG = 0; uint8_t IOTAG_MASK = 0; uint8_t SRCPORT = 5; uint8_t SRCPORT_MASK = 0xF; uint8_t DESTPORTS = 0x02; uint8_t ENFPORT = 1; uint8_t RETAG = 0; uint8_t MIRROR = 0; uint8_t TAKETS = 0; uint16_t MIRR_VLAN = 0xFFF; uint8_t TRAPTOHOST = 0; uint8_t CBSIDIN = 0x3F; uint8_t CBENONDA = 0; uint16_t VLIDX = 0xFFF; uint8_t SA_POLICE = 0; uint8_t DA_POLICE = 0; entry[0] = ((INDEX & 0x03FF) << 1) | ((ENFPORT & 0x1) << 11) | ((DESTPORTS & 0x7FF) << 12) | ((SRCPORT & 0xF) << 23) | ((MACADDR & 0x1F) << 27); entry[1] = (uint32_t)((MACADDR >> 5) & 0xFFFFFFFF); entry[2] = (((MACADDR >> 37) & 0x7FF) << 0) | ((VLANID & 0xFFF) << 11) | ((IOTAG & 0x1) << 23) | ((MACADDR_MASK & 0xFF) << 24); entry[3] = (uint32_t)((MACADDR_MASK >> 😎 & 0xFFFFFFFF); entry[4] = (((MACADDR_MASK >> 40) & 0xFF) << 0) | ((VLANID_MASK & 0xFFF) << 😎 | ((IOTAG_MASK & 0x1) << 20) | ((SRCPORT_MASK & 0xF) << 21) | ((RETAG & 0x1) << 25) | ((MIRROR & 0x1) << 26) | ((TAKETS & 0x1) << 27) | ((MIRR_VLAN & 0xF) << 28); entry[5] = (((MIRR_VLAN >> 4) & 0xFF) << 0) | ((TRAPTOHOST & 0x1) << 😎 | ((CBSIDIN & 0x3F) << 9) | ((CBENONDA & 0x1) << 15) | ((VLIDX & 0xFFF) << 17) | ((SA_POLICE & 0x1) << 29) | ((DA_POLICE & 0x1) << 30); return E_OK; } Std_ReturnType WriteL2LookupEntry(uint8_t swt) { if (swt > 0) return E_NOT_OK; Std_ReturnType ret; uint32_t ctrlReg = 0; uint32_t entry[6]; ret = CreateL2Entry(entry); if (ret != E_OK) return ret; do { ret = spi_read_reg(L2_CTRL_ADDR, &ctrlReg); if (ret != E_OK) return ret; } while (ctrlReg & (1U << 31)); ret = spi_write_reg(L2_ENTRY0_ADDR, entry[0]); if (ret != E_OK) return ret; ret = spi_write_reg(L2_ENTRY1_ADDR, entry[1]); if (ret != E_OK) return ret; ret = spi_write_reg(L2_ENTRY2_ADDR, entry[2]); if (ret != E_OK) return ret; ret = spi_write_reg(L2_ENTRY3_ADDR, entry[3]); if (ret != E_OK) return ret; ret = spi_write_reg(L2_ENTRY4_ADDR, entry[4]); if (ret != E_OK) return ret; ret = spi_write_reg(L2_ENTRY5_ADDR, entry[5]); if (ret != E_OK) return ret; uint32_t ctrlValue = (1U << 31) | (1U << 30) | (1U << 28) | (1U << 27) | (3U << 23); ret = spi_write_reg(L2_CTRL_ADDR, ctrlValue); if (ret != E_OK) return ret; do { ret = spi_read_reg(L2_CTRL_ADDR, &ctrlReg); if (ret != E_OK) return ret; } while (ctrlReg & (1U << 31)); return E_OK; } This was the current implementation for Creating a Dynamic Entry can you cross verify with FAE whether this implementation is correct !! Any other changes need to be done  Re: Dynamic configuration in sja1110 Hello @Atkinson , Answers to your question are related to your application use case. You can create a dynamic entry absolutely anywhere, also in S32G or in SJA1110: transfer the entry in any supported way to the S32G and write it to SJA1110 via SPI, or via Ethernet or, transfer the entry to the SJA1110 via Ethernet and use internal AHB access or, send a custom trigger event (GPIO, Ethernet frame, ...) to the SJA1110, create a dynamic entry there and write the entry via AHB access or, .... or, .... There are examples how to write dynamic entry to the switchcore of SJA1110: via SPI - python script write_l2_lookup_table.py via AHB - source code of ECT server Bets regards, Pavel Re: Dynamic configuration in sja1110 Hi @PavelL  1.) So this change of accessing the register for Dynamic configuration need to be done in S32G or SJA1110 switch ? 2.)if via SJA1110 switch whether reading and writing the register by SPI need to be performed and where this implementation need to be carried in between SWITCH_DRV? 3.) where we can create our Dynamic entry so that it will get append in switch  More Explanation would be great help!! Re: Dynamic configuration in sja1110 Hello @Atkinson , I apologize for late response caused my current workload. I understand it might not seem straightforward at first, but the concept is actually quite simple. The final register address depends on the access method - whether you're accessing it internally via the M7 core over AHB, or externally via the SPI_AP interface. The base addresses differ depending on the access point. The register address is calculated using the base address provided in Table 2 of UM11107. For example, for the switch subsystem, the base address is 0x00000000 for SPI_AP access and 0xFF000000 for AHB access. In your case, the register 0x8C (DYN_BE_LKP_ENTRY0) becomes 0xFF00008C when accessed via AHB. Now, here’s where it might get confusing: the SDK driver defines the following: #define SJA1110_L2_ART_LE_ADDR (0x3fc00023) /**< Address of the l2ArtLockedEntry register *   The SWITCH_DRV_Write routine shifts the address left by 2 bits (<< 2) for internal (AHB) access. For SPI transfers (used in cascaded switch setups), no shift is applied. So, 0x3fc00023 << 2 results in 0xFF00008C.   I hope that with the explanation above, it makes sense now.   Best regards, Pavel Re: Dynamic configuration in sja1110 Hi @PavelL  can you give me the complete address for Reading and writing  Address Name Access Reset Description 8Ch DYN_BE_LKP_ ENTRY0 R/W 0h (FFFFFFFEh) before 8ch  what would be the base address? like for example it will have 0x3fc0008c so for this dynamic entry table we will have a complete address can you give me the complete address for  8Ch DYN_BE_LKP_ ENTRY0 R/W 0h (FFFFFFFEh) 90h DYN_BE_LKP_ ENTRY1 R/W 0h 94h DYN_BE_LKP_ ENTRY2 R/W 0h 98h DYN_BE_LKP_ ENTRY3 R/W 0h 9Ch DYN_BE_LKP_ ENTRY4 R/W 0h A0h DYN_BE_LKP_ ENTRY5 R/W 0h A4h DYN_BE_LKP_CTRL R/W 0h (FF800000h) Re: Dynamic configuration in sja1110 Hello @Atkinson , I'm not aware of any supporting documents - that's a general knowledge, device independent. I have consulted this topic with Copilot and it should be possible to modify sja11xx_ftdi4232.py to use DSPI5 instead of FTDI. Best regards, Pavel Re: Dynamic configuration in sja1110 Hi @PavelL  To use this script with the S32G-VNP-RDB2 or RDB3 board, the FTDI layer would need to be modified to communicate via DSPI5 on the S32G processor. How to do that? is there any supporting documents? Re: Dynamic configuration in sja1110 Hello @Atkinson , Q1: "So since the Linux BSP is pre-installed on the SD Card... will it enable dynamic configuration automatically?" A1: No, the BSP includes the DSA driver, which supports dynamic configuration, but it is not automatically enabled for all use cases. Q2: "For configuring the L2 lookup entry via Dynamically using the write_l2_lookup.py (python evm host tools) whether that process remains same ?or for S32G-VNP-RDB board it will change" A2: The general flow for creating and uploading a dynamic entry remains the same, as described in UM11107 and AN12925. However, the write_l2_lookup_table.py script uses the FTDI driver to access the SJA1110-EVM via USB. To use this script with the S32G-VNP-RDB2 or RDB3 board, the FTDI layer would need to be modified to communicate via DSPI5 on the S32G processor. Q3: "Whether it is possible to interface Laptop & S32G-VNP_RDB32 board creating a Dynamic entry?" A3: Yes, it is possible. You are free to develop custom software running on Linux to handle your own protocol over SPI or Ethernet to configure dynamic entries. Q4: "and one more thing whether SJA1110_SDK_1.0.2 is a main thing needed for implementing RTM1.0.0 would that be fine?" A4: No, it is recommended to use the latest version of SJA1110 SDK 1.0.2 for compatibility and stability. For further support, please contact your FAE or submit a ticket via https://support.nxp.com/s/?language=en_US. Thank you for your understanding. Best regards, Pavel Re: Dynamic configuration in sja1110 Hi @PavelL  So since the Linux BSP is pre-installed on the SD Card if the SD card is getting inserted into the S32G-VNP-RDB board. so whether the BSP which present in SD card which will be enabling Dynamic configuration automatically  For configuring the L2 lookup entry via Dynamically using the write_l2_lookup.py (python evm host tools) whether that process remains same ?or for S32G-VNP-RDB board it will change  If the Process remains same how can we interface laptop & RDB32Board when interfacing it via Laptop and SJA1110 EVM board it will be connected using USB interface which will help to configure it Dynamic entry So in the case of S32G-VNP-RDB32 Board How the interface will be? Whether it is possible to interface Laptop & S32G-VNP_RDB32 board creating a Dynamic entry? and one more thing whether SJA1110_SDK_1.0.2 is a main thing needed for implementing RTM1.0.0 would that be fine ? Re: Dynamic configuration in sja1110 Hello @Atkinson , The Linux BSP is already pre-installed on the SD card delivered with the S32G-VNP-RDB3 board, so no additional action is required in that regard. I assume you have successfully brought up the board (apologies if you already mentioned this in previous messages). The BSP includes the SJA1110 DSA driver, which provides a range of useful features — including support for dynamic L2 lookup table configuration. The DSA driver is enabled by default. As this case has evolved into a multi-domain topic, I’ve reached out to your FAE to discuss how we should proceed further. Best regards, Pavel Re: Dynamic configuration in sja1110 Hi @PavelL  I am currently trying to implement it in S32G-VNP-RDB32 -- SJA1110 Switch  currently, I don't have any firmware on my own  Which Linux BSP need to be utilized  What might be the complete changes need to be done Re: Dynamic configuration in sja1110 Hello @Atkinson , If you're planning to do this from the S32G-VNP-RDB3 board, that changes things significantly. Will you be running the Linux BSP on the board, or do you plan to use your own firmware? Best regards, Pavel Re: Dynamic configuration in sja1110 Hi @PavelL  3. SPI_HAP (Host Access Protocol) The write_l2_lookup_table.py script from the host tools demonstrates how to configure the L2 table dynamically via SPI. This approach can be used by any external MCU or host processor. The logic from this script can also be ported to run directly on the internal M7 core if needed. I am looking to configure an entry via write_l2_lookup_table.py  via how the configuration which we written in write_l2_lookup_table.py file will be moving to the RDB32 Board what interface need to be done from laptop to RDB32Board? what are the communication mechanism through which we can pass our l2 lookup entry to the device (RDB32 Board) can you give me a procedure or where i can find the procedure for implementation  Re: Dynamic configuration in sja1110 Hello @Atkinson , Yes, you're right — when the system boots, the static configuration is automatically loaded from external flash. Let me clarify the concept of dynamic configuration in more detail. The task of dynamic configuration can be split into two parts: Assembling a valid entry — see UM11107, chapter 5.6 "Dynamic configuration" Writing this entry to the switch — see AN12925, chapter 5.1.3.2 "Writing an L2 Lookup Table Entry" There are three interfaces that can be used for this: AHB — via the internal M7 core. SDK support is available, and the ECT server source code can serve as a starting point. SPI_HAP — the host processor assembles a valid entry and writes it to the switch. This is what write_l2_lookup_table.py does. Ethernet — the host processor sends a user-defined message (UDP, TCP, etc.), which is processed by the internal M7 core. The M7 decodes the message, assembles a valid entry, and writes it to the switch — so we’re effectively back to point 1. This is how ECT works internally. Best regards, Pavel Re: Dynamic configuration in sja1110 Hi @PavelL  3. SPI_HAP (Host Access Protocol) The write_l2_lookup_table.py script from the host tools demonstrates how to configure the L2 table dynamically via SPI. This approach can be used by any external MCU or host processor. The logic from this script can also be ported to run directly on the internal M7 core if needed. I am looking to configure an entry via write_l2_lookup_table.py  via how the configuration which we written in write_l2_lookup_table.py file will be moving to the RDB32 Board what interface need to be done from laptop to RDB32Board? what are the communication mechanism through which we can pass our l2 lookup entry to the device (RDB32 Board) can you give me a procedure or where i can find the procedure for implementation  Re: Dynamic configuration in sja1110 Hello @PavelL  As you mentioned I would like to configure the switch_core configuration Dynamically  When a System boots the static configuration which we configured in peripherals is getting loaded  I am looking in a way to configure the Table entry which are configured in Static needs to be configured it via, Dynamically. In either case, there are generally three ways to update the switch configuration dynamically: From the internal M7 core From the host processor via SPI_HAP From the host processor via Ethernet so you are saying these are the only ways of updating the system dynamically ? if these are the only possible way, then configuring it in as a code which i provided will work or will not work ? and also the three process which mentioned here is it same as the ECT & write_l2_lookup_table.py? or these are different one !! Re: Dynamic configuration in sja1110 Hello @Atkinson , Could you please clarify your use case for using a dynamic L2 lookup table? Personally, I would consider using dynamic entries in two typical scenarios: When you want to maintain a common switch configuration across multiple devices and then "personalize" each switch dynamically after power-up. When you need to modify the switch configuration at runtime based on application-specific requirements. In either case, there are generally three ways to update the switch configuration dynamically: From the internal M7 core From the host processor via SPI_HAP From the host processor via Ethernet Does your use case fall into one of these categories, or are you aiming for something different? Best regards, Pavel Re: Dynamic configuration in sja1110 Hello @PavelL  As you mentioned it i tried incorporating the code  can you confirm where do i need to place the code which will help us in creating the entry  Earlier Message you have mentioned there were Two Methods via doing it using ECT (Ethernet configuration Tool)  and SPI_HAP  so these tools and files are needed to process on run -time ryt ?? The code which i shared is which i am trying to implement it without these tools  I am looking to create a Dynamic L2 Lookup Entry whether it is fine to do ?? Regards Atkinson  Re: Dynamic configuration in sja1110 Hello @Atkinson , I apologize for the delayed response due to public holidays. Thank you for sharing your code. I had a quick look, and at first glance, it appears to align with the principles outlined in AN12925, chapter 5.1.3.2 Writing a L2 Lookup table entry. I also noticed that the #define statements seem to be reused from SJA1110.h, which is standard practice. Please note, however, that an in-depth custom code review goes beyond the scope of our complimentary online support. Additionally, the timing and context in which this function should be called are highly application-specific and may vary depending on your system architecture and requirements. Best regards, Pavel Re: Dynamic configuration in sja1110 Hello @PavelL  static status_t wait_for_valid_clear(uint8_t swt) { status_t status; uint32_t ctrl = 0; do { status = SWITCH_DRV_Read(swt, 1, DYN_BE_LKP_CTRL, &ctrl); if (status != STATUS_SUCCESS) return status; } while (ctrl & DYN_BE_LKP_CTRL_VALID_MASK); if (ctrl & DYN_BE_LKP_CTRL_ERROR_MASK) return STATUS_ERROR; return STATUS_SUCCESS; } status_t SJA1110_AddL2LookupEntry_Dynamic(uint8_t swt) { status_t status; // MAC = 66:11:22:33:44:55 uint8_t mac[6] = {0x66, 0x11, 0x22, 0x33, 0x44, 0x55}; uint64_t mac64 = ((uint64_t)mac[0] << 40) | ((uint64_t)mac[1] << 32) | ((uint64_t)mac[2] << 24) | ((uint64_t)mac[3] << 16) | ((uint64_t)mac[4] << 😎 | (uint64_t)mac[5]; // Prepare L2 lookup entry fields uint32_t entry[WORD_COUNT] = {0}; entry[0] = ((5 & 0xF) << 24) | (1 << 11); // SrcPort, DestPorts 1 & 2 entry[1] = (uint32_t)(mac64 & 0xFFFFFFFF); entry[2] = (uint32_t)((mac64 >> 32) & 0xFFFF); entry[2] |= (3 << 16); // VLAN ID = 3 entry[3] = 0; // Optional masks entry[4] = 0; entry[5] = (8 << 4) | (1 << 10); // CB_SID_IN = 8, CB_ON_DA = 1 // Wait until previous operation completes status = wait_for_valid_clear(swt); if (status != STATUS_SUCCESS) return status; // Write L2 entry data to registers status = SWITCH_DRV_Write(swt, WORD_COUNT, DYN_BE_LKP_ENTRY0, entry); if (status != STATUS_SUCCESS) return status; // Construct control register value uint32_t ctrl = DYN_BE_LKP_CTRL_VALID_MASK | DYN_BE_LKP_CTRL_RDWRSET_MASK | (HOSTCMD_WRITE << DYN_BE_LKP_CTRL_HOSTCMD_SHIFT); // Trigger write status = SWITCH_DRV_Write(swt, 1, DYN_BE_LKP_CTRL, &ctrl); if (status != STATUS_SUCCESS) return status; // Wait for operation to complete return wait_for_valid_clear(swt); } Whether this code can be utilized for generating a Dynamic entry ? if this code is correct, where the function needs to be called?? Regards Atkinson  Re: Dynamic configuration in sja1110 Hi @PavelL  #include #include // Define register addresses as per your SoC mapping #define DYN_BE_LKP_ENTRY0 0x000 // Replace with actual address #define DYN_BE_LKP_ENTRY1 0x004 #define DYN_BE_LKP_ENTRY2 0x008 #define DYN_BE_LKP_ENTRY3 0x00C #define DYN_BE_LKP_ENTRY4 0x010 #define DYN_BE_LKP_ENTRY5 0x014 #define DYN_BE_LKP_CTRL 0x018 void insert_l2_unicast_entry(void) { // === INPUTS === uint64_t mac = 0x021122334455ULL; // MAC address uint16_t vlan_id = 3; uint8_t dest_port = 3; // Port 3 uint16_t dest_ports_mask = (1 << dest_port); uint16_t index = 5; // === STEP 1: Wait for previous operation to complete === while (read_register(DYN_BE_LKP_CTRL) & ETHSW_DYN_BE_LKP_CTRL_bValid_MASK); // === STEP 2: Prepare entry fields === uint32_t mac_lo = (uint32_t)(mac & 0xFFFFFFFF); // Lower 32 bits uint32_t mac_hi = (uint32_t)((mac >> 32) & 0xFFFF); // Upper 16 bits uint32_t entry0 = ETHSW_DYN_BE_LKP_ENTRY0_uvEntry_30__0_(0x00000000); uint32_t entry1 = ETHSW_DYN_BE_LKP_ENTRY1_uvEntry_62__31_(mac_lo); uint32_t entry2 = ETHSW_DYN_BE_LKP_ENTRY2_uvEntry_94__63_(mac_hi); uint32_t entry3 = ETHSW_DYN_BE_LKP_ENTRY3_uvEntry_126__95_( ((vlan_id & 0xFFF) << 16) | (dest_ports_mask & 0xFFFF)); uint32_t entry4 = ETHSW_DYN_BE_LKP_ENTRY4_uvEntry_158__127_(0x00000000); // optional flags/reserved uint32_t entry5 = ETHSW_DYN_BE_LKP_ENTRY5_uvEntry_190__159_(index); // === STEP 3: Write entries to DYN registers === write_register(DYN_BE_LKP_ENTRY0, entry0); write_register(DYN_BE_LKP_ENTRY1, entry1); write_register(DYN_BE_LKP_ENTRY2, entry2); write_register(DYN_BE_LKP_ENTRY3, entry3); write_register(DYN_BE_LKP_ENTRY4, entry4); write_register(DYN_BE_LKP_ENTRY5, entry5); // === STEP 4: Trigger WRITE via control register === uint32_t ctrl_val = 0; ctrl_val |= ETHSW_DYN_BE_LKP_CTRL_bValid(1); ctrl_val |= ETHSW_DYN_BE_LKP_CTRL_bWrRdB(1); // Write operation ctrl_val |= ETHSW_DYN_BE_LKP_CTRL_uvHostCommand(0b011); // Host write ctrl_val |= ETHSW_DYN_BE_LKP_CTRL_bValidEntry(1); // Valid entry write_register(DYN_BE_LKP_CTRL, ctrl_val); // === STEP 5: Wait for operation to complete === while (read_register(DYN_BE_LKP_CTRL) & ETHSW_DYN_BE_LKP_CTRL_bValid_MASK); // === STEP 6: Check for error === uint32_t status = read_register(DYN_BE_LKP_CTRL); if (status & ETHSW_DYN_BE_LKP_CTRL_bError_MASK) { // Handle the error // You can print or log this as needed } } whether can i insert this code for Dynamically Writing the data to L2 Lookup Table  Where should i insert this code to test ? Looking forward for your reply  Regards Atkinson Re: Dynamic configuration in sja1110 Hi @PavelL  In the Method of configuring via SPI_HAP  where can i find the write_l2_lookup_table.py? How this needs to be communicated via SPI_HAP? when after the device bootup  In Previously during the static configuration, we have configured it each data via each index? so whether data if static initially configured is fine or none of the static configuration its shouldn't be connected? whether this write_l2_lookup_table.py can you share it? when running this script from where (which port it need to be connected to pass the data) the script will be polling the data? Regards Atkinson  Re: Dynamic configuration in sja1110 Hello @Atkinson , The method of dynamic configuration depends on your use case — it can be performed either by the internal M7 core or externally via SPI. Below is a list of possible solutions: 1. ECT (Ethernet Control Tool) Dynamic configuration via external Ethernet (UDP) frames. The internal firmware running on the M7 core receives the configuration and applies it to the switch core. 2. Modified ECT The ECT source code can be adapted to accept any Ethernet frame format (not just UDP). This allows integration into custom protocols or systems. The internal logic remains the same — the M7 core performs the actual register updates. 3. SPI_HAP (Host Access Protocol) The write_l2_lookup_table.py script from the host tools demonstrates how to configure the L2 table dynamically via SPI. This approach can be used by any external MCU or host processor. The logic from this script can also be ported to run directly on the internal M7 core if needed. All of the above methods follow the same principle described in AN12925, section 5.1.3.2. The register-level flow is identical and includes polling the control register, writing to the entry registers, and triggering the update via the control register. Best regards, Pavel
記事全体を表示
为安装 HSE 闪烁十六进制后,代码不跳转到主系统 您好, 我为 s32K312 移植了 HSE 固件安装示例代码。 我可以在刷新 mcu 之后安装 HSE 固件并在调试模式下运行它,但是当我直接刷新项目的十六进制文件时我遇到了问题,然后它无法安装固件,因为它在 RESET mcu 后它没有跳到主服务器。 我正在安装 IVT。请查看链接器文件和 boot_header.c文件供您参考。 并提供相应的解决方案。 Re: code not jumping to main after flashing hex for hse installation 为了帮助您调试为什么 S32K312 在闪存十六进制文件后不能跳转到主菜单(但在调试模式下可以工作),我们需要关注几个关键方面: IVT 和启动头配置 链接脚本与 IVT/bootloader 对齐 RESET 向量和启动条目行为 可能的监视器RESET或早期故障 既然你已经使用 IVT 移植了 HSE 固件安装,并提到了独立组网 (SA) 十六进制刷新的问题,请分享你的链接脚本。看到这些信息后,我就可以帮助确定是否存在配置错误或缺少设置步骤。 mymilestonecard.com 激活 Re: code not jumping to main after flashing hex for hse installation 如果问题是应用程序在RESET后无法启动,而是在调试模式下运行,则几乎总是由于: IVT 指向错误的 RESET 向量 HSE 固件地址不匹配 链接器未将 IVT/boot_header 放在正确位置 RESET 矢量部分映射不正确 publixsurvey.com Re: code not jumping to main after flashing hex for hse installation 您好, 我移植了为 s32k344 提供的示例代码,检查后发现链接文件与 s32k344 相同。 我在邮件中附上了文件。请检查并告诉我哪里做错了。 Re: code not jumping to main after flashing hex for hse installation 您好, 对于 S32K312,请确保在链接器文件和 boot_header.c 中正确设置了 IVT 和启动配置。检查 HSE GPR 状态寄存器,确认固件是否存在。如果问题仍然存在,请使您的IVT更新流程与恩智浦示例项目保持一致,因为不正确的IVT更新可能会导致启动失败。 Re: code not jumping to main after flashing hex for hse installation 请提供解决方案
記事全体を表示
code not jumping to main after flashing hex for hse installation Hi ,   I have ported the HSE firmware installation example code for s32K312. I am able to install the HSE firmware after flashing the mcu and run it in debug mode but i am facing issue when i am flashing the hex file of the project directly then it is not installing the firmware because it is not jumping to the main after the reset the mcu . I am using the installation with IVT. kindly look the linker file and boot_header.c file for your reference. and provide the solution for the same. Re: code not jumping to main after flashing hex for hse installation To help you debug why your S32K312 is not jumping to main after flashing the hex file (but works in debug mode), we need to focus on a few key areas: IVT and boot header configuration Linker script alignment with IVT/bootloader Reset vector and boot entry behavior Possible watchdog resets or early faults Since you've ported the HSE firmware installation with IVT and mentioned issues with standalone hex flashing, please share your linker script. Once I see those, I can help identify if there are misconfigurations or missing setup steps. mymilestonecard.com activate Re: code not jumping to main after flashing hex for hse installation If the issue is that the application is not starting after reset, but works in debug mode, it's almost always due to: IVT pointing to wrong reset vector HSE firmware address mismatch Linker not placing IVT/boot_header in correct location Reset vector section not mapped correctly publixsurvey.com Re: code not jumping to main after flashing hex for hse installation Hi ,   I had ported the example code given for the s32k344, i have checked and found that the linker file is same with s32k344 . i have attached the files in the message . kindly check and let me know what i am doing wrong. Re: code not jumping to main after flashing hex for hse installation Hi, For the S32K312, ensure the IVT and boot configuration are correctly set in your linker file and boot_header.c. Check the HSE GPR status register to confirm if the firmware is present. If issues persist, align your IVT update process with the NXP sample project, as improper IVT updates can cause boot failures. Re: code not jumping to main after flashing hex for hse installation Kindly provide solution
記事全体を表示
FS85 SPI communication error Hi, I ported the FS8x_S32K144_WatchdogExample this demo in the part about SPI read and write FS85 registers, now the cycle read register M_FLAG, deviceStatus = 0xF0,readData = 0xF014. the specific errors are Wrong number of clock cycles ( <32 or >32) and Error detected in the SPI CRC The CRC8 uses the same function provided by DEMO, why is there an error? How to solve these two errors? Reading register FS_STATES, readData = 0x2003, the state machine corresponding to 03 was not found. FS85 &FS84 回复: FS85 SPI通信报错 Hello  Osker The FS_STATE =5 indicates that RSTB is not released to high, can customer check the RSTB pin level ?    The OV/UV related flag registers are not active at this moment. Any other questions, please let me know. Brs CIndy Wen 回复: FS85 SPI通信报错 Hi, did you follow up on the SPI communication problem with the first chip to find out what caused it. 回复: FS85 SPI通信报错 Hi xuxin User should clear FS_OVUVREG_STATUS by writing all bits to '1',if the faults are triggered again, that is real OV UV fault.  As in FS8510D3 OTP ,ABIST1 is assigned to all the monitors. So if VCOREMON or VMON1~4 reported UV, the   state machine is stuck at ABIST1 state, and can not go to INIT_FS state.  VCOREMON should be connected to BUCK1, VMON1~4 should used to monitor regulators in your schematic. Please refer to the FS85 DEMO board. Please contact local DISTI FAE for more help if debugging support is needed. Brs Cindy Wen 回复: FS85 SPI通信报错 Hi Xuxin Please read the FS_OVUVREG_STATUS register.  Please check if VCOREMON is connected to BUCK1 output.  Check whether the VDDIO voltage is the  level defined by OTP.   Check whether VMON1~4 are 0.8V. Which part number are you using? If you are using specific OTP defined by your company , please share the OTP file to me .  Brs Cindy Wen 回复: FS85 SPI通信报错 Hi Cindy, I just asked my hardware engineer to measure the PGOOD and RSTB pins and both are low, the hardware engineer said that pull-up resistors have been added but did not succeed in pulling them high. Do I need to configure any registers in software next? Or is it simply a hardware issue? 回复: FS85 SPI通信报错 Hi Xuxin If FS state can not enter INIT_FS,I think the PGOOD/RSTB are not released due to some faults.  Please check whether the PGOOD/RSTB are released to high or not? If they are low, please check if there is OV/UV faults on board. Brs Cindy Wen 回复: FS85 SPI通信报错 Hello Cindy. I followed your suggestion and read the following registers after writing 1 to the corresponding bit of M_FLAG, and MISO returned the data as shown, and FS_STATS is still 0x2003. 回复: FS85 SPI通信报错 Hello Xuxin Could you clear these below bits by writing ‘1’  to these bits and see if the faults will be triggered again.  If these faults were triggered only when power on reset, we can ignore them, as they will not happen during the normal operation.   Brs Cindy Wen 回复: FS85 SPI通信报错 Hello, Tomas. Here is the SPI waveform I read from the SPI waveform from FS_STATES register. 1 is CLK, 2 is CS, 3 is MOSI, 4 is MISO. the MOSI I parsed from the waveform is 0xAC,00,00,F4, and the MISO is 0x70,20,03,14. it's really not 0x2006. does it have something to do with the fact that I'm in debug mode all the time? 回复: FS85 SPI通信报错 Hello Xuxin, Good to know that the original error disappeared. I am not aware of the fail-safe state machine state code of 0x03. It should be indeed 0x06. Could you please share a scope shot illustrating the read of the FS_STATES register? BRs. Tomas 回复: FS85 SPI通信报错 Hi Tomas, After I replaced a new FS85 chip, the Wrong number of clock cycles ( <32 or >32) and Error detected in the SPI CRC disappeared. I wrote DBG_EXIT in the FS_STATES register, but when I read the FS_STATES register, readData = 0x2003, not 0x2006, what does this 03 stand for? How to enter INIT_FS state? 回复: FS85 SPI通信报错 As shown, 1 is MOSI, 2 is CLK, 3 is CS, 4 is MISO. i read the FS_DIAG_SAFETY register, and the MOSI is 0xA8,0x00,0x00,0xF2. the MISO values are 0xF0,0x04,0x29,0xD9. 0xF2 and 0xD9 are the CRC values, which are the same as the ones i calculated with the CRC8 tool! the same as the values I calculated with the CRC8 tool. Also, I don't know how to confirm the values in table100. 回复: FS85 SPI通信报错 Hello Xuxin, If you have an oscilloscope or a logic analyzer, could you please share screenshots illustrating both SPI write and read transactions? Also please double check that all SPI timing requirements as shown in Table 100 of the datasheet are met. BRs, Tomas  回复: FS85 SPI通信报错 SPI configuration is as follows: clock 20Mhz, chip select low active, MSB transmission, clock idle low, sampling on the second edge of the clock, SPI frame length is 32 bits, baud rate is 1000000
記事全体を表示
LPC5536 MCAN RF0F割り込み こんにちは、 IE:RF0FE が 0 に設定されているのに、なぜこの割り込み (IR:RF0F) が発生するのでしょうか? 私は IE レジスタを監視してこれを理解しようとしていますが、0x3800000 から 0x3800001 に変更されており、ビット番号 3 はいつでも設定されていません。 よろしくお願いいたします。 クリスティアーノ・ロドリゲス Re: LPC5536 MCAN RF0F Interrupt こんにちは@microcris kMCAN_RxFifo0FullFlag のフラグは、Rx FIFO オーバーフローを回避するためのものです。 よろしくお願いします。 アリス Re: LPC5536 MCAN RF0F Interrupt こんにちは@Alice_Yang ! ご回答ありがとうございます。 IE レジスタではすべて正常です。私は、IE:RF0FE (ビット番号 2 であり、ビット番号 3 ではありません) が設定されておらず、IR:RF0F がトリガーされていると述べました。ハードウェア的なものであれば問題ありません。 受信したメッセージごとに、kStatus_MCAN_TxIdle と kStatus_MCAN_UnHandled の結果が kMCAN_RxFifo0FullFlag に設定されるのは少し面倒です。 Re: LPC5536 MCAN RF0F Interrupt こんにちは@microcris ご質問ありがとうございます。 フラグ (IR:RF0F) はハードウェアによって自動的に設定され、割り込み有効レジスタ IE:RF0FE とは関係ありません。IE レジスタは、割り込みハンドラを実行するように CPU に通知します。IE ビット 0 を 0 から 1 に変更する場合は、コードをデバッグして、このビットがどこで変更されているかを確認してください。 よろしくお願いします。 BR アリス
記事全体を表示
FS85 SPI通信报错 你好,我移植了FS8x_S32K144_WatchdogExample这个demo中关于SPI读写FS85寄存器的部分,现在周期读取寄存器M_FLAG,deviceStatus=0xF0,readData = 0xF014.具体错误为 Wrong number of clock cycles (<32 or >32)和Error detected in the SPI CRC CRC8用的也是DEMO提供的函数,为什么会报错呢?这两个错误该怎么解决呢? 读取寄存器FS_STATES,readData = 0x2003,没有找到03对应的状态机。 FS85&FS84 回复: FS85 SPI通信报错 你好,奥斯克 FS_STATE =5 表示 RSTB 未版本到高电平,客户能否查看 RSTB 引脚电平?此时,与 OV/UV 相关的标志寄存器未激活。 如有其他问题,请告诉我。 BRS CIndy Wen 回复: FS85 SPI通信报错 你好,请问第一块芯片出现的SPI通讯问题,后续有查明是什么原因导致的吗。 回复: FS85 SPI通信报错 你好 xuxin 用户应通过将所有位写入 “1” 来清除 FS_OVUVREG_STATUS,如果故障再次触发信号,那就是真正的 OV 紫外线故障。 与 FS8510D3 OTP 一样,ABIST1 被分配给所有监测。因此,如果 VCOREMON 或 VMON1~4 报告 UV,状态机就会停留在 ABIST1 状态,无法进入 INIT_FS 状态。 VCOREMON 应连接到 BUCK1,应使用 VMON1~4 来监测原理图中的稳压器。请参阅 FS85 演示板。 如果需要调试支持,请联系当地的 DISTI FAE 以获得更多帮助。 BRS 辛迪-温 回复: FS85 SPI通信报错 你好,徐新 请读取 FS_OVUVREG_STATUS 寄存器。 请检查 VCOREMON 是否连接至 BUCK1 输出端。 检查 VDDIO 电压是否符合 OTP 规定的电平。 检查 VMON1~4 是否为 0.8V。 您使用的是哪个零件编号?如果您使用的是贵公司定义的特定 OTP,请与我共享 OTP 文件。 BRS 辛迪-温 回复: FS85 SPI通信报错 你好Cindy, 我刚才请硬件工程师测量了PGOOD和RSTB引脚,两个都是低电平,硬件工程师说已经加了上拉电阻,但是没成功拉高。接下来需要软件配置什么寄存器吗?还是单纯的硬件问题? 回复: FS85 SPI通信报错 你好,徐新 如果 FS 状态无法进入 INIT_FS,我认为由于某些故障,PGOOD/RSTB 没有版本。 请检查 PGOOD/RSTB 是否版本到高位? 如果它们很低,请检查板上是否有 OV/UV 故障。 BRS 辛迪-温 回复: FS85 SPI通信报错 你好Cindy, 我按照你的建议,在M_FLAG对应位写1后又读取了如下寄存器,MISO返回数据如图,FS_STATS还是0x2003. 回复: FS85 SPI通信报错 你好,徐新 您能否通过向这些位写入 “1” 来清除以下这些位,看看故障是否会再次触发信号。如果这些故障仅在上电复位时触发,我们可以忽略它们,因为它们不会在正常运行期间发生。 BRS 辛迪-温 回复: FS85 SPI通信报错 你好,Tomas。 下面是我读取FS_STATES寄存器的SPI波形。1是CLK,2是CS,3是MOSI,4是MISO。我从波形解析到的MOSI是0xAC,00,00,F4,MISO是0x70,20,03,14。确实不是0x2006,这跟我一直在debug mode有关吗? 回复: FS85 SPI通信报错 你好,徐新、 很高兴知道原来的错误消失了。我不知道 0x03 的故障保护状态机状态码。实际上应该是 0x06。能否分享一个示波器截图,说明 FS_STATES 寄存器的读取情况? BRs.托马斯 回复: FS85 SPI通信报错 你好Tomas, 我更换了一片新的FS85芯片后,Wrong number of clock cycles (<32 or >32)和Error detected in the SPI CRC消失了。我在FS_STATES寄存器写入DBG_EXIT,但是读取寄存器FS_STATES,readData = 0x2003,并不是0x2006,这个03代表什么呢?怎样进入INIT_FS状态? 回复: FS85 SPI通信报错 如图,1是MOSI,2是CLK,3是CS,4是MISO。我读取了FS_DIAG_SAFETY寄存器,MOSI是0xA8,0x00,0x00,0xF2。MISO值是0xF0,0x04,0x29,0xD9。0xF2和0xD9是CRC值,跟我用CRC8工具计算的值是一样的。 另外,我不知道该怎么确认table100中的数值。 回复: FS85 SPI通信报错 你好,徐新、 如果您有示波器或逻辑分析仪,能否分享说明 SPI 写入和读取事务的截图?另外,请仔细检查是否符合数据表表 100 中所示的所有 SPI 时序要求。 BRs, Tomas 回复: FS85 SPI通信报错 SPI配置如下:时钟20Mhz,片选低有效,MSB传输,时钟空闲低电平,在时钟第二个边沿采样,SPI帧长度为32位,波特率为1000000
記事全体を表示
HAB i.MX28 Invalid Certificate Hi   I am having a problem with a Freescale imx28 to get HAB (High Assurance Boot) working with U-Boot.   What I have done is that I have started with a mainline U-Boot (v2016.01) and I have added/modified a few hab-related items. The main reason for choosing a late U-Boot is that Marek Vasut has added support to generate the IVT by building U-Boot using "make u-boot-signed.sb"   * board/freescale/mx28evk/sign/u-boot-spl.csf * board/freescale/mx28evk/sign/u-boot.csf * board/freescale/mx28evk/hab.h * board/freescale/mx28evk/hab_types.h * board/freescale/mx28evk/mx28evk.c   I have attached all these files to the post as a reference. hab.h and hab_types.h have been stolen from https://community.freescale.com/thread/306378 where Christopher Preschern has done a really good job describing his problems and solutions.   I used CST 2.3.1 to generate a pki tree. I read today that all CST versions after 2.0.0 are broken on the i.MX28. http://lists.denx.de/pipermail/u-boot/2015-November/234717.html   I have posted to the support to get access to BLN_CST_MAIN_02.00.00 and will hopefully soon get that CST version to try. At the time of writing I have not verified if that is the cause of my problems.   I have tried to generate both 1024 bit keys and 2048 bit keys with the same result. I generated the srk_table.bin and srk_fuses.bin using srktool in the CST. $ srktool -h 4 -t srk_table.bin -e srk_fuses.bin -d sha256 -c crts/SRK1_sha256_2048_65537_v3_ca_crt.pem -f 1   The following files have been copied from the cst tool to the u-boot root directory. * CSF1_1_sha256_2048_65537_v3_usr_crt.pem * IMG1_1_sha256_2048_65537_v3_usr_crt.pem * srk_table.bin * srk_fuses.bin * key_pass.txt   Once all this was in placed I built and ran it using $ make mrproper $ make mx28evk_nand_config $ make u-boot-signed.sb $ sudo mxsldr u-boot-signed.sb   I get the following result: --------- HAB Event 1 ----------------- event data:     0xdb 0x00 0x14 0x40 0x33 0x21 0xc0 0x00     0xbe 0x00 0x0c 0x00 0x03 0x17 0x00 0x00     0x00 0x00 0x00 0x50 (HAB_INV_CERTIFICATE 0x21)   --------- HAB Event 2 ----------------- event data:     0xdb 0x00 0x14 0x40 0x33 0x0c 0xa0 0x00     0x00 0x00 0x00 0x00 0x00 0x00 0x80 0x00     0x00 0x00 0x00 0x20 (HAB_INV_ASSERTION 0x0C)   --------- HAB Event 3 ----------------- event data:     0xdb 0x00 0x14 0x40 0x33 0x0c 0xa0 0x00     0x00 0x00 0x00 0x00 0x00 0x00 0x10 0x00     0x00 0x00 0x00 0x04 (HAB_INV_ASSERTION 0x0C)   --------- HAB Event 4 ----------------- event data:     0xdb 0x00 0x14 0x40 0x33 0x21 0xc0 0x00     0xbe 0x00 0x0c 0x00 0x03 0x17 0x00 0x00     0x00 0x00 0x00 0x50 (HAB_INV_CERTIFICATE 0x21)   --------- HAB Event 5 ----------------- event data:     0xdb 0x00 0x14 0x40 0x33 0x0c 0xa0 0x00     0x00 0x00 0x00 0x00 0x40 0x00 0x10 0x00     0x00 0x00 0x00 0x20 (HAB_INV_ASSERTION 0x0C)   --------- HAB Event 6 ----------------- event data:     0xdb 0x00 0x14 0x40 0x33 0x0c 0xa0 0x00     0x00 0x00 0x00 0x00 0x40 0x00 0x20 0x00     0x00 0x00 0x00 0x04 (HAB_INV_ASSERTION 0x0C)   We get two invalid certificates. These are probably from u-boot-spl and u-boot. I am guessing the asserts are the execution of the unverified code.   Here are my questions: 1. Invalid Certificate, does this mean that it does not conform to the x509 standard or does this mean that it is indeed a certificate but does not match the SRK_HASH written in the fuses (Bank 4 Word 0..7)   2. When writing the fuses for the SRK_HASH I am unsure what goes where. I have a fuse file that looks like this: $ od -t x1 srk_fuses.bin 0000000 b4 d9 54 14 bc 39 da 51 4e 1d 42 d8 be 57 88 22 0000020 1d ca 3b f3 28 1f 3f 04 3f 0c 4b 34 8a a4 2b 57   What should then be written to Bank 4 Word 0: Should it be b4d95414 or should it be 1454d9b4? I have seen guides online that indicate the latter saying that it should be written in the same order as if you read the file in 4 byte words: $ od -t x4 srk_fuses.bin 0000000 1454d9b4 51da39bc d8421d4e 228857be 0000020 f33bca1d 043f1f28 344b0c3f 572ba48a   If I use otp_burner.py (which only works on 32 bit systems) and order it to print the result I get the following which also strengthens this theory. $ python otp_burner.py -i bit_settings.txt -o bit_settings.sb --srk srk_fuses.bin -a -p   Bank 0          Bank 1          Bank 2          Bank 3          Bank 4 0: 0x00000000   0: 0x00000000   0: 0x00000000   0: 0x00000000   0: 0x1454d9b4 1: 0x00000000   1: 0x00000000   1: 0x00000000   1: 0x00000000   1: 0x51da39bc 2: 0x00000000   2: 0x00000000   2: 0x00000000   2: 0x00000000   2: 0xd8421d4e 3: 0x00000000   3: 0x00000000   3: 0x00000000   3: 0x00000000   3: 0x228857be 4: 0x00000000   4: 0x00000000   4: 0x00000000   4: 0x00000000   4: 0xf33bca1d 5: 0x00000000   5: 0x00000000   5: 0x00000000   5: 0x00000000   5: 0x043f1f28 6: 0x00000000   6: 0x00000000   6: 0x00000000   6: 0x00000000   6: 0x344b0c3f 7: 0x00000000   7: 0x00000000   7: 0x00000000   7: 0x00000000   7: 0x572ba48a   So once more it indicates that the latter option is the correct one.   However the documentation seems to indicate the other alternative: HABCST_UG.pdf page 30: The SRK1_2_3_4_fuse.bin file from the example in the previous section has the following contents: 93ea61d0bd30ffb62aba0b9d5e144d082dd7faeb39223d9e3f9a22a06429895a This hash value must be burned to the SoC efuses in the following order: SRK_HASH[255:248] = 0x93 SRK_HASH[247:240] = 0xea SRK_HASH[239:232] = 0x61 ... SRK_HASH[15:8] = 0x89 SRK_HASH[7:0] = 0x5a   i.MX28 Reference page 957: HW_OCOTP_SRK0: 0x8002C220:31:0 Super Root Key hash value bits 255-254 (Typo in document, should be 224 not 254) HW_OCOTP_SRK1: 0x8002C230:31:0 Super Root Key hash value bits 223-192 HW_OCOTP_SRK2: 0x8002C240:31:0 Super Root Key hash value bits 191-160 HW_OCOTP_SRK3: 0x8002C250:31:0 Super Root Key hash value bits 159-128 HW_OCOTP_SRK4: 0x8002C260:31:0 Super Root Key hash value bits 127-96 HW_OCOTP_SRK5: 0x8002C270:31:0 Super Root Key hash value bits 95-64 HW_OCOTP_SRK6: 0x8002C280:31:0 Super Root Key hash value bits 63-32 HW_OCOTP_SRK7: 0x8002C290:31:0 Super Root Key hash value bits 31-0   I interpret this as HW_OCOTP_SRK0 should have the value 0x93ea61d0 but as said, that goes against the guides I have found.   I would like if anyone could confirm this one way or another to limit the amount of devices I have to write the wrong values to.   And yes, I am fully aware that any device signed with these keys is not secure since I am handing out every single bit that has been generated. These keys are debug and development keys only.   Many thanks in advance, Per Smitt Original Attachment has been moved to: burned_certs.tar.gz Original Attachment has been moved to: srk_table.bin.zip Original Attachment has been moved to: srk_fuses.bin.zip Original Attachment has been moved to: mx28evk.c.patch.zip Original Attachment has been moved to: u-boot.csf.zip Original Attachment has been moved to: hab_types.h.zip Original Attachment has been moved to: hab.h.zip Original Attachment has been moved to: u-boot-spl.csf.zip Original Attachment has been moved to: mx28evk.c.zip i.MX2x Re: HAB i.MX28 Invalid Certificate Does the current version of cst (4.0.1) work with imx28? If not, can use send me download link to cst2.0.0? -Jari Re: HAB i.MX28 Invalid Certificate Hello, I send You email with CST 2 link. Hope it helps. Regards, Yuri. Re: HAB i.MX28 Invalid Certificate Hi Per, Where can I download the CST 2.0.0 ? In freescale's webisite now it is cst-2.3.2. I want to sign my eboot for i.MX28. Re: HAB i.MX28 Invalid Certificate I have now managed to test the CST 2.0.0 and HAB works. Anything after 2.0.0 is broken for the i.MX28 which is really a shame. It should be written in the release notes and manual a large warning that it doesn't work with the i.MX28 so engineers don't have to waste days on debugging and searching for the reason why things aren't working. So to sum up my problems so others can benefit from my experience: Problem 1: Use CST 2.0.0 Anything later breaks HAB for i.MX28.The software package name is BLN_CST_MAIN_02.00.00. Problem 2: CST 2.0.0 only works on 32 bit systems To get CST 2.0.0 to work I installed ubuntu32. I used vagrant to quickly setup an ubuntu server with VirtualBox. VagrantFile with configuration is attached. Problem 3: CST 2.0.0 takes 20 minutes to execute without an entropy generator To solve the CST entropy problem I had to install rngtools. $ sudo apt-get install rng-tools Problem 4: make u-boot-signed.sb failed due to lacking keys This was my bad. In the above post I had only copied CSF1 and IMG1 certificates to the U-Boot root directory. The private keys are also needed. Problem 5: How to write the fuses otp_burner.py is broken on 64 bit systems. BitInit.exe can apparently work on some Windows XP systems, but I didn't manage to get it to work in either Windows 7 64 bit or Windows XP 32 bit. Instead of these faulty tools use the Linux command od. $ od -t x4  ../crts/SRK_1_2_3_4_fuse.bin 0000000 d7dd02f7 596a91bd b7fb2ec3 09525b17 0000020 6fe30579 0bb67f9e 7e53c7e4 44f06a93 These values can then be written with the MfgTool: Burn Word 0 of SRK hash field in OTP Or with the fuse command in U-Boot: fuse prog 4 0 d7dd02f7 596a91bd b7fb2ec3 09525b17 6fe30579 0bb67f9e 7e53c7e4 44f06a93 Add #define CONFIG_CMD_FUSE to mx28evk.h in U-Boot to compile in fuse support. Or write them manually with BitBurner.exe from the Freescale OTP package. The one OTP tool that actually worked like a charm. Problem 6: Shared Drive I made the mistake to build U-Boot on a shared drive in Virtual Box. Big mistake. It was significantly slower and the last step fails saying that mkimage cannot map u-boot-signed.sb. Simply avoid working on a shared drive and you are good. Conclusion: These steps combined with my post above should get HAB to work on the iMX28. At least it is working like a charm for me. I even put HAB to closed and verified that unsigned software would not execute. One final note is that to build U-Boot on the 32 bit ubuntu server you obviously need to get a 32 bit tool chain. You also need to install libssl-dev and some other packages to get  U-Boot to build. But if you have gotten this far compiling U-Boot is the least of your concerns. Re: HAB i.MX28 Invalid Certificate Trust me I would have loved to use the tools described there as a baseline to know how it is supposed to look. Unfortunately that's where the problems start. otp_burner.py - Does not work on 64 bit systems. I installed a 32bit ubuntu server in virtual box and ran it there. It is with that tool I have a good indication how the fuses should be set. BitInit.exe - This tool crashes under Windows 7 64 bit and Windows XP 32 bit. Since it keeps crashing I cannot use it for reference. BitBurner.exe - This tool requires you to write the fuses manually. Pretty much like MFG tool you need to know the value the fuses should have to use this tool. It is because these tools couldn't give me a 100% certain answer that I asked about the fuses. I am 95% certain how it is supposed to be but since writing the fuses is final I wanted to have some external verification. I am right now preparing a 32 bit tool chain since the CST 2.0.0 that you gave me only works under 32bit Linux. Many thanks for the tool, and I will report my success or failure as soon as I have tried it. I wonder though, are customers and developers who use these tools expected to have less than 4GB of RAM and use 32 bit systems? Re: HAB i.MX28 Invalid Certificate Hello, It may be recommended just to follow section 6 (Manage the electrical fuses) of app note AN4555 (Secure Boot with i.MX28 HAB Version 4). Have a great day, Yuri ----------------------------------------------------------------------------------------------------------------------- Note: If this post answers your question, please click the Correct Answer button. Thank you! -----------------------------------------------------------------------------------------------------------------------
記事全体を表示
HAB i.MX28 无效证书 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> HI   我在使用飞思卡尔 imx28 时遇到了问题,无法让 HAB(高度保证启动)与 U-Boot 配合使用。   我所做的是我从主线 U-启动 (v2016.01) 开始我还添加/修改了一些与居住相关的项目。选择较晚的 U-Boot 的主要原因是 Marek Vasut 通过使用 " make u-boot-signed.sb " 构建 U-Boot 来增加对生成 IVT 的支持   * 板/freescale/mx28evk/sign/u-启动-spl.csf * 板/freescale/mx28evk/sign/u-启动.csf * 板/freescale/mx28evk/hab.h * 板/freescale/mx28evk/hab_types.h * 板/freescale/mx28evk/mx28evk.c   我已将所有这些文件附在帖子中作为参考。hab.h 和 hab_types.h已从https://community.freescale.com/thread/306378克里斯托弗-普雷舍恩(Christopher Preschern)在该书中很好地描述了他的问题和解决方案。   我使用 CST 2.3.1 生成了一棵 pki 树。我今天看到消息说,所有 2.0.0 之后的 CST 版本在 i.MX28 上都被破解了。 http://lists.denx.de/pipermail/u-boot/2015-November/234717.html   我已向技术支持部门提交了 BLN_CST_MAIN_02.00.00 的访问权限,希望很快就能得到该 CST 版本供试用。在撰写本报告时,我尚未证实这是否是造成我的问题的原因。   我曾尝试生成 1024 位密钥和 2048 位密钥,结果都一样。 我使用 CST 中的 srktool 生成了 srk_table.bin 和 srk_fuses.bin。 $ srktool -h 4 -t srk_table.bin -e srk_fuses.bin -d sha256 -c crts/SRK1_sha256_2048_65537_v3_ca_crt.pem -f 1   以下文件已从 cst 工具复制到 u-启动 根目录。 * CSF1_1_sha256_2048_65537_v3_usr_crt.pem * IMG1_1_sha256_2048_65537_v3_usr_crt.pem * srk_table.bin * srk_fuses.bin * key_pass.txt   所有这些都准备就绪后,我使用它来版本和运行它 $ make mrproper $ make mx28evk_nand_config $ make u-启动-signed.sb $ sudo mxsldr u-启动-signed.sb   结果如下 --------- HAB 事件 1 ----------------- 事件数据: 0xdb 0x00 0x14 0x40 0x33 0x21 0xc0 0x00 0xbe 0x00 0x0c 0x00 0x03 0x17 0x00 0x00 0x00 0x00 0x00 0x50 (HAB_INV_CERTIFICATE 0x21)   --------- HAB Event 2 ----------------- 事件数据: 0xdb 0x00 0x14 0x40 0x33 0x0c 0xa0 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x20 (HAB_INV_ASSERTION 0x0C)   --------- HAB Event 3 ----------------- 事件数据: 0xdb 0x00 0x14 0x40 0x33 0x0c 0xa0 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x10 0x00 0x00 0x00 0x00 0x04 (HAB_INV_ASSERTION 0x0C)   --------- HAB Event 4 ----------------- 事件数据: 0xdb 0x00 0x14 0x40 0x33 0x21 0xc0 0x00 0xbe 0x00 0x0c 0x00 0x03 0x17 0x00 0x00 0x00 0x00 0x00 0x50 (HAB_INV_CERTIFICATE 0x21)   --------- HAB Event 5 ----------------- 事件数据: 0xdb 0x00 0x14 0x40 0x33 0x0c 0xa0 0x00 0x00 0x00 0x00 0x00 0x40 0x00 0x10 0x00 0x00 0x00 0x00 0x20 (HAB_INV_ASSERTION 0x0C)   --------- HAB Event 6 ----------------- 事件数据: 0xdb 0x00 0x14 0x40 0x33 0x0c 0xa0 0x00 0x00 0x00 0x00 0x00 0x40 0x00 0x20 0x00 0x00 0x00 0x00 0x04 (HAB_INV_ASSERTION 0x0C)   我们得到了两份无效证书。这些可能来自 u-boot-spl 和 u-boot。我猜测断言是未验证代码的执行。   以下是我的问题: 1。证书无效,这是否意味着它不符合 x509 标准,还是意味着它确实是证书但与熔丝中写的 SRK_HASH 不匹配(Bank 4 Word 0.. 7)   2。在为 SRK_HASH 编写熔丝时,我不确定会发生什么。 我有一个看起来像这样的熔丝文件: $ od -t x1 srk_fuses.bin 0000000 B4 D9 54 14 BC 39 DA 51 4E 1D 42 D8 BE 57 88 22 0000020 1D CA 3B F3 28 1F 3F 04 3F 0C 4B 34 8A A4 2B 57   然后应向第 4 组字 0 写入什么内容: 应该是b4d95414还是1454d9b4? 我在网上看到过指南,其中指出后者说应该按照与你用 4 字节字节的字读取文件相同的顺序编写: $ od -t x4 srk_fuses.bin 00000001454D9B451DA39BC D8421D4E 228857BE 0000020 F33BCA1D 043F1F28 344B0C3F 572BA48A   如果我使用 otp_burner.py(仅适用于 32 位系统)并命令它打印结果,会得到以下结果,这也加强了我的理论。 $ python otp_burner.py -i bit_settings.txt -o bit_settings.sb --srk srk_fuses.bin -a -p   银行 0 银行 1 银行 2 银行 3 银行 4 0: 0x00000000 0: 0x00000000 0: 0x00000000 0: 0x00000000 0:0x1454d9b4 1: 0x00000000 1: 0x00000000 1: 0x00000000 1: 0x00000000 1: 0x51da39bc 2: 0x00000000 2: 0x00000000 2: 0x00000000 2: 0x00000000 2: 0xd8421d4e 3: 0x00000000 3: 0x00000000 3: 0x00000000 3: 0x00000000 3: 0x228857be 4: 0x00000000 4: 0x00000000 4: 0x00000000 4: 0x00000000 4: 0xf33bca1d 5: 0x00000000 5: 0x00000000 5: 0x00000000 5: 0x00000000 5: 0x043f1f28 6: 0x00000000 6: 0x00000000 6: 0x00000000 6: 0x00000000 6: 0x344b0c3f 7: 0x00000000 7: 0x00000000 7: 0x00000000 7: 0x00000000 7: 0x572ba48a   因此,这再次表明后一种选择是正确的。   不过,文件似乎显示了另一种选择: HABCST_UG.pdf 第 30 页: 上节示例中的 SRK1_2_3_4_fuse.bin 文件内容如下: 93ea61d0bd30ffb62aba0b9d5e144d082dd7faeb39223d9e3f9a22a06429895a 必须按照以下顺序将哈希值烧录到 SoC 的保险丝中: SRK_HASH[255:248] = 0x93 SRK_HASH[247:240] = 0xea SRK_HASH[239:232] = 0x61 ... SRK_HASH[15:8] = 0x89 SRK_HASH[7:0] = 0x5a   i.MX28 参考页面 957: HW_OCOTP_SRK0:0x8002C220:31:0 超级根密钥哈希值位 255-254 (文件中有错字,应为 224 而非 254) HW_OCOTP_SRK1:0x8002C230:31:0 超级根密钥哈希值第 223-192 位 HW_OCOTP_SRK2:0x8002C240:31:0 超级根密钥哈希值第 191-160 位 HW_OCOTP_SRK3:0x8002C250:31:0 超级根密钥哈希值第 159-128 位 HW_OCOTP_SRK4:0x8002C260:31:0 超级根密钥哈希值第 127-96 位 HW_OCOTP_SRK5:0x8002C270:31:0 超级根密钥哈希值第 95-64 位 HW_OCOTP_SRK6:0x8002C280:31:0 超级根密钥哈希值第 63-32 位 HW_OCOTP_SRK7:0x8002C290:31:0 超级根密钥哈希值第 31-0 位   我的理解是,HW_OCOTP_SRK0 的值应该是 0x93ea61d0,但如前所述,这与我找到的指南相悖。   我想知道是否有人能以一种或另一种方式确认这一点,以限制我必须向其写入错误值的设备数量。   是的,我完全意识到任何使用这些密钥签名的设备都是不安全的,因为我会分发生成的每一位。这些密钥仅用于调试和开发。   非常感谢、 佩尔-斯密特 原始附件已移至:burned_certs.tar.gz 原始附件已移至:srk_table.bin.zip 原始附件已移至:srk_fuses.bin.zip 原始附件已移至:mx28evk.c.patch.zip 原始附件已移至:u-启动oot.csf.zip 原始附件已移至:hab_types.h.zip 原始附件已移至:hab.h.zip 原始附件已移至:u-启动-spl.csf.zip 原始附件已移至:mx28evk.c.zip i.MX2x Re: HAB i.MX28 Invalid Certificate 当前版本的 cst(4.0.1)能与 imx28 一起使用吗?如果没有,能否将 cst2.0.0 的下载链接发送给我? -Jari Re: HAB i.MX28 Invalid Certificate <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 你好 我给您发送了带有 CST 2 链接的电子邮件。 希望对你有所帮助。 此致, 尤里。 Re: HAB i.MX28 Invalid Certificate <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 嗨,佩尔、 在哪里可以下载 CST 2.0.0? 在飞思卡尔的网站上,现在是 cst-2.3.2。 我想在 i.MX28 的电子启动器上签名。 Re: HAB i.MX28 Invalid Certificate <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 我现在已经成功测试了 CST 2.0.0,HAB 可以正常工作。对于 i.MX28 而言,2.0.0 版之后的任何版本都已失效,这实在令人遗憾。它应该写在版本说明和手册中,警告它不适用于i.MX28,这样工程师就不必浪费几天时间进行调试和寻找无法运行的原因。 因此,总结一下我的问题,以便其他人能从我的经验中受益: 问题 1:使用 CST 2.0.0 以后任何东西都会破坏 i.mx28 的 HAB。代码包的名称是 BLN_CST_MAIN_02.00.00。 问题 2:CST 2.0.0仅适用于 32 位系统 为了让 CST 2.0.0 正常工作,我安装了 ubuntu32。我用 vagrant 通过 VirtualBox 快速安装了一个 ubuntu 服务器。已附上包含配置的 VagrantFile。 问题 3:CST 2.0.0 在没有熵发生器的情况下需要 20 分钟才能执行 为了解决 CST熵问题,我必须安装 rngtools。 $ sudo apt-get install rng-tools 问题 4:由于缺少密钥,使 u-启动-signed.sb 失败 这是我的错。在上面的文章中,我只将 CSF1 和 IMG1 证书复制到 U-启动 根目录中。还需要私钥。 问题 5:如何写熔丝 在 64 位系统上,otp_burner.py 已损坏。BitInit.exe 显然可以在某些 Windows XP 系统上运行,但我没能让它在 Windows 7 64 位和 Windows XP 32 位系统上运行。 使用 Linux 命令 od 代替这些错误的工具。 $ od -t x4 ../crts/SRK_1_2_3_4_fuse.bin 0000000 D7DD02F7 596A91BD B7FB2EC3 09525B17 0000020 6fe30579 0bb67f9e 7e53c7e4 44f06a93 然后就可以使用制造工具写入这些值: Burn Word 0 of SRK hash field in OTP 或者在 U-Boot 中使用熔丝命令: 熔丝 prog 4 0 d7dd02f7 596a91bd b7fb2ec3 09525b17 6fe30579 0bb67f9e 7e53c7e4 44f06a93 在 启动 中将 #define CONFIG_CMD_FUSE 添加到 mx28evk.h 中,以在 熔丝 支持下进行编译。 或者使用飞思卡尔 OTP 代码包中的 BitBurner.exe 手动编写它们。这是最有效的 OTP 工具。 问题 6:共享驱动器 我犯了在 Virtual Box 中的共享驱动器上版本 U-启动 的错误。大错特错。速度要慢得多,最后一个步骤失败了,说 mkimage 无法映射 u-启动-signed.sb。只要避免在共享驱动器上工作就可以了。 结论 这些步骤与我上面的帖子相结合,应该能让 HAB 在 iMX28 上运行。至少它对我来说非常有效。我甚至将 HAB 设为关闭,并验证了未签名软件不会执行。 最后要注意的是,要在32位的ubuntu服务器上版本U-Boot,你显然需要一个32位的工具链。你还需要安装 libssl-dev 和其他一些代码包才能构建 U-启动。但是,如果你已经走了这么远,编译 U-启动 是你最不关心的问题。 Re: HAB i.MX28 Invalid Certificate <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 相信我,我很想用那里描述的工具作为基准,了解它应该是什么样子。不幸的是,问题就是从这里开始的。 otp_burner.py - 无法在 64 位系统上运行。我在虚拟机中安装了一个 32 位 ubuntu 服务器并在那里运行。正是有了这个工具,我就可以清楚地知道应该如何设置熔丝。 BitInit.exe - 该工具在 Windows 7 64 位和 Windows XP 32 位操作系统下会崩溃。由于它一直崩溃,我无法将其用作参考。 BitBurner.exe-这个工具需要你手动写熔丝。就像制造工具一样,你需要知道熔丝在使用这个工具时应该具备的价值。 我之所以问熔丝问题,是因为这些工具无法给出百分之百确定的答案。我 95% 确定应该是什么样子,但由于熔丝的写作是最终的,所以我想进行一些外部验证。我现在正在准备一个 32 位工具链,因为你给我的 CST 2.0.0 只能在 32 位 Linux 下运行。非常感谢你提供的工具,一旦试用成功,我将立即报告我的成败。 但我想知道,使用这些工具的客户和开发人员的内存是否会低于 4GB,并使用 32 位系统? Re: HAB i.MX28 Invalid Certificate <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 你好 可能建议您只遵循应用笔记 AN4555(使用 i.MX28 HAB 版本 4 进行安全启动) 第 6 节(管理电气熔丝)。 祝您愉快, Yuri ----------------------------------------------------------------------------------------------------------------------- 注:如果本帖回答了您的问题,请点击正确答案按钮。Thank you! -----------------------------------------------------------------------------------------------------------------------
記事全体を表示
LPC5536 MCAN RF0F Interrupt Hello, Why am I getting this interrupt (IR:RF0F) if the IE:RF0FE is set to 0? I'm trying to figure this out by monitoring the IE register and it is changing from 0x3800000 to 0x3800001, the bit number 3 is not being set at anytime. Best regards, Cristiano Rodrigues Re: LPC5536 MCAN RF0F Interrupt Hello @microcris  The flag of kMCAN_RxFifo0FullFlag is to avoid Rx FIFO overflow. Thank you. Alice Re: LPC5536 MCAN RF0F Interrupt Hello @Alice_Yang! Thank you for your answer. It is all fine with the IE register. I was just stating that the IE:RF0FE (it is the bit number 2 and not the bit number 3) was not being set and the and the IR:RF0F was being triggered. If it is an hardware thing, it is all right then. It is just a little bit annoying to have a kStatus_MCAN_TxIdle and a kStatus_MCAN_UnHandled with result set to kMCAN_RxFifo0FullFlag for every received message. Re: LPC5536 MCAN RF0F Interrupt Hello @microcris  Thanks for your question. The flag (IR:RF0F) is automatically set by the hardware and has no relation to the interrupt enable register IE:RF0FE. The IE register notifies the CPU to execute the interrupt handler. Regarding the change of IE bit 0 from 0 to 1, please debug the code to check where this bit is being modified. Thank you. BR Alice
記事全体を表示
HAB i.MX28 無効な証明書 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> ハイ   Freescale imx28 で HAB (High Assurance Boot) を U-Boot で動作させるのに問題があります。   私がやったことは、メインラインのU-Boot(v2016.01)から始めたことです。また、ハブ関連の項目をいくつか追加/変更しました。後期のU-Bootを選択した主な理由は、Marek Vasutが「make u-boot-signed.sb」を使用してU-BootをビルディングすることでIVTを生成するためのサポートを追加したためです。   * ボード/フリースケール/mx28evk/サイン/u-boot-spl.csf * ボード/フリースケール/mx28evk/サイン/u-boot.csf * ボード/フリースケール/mx28evk/hab.h * ボード/フリースケール/mx28evk/hab_types.h * ボード/フリースケール/mx28evk/mx28evk.c   これらすべてのファイルを参考として投稿に添付しました。hab.h と hab_types.hhttps://community.freescale.com/thread/306378から盗まれたものですChristopher Preschern 氏が、問題と解決策を非常にうまく説明しています。   pki ツリーを生成するために CST 2.3.1 を使用しました。今日読んだところによると、2.0.0 以降のすべての CST バージョンは i.MX28 では壊れているそうです。 http://lists.denx.de/pipermail/u-boot/2015-November/234717.html   BLN_CST_MAIN_02.00.00 にアクセスできるようにサポートに投稿しました。近いうちにその CST バージョンを入手して試せるようになると思います。これを書いている時点では、これが問題の原因であるかどうかは確認していません。   1024 ビット キーと 2048 ビット キーの両方を生成しようとしましたが、結果は同じでした。 CST の srktool を使用して srk_table.bin と srk_fuses.bin を生成しました。 $ srktool -h 4 -t srk_table.bin -e srk_fuses.bin -d sha256 -c crts/SRK1_sha256_2048_65537_v3_ca_crt.pem -f 1   次のファイルは cst ツールから u-boot ルート ディレクトリにコピーされました。 * CSF1_1_sha256_2048_65537_v3_usr_crt.pem * IMG1_1_sha256_2048_65537_v3_usr_crt.pem * srk_table.bin * srk_fuses.bin * key_pass.txt   これらすべてを配置したら、ビルドして実行しました。 $ mrproper を作成する $ mx28evk_nand_config を作成する $ u-boot-signed.sb を作成します $ sudo mxsldr u-boot-signed.sb   次の結果が得られます。 --------- HAB イベント情報 1 ----------------- イベント情報データ: 0xdb 0x00 0x14 0x40 0x33 0x21 0xc0 0x00 0xbe 0x00 0x0c 0x00 0x03 0x17 0x00 0x00 0x00 0x00 0x00 0x50 (HAB_INV_CERTIFICATE 0x21)   --------- HAB イベント情報 2 ----------------- イベント情報データ: 0xdb 0x00 0x14 0x40 0x33 0x0c 0xa0 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x20 (HAB_INV_ASSERTION 0x0C)   --------- HAB イベント情報 3 ----------------- イベント情報データ: 0xdb 0x00 0x14 0x40 0x33 0x0c 0xa0 0x00 0x00 0x00 0x00 0x00 0x00 0x10 0x00 0x00 0x00 0x00 0x04 (HAB_INV_ASSERTION 0x0C)   --------- HAB イベント情報 4 ----------------- イベント情報データ: 0xdb 0x00 0x14 0x40 0x33 0x21 0xc0 0x00 0xbe 0x00 0x0c 0x00 0x03 0x17 0x00 0x00 0x00 0x00 0x00 0x50 (HAB_INV_CERTIFICATE 0x21)   --------- HAB イベント情報 5 ----------------- イベント情報データ: 0xdb 0x00 0x14 0x40 0x33 0x0c 0xa0 0x00 0x00 0x00 0x00 0x00 0x40 0x00 0x10 0x00 0x00 0x00 0x00 0x20 (HAB_INV_ASSERTION 0x0C)   --------- HAB イベント情報 6 ----------------- イベント情報データ: 0xdb 0x00 0x14 0x40 0x33 0x0c 0xa0 0x00 0x00 0x00 0x00 0x00 0x40 0x00 0x20 0x00 0x00 0x00 0x00 0x04 (HAB_INV_ASSERTION 0x0C)   無効な証明書が 2 つあります。これらはおそらく u-boot-spl と u-boot からのものです。アサートは検証されていないコードの実行であると推測しています。   私の質問は次のとおりです。 1. 無効な証明書です。これは x509 標準に準拠していないことを意味しますか、それとも証明書ではあるがヒューズ (バンク 4 ワード 0..7) に書き込まれた SRK_HASH と一致しないことを意味しますか。   2. SRK_HASH のヒューズを書き込むときに、どこに何が入るかわかりません。 次のようなヒューズ ファイルがあります。 $ od -t x1 srk_fuses.bin 0000000 b4 d9 54 14 bc 39 da 51 4e 1d 42 d8 be 57 88 22 0000020 1d ca 3b f3 28 1f 3f 04 3f 0c 4b 34 8a a4 2b 57   バンク4ワード0に書き込むべきものは次のとおりです。 b4d95414とすべきでしょうか、それとも1454d9b4とすべきでしょうか? オンラインで、後者については、ファイルを 4 バイト ワードで読み取る場合と同じ順序で書き込む必要があると示すガイドを見たことがあります。 $ od -t x4 srk_fuses.bin 0000000 1454d9b4 51da39bc d8421d4e 228857be 0000020 f33bca1d 043f1f28 344b0c3f 572ba48a   otp_burner.py (32 ビット システムでのみ動作します) を使用して結果を印刷するように指示すると、次の結果が得られ、これもこの理論を強化します。 $ python otp_burner.py -i bit_settings.txt -o bit_settings.sb --srk srk_fuses.bin -a -p   バンク0 バンク1 バンク2 バンク3 バンク4 0: 0x00000000 0: 0x00000000 0: 0x00000000 0: 0x1454d9b4 1: 0x00000000 1: 0x00000000 1: 0x00000000 1: 0x00000000 1: 0x51da39bc 2: 0x00000000 2: 0x00000000 2: 0x00000000 2: 0x00000000 2: 0xd8421d4e 3: 0x00000000 3: 0x00000000 3: 0x00000000 3: 0x00000000 3: 0x228857be 4: 0x00000000 4: 0x00000000 4: 0x00000000 4: 0x00000000 4: 0xf33bca1d 5: 0x00000000 5: 0x00000000 5: 0x00000000 5: 0x043f1f28 6: 0x00000000 6: 0x00000000 6: 0x00000000 6: 0x344b0c3f 7: 0x00000000 7: 0x00000000 7: 0x00000000 7: 0x00000000 7: 0x572ba48a   SO、もう一度、後者のオプションが正しいことを示します。   ただし、ドキュメントでは別の代替案が示されているようです。 HABCST_UG.pdf 30ページ: 前のセクションの例の SRK1_2_3_4_fuse.bin ファイルの内容は次のとおりです。 93ea61d0bd30ffb62aba0b9d5e144d082dd7faeb39223d9e3f9a22a06429895a このハッシュ値は、次の順序で SoC eFUSE に書き込む必要があります。 SRK_HASH[255:248] = 0x93 SRK_HASH[247:240] = 0xea SRK_HASH[239:232] = 0x61 ... SRK_HASH[15:8] = 0x89 SRK_HASH[7:0] = 0x5a   i.MX28 リファレンスページ 957: HW_OCOTP_SRK0: 0x8002C220:31:0 スーパールートキーのハッシュ値ビット 255-254 (文書内のタイプミス、254 ではなく 224 である必要があります) HW_OCOTP_SRK1: 0x8002C230:31:0 スーパールートキーハッシュ値ビット223-192 HW_OCOTP_SRK2: 0x8002C240:31:0 スーパールートキーハッシュ値ビット191-160 HW_OCOTP_SRK3: 0x8002C250:31:0 スーパールートキーハッシュ値ビット159-128 HW_OCOTP_SRK4: 0x8002C260:31:0 スーパールートキーハッシュ値ビット127-96 HW_OCOTP_SRK5: 0x8002C270:31:0 スーパールートキーハッシュ値ビット95-64 HW_OCOTP_SRK6: 0x8002C280:31:0 スーパールートキーハッシュ値ビット63-32 HW_OCOTP_SRK7: 0x8002C290:31:0 スーパールートキーハッシュ値ビット31-0   私はこれを、HW_OCOTP_SRK0 の値は 0x93ea61d0 であるはずだと解釈していますが、前述のとおり、それは私が見つけたガイドに反しています。   間違った値を書き込むデバイスの数を制限できるように、誰かが何らかの方法でこれを確認できればと思います。   そしてはい、私は生成されたすべてのビットを配布しているので、これらのキーで署名されたデバイスは安全ではないことを十分に認識しています。これらのキーはデバッグおよび開発キーのみです。   よろしくお願いします。 パー・スミット 元の添付ファイルはburned_certs.tar.gzに移動されました 元の添付ファイルは次の場所に移動されました: srk_table.bin.zip 元の添付ファイルは次の場所に移動されました: srk_fuses.bin.zip 元の添付ファイルは次の場所に移動されました: mx28evk.c.patch.zip 元の添付ファイルは次の場所に移動されました: u-boot.csf.zip 元の添付ファイルは、 hab_types.h.zipに移動されました。 元の添付ファイルは、 hab.h.zipに移動されました。 元の添付ファイルは次の場所に移動されました: u-boot-spl.csf.zip 元の添付ファイルは次の場所に移動されました: mx28evk.c.zip i.MX2x Re: HAB i.MX28 Invalid Certificate 現在のバージョンの cst (4.0.1) は imx28 で動作しますか?そうでない場合は、cst2.0.0 へのダウンロード リンクを CAN 送信していただけますか? -ヤリ Re: HAB i.MX28 Invalid Certificate <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> こんにちは、 CST 2 リンクを記載したメールをお送りします。 お役に立てれば幸いです。 よろしくお願いいたします。 Yuri. Re: HAB i.MX28 Invalid Certificate <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> こんにちは、パーさん。 CST 2.0.0 はどこからダウンロードできますか? 現在、フリースケールの Web サイトでは cst-2.3.2 となっています。 i.MX28 の eboot に署名したいです。 Re: HAB i.MX28 Invalid Certificate <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 現在、CST 2.0.0 と HAB の動作をテストすることができました。2.0.0 以降は i.MX28 では壊れており、本当に残念です。エンジニアがデバッグや動作しない理由の調査に何日も費やす必要がないように、リリース ノートとマニュアルに、i.MX28 では動作しないという大きな警告を記載する必要があります。 SO私の問題を要約すると、他の人も私の経験から利益を得られるようになります。 問題1: CST 2.0.0を使用する それ以降のバージョンでは、i.MX28 の HAB が壊れます。ソフトウェア パッケージ名は BLN_CST_MAIN_02.00.00 です。 問題2: CST 2.0.032ビットシステムでのみ動作します CST 2.0.0 を動作させるために、ubuntu32 をインストールしました。Vagrant を使用して、VirtualBox で Ubuntu サーバーをすばやくセットアップしました。設定を含む VagrantFile が添付されています。 問題3: CST 2.0.0はエントロピージェネレータなしでは実行に20分かかる CST エントロピー問題を解決するには、rngtools をインストールする必要がありました。 $ sudo apt-get rng-tools をインストール 問題4: u-boot-signed.sb がキー不足のため失敗する これは私のミスでした。上記の投稿では、CSF1 証明書と IMG1 証明書のみを U-Boot ルート ディレクトリにコピーしました。秘密鍵も必要です。 問題5: ヒューズの書き方 otp_burner.py は 64 ビット システムでは壊れています。BitInit.exe は一部の Windows XP システムではCAN動作するようですが、Windows 7 64 ビット版や Windows XP 32 ビット版では動作しませんでした。 これらの欠陥のあるツールの代わりに、Linux コマンド od を使用してください。 $ od -t x4 ../crts/SRK_1_2_3_4_fuse.bin 0000000 d7dd02f7 596a91bd b7fb2ec3 09525b17 0000020 6fe30579 0bb67f9e 7e53c7e4 44f06a93 これらの値は、MfgTool を使用して CAN 書き込むことができます。 OTPのSRKハッシュフィールドのワード0を書き込みます または、U-Boot の fuse コマンドを使用します。 ヒューズプログラム 4 0 d7dd02f7 596a91bd b7fb2ec3 09525b17 6fe30579 0bb67f9e 7e53c7e4 44f06a93 fuse サポートをコンパイルするには、U-Boot の mx28evk.h に #define CONFIG_CMD_FUSE を追加します。 または、Freescale OTP パッケージの BitBurner.exe を使用して手動で書き込みます。実際に完璧に機能した唯一の OTP ツール。 問題6: 共有ドライブ 私は Virtual Box の共有ドライブ上に U-Boot を構築するという間違いを犯しました。大きな間違いです。速度が大幅に低下し、最後のステップでは、mkimage が u-boot-signed.sb をマップできないというメッセージが表示されて失敗します。共有ドライブでの作業を避けるだけで問題ありません。 結論: これらの手順と上記の私の投稿を組み合わせると、HAB が iMX28 で動作するようになるはずです。少なくとも私にとっては、それはうまく機能しています。さらに、HAB を閉じて、署名されていないソフトウェアは実行されないことを確認しました。 最後に注意すべき点は、32 ビット Ubuntu サーバー上で U-Boot を構築するには、当然 32 ビット ツール チェーンを入手する必要があるということです。U-Boot をビルドするには、libssl-dev とその他のパッケージもインストールする必要があります。しかし、ここまで来たら、U-Boot のコンパイルはそれほど心配する必要はないでしょう。 Re: HAB i.MX28 Invalid Certificate <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 信じてください、私はそれがどのように見えるかを知るための基準として、そこに説明されているツールを使用したかったのです。残念ながら、問題はそこから始まります。 otp_burner.py - 64 ビット システムでは動作しません。仮想ボックスに 32 ビット Ubuntu サーバーをインストールし、そこで実行しました。このツールを使用すると、ヒューズをどのように設定すればよいかがよくわかります。 BitInit.exe - このツールは、Windows 7 64 ビットおよび Windows XP 32 ビットではクラッシュします。クラッシュし続けるため、参考として使用することはCAN。 BitBurner.exe - このツールでは、ヒューズを手動で書き込む必要があります。MFG ツールとほぼ同様に、このツールを使用するにはヒューズの値を知っておく必要があります。 これらのツールでは 100% 確実な答えが得られなかったため、ヒューズについて質問しました。私はそれがどのようになっているかについて 95% 確信していますが、ヒューズの書き込みは最終的なものなので、外部で検証したいと考えていました。提供していただいた CST 2.0.0 は 32 ビット Linux でしか動作しないため、現在 32 ビット ツール チェーンを準備しています。このツールに感謝します。試してみたら、成功か失敗かをすぐに報告します。 しかし、これらのツールを使用するお客様や開発者は、4 GB 未満の RAM を搭載し、32 ビット システムを使用することが想定されているのでしょうか? Re: HAB i.MX28 Invalid Certificate <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> こんにちは、 セクション6(電気ヒューズの管理)に従うことをお勧めします。 アプリケーション ノート AN4555 (i.MX28 HAB バージョン 4 を使用したセキュア ブート)。 すてきな一日を、 ユリ ----------------------------------------------------------------------------------------------------------------------- 注: この投稿で質問が解決した場合は、「正解」ボタンをクリックしてください。ありがとう! -----------------------------------------------------------------------------------------------------------------------
記事全体を表示
LPC5536 MCAN RF0F 中断 你好 如果 IE:RF0FE 设置为 0,为什么会出现中断 (IR:RF0F)? 我正试图通过监控 IE 寄存器来解决这个问题,它正在从 0x3800000 变为 0x3800001,但第 3 位在任何时候都没有被设置。 顺祝商祺! 克里斯蒂亚诺-罗德里格斯 Re: LPC5536 MCAN RF0F Interrupt 你好@microcris kMCAN_RxFifo0FullFlag 的作用是避免 Rx FIFO 溢出。 谢谢! 爱丽丝 Re: LPC5536 MCAN RF0F Interrupt 你好,@Alice_Yang! 谢谢您的回答。 IE 注册器一切正常。我只是说没有设置 IE: RF0FE(它是位数 2 而不是位数 3),而且还有 IR: RF0F 被触发信号。如果是硬件问题,那就没关系。 每次接收到信息时,都会出现结果设置为 kMCAN_RxFifo0FullFlag 的 kStatus_MCAN_TxIdle 和 kStatus_MCAN_UnHandled,这实在有点恼人。 Re: LPC5536 MCAN RF0F Interrupt 你好@microcris 感谢您的提问。 标志 (IR:RF0F) 由硬件自动设置,与中断使能寄存器 IE:RF0FE 无关。IE 寄存器通知 CPU 执行中断处理程序。关于将 IE 第 0 位从 0 改为 1 的问题,请调试代码以检查该位被修改的位置。 谢谢! BR 爱丽丝
記事全体を表示
FS85 SPI通信エラー こんにちは。FS85レジスタのSPI読み書きに関する部分をデモFS8x_S32K144_WatchdogExampleから移植しました。現在、レジスタM_FLAGを定期的に読み込んでいます。deviceStatus=0xF0、readData=0xF014です。具体的なエラーは次のとおりです。 クロックサイクル数が間違っています(<32 or > 32)および SPI CRC でエラーが検出されました デモで提供されているCRC8関数も使用されています。なぜエラーが発生するのでしょうか?この2つのエラーを解決するにはどうすればよいですか? レジスタ FS_STATES を読み取り中、readData = 0x2003、03 に対応するステート マシンは見つかりませんでした。 FS85とFS84 回复: FS85 SPI通信报错 こんにちは、オスカー FS_STATE =5 は、RSTB がハイにリリースされていないことを示します。お客様は RSTB ピンのレベルを確認できますか?現時点では、OV/UV 関連のフラグ レジスタはアクティブではありません。 他にご質問がございましたら、お知らせください。 兄弟 シンディ・ウェン 回复: FS85 SPI通信报错 こんにちは。最初のチップで発生したSPI通信の問題ですが、原因は特定されましたでしょうか? 回复: FS85 SPI通信报错 こんにちは、徐新 障害が再度トリガーされた場合、それは実際の OV UV 障害であるため、ユーザーはすべてのビットを '1' に書き込むことによって FS_OVUVREG_STATUS をクリアする必要があります。 FS8510D3 OTP と同様に、ABIST1 はすべてのモニターに割り当てられます。SO、VCOREMON または VMON1 ~ 4 が UV を報告した場合、ステート マシンは ABIST1 状態のままになり、INIT_FS 状態に移行できません。 VCOREMON は BUCK1 にコネクテッドし、VMON1 ~ 4 は回路図内のレギュレータを監視するために使用する必要があります。FS85 DEMOボードを参照してください。 デバッグ サポートが必要な場合は、ローカル DISTI FAE に問い合わせてさらにサポートを受けてください。 兄弟 シンディ・ウェン 回复: FS85 SPI通信报错 こんにちは、徐新 FS_OVUVREG_STATUSレジスタを読んでください。VCOREMON が BUCK1 出力にコネクテッドされているかどうかを確認してください。VDDIO 電圧が OTP で定義されたレベルであるかどうかを確認します。VMON1~4が0.8Vになっているか確認します。 どの部品番号を使用していますか?NXPについてで定義された特定の OTP を使用している場合は、OTP ファイルを私と共有してください。 兄弟 シンディ・ウェン 回复: FS85 SPI通信报错 こんにちは、シンディさん。 ハードウェアエンジニアにPGOODピンとRSTBピンを測ってもらったところ、どちらもローレベルでした。エンジニアによると、プルアップ抵抗は既に追加したとのことですが、ハイレベルに引き上げることができなかったそうです。次にソフトウェアでレジスタを設定する必要があるのでしょうか?それとも、単にハードウェアの問題なのでしょうか? 回复: FS85 SPI通信报错 こんにちは、徐新 FS 状態が INIT_FS に入ることがCANない場合は、何らかの障害のために PGOOD/RSTB が解放されていないと考えられます。 PGOOD/RSTB がハイにリリースされているかどうかを確認してください。 低い場合は、搭載 OV/UV 障害がないか確認してください。 兄弟 シンディ・ウェン 回复: FS85 SPI通信报错 こんにちは、シンディさん。 ご指摘に従い、M_FLAGの対応するビットに1を書き込み、次のレジスタを読み出してみました。MISOから返されたデータは図の通りで、FS_STATSは依然として0x2003です。 回复: FS85 SPI通信报错 こんにちは、徐新 以下のビットに「1」を書き込んでクリアし、障害が再度発生するかどうかを確認してください。これらの障害がパワーオンリセット時にのみ発生した場合、通常の操作中には発生しないため、無視CANます。 兄弟 シンディ・ウェン 回复: FS85 SPI通信报错 こんにちは、トーマス。 以下はFS_STATESレジスタから読み取ったSPI波形です。1はCLK、2はCS、3はMOSI、4はMISOです。波形から、MOSIは0xAC,00,00,F4、MISOは0x70,20,03,14と推測しました。0x2006ではないことは確かです。これはデバッグモードに入っていたことと関係があるのでしょうか? 回复: FS85 SPI通信报错 こんにちは、徐新さん 元のエラーが消えたのは良かったです。フェイルセーフ ステート マシンの状態コード 0x03 についてはわかりません。実際には 0x06 であるはずです。FS_STATES レジスタの読み取りを示すスコープショットを共有していただけますか? BRs. トーマス 回复: FS85 SPI通信报错 こんにちは、トーマス。 FS85チップを交換した後、「クロックサイクル数が間違っています(<32 or > 32)」と「SPI CRCでエラーが検出されました」というメッセージが表示されなくなりました。FS_STATESレジスタにDBG_EXITを書き込みましたが、FS_STATESレジスタを読み出すと、readData = 0x2006ではなく0x2003が返されます。この03は何を表しているのでしょうか?INIT_FS状態に入るにはどうすればよいですか? 回复: FS85 SPI通信报错 図に示すように、1はMOSI、2はCLK、3はCS、4はMISOです。FS_DIAG_SAFETYレジスタを読み出すと、MOSIの値は0xA8、0x00、0x00、0xF2です。MISOの値は0xF0、0x04、0x29、0xD9です。0xF2と0xD9はCRC値で、CRC8ツールを使用して計算した値と一致しています。 さらに、table100の値を確認する方法がわかりません。 回复: FS85 SPI通信报错 こんにちは、徐新さん オシロスコープまたはロジック アナライザーをお持ちの場合は、SPI 書き込みトランザクションと読み取りトランザクションの両方を示すスクリーンショットを共有していただけますか?また、データシートの表 100 に示されているすべての SPI タイミング要件が満たされていることを再確認してください。 BRs、トーマス 回复: FS85 SPI通信报错 SPI 構成は次のとおりです: 20 MHz クロック、アクティブ ロー チップ セレクト、MSB 送信、低クロック アイドル レベル、クロックの 2 番目のエッジでのサンプリング、32 ビット SPI フレーム長、および 1,000,000 ボー レート。
記事全体を表示
i.MX8MP Secure boot - HAB errors using HSM Signatures Hi NXP, I'm working on enabling secure boot on a board based on the i.MX8M Plus. Secure boot works correctly when using certificates, keys, and signatures generated with the CST Tool version 4.0.0. Running hab_status shows no events in this case. However, on another board, when we attempt the secure boot process using certificates, keys, and signatures generated in our internal PKI environment, hab_status reports multiple errors. Below, I’ve included the CSF files and the HAB events we’re encountering. We are using "HSM Mode" and have configured the signature size accordingly. We would like to understand which options or parameters we should use when generating signatures—particularly if we want to simulate the process using an OpenSSL command. Thank you in advance for your support. Best regards, Christophe Guerreiro i.MX 8M | i.MX 8M Mini | i.MX 8M Nano Security Re: i.MX8MP Secure boot - HAB errors using HSM Signatures So, here an update. It appears that when using 4 certificates, the SRK_TABLE is bigger. As our signature are big, this leads on big CSF Binary and get overlapped as some Memory zone are used for other functions. We need to try to reduce the CMS content as it was recommended. I will update the ticket here once this is done. Re: i.MX8MP Secure boot - HAB errors using HSM Signatures Hi @se_cguerr, CC @anda_despotovici, @ZeeFrench, Following our call yesterday, we were able to successfully simulate your use case, and we have a properly signed image. To answer your questions above, here is example command to generate CMS signature with OpenSSL: openssl cms -sign -md sha256 -outform DER -nosmimecap -nocerts -binary -in ${csf_sigreq_file} -out ${csf_sig_file} -signer ${csf_crt} -inkey ${csf_key} -passin file:../keys/key_pass.txt  I assume for this one you have the same command as shown during the call. As per your request here is the command to verify the generated signature: openssl cms -verify -in ${csf_sig_file} -inform DER -binary -content ${csf_sigreq_file} -certsout /dev/null -certfile ${csf_crt} -noverify -out verified_csf_output.txt Duplicate these commands for IMG. Duplicate signing process for SPL & FIT. In my case, the size of output signature size is 509 bytes. Therefore I modify my CSF headers and set  [Header] Signature Size = 509 Regarding the current limitation of your signing room—which only supports signing a provided hash and not raw content, there’s an important update worth noting. As of OpenSSL >= 3.2, an undocumented feature allows you to pass a precomputed hash using the -digest option. I’ve tested this on my side, and it works as expected. Updated Signing Process: Compute the hash of the content externally. csf_sigreq_digest=$(openssl dgst -sha256 ${csf_sigreq_file} | awk '{printf $2}') Sign the precomputed hash using the -digest option. $OPENSSL_PATH/openssl cms -sign -md sha256 -outform DER -nosmimecap -nocerts -binary -digest ${csf_sigreq_digest} -out ${csf_sig_file} -signer ${csf_crt} -inkey ${csf_key} -passin file:../keys/key_pass.txt Verify: $OPENSSL_PATH/openssl cms -verify -in ${csf_sig_file} -inform DER -binary -content ${csf_sigreq_file} -certsout /dev/null -certfile ${csf_crt} -noverify -out verified_csf_output.txt I hope this helps. Let us know if this works for you. Best Maro Re: i.MX8MP Secure boot - HAB errors using HSM Signatures See below files mentionned in my first post. I've read the UG10106.  We are using the CST in HSM mode while we get a signature request. We inject back the signature on the appropriate unique tag and rebuild the flash.bin file. This  procedure works with certificates/keys generated from CST. We don't use PKCS#11 in our case. We are using a signing room. Thanks for your fast reply. Regards, Christophe Re: i.MX8MP Secure boot - HAB errors using HSM Signatures Hello, I am not able to see the CSF files and HAB events mentioned in the description. Could you please confirm if you have followed the procedure described in CST UG in chapter Using CST with Hardware Security Module? If not, is anything that requires a different approach on your side? Thank you. Anda
記事全体を表示
imx8mp OpenGL without display Is there a way to get OpenGL to work while running in headless mode (without connecting a display)? I'm running a imx8mp with an fsl-xwayland based image. I know PGU et-al are configured correctly in my devicetree as I can get a display working when connected. If I try to run a simple gstreamer pipeline like this: gst-launch-1.0 videotestsrc ! video/x-raw,format=NV12,width=1920,height=1080 ! queue ! glupload ! glcolorconvert ! gldownload ! video/x-raw,format=RGB ! queue ! fakesink I get the following error:  Got context from element 'gldownloadelement0': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayWayland\)\ gldisplaywayland0"; ERROR: from element /GstPipeline:pipeline0/GstGLUploadElement:gluploadelement0: Failed to perform a wayland roundtrip My system is set up to use remote-x server via SSH, but even then I get nothing. Is there some XDG variable to set? or is there a way to get a fake framebuffer or something? Graphics & Display i.MX 8M | i.MX 8M Mini | i.MX 8M Nano Linux Multimedia Yocto Project Re: imx8mp OpenGL without display So to answer my own question for anyone else coming here:  I could get the GPU working and perform gstreamer glupload/glshader etc commands by:  - Loading VKMS kernel module for a virtual display - setting renderer=gl and disabling "g2d" in westom.ini.  With these chnages weston starts up, and I have opngl commands.  Interestingly, I was able to verify that OpenCL works fine even when weston is offline. Unfortunately the performance of anything in OpenCV using UMat's and the T-API didn't improve vs a normal matrix. It does seem to be much faster than a simple element wise multiplication for example in C, so that's probably down to the ARM-Neon acceleration in OpenCV.   Re: imx8mp OpenGL without display thanks ugurkur, but that doesn't seem to help.  If I check `echo $XDG_RUNTIME_DIR` I get "/run/user/0", so that seems fine.  And according to my manifest I have all the packages you mentioned. Still I cant get OpenGL to work. Re: imx8mp OpenGL without display Hi there, I encountered the same issue on my i.MX8M board. What worked for me was adding the weston, weston-init, and weston-xwayland packages to my Yocto image, which completely resolved the display errors. Additionally, I set the XDG_RUNTIME_DIR environment variable using the following command:  export XDG_RUNTIME_DIR=/run/user/$(id -u) I hope this helps you resolve your issue as well! Re: imx8mp OpenGL without display so does they teach us anything? Do you have any other ideas what could be causing the issue? Re: imx8mp OpenGL without display That's is not an error, your system should be running without display. Regards Re: imx8mp OpenGL without display I get the following: WARNING: erroneous pipeline: could not link videotestsrc0 to xvimagesink0, neither element can handle caps video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080 Am I missing a kernel config? Re: imx8mp OpenGL without display Hello, Please try this again: $ DISPLAY=:0 gst-launch-1.0 videotestsrc ! video/x-raw(memory:NVMM),width=1920,height=1080, 'video/x-raw,width=1920, height=1080 ! xvimagesink sync=0 Regards
記事全体を表示
FRDM33771BSPIEVB MATLAB support Hello, In NXP model-based design toolbox, I'm not getting Bcc_771 blockset in battery examples. Can you please let me know if I need to install any additional blocksets ? Bcc_772, Bcc_774, Bcc_775 is there but Bcc_771 not found. And also, can I get the step-by-step procedure to to get cell voltages, current, temperature of battery pack using this blockset along with balancing logic? It will be helpful, Thanks !  Re: FRDM33771BSPIEVB MATLAB support Hello @bhushan7051 and @petervlna  The Model-Based Design Toolbox for BMS supports only the MC33774A, MC33775A and MC33772C, the parts used for the main HVBMS reference designs, because the generated code from Simulink, when used in conjunction with the MBDT for S32K3, is based on the NXP Real-Time Drivers and BMS SDK which do not provide support for the MC33771B/MC33771C. However, to use the FRDM33771BSPIEVB board you have to pair it with an S32K144, and please download and install the MBDT for S32K1 from here https://www.mathworks.com/matlabcentral/fileexchange/64740-nxp-support-package-s32k1xx The latest version supports both MC3377[1/2][B/C]. Regards, Marius Re: FRDM33771BSPIEVB MATLAB support Hello, Since I didn't get any feedback from BMS team I am looking into this from available materials. I can see that 771 is not present in the packages available for S32K358: However I do not understand the point of FRDM33771BSPIEVB which has demo in Codewarrior, how it is connected to the BCC_77x examples. I see demo for BCC_S32K144_MC33771_FreeMASTER and BCC_S32K144_Monitoring where the documentation is in XML format included. Could you be more specific here? And also, can I get the step-by-step procedure to to get cell voltages, current, temperature of battery pack using this blockset along with balancing logic? There is BMS Software Installation Guide where in chapter 5 is the basic how to work with examples: https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://community.nxp.com/pwmxy87654/attachments/pwmxy87654/S32K/31702/1/BMS_SWInstalationGuide_Application.pdf&ved=2ahUKEwi0o4ywh6COAxUFzAIHHU6XA5YQFnoECBMQAQ&usg=AOvVaw1EUf4PdWTQXhFyQM-w5QVJ The documentation on API is present in RTD package in folder doc. Also here is tutorial: https://www.nxp.com/design/design-center/training/TIP-SPEED-UP-BMS-APPS-MBDT Best regards, Peter Re: FRDM33771BSPIEVB MATLAB support Still didn't get response ? Re: FRDM33771BSPIEVB MATLAB support Hello, I haven't got any response so I have escalated the topic. I will inform you ASAP. Best regards, Peter Re: FRDM33771BSPIEVB MATLAB support Hello, No update until now. Still waiting for BMS team response. Best regards, Peter Re: FRDM33771BSPIEVB MATLAB support Thanks Peter, waiting for further response ! Re: FRDM33771BSPIEVB MATLAB support Hello, I have contact our BMS team to see what is the issue here. I will feedback you ASAP. Best regards, Peter
記事全体を表示