Skip to content

Commit

Permalink
601 config defaults, TPS546 corruption fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Wilson committed Sep 23, 2024
1 parent 3589c36 commit 4cd50c9
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 19 deletions.
4 changes: 2 additions & 2 deletions config-601.cvs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ stratumurl,data,string,public-pool.io
stratumport,data,u16,21496
stratumuser,data,string,bc1qnp980s5fpp8l94p5cvttmtdqy8rvrq74qly2yrfmzkdsntqzlc5qkc4rkq.bitaxe
stratumpass,data,string,x
asicfrequency,data,u16,525
asicvoltage,data,u16,1100
asicfrequency,data,u16,596
asicvoltage,data,u16,1150
asicmodel,data,string,BM1370
devicemodel,data,string,gamma
boardversion,data,string,601
Expand Down
28 changes: 17 additions & 11 deletions main/TPS546.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,15 +389,16 @@ int TPS546_init(void)

/* Read version number and see if it matches */
TPS546_read_mfr_info(read_mfr_revision);
if (memcmp(read_mfr_revision, MFR_REVISION, 3) != 0) {
uint8_t voutmode;
// If it doesn't match, then write all the registers and set new version number
ESP_LOGI(TAG, "--------------------------------");
ESP_LOGI(TAG, "Config version mismatch, writing new config values");
smb_read_byte(PMBUS_VOUT_MODE, &voutmode);
ESP_LOGI(TAG, "VOUT_MODE: %02x", voutmode);
TPS546_write_entire_config();
}
// if (memcmp(read_mfr_revision, MFR_REVISION, 3) != 0) {
uint8_t voutmode;
// If it doesn't match, then write all the registers and set new version number
// ESP_LOGI(TAG, "--------------------------------");
// ESP_LOGI(TAG, "Config version mismatch, writing new config values");
ESP_LOGI(TAG, "Writing new config values");
smb_read_byte(PMBUS_VOUT_MODE, &voutmode);
ESP_LOGI(TAG, "VOUT_MODE: %02x", voutmode);
TPS546_write_entire_config();
//}

/* Show temperature */
ESP_LOGI(TAG, "--------------------------------");
Expand Down Expand Up @@ -560,9 +561,14 @@ void TPS546_write_entire_config(void)
ESP_LOGI(TAG, "Writing MFR REVISION");
smb_write_block(PMBUS_MFR_ID, MFR_REVISION, 3);

/*
!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Never write this to NVM as it can corrupt the TPS in an unrecoverable state, just do it on boot every time
!!!!!!!!!!!!!!!!!!!!!!!!!!!
*/
/* store configuration in NVM */
ESP_LOGI(TAG, "---Saving new config---");
smb_write_byte(PMBUS_STORE_USER_ALL, 0x98);
// ESP_LOGI(TAG, "---Saving new config---");
// smb_write_byte(PMBUS_STORE_USER_ALL, 0x98);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,18 @@ export class EditComponent implements OnInit {
public BM1370DropdownFrequency = [
{ name: '400', value: 400 },
{ name: '490', value: 490 },
{ name: '525 (default)', value: 525 },
{ name: '525', value: 525 },
{ name: '575', value: 575 },
{ name: '596', value: 596 },
{ name: '596 (default)', value: 596 },
{ name: '610', value: 610 },
{ name: '625', value: 625 },
];

public BM1370CoreVoltage = [
{ name: '900', value: 900 },
{ name: '950', value: 950 },
{ name: '1000', value: 1000 },
{ name: '1060', value: 1060 },
{ name: '1100 (default)', value: 1100 },
{ name: '1150', value: 1150 },
{ name: '1100', value: 1100 },
{ name: '1150 (default)', value: 1150 },
{ name: '1200', value: 1200 },
{ name: '1250', value: 1250 },
];
Expand Down

0 comments on commit 4cd50c9

Please sign in to comment.