fix: wake bms up before requesting serial ID

This commit is contained in:
Kilian Bracher 2025-03-23 15:43:59 +01:00
parent 5a50e4ebcd
commit 91bc0b20c8

View File

@ -31,7 +31,9 @@ HAL_StatusTypeDef amsReset() {
amsWakeUp(); amsWakeUp();
readCMD(SRST, CMD_EMPTY_BUFFER, 0); readCMD(SRST, CMD_EMPTY_BUFFER, 0);
/* uint8_t sidbuffer[CMD_BUFFER_SIZE(SID_GROUP_SIZE)] = {}; amsWakeUp();
uint8_t sidbuffer[CMD_BUFFER_SIZE(SID_GROUP_SIZE)] = {};
if (readCMD(RDSID, sidbuffer, SID_GROUP_SIZE) != HAL_OK) { if (readCMD(RDSID, sidbuffer, SID_GROUP_SIZE) != HAL_OK) {
bool nonzero = false; bool nonzero = false;
for (size_t i = 0; i < N_BMS; i++) { for (size_t i = 0; i < N_BMS; i++) {
@ -61,7 +63,7 @@ HAL_StatusTypeDef amsReset() {
} }
debug_log_cont(LOG_LEVEL_INFO, "0x%lx%lx ", (uint32_t)(id >> 32), (uint32_t)(id & 0xFFFFFFFF)); //newlib does not support %llu debug_log_cont(LOG_LEVEL_INFO, "0x%lx%lx ", (uint32_t)(id >> 32), (uint32_t)(id & 0xFFFFFFFF)); //newlib does not support %llu
} }
} */ }
mcuDelay(10); mcuDelay(10);
amsWakeUp(); amsWakeUp();