diff --git a/uappbase/service/config_service.cpp b/uappbase/service/config_service.cpp index 8a5d1d2..c8427c8 100644 --- a/uappbase/service/config_service.cpp +++ b/uappbase/service/config_service.cpp @@ -58,6 +58,7 @@ bool ConfigService::initialize() { AppHal::MX_I2C1_Init(); eeprom.initialize(&hi2c1); + eeprom.scan_i2c(); static_assert(kcfg_max == CFG_MAX_INDEX, ""); if (!checkcfg()) { diff --git a/ucomponents/eeprom/m24m02_i2c_eeprom.cpp b/ucomponents/eeprom/m24m02_i2c_eeprom.cpp index 6c00811..0ca318d 100644 --- a/ucomponents/eeprom/m24m02_i2c_eeprom.cpp +++ b/ucomponents/eeprom/m24m02_i2c_eeprom.cpp @@ -102,6 +102,7 @@ int32_t M24M02_I2C_EEPROM::read32(uint16_t add, uint32_t* val) { void M24M02_I2C_EEPROM::scan_i2c() { memset(i2c_ping_state, 0, sizeof(i2c_ping_state)); + ZLOGI(TAG, "scan i2c"); for (uint16_t i = 0; i < 255; i++) { HAL_StatusTypeDef status = HAL_I2C_IsDeviceReady(m_i2c_handle, i << 1, 1, 1); if (status == HAL_OK) { @@ -111,6 +112,7 @@ void M24M02_I2C_EEPROM::scan_i2c() { i2c_ping_state[i] = false; } } + ZLOGI(TAG, "scan i2c done"); } void M24M02_I2C_EEPROM::write_test_data_rom() {