From 4cd50c9c5304a7923907a959228ceb98160dee05 Mon Sep 17 00:00:00 2001 From: Benjamin Wilson Date: Sun, 22 Sep 2024 20:59:46 -0400 Subject: [PATCH] 601 config defaults, TPS546 corruption fix --- config-601.cvs | 4 +-- main/TPS546.c | 28 +++++++++++-------- .../src/app/components/edit/edit.component.ts | 10 +++---- 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/config-601.cvs b/config-601.cvs index 68d3568a2..81d0a9109 100644 --- a/config-601.cvs +++ b/config-601.cvs @@ -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 diff --git a/main/TPS546.c b/main/TPS546.c index b1995af81..168341327 100644 --- a/main/TPS546.c +++ b/main/TPS546.c @@ -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, "--------------------------------"); @@ -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); } diff --git a/main/http_server/axe-os/src/app/components/edit/edit.component.ts b/main/http_server/axe-os/src/app/components/edit/edit.component.ts index 632c8a37f..de02df109 100644 --- a/main/http_server/axe-os/src/app/components/edit/edit.component.ts +++ b/main/http_server/axe-os/src/app/components/edit/edit.component.ts @@ -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 }, ];