Skip to content

Commit

Permalink
probably fixed duplicate nonces
Browse files Browse the repository at this point in the history
  • Loading branch information
shufps committed Nov 10, 2024
1 parent dd1c670 commit f6fab1f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion components/bm1397/asic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ bool Asic::processWork(task_result *result)

uint32_t rolled_version = (reverseUint16(asic_result.version) << 13); // shift the 16 bit value left 13

int asic_nr = (asic_result.nonce & 0x0000fc00) >> 10;
int asic_nr = (asic_result.nonce & 0x0000fc00) >> 11;

result->job_id = job_id;
result->asic_nr = asic_nr;
Expand Down
16 changes: 8 additions & 8 deletions components/bm1397/bm1370.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ uint8_t BM1370::init(uint64_t frequency, uint16_t asic_count, uint32_t difficult

// set chip address
for (uint8_t i = 0; i < chip_counter; i++) {
setChipAddress(i * 2);
setChipAddress(i * 4);
}

// Core Register Control
Expand All @@ -91,15 +91,15 @@ uint8_t BM1370::init(uint64_t frequency, uint16_t asic_count, uint32_t difficult

for (uint8_t i = 0; i < chip_counter; i++) {
// Reg_A8
send6(CMD_WRITE_SINGLE, i * 2, 0xA8, 0x00, 0x07, 0x01, 0xF0);
send6(CMD_WRITE_SINGLE, i * 4, 0xA8, 0x00, 0x07, 0x01, 0xF0);
// Misc Control
send6(CMD_WRITE_SINGLE, i * 2, 0x18, 0xF0, 0x00, 0xC1, 0x00);
send6(CMD_WRITE_SINGLE, i * 4, 0x18, 0xF0, 0x00, 0xC1, 0x00);
// Core Register Control
send6(CMD_WRITE_SINGLE, i * 2, 0x3C, 0x80, 0x00, 0x8B, 0x00);
send6(CMD_WRITE_SINGLE, i * 4, 0x3C, 0x80, 0x00, 0x8B, 0x00);
// Core Register Control
send6(CMD_WRITE_SINGLE, i * 2, 0x3C, 0x80, 0x00, 0x80, 0x0C);
send6(CMD_WRITE_SINGLE, i * 4, 0x3C, 0x80, 0x00, 0x80, 0x0C);
// Core Register Control
send6(CMD_WRITE_SINGLE, i * 2, 0x3C, 0x80, 0x00, 0x82, 0xAA);
send6(CMD_WRITE_SINGLE, i * 4, 0x3C, 0x80, 0x00, 0x82, 0xAA);
}

// ?
Expand All @@ -118,13 +118,13 @@ uint8_t BM1370::init(uint64_t frequency, uint16_t asic_count, uint32_t difficult

// register 10 is still a bit of a mystery. discussion: https://github.com/skot/ESP-Miner/pull/167

send6(CMD_WRITE_ALL, 0x00, 0x10, 0x00, 0x00, 0x11, 0x5A); //S19k Pro Default
// send6(CMD_WRITE_ALL, 0x00, 0x10, 0x00, 0x00, 0x11, 0x5A); //S19k Pro Default
// send6(CMD_WRITE_ALL, 0x00, 0x10, 0x00, 0x00, 0x14, 0x46); //S19XP-Luxos Default
// send6(CMD_WRITE_ALL, 0x00, 0x10, 0x00, 0x00, 0x15, 0x1C); //S19XP-Stock Default
// send6(CMD_WRITE_ALL, 0x00, 0x10, 0x00, 0x0F, 0x00, 0x00); //supposedly the "full" 32bit nonce range
//send6(CMD_WRITE_ALL, 0x00, 0x10, 0x00, 0x00, 0x15, 0xA4); // S21-Stock Default
// this creates duplicate nonces
// send6(CMD_WRITE_ALL, 0x00, 0x10, 0x00, 0x00, 0x1e, 0xB5); // S21-Pro
send6(CMD_WRITE_ALL, 0x00, 0x10, 0x00, 0x00, 0x1e, 0xB5); // S21-Pro

send6(CMD_WRITE_ALL, 0x00, 0xA4, 0x90, 0x00, 0xFF, 0xFF);

Expand Down

0 comments on commit f6fab1f

Please sign in to comment.