{"id":20941949,"url":"https://github.com/ifm/lan743x-config","last_synced_at":"2025-05-13T23:32:26.304Z","repository":{"id":83248164,"uuid":"281393659","full_name":"ifm/lan743x-config","owner":"ifm","description":"Command line utility for changing the LAN743x configuration EEPROM","archived":false,"fork":false,"pushed_at":"2023-12-21T10:35:24.000Z","size":1890,"stargazers_count":4,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-25T06:20:13.282Z","etag":null,"topics":["cli","eeprom"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ifm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-07-21T12:36:45.000Z","updated_at":"2023-01-10T10:44:32.000Z","dependencies_parsed_at":"2023-12-21T11:43:22.266Z","dependency_job_id":"e4145a8a-de14-4e4a-9bd6-efc449958d0b","html_url":"https://github.com/ifm/lan743x-config","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ifm%2Flan743x-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ifm%2Flan743x-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ifm%2Flan743x-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ifm%2Flan743x-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ifm","download_url":"https://codeload.github.com/ifm/lan743x-config/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225265844,"owners_count":17446882,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","eeprom"],"created_at":"2024-11-18T23:19:57.003Z","updated_at":"2024-11-18T23:19:57.542Z","avatar_url":"https://github.com/ifm.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Configuration of the LAN7430 PCIe GigE Ethernet card\n\nThe LAN7430 has the possibility to read its MAC address from a EEPROM. To achieve this the EEPROM content needs to be generated and written to the EEPROM.\n\n# Build\nTo build the CLI tool and the library, you need a compiler that supports C++17. Prefer [vcpkg](https://vcpkg.io/en/) to install the dependencies.\n## Dependencies\nCLI tool:\n* spdlog (system/3rdparty)\n* cli11 (system/3rdparty)\n\nLibrary:\n* spdlog (system/3rdparty)\n\nTests:\n* catch2 (3rdparty)\n* spdlog (system/3rdparty)\n\n## Build\n\nThere are several ways to build the project. The easiest way is to use the provided CMakePresets.json with [vcpgk](https://vcpkg.io/en/).\n\n```sh\n# Make sure that vcpkg is installed and the environment variable VCPKG_ROOT is set\necho $VCPKG_ROOT\n\ncmake --preset release\ncmake --build build\n```\n\nIf you want to build the project without vcpkg, you need to install the dependencies manually or use the provided 3dparty folder.\n\n```sh\ncmake -Bbuild -DCMAKE_BUILD_TYPE=Release -H.\ncmake --build build\n```\n\n# CLI usage\n```\nUsage: ./lan7430-config [OPTIONS] SUBCOMMAND\n\nOptions:\n  -h,--help                   Print this help message and exit\n  --config TEXT               Read an ini file\n  --printconfig               Print an ini file to the console\n\nSubcommands:\n  configure\n  info  \n```\n\n\n***\n## *configure* subcommand\nYou can build up a *.bin file by using the configure command and it's subcommands, adding more configurations as you go.\n\nWhen a file is created for the first time a reasonable configuration is used.\n```\nUsage: ./lan7430-config configure [OPTIONS] [SUBCOMMAND]\n\nOptions:\n  -h,--help                   Print this help message and exit\n  -i,--input TEXT:FILE        Input that the output EEPROM file should be based on\n  -o,--output TEXT:DIR=lan7430_config.bin\n                              Output path of the EEPROM file\n  --memory ENUM:value in {eeprom-\u003e165,eepromMac-\u003e170,eepromOTP1-\u003e243,eepromOTP2-\u003e247} OR {165,170,243,247}\n                              Determines where this configuration will be stored\n\nSubcommands:\n  mac                         Allows configuring the mac address\n  led                         Allows configuring the parameters of the LEDs\n```\n\nPlease note that currently the command line tool is very limited in regards of options that can be configured.\n\nTo have access to more configurable options, you can use the lan7430conf library.\n\n#### Example:\n```\nlan7430-config configure -o lan7430_config.bin --memory eeprom\n```\n\n### *mac* subcommand\n```\nAllows configuring the mac address\nUsage: ./lan7430-config configure mac [OPTIONS] mac\n\nPositionals:\n  mac TEXT:MAC REQUIRED       MAC address (00:00:00:00:00:00)\n\nOptions:\n  -h,--help                   Print this help message and exit\n  -m,--mac TEXT:MAC REQUIRED  MAC address (00:00:00:00:00:00)\n```\n\n#### Example:\n```\nlan7430-config configure -i lan7430_config.bin -o lan7430_config.bin mac AA:BB:CC:DD:EE:FF\n```\n\n### *led* subcommand\n#### Example:\n```\nlan7430-config configure -i lan7430_config.bin -o lan7430_config.bin led --id 0 --on -p ActiveHigh -c LinkActivity -C Enable -b Blink\n```\n\n\n***\n## *info* subcommand\n\n```\nUsage: ./lan7430-config info [OPTIONS] [input]\n\nPositionals:\n  input TEXT:FILE=lan7430_config.bin\n                              Dump information about the EEPROM file to console\n\nOptions:\n  -h,--help                   Print this help message and exit\n  -i,--input TEXT:FILE=lan7430_config.bin\n                              Dump information about the EEPROM file to console\n```\n\n#### Example:\n```\nlan7430-config info -i lan7430_config.bin\n```\n\n\n# Reading of the EEPROM\n\n```\n$ ethtool --eeprom-dump devname raw on \u003e eeprom.bin\n```\n\n# Writing of the EEPROM\n\n```\n$ ethtool --change-eeprom eth1 magic 0x74A5 \u003c 00-02-01-23-10-58-pad.bin\n```\n\n# Content of the EEPROM\n\nThis is a HEXDUMP of the EEPROM file for the MAC Address ``00:02:01:23:10:58``\n\n```\nhexdump -C doc/bin/00-02-01-23-10-58-pad.bin\n00000000  aa 00 02 01 23 10 58 00  00 14 00 00 00 00 00 00  |....#.X.........|\n00000010  00 00 00 00 00 05 00 00  00 00 00 b8 00 07 e6 80  |................|\n00000020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|\n*\n00000200\n```\n\nThere seems to be no checksum to verify the EEPROM content the only difference between two files is the MAC address\n\n```\n--- doc/bin/00-02-01-23-10-58-pad.txt   2020-03-12 09:46:55.116083608 +0100\n+++ doc/bin/00-02-01-23-10-57-pad.txt   2020-03-12 09:47:01.884083558 +0100\n@@ -1,4 +1,4 @@\n-00000000  aa 00 02 01 23 10 58 00  00 14 00 00 00 00 00 00  |....#.X.........|\n+00000000  aa 00 02 01 23 10 57 00  00 14 00 00 00 00 00 00  |....#.W.........|\n 00000010  00 00 00 00 00 05 00 00  00 00 00 b8 00 07 e6 80  |................|\n 00000020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|\n *\n```\n# Development\nWe recommend to use the [devcontainer](https://code.visualstudio.com/docs/devcontainers/containers) to have a consistent development environment. Otherwise you need to install the dependencies manually (see [Dependencies](#dependencies) / [Build](#build-1)).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fifm%2Flan743x-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fifm%2Flan743x-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fifm%2Flan743x-config/lists"}