After associating Hardware with a Firmware (on the Hardware tab) and clicking Save, you get Error 500 while running an early release of the Service Gateway v5.2 Beta.
It is expected that the association is saved without an error.
This is a known issue on early releases of Service Gateway v5.2 Beta. This was fixed in the final version for v5.2.
Upgrade to the final version of v5.2 to have this issue fixed. See the version 5.2 release notes for installation instructions.
After upgrading to the final version of v5.2, Hardware associations with Firmwares should be saved correctly.