Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flashing custom firmware package onto uhk60 via agent80 not working. #2438

Open
kareltucek opened this issue Dec 2, 2024 · 6 comments
Open

Comments

@kareltucek
Copy link
Contributor

I have a custom local firmware release on a tagged branch: uhk-firmware-11.2.0-stuck_keys_hunt_v2.tar.gz (5801ac64a70342c92f1daf2ee483d81a10fafff8), and I am trying to flash it.

Neither right nor left half gets flashed. Only trackball does. Actually, trackball gets flashed every single time, although given that subsequent flashes should have same checksums, it probably shouldn't get flashed second time around.

Right and left stay on 443e5df59f2ae66a0ee424618080ac4a239c5e51, which is a couple commits ago.

Agent flash log: flog.txt

Any idea (@ert78gb) what is wrong? Could you look into it?

@ert78gb
Copy link
Member

ert78gb commented Dec 3, 2024

The attached log contains only 1 runs of the firmware upgrade process.

[DeviceService] "Trackball" firmware version: 11.2.0
[DeviceService] "Trackball" current firmware checksum: 8e70d90f3a4e83cf959af8900658f456
[DeviceService] "Trackball" new firmware checksum: 00000000000000000000000000000000
[UhkOperations] Start flashing "Trackball" module firmware

based on these lines Agent correctly upgrade the Trackball firmware because the 2 checksum are different.

@ert78gb
Copy link
Member

ert78gb commented Dec 3, 2024

I am investigating it. The following is my hardware information. I already flashed my uhk60v2 keyboard with your firmware

There are 2 sub structure.
The moduleInfos that contains details information of an UHK module. Left half also a module.
The rightModuleInfo contains the right half information.

The 3 is the Trackball module ID. It is available in both sub structure.

 "hardwareModules": {
    "moduleInfos": [
      {
        "module": {
          "id": 1,
          "name": "Left keyboard half",
          "slotId": 1,
          "i2cAddress": 16,
          "firmwareUpgradeSupported": true
        },
        "info": {
          "moduleProtocolVersion": "4.3.0",
          "firmwareVersion": "11.2.0",
          "firmwareGitRepo": "UltimateHackingKeyboard/firmware-uhk80",
          "firmwareGitTag": "89e7f92",
          "firmwareChecksum": "9a9e8063c2bd1ca3674bd742b9aa455b"
        }
      },
      {
        "module": {
          "id": 3,
          "name": "Trackball",
          "configPath": "/add-on/trackball",
          "slotId": 3,
          "i2cAddress": 48,
          "firmwareUpgradeSupported": true
        },
        "info": {
          "moduleProtocolVersion": "4.3.0",
          "firmwareVersion": "11.2.0",
          "firmwareGitRepo": "UltimateHackingKeyboard/firmware-uhk80",
          "firmwareGitTag": "stuck_keys_hunt_v2",
          "firmwareChecksum": "8e70d90f3a4e83cf959af8900658f456"
        }
      }
    ],
    "rightModuleInfo": {
      "firmwareVersion": "11.2.0",
      "deviceProtocolVersion": "4.11.0",
      "moduleProtocolVersion": "4.3.0",
      "userConfigVersion": "8.3.0",
      "hardwareConfigVersion": "1.0.0",
      "smartMacrosVersion": "2.5.0",
      "firmwareGitRepo": "UltimateHackingKeyboard/firmware-uhk80",
      "firmwareGitTag": "28b254f",
      "firmwareChecksum": "951c0587f7d6b2283abc60e41b040964",
      "modules": {
        "1": {
          "md5": "9a9e8063c2bd1ca3674bd742b9aa455b"
        },
        "3": {
          "md5": "4b5b5b92c17ddb96b3a75f2c6573eaf1"
        }
      }
    }
  }

The hardwareModules. moduleInfos.3.firmwareChecksum: 8e70d90f3a4e83cf959af8900658f456The rightModuleInfo.modules.3.md5: 4b5b5b92c17ddb96b3a75f2c6573eaf1`
The 2 value are different. (I have to unify the naming)

We use the following USB command to collect these data
hardwareModules. moduleInfos.3.firmwareChecksum => 0x0e 0x03 0x03

  • GetModuleProperty USB command 0x0e
  • module ID 0x03
  • protocolVersions property 0x03

rightModuleInfo.modules.3.md5 => 0x00 0x08 0x03

  • GetProperty USB command 0x00
  • FirmwareChecksum property 0x08
  • module ID 0x03

Agent compares these 2 checksum and if they are different then flashes the module.
The original story #1663

@mondalaci
Copy link
Member

Is this a duplicate of #2435 ?

@ert78gb
Copy link
Member

ert78gb commented Dec 4, 2024

Yes

@kareltucek
Copy link
Contributor Author

kareltucek commented Dec 4, 2024

Partially I think.

This looks like Agent concludes that the (trackball) checksums are different every single time, and therefore it always tries to flash only the module and never triggers the scenario when it allows to reflash everything even when checksums match.

Furthermore, the zero checksum in the log above is pretty suspicious. If it is present in the firmware build package, then that clearly is firmware build machinery fail.

@ert78gb
Copy link
Member

ert78gb commented Dec 4, 2024

This looks like Agent concludes that the (trackball) checksums are different every single time, and therefore it always tries to flash only the module and never triggers the scenario when it allows to reflash everything even when checksums match.

exactly

Furthermore, the zero checksum in the log above is pretty suspicious. If it is present in the firmware build package, then that clearly is firmware build machinery fail.

the first step off the firmware build is create a build with 0 checksum. And the 2nd step/run uses the calculated checksum of the first build.

@mondalaci mondalaci transferred this issue from UltimateHackingKeyboard/agent80 Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants