1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-25 16:08:32 +00:00

feat(core/prodtest): update wpc-info command to return machine readable data.

[no changelog]
This commit is contained in:
kopecdav 2025-06-23 14:59:59 +02:00 committed by kopecdav
parent bec455c9e5
commit 0f6f9bc074
2 changed files with 17 additions and 2 deletions

View File

@ -921,6 +921,8 @@ OK 00000001000000000000000000000000000000000000000000000000000000000000000001000
### wpc-info ### wpc-info
Retrieves detailed information from the wireless power receiver, including chip identification, firmware version, configuration settings, and error status. Retrieves detailed information from the wireless power receiver, including chip identification, firmware version, configuration settings, and error status.
WARNING: The command will only succeed if the receiver is externally powered (5V present on the VOUT/VRECT test point).
Example: Example:
``` ```
> wpc-info > wpc-info
@ -943,13 +945,14 @@ Example:
# nvm_config_err: 0x0 # nvm_config_err: 0x0
# nvm_patch_err: 0x0 # nvm_patch_err: 0x0
# nvm_prod_info_err: 0x0 # nvm_prod_info_err: 0x0
PROGRESS 0x38 0x4 0x0 0x161 0x1645 0x1D7C 0xC 0x1 0x52353038385055AA09446D0655AA55AA 0x0
OK OK
``` ```
### wpc-update ### wpc-update
Updates the firmware and configuration of the wireless power receiver. Updates the firmware and configuration of the wireless power receiver.
WARNING: The update will only succeed if the receiver is externally powered (5V present on the VOUT test point). WARNING: The command will only succeed if the receiver is externally powered (5V present on the VOUT/VRECT test point).
Example: Example:
``` ```

View File

@ -63,7 +63,13 @@ static void prodtest_wpc_info(cli_t* cli) {
cli_trace(cli, "chip_rev 0x%d ", chip_info.chip_rev); cli_trace(cli, "chip_rev 0x%d ", chip_info.chip_rev);
cli_trace(cli, "cust_id 0x%d ", chip_info.cust_id); cli_trace(cli, "cust_id 0x%d ", chip_info.cust_id);
cli_trace(cli, "rom_id 0x%X ", chip_info.rom_id); cli_trace(cli, "rom_id 0x%X ", chip_info.rom_id);
cli_trace(cli, "patch_id 0x%X ", chip_info.patch_id);
if (chip_info.patch_id == 0) {
cli_trace(cli, "patch_id 0x%X (This value may be visible after reset)",
chip_info.patch_id);
} else {
cli_trace(cli, "patch_id 0x%X ", chip_info.patch_id);
}
cli_trace(cli, "cfg_id 0x%X ", chip_info.cfg_id); cli_trace(cli, "cfg_id 0x%X ", chip_info.cfg_id);
cli_trace(cli, "pe_id 0x%X ", chip_info.pe_id); cli_trace(cli, "pe_id 0x%X ", chip_info.pe_id);
cli_trace(cli, "op_mode 0x%X ", chip_info.op_mode); cli_trace(cli, "op_mode 0x%X ", chip_info.op_mode);
@ -78,6 +84,12 @@ static void prodtest_wpc_info(cli_t* cli) {
cli_trace(cli, " nvm_patch_err: 0x%X ", chip_info.nvm_patch_err); cli_trace(cli, " nvm_patch_err: 0x%X ", chip_info.nvm_patch_err);
cli_trace(cli, " nvm_prod_info_err: 0x%X ", chip_info.nvm_prod_info_err); cli_trace(cli, " nvm_prod_info_err: 0x%X ", chip_info.nvm_prod_info_err);
cli_progress(cli, "0x%d 0x%d 0x%d 0x%X 0x%X 0x%X 0x%X 0x%X 0x%s 0x%X",
chip_info.chip_id, chip_info.chip_rev, chip_info.cust_id,
chip_info.rom_id, chip_info.patch_id, chip_info.cfg_id,
chip_info.pe_id, chip_info.op_mode, device_id,
chip_info.sys_err);
stwlc38_deinit(); stwlc38_deinit();
cli_ok(cli, ""); cli_ok(cli, "");