Hello @Abrar_23 ,
This topic has come up a few times recently, so let me provide a brief summary of the available options for dynamically configuring the L2 Lookup Table on the SJA1110 switch.
Both the ECT firmware and the Python script (write_l2_lookup_table.py) are valid and supported approaches. The method you choose depends on your use case — dynamic configuration can be performed either by the internal M7 core or externally via SPI.
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