I've been playing for sometime with the esp32 ADC calibration found a nice quick sketch that assist with that:
https://github.com/tommag/ESP32_ADC_Calibration_tool
and burned the Fuse according to the values the sketch game me:
Code: Select all
Final ADC readings after 4096 samples: 308
Now, apply 850mV to GPIO 25 and GPIO34. Press Enter when ready.
Final ADC readings after 4096 samples: 3181
Scaled and shifted calibration values: A1 = 7, B1 = -21, A2 = 918, B2 = 172
EFUSE_BLK3_RDATA3 value: 0x5616F587
------------------------------
To burn these calibration values permanently use the following commands:
echo -n -e \\x87\\xf5\\x16\\x56 > efuse_blk3.bin
espefuse.py burn_block_data --offset 12 BLK3 efuse_blk3.bin
espefuse.py burn_efuse BLK3_PART_RESERVE 1
Code: Select all
echo -n -e \\x87\\xf5\\x16\\x56 > efuse_blk3.bin
now trying to burn it again it says the following
Is there a not too painful way to re write this fuse block?A fatal error occurred: Efuse block already has values written.
Also how does the
Code: Select all
espefuse.py burn_block_data --offset 12 BLK3 efuse_blk3.bin
less related but still might be relevant:
After flash the TP calibration ADC eFuse registers, Do you just call esp_adc_cal_raw_to_voltage(); to get the correct values or do I have to read the TP calibration values and re use them everytime the sketch inits?