Set to -O2 mode idf.py menuconfig -> compiler options ### Opt CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF=y CONFIG_COMPILER_OPTIMIZATION_PERF=y CONFIG_FREERTOS_HZ=1000 ### CACHE CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_32B=y CONFIG_ESP32S3_DATA_CACHE_64KB=y CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y CONFIG_ESP32S3_DATA_CACHE_LINE_SIZE=64 ================================= Initialize variables with 0 for -O2 --- TPS546.c.ORIG 2025-05-20 18:47:35.414286863 -0700 +++ TPS546.c 2025-05-20 18:18:55.246900821 -0700 @@ -333,8 +333,8 @@ esp_err_t TPS546_init(TPS546_CONFIG config) { uint8_t data[7]; - uint8_t u8_value; - uint16_t u16_value; + uint8_t u8_value = 0; + uint16_t u16_value = 0; uint8_t read_mfr_revision[4]; int temp; uint8_t comp_config[5]; @@ -633,7 +633,7 @@ int TPS546_get_frequency(void) { - uint16_t value; + uint16_t value = 0; int freq; smb_read_word(PMBUS_FREQUENCY_SWITCH, &value); @@ -644,7 +644,7 @@ void TPS546_set_frequency(int newfreq) { - uint16_t value; + uint16_t value = 0; //int freq; ESP_LOGI(TAG, "Writing new frequency: %d", newfreq); @@ -659,7 +659,7 @@ int TPS546_get_temperature(void) { - uint16_t value; + uint16_t value = 0; int temp; smb_read_word(PMBUS_READ_TEMPERATURE_1, &value); @@ -669,7 +669,7 @@ float TPS546_get_vin(void) { - uint16_t u16_value; + uint16_t u16_value = 0; float vin /* Get voltage input (ULINEAR16) */ @@ -687,7 +687,7 @@ float TPS546_get_iout(void) { - uint16_t u16_value; + uint16_t u16_value = 0; float iout; //set the phase register to 0xFF to read all phases @@ -713,7 +713,7 @@ float TPS546_get_vout(void) { - uint16_t u16_value; + uint16_t u16_value = 0; float vout; /* Get voltage output (ULINEAR16) */ @@ -1009,7 +1009,7 @@ void TPS546_show_voltage_settings(void) { - uint16_t u16_value; + uint16_t u16_value = 0; uint8_t u8_value; float f_value; ========================