├── .gitignore ├── .travis.yml ├── README.md ├── doc ├── 20190625_calibration_results.ods └── adc_error_mv.png ├── include └── README ├── lib └── README ├── platformio.ini ├── src ├── main.c └── sdkconfig.h └── test └── README /.gitignore: -------------------------------------------------------------------------------- 1 | .pio 2 | .pioenvs 3 | .piolibdeps 4 | .vscode/.browse.c_cpp.db* 5 | .vscode/c_cpp_properties.json 6 | .vscode/launch.json 7 | .vscode -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # Continuous Integration (CI) is the practice, in software 2 | # engineering, of merging all developer working copies with a shared mainline 3 | # several times a day < https://docs.platformio.org/page/ci/index.html > 4 | # 5 | # Documentation: 6 | # 7 | # * Travis CI Embedded Builds with PlatformIO 8 | # < https://docs.travis-ci.com/user/integration/platformio/ > 9 | # 10 | # * PlatformIO integration with Travis CI 11 | # < https://docs.platformio.org/page/ci/travis.html > 12 | # 13 | # * User Guide for `platformio ci` command 14 | # < https://docs.platformio.org/page/userguide/cmd_ci.html > 15 | # 16 | # 17 | # Please choose one of the following templates (proposed below) and uncomment 18 | # it (remove "# " before each line) or use own configuration according to the 19 | # Travis CI documentation (see above). 20 | # 21 | 22 | 23 | # 24 | # Template #1: General project. Test it using existing `platformio.ini`. 25 | # 26 | 27 | # language: python 28 | # python: 29 | # - "2.7" 30 | # 31 | # sudo: false 32 | # cache: 33 | # directories: 34 | # - "~/.platformio" 35 | # 36 | # install: 37 | # - pip install -U platformio 38 | # - platformio update 39 | # 40 | # script: 41 | # - platformio run 42 | 43 | 44 | # 45 | # Template #2: The project is intended to be used as a library with examples. 46 | # 47 | 48 | # language: python 49 | # python: 50 | # - "2.7" 51 | # 52 | # sudo: false 53 | # cache: 54 | # directories: 55 | # - "~/.platformio" 56 | # 57 | # env: 58 | # - PLATFORMIO_CI_SRC=path/to/test/file.c 59 | # - PLATFORMIO_CI_SRC=examples/file.ino 60 | # - PLATFORMIO_CI_SRC=path/to/test/directory 61 | # 62 | # install: 63 | # - pip install -U platformio 64 | # - platformio update 65 | # 66 | # script: 67 | # - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N 68 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ESP32 ADC calibration tool 2 | 3 | This code is written to assist you in calibrating the ESP32 Analog to Digital converter. 4 | While newer chips are factory calibrated, older chips rely on a default VRef value and most of the time have poor ADC performance. 5 | 6 | This tool is based on this forum post : https://esp32.com/viewtopic.php?t=8774#p36882 . 7 | 8 | # Disclaimer 9 | **Performing an ADC calibration involves burning fuses, which is an irreversible operation. 10 | Use this code at your own risk.** 11 | 12 | # Setup 13 | Open this project with PlatformIO and upload to a ESP32 board. 14 | 15 | # Usage 16 | Open a serial console at 115200 bps on UART0. Then follow the instructions. 17 | 18 | The workflow is the following : 19 | 20 | 1. Apply 150mV to GPIO25 (ADC2) and GPIO34 (ADC1). It is advised to add a decoupling capacitor next to the pins. 21 | 22 | 2. Apply 850mV to GPIO25 and GPIO34 when requested. 23 | 24 | 3. Burn the calibration data into eFuse using `espefuse.py` tool and the values printed on the serial console. 25 | 26 | # Results 27 | ![ADC error chart](doc/adc_error_mv.png) 28 | 29 | For ADC1 the accuracy improved in the 0.2-2.5V range. Outside this range it seems that two point calibration is not used. -------------------------------------------------------------------------------- /doc/20190625_calibration_results.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommag/ESP32_ADC_Calibration_tool/893190db6c188249f171c9f4265349d3c4514474/doc/20190625_calibration_results.ods -------------------------------------------------------------------------------- /doc/adc_error_mv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommag/ESP32_ADC_Calibration_tool/893190db6c188249f171c9f4265349d3c4514474/doc/adc_error_mv.png -------------------------------------------------------------------------------- /include/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for project header files. 3 | 4 | A header file is a file containing C declarations and macro definitions 5 | to be shared between several project source files. You request the use of a 6 | header file in your project source file (C, C++, etc) located in `src` folder 7 | by including it, with the C preprocessing directive `#include'. 8 | 9 | ```src/main.c 10 | 11 | #include "header.h" 12 | 13 | int main (void) 14 | { 15 | ... 16 | } 17 | ``` 18 | 19 | Including a header file produces the same results as copying the header file 20 | into each source file that needs it. Such copying would be time-consuming 21 | and error-prone. With a header file, the related declarations appear 22 | in only one place. If they need to be changed, they can be changed in one 23 | place, and programs that include the header file will automatically use the 24 | new version when next recompiled. The header file eliminates the labor of 25 | finding and changing all the copies as well as the risk that a failure to 26 | find one copy will result in inconsistencies within a program. 27 | 28 | In C, the usual convention is to give header files names that end with `.h'. 29 | It is most portable to use only letters, digits, dashes, and underscores in 30 | header file names, and at most one dot. 31 | 32 | Read more about using header files in official GCC documentation: 33 | 34 | * Include Syntax 35 | * Include Operation 36 | * Once-Only Headers 37 | * Computed Includes 38 | 39 | https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html 40 | -------------------------------------------------------------------------------- /lib/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for project specific (private) libraries. 3 | PlatformIO will compile them to static libraries and link into executable file. 4 | 5 | The source code of each library should be placed in a an own separate directory 6 | ("lib/your_library_name/[here are source files]"). 7 | 8 | For example, see a structure of the following two libraries `Foo` and `Bar`: 9 | 10 | |--lib 11 | | | 12 | | |--Bar 13 | | | |--docs 14 | | | |--examples 15 | | | |--src 16 | | | |- Bar.c 17 | | | |- Bar.h 18 | | | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html 19 | | | 20 | | |--Foo 21 | | | |- Foo.c 22 | | | |- Foo.h 23 | | | 24 | | |- README --> THIS FILE 25 | | 26 | |- platformio.ini 27 | |--src 28 | |- main.c 29 | 30 | and a contents of `src/main.c`: 31 | ``` 32 | #include 33 | #include 34 | 35 | int main (void) 36 | { 37 | ... 38 | } 39 | 40 | ``` 41 | 42 | PlatformIO Library Dependency Finder will find automatically dependent 43 | libraries scanning project source files. 44 | 45 | More information about PlatformIO Library Dependency Finder 46 | - https://docs.platformio.org/page/librarymanager/ldf.html 47 | -------------------------------------------------------------------------------- /platformio.ini: -------------------------------------------------------------------------------- 1 | ; PlatformIO Project Configuration File 2 | ; 3 | ; Build options: build flags, source filter 4 | ; Upload options: custom upload port, speed and extra flags 5 | ; Library options: dependencies, extra library storages 6 | ; Advanced options: extra scripting 7 | ; 8 | ; Please visit documentation for the other options and examples 9 | ; https://docs.platformio.org/page/projectconf.html 10 | 11 | [env:featheresp32] 12 | platform = espressif32 13 | board = featheresp32 14 | framework = espidf 15 | monitor_speed = 115200 -------------------------------------------------------------------------------- /src/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2019 Tom Magnier 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | */ 24 | 25 | #include 26 | #include "freertos/FreeRTOS.h" 27 | #include "freertos/task.h" 28 | #include "driver/uart.h" 29 | #include "esp_system.h" 30 | #include "driver/gpio.h" 31 | #include "driver/adc.h" 32 | #include "esp_vfs_dev.h" 33 | #include "esp_adc_cal.h" 34 | #include "soc/efuse_reg.h" 35 | 36 | #define ADC_NUM_SAMPLES (4096) 37 | #define ADC1_CHANNEL (ADC_CHANNEL_6) //GPIO34 = ADC1 channel 6 38 | #define ADC2_CHANNEL (ADC_CHANNEL_8) //GPIO25 = ADC2 channel 8 39 | #define DEFAULT_VREF (1100) //Used for old/new calibration comparison 40 | 41 | /* Following functions taken from esp_adc_cal_mod.c from https://esp32.com/viewtopic.php?t=8774#p36882 */ 42 | #define TP_LOW1_OFFSET 278 43 | #define TP_LOW2_OFFSET 421 44 | #define TP_LOW_MASK 0x7F 45 | #define TP_LOW_VOLTAGE 150 46 | #define TP_HIGH1_OFFSET 3265 47 | #define TP_HIGH2_OFFSET 3406 48 | #define TP_HIGH_MASK 0x1FF 49 | #define TP_HIGH_VOLTAGE 850 50 | #define TP_STEP_SIZE 4 51 | 52 | static const uint32_t adc1_tp_atten_scale[4] = {65504, 86975, 120389, 224310}; 53 | static const uint32_t adc2_tp_atten_scale[4] = {65467, 86861, 120416, 224708}; 54 | static const uint32_t adc1_tp_atten_offset[4] = {0, 1, 27, 54}; 55 | static const uint32_t adc2_tp_atten_offset[4] = {0, 9, 26, 66}; 56 | 57 | static inline int decode_bits(uint32_t bits, uint32_t mask, bool is_twos_compl) 58 | { 59 | int ret; 60 | if (bits & (~(mask >> 1) & mask)) { //Check sign bit (MSB of mask) 61 | //Negative 62 | if (is_twos_compl) { 63 | ret = -(((~bits) + 1) & (mask >> 1)); //2's complement 64 | } else { 65 | ret = -(bits & (mask >> 1)); //Sign-magnitude 66 | } 67 | } else { 68 | //Positive 69 | ret = bits & (mask >> 1); 70 | } 71 | return ret; 72 | } 73 | 74 | static uint32_t read_efuse_tp_low_custom(adc_unit_t adc_num, uint32_t efuse_val) 75 | { 76 | //ADC reading at 150mV stored in two's complement format 77 | uint32_t ret; 78 | uint32_t bits; 79 | 80 | if (adc_num == ADC_UNIT_1) { 81 | ret = TP_LOW1_OFFSET; 82 | //bits = REG_GET_FIELD(TP_REG, EFUSE_RD_ADC1_TP_LOW); 83 | bits = (efuse_val >> EFUSE_RD_ADC1_TP_LOW_S) & EFUSE_RD_ADC1_TP_LOW_V; 84 | } else { 85 | ret = TP_LOW2_OFFSET; 86 | //bits = REG_GET_FIELD(TP_REG, EFUSE_RD_ADC2_TP_LOW); 87 | bits = (efuse_val >> EFUSE_RD_ADC2_TP_LOW_S) & EFUSE_RD_ADC2_TP_LOW_V; 88 | } 89 | ret += decode_bits(bits, TP_LOW_MASK, true) * TP_STEP_SIZE; 90 | return ret; //Reading of ADC at 150mV 91 | } 92 | 93 | static uint32_t read_efuse_tp_high_custom(adc_unit_t adc_num, uint32_t efuse_val) 94 | { 95 | //ADC reading at 850mV stored in two's complement format 96 | uint32_t ret; 97 | uint32_t bits; 98 | 99 | if (adc_num == ADC_UNIT_1) { 100 | ret = TP_HIGH1_OFFSET; 101 | //bits = REG_GET_FIELD(TP_REG, EFUSE_RD_ADC1_TP_HIGH); 102 | bits = (efuse_val >> EFUSE_RD_ADC1_TP_HIGH_S) & EFUSE_RD_ADC1_TP_HIGH_V; 103 | } else { 104 | ret = TP_HIGH2_OFFSET; 105 | //bits = REG_GET_FIELD(TP_REG, EFUSE_RD_ADC1_TP_HIGH); 106 | bits = (efuse_val >> EFUSE_RD_ADC1_TP_HIGH_S) & EFUSE_RD_ADC1_TP_HIGH_V; 107 | } 108 | ret += decode_bits(bits, TP_HIGH_MASK, true) * TP_STEP_SIZE; 109 | return ret; //Reading of ADC at 850mV 110 | } 111 | 112 | static void characterize_using_two_point(adc_unit_t adc_num, 113 | adc_atten_t atten, 114 | uint32_t high, 115 | uint32_t low, 116 | uint32_t *coeff_a, 117 | uint32_t *coeff_b) 118 | { 119 | const uint32_t *atten_scales; 120 | const uint32_t *atten_offsets; 121 | 122 | if (adc_num == ADC_UNIT_1) { //Using ADC 1 123 | atten_scales = adc1_tp_atten_scale; 124 | atten_offsets = adc1_tp_atten_offset; 125 | } else { //Using ADC 2 126 | atten_scales = adc2_tp_atten_scale; 127 | atten_offsets = adc2_tp_atten_offset; 128 | } 129 | //Characterize ADC-Voltage curve as y = (coeff_a * x) + coeff_b 130 | uint32_t delta_x = high - low; 131 | uint32_t delta_v = TP_HIGH_VOLTAGE - TP_LOW_VOLTAGE; 132 | //Where coeff_a = (delta_v/delta_x) * atten_scale 133 | *coeff_a = (delta_v * atten_scales[atten] + (delta_x / 2)) / delta_x; //+(delta_x/2) for rounding 134 | //Where coeff_b = high_v - ((delta_v/delta_x) * high_x) + atten_offset 135 | *coeff_b = TP_HIGH_VOLTAGE - ((delta_v * high + (delta_x / 2)) / delta_x) + atten_offsets[atten]; 136 | } 137 | 138 | esp_adc_cal_value_t esp_adc_cal_characterize_custom(adc_unit_t adc_num, 139 | adc_atten_t atten, 140 | adc_bits_width_t bit_width, 141 | esp_adc_cal_characteristics_t *chars, 142 | uint32_t efuse_blk3) 143 | { 144 | //Check parameters 145 | assert((adc_num == ADC_UNIT_1) || (adc_num == ADC_UNIT_2)); 146 | assert(chars != NULL); 147 | assert(bit_width < ADC_WIDTH_MAX); 148 | 149 | esp_adc_cal_value_t ret; 150 | 151 | //Initialize most fields 152 | esp_adc_cal_characterize(adc_num, atten, bit_width, DEFAULT_VREF, chars); 153 | 154 | //Characterize based on Two Point values 155 | uint32_t high = read_efuse_tp_high_custom(adc_num, efuse_blk3); 156 | uint32_t low = read_efuse_tp_low_custom(adc_num, efuse_blk3); 157 | characterize_using_two_point(adc_num, atten, high, low, &chars->coeff_a, &chars->coeff_b); 158 | ret = ESP_ADC_CAL_VAL_EFUSE_TP; 159 | 160 | return ret; 161 | } 162 | 163 | static void read_both_adc(uint16_t *adc1_result, uint16_t *adc2_result) 164 | { 165 | uint64_t adc1_acc = 0, adc2_acc = 0; 166 | 167 | for (int i = 0; i < ADC_NUM_SAMPLES; i++) 168 | { 169 | adc1_acc += adc1_get_raw((adc1_channel_t)ADC1_CHANNEL); 170 | int adc2_raw; 171 | adc2_get_raw((adc2_channel_t)ADC2_CHANNEL, ADC_WIDTH_BIT_12, &adc2_raw); 172 | adc2_acc += adc2_raw; 173 | 174 | // vTaskDelay(pdMS_TO_TICKS(1)); 175 | } 176 | 177 | *adc1_result = (uint16_t)(adc1_acc / ADC_NUM_SAMPLES); 178 | *adc2_result = (uint16_t)(adc2_acc / ADC_NUM_SAMPLES); 179 | } 180 | 181 | static void flush_stdin() 182 | { 183 | int ch; 184 | while ((ch = getchar()) != '\n' && ch != EOF); 185 | } 186 | 187 | static void calibrate_task() 188 | { 189 | printf("To begin Two Point calibration, apply 150mV to GPIO 25 and GPIO34.\n"); 190 | printf("Consider adding a 100nF decoupling capacitor to GND as close as possible to the GPIO.\n"); 191 | printf("Press Enter when ready\n"); 192 | getchar(); 193 | flush_stdin(); 194 | 195 | uint16_t adc1_150mV, adc2_150mV; 196 | read_both_adc(&adc1_150mV, &adc2_150mV); 197 | printf("\nFinal ADC readings after %d samples: %4hu, %4hu\n", ADC_NUM_SAMPLES, adc1_150mV, adc2_150mV); 198 | 199 | printf("\nNow, apply 850mV to GPIO 25 and GPIO34. Press Enter when ready.\n"); 200 | getchar(); 201 | flush_stdin(); 202 | 203 | uint16_t adc1_850mV, adc2_850mV; 204 | read_both_adc(&adc1_850mV, &adc2_850mV); 205 | printf("\nFinal ADC readings after %d samples: %4hu, %4hu\n", ADC_NUM_SAMPLES, adc1_850mV, adc2_850mV); 206 | 207 | //Uncomment to test calculation with the forum post example. Should be 0xE778F207 at the end. 208 | // adc1_150mV = 306; 209 | // adc1_850mV = 3153; 210 | // adc2_150mV = 389; 211 | // adc2_850mV = 3206; 212 | 213 | /* Scaling and shifting as per https://esp32.com/viewtopic.php?t=8774#p36882 */ 214 | int a1 = (adc1_150mV - TP_LOW1_OFFSET) / TP_STEP_SIZE; 215 | int b1 = (adc1_850mV - TP_HIGH1_OFFSET) / TP_STEP_SIZE; 216 | int a2 = (adc2_150mV - TP_LOW2_OFFSET) / TP_STEP_SIZE; 217 | int b2 = (adc2_850mV - TP_HIGH2_OFFSET) / TP_STEP_SIZE; 218 | 219 | printf("\nScaled and shifted calibration values: A1 = %d, B1 = %d, A2 = %d, B2 = %d", a1, b1, a2, b2); 220 | 221 | /* Modify two's complement to account for calibrated 0 value */ 222 | if (a1 == 0) a1 = 0x40; 223 | if (a2 == 0) a2 = 0x40; 224 | if (b1 == 0) b1 = 0x100; 225 | if (b2 == 0) b2 = 0x100; 226 | 227 | /* Concatenate into a single 32 bit value */ 228 | uint32_t efuse_blk3_value = (a1 & TP_LOW_MASK) | 229 | (b1 & TP_HIGH_MASK) << 7 | 230 | (a2 & TP_LOW_MASK) << 16 | 231 | (b2 & TP_HIGH_MASK) << 23; 232 | printf("\nEFUSE_BLK3_RDATA3 value: 0x%08X\n", efuse_blk3_value); 233 | 234 | printf("------------------------------\n"); 235 | printf("To burn these calibration values permanently use the following commands:\n\n"); 236 | printf("echo -n -e \\\\x%02x\\\\x%02x\\\\x%02x\\\\x%02x > efuse_blk3.bin\n", 237 | efuse_blk3_value & 0xFF, 238 | (efuse_blk3_value >> 8) & 0xFF, 239 | (efuse_blk3_value >> 16) & 0xFF, 240 | (efuse_blk3_value >> 24 & 0xFF)); 241 | printf("espefuse.py burn_block_data --offset 12 BLK3 efuse_blk3.bin\n"); 242 | printf("espefuse.py burn_efuse BLK3_PART_RESERVE 1\n\n"); 243 | printf("------------------------------\n"); 244 | 245 | 246 | 247 | /* Try the new values */ 248 | adc1_config_channel_atten(ADC1_CHANNEL, ADC_ATTEN_11db); 249 | adc2_config_channel_atten(ADC2_CHANNEL, ADC_ATTEN_11db); 250 | 251 | esp_adc_cal_characteristics_t adc1_old_chars, adc1_new_chars, adc2_old_chars, adc2_new_chars; 252 | esp_adc_cal_characterize(ADC_UNIT_1, ADC_ATTEN_11db, ADC_WIDTH_12Bit, DEFAULT_VREF, &adc1_old_chars); 253 | esp_adc_cal_characterize(ADC_UNIT_2, ADC_ATTEN_11db, ADC_WIDTH_12Bit, DEFAULT_VREF, &adc2_old_chars); 254 | esp_adc_cal_characterize_custom(ADC_UNIT_1, ADC_ATTEN_11db, ADC_WIDTH_12Bit, &adc1_new_chars, efuse_blk3_value); 255 | esp_adc_cal_characterize_custom(ADC_UNIT_2, ADC_ATTEN_11db, ADC_WIDTH_12Bit, &adc2_new_chars, efuse_blk3_value); 256 | 257 | printf("You can now change the voltage to test the new vs old calibration values.\nAttenuation is set to 11dB so you can measure voltages up to 3.3V.\n"); 258 | printf("Current ADC reading: \nADC1\t\t\t\t\tADC2\nRaw\tOld cal mV\tNew cal mV\tRaw\tOld cal mV\tNew cal mV\n"); 259 | while (1) 260 | { 261 | uint16_t adc1_val, adc2_val; 262 | read_both_adc(&adc1_val, &adc2_val); 263 | printf("\r%4u\t%4u\t\t%4u\t\t%4u\t%4u\t\t%4u", 264 | adc1_val, 265 | esp_adc_cal_raw_to_voltage(adc1_val, &adc1_old_chars), 266 | esp_adc_cal_raw_to_voltage(adc1_val, &adc1_new_chars), 267 | adc2_val, 268 | esp_adc_cal_raw_to_voltage(adc2_val, &adc2_old_chars), 269 | esp_adc_cal_raw_to_voltage(adc2_val, &adc2_new_chars)); 270 | 271 | vTaskDelay(pdMS_TO_TICKS(100)); 272 | } 273 | } 274 | 275 | static void init_stdin() 276 | { 277 | /* Disable buffering on stdin */ 278 | setvbuf(stdin, NULL, _IONBF, 0); 279 | 280 | /* Minicom, screen, idf_monitor send CR when ENTER key is pressed */ 281 | esp_vfs_dev_uart_set_rx_line_endings(ESP_LINE_ENDINGS_CR); 282 | /* Move the caret to the beginning of the next line on '\n' */ 283 | esp_vfs_dev_uart_set_tx_line_endings(ESP_LINE_ENDINGS_CRLF); 284 | 285 | /* Configure UART. Note that REF_TICK is used so that the baud rate remains 286 | * correct while APB frequency is changing in light sleep mode. 287 | */ 288 | const uart_config_t uart_config = { 289 | .baud_rate = 115200, 290 | .data_bits = UART_DATA_8_BITS, 291 | .parity = UART_PARITY_DISABLE, 292 | .stop_bits = UART_STOP_BITS_1, 293 | .use_ref_tick = true 294 | }; 295 | ESP_ERROR_CHECK( uart_param_config(UART_NUM_0, &uart_config) ); 296 | 297 | /* Install UART driver for interrupt-driven reads and writes */ 298 | ESP_ERROR_CHECK( uart_driver_install(UART_NUM_0, 299 | 256, 0, 0, NULL, 0) ); 300 | 301 | esp_vfs_dev_uart_use_driver(UART_NUM_0); 302 | } 303 | 304 | static void init_adc() 305 | { 306 | adc1_config_width(ADC_WIDTH_BIT_12); 307 | adc1_config_channel_atten(ADC1_CHANNEL, ADC_ATTEN_DB_0); 308 | 309 | adc2_config_channel_atten(ADC2_CHANNEL, ADC_ATTEN_DB_0); 310 | } 311 | 312 | void app_main() 313 | { 314 | init_stdin(); 315 | 316 | printf("Press Enter to begin.\n"); 317 | getchar(); 318 | flush_stdin(); 319 | 320 | /* Print chip information */ 321 | esp_chip_info_t chip_info; 322 | esp_chip_info(&chip_info); 323 | printf("This is ESP32 chip with %d CPU cores, WiFi%s%s, ", 324 | chip_info.cores, 325 | (chip_info.features & CHIP_FEATURE_BT) ? "/BT" : "", 326 | (chip_info.features & CHIP_FEATURE_BLE) ? "/BLE" : ""); 327 | 328 | printf("silicon revision %d\n", chip_info.revision); 329 | 330 | //Check TP is burned into eFuse 331 | printf("eFuse Two Point: %s\n", 332 | (esp_adc_cal_check_efuse(ESP_ADC_CAL_VAL_EFUSE_TP) == ESP_OK) ? "present" : "not present"); 333 | 334 | //Check Vref is burned into eFuse 335 | printf("eFuse Vref: %s\n", 336 | (esp_adc_cal_check_efuse(ESP_ADC_CAL_VAL_EFUSE_VREF) == ESP_OK) ? "present" : "not present"); 337 | 338 | init_adc(); 339 | 340 | printf("Press Enter to begin calibration.\n"); 341 | getchar(); 342 | flush_stdin(); 343 | 344 | xTaskCreate(calibrate_task, "calibrate_task", 2048, NULL, 10, NULL); 345 | } -------------------------------------------------------------------------------- /src/sdkconfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Automatically generated file; DO NOT EDIT. 4 | * Espressif IoT Development Framework Configuration 5 | * 6 | */ 7 | #define CONFIG_GATTC_ENABLE 1 8 | #define CONFIG_ESP32_PHY_MAX_TX_POWER 20 9 | #define CONFIG_TRACEMEM_RESERVE_DRAM 0x0 10 | #define CONFIG_FREERTOS_MAX_TASK_NAME_LEN 16 11 | #define CONFIG_MQTT_TRANSPORT_SSL 1 12 | #define CONFIG_BLE_SMP_ENABLE 1 13 | #define CONFIG_SDP_INITIAL_TRACE_LEVEL 2 14 | #define CONFIG_MB_SERIAL_TASK_PRIO 10 15 | #define CONFIG_MQTT_PROTOCOL_311 1 16 | #define CONFIG_TCP_RECVMBOX_SIZE 6 17 | #define CONFIG_FATFS_CODEPAGE_437 1 18 | #define CONFIG_BLE_SCAN_DUPLICATE 1 19 | #define CONFIG_AVDT_TRACE_LEVEL_WARNING 1 20 | #define CONFIG_AWS_IOT_SHADOW_MAX_SIMULTANEOUS_ACKS 10 21 | #define CONFIG_TCP_WND_DEFAULT 5744 22 | #define CONFIG_PARTITION_TABLE_OFFSET 0x8000 23 | #define CONFIG_SW_COEXIST_ENABLE 1 24 | #define CONFIG_SPIFFS_USE_MAGIC_LENGTH 1 25 | #define CONFIG_AVCT_INITIAL_TRACE_LEVEL 2 26 | #define CONFIG_IPC_TASK_STACK_SIZE 1024 27 | #define CONFIG_FATFS_PER_FILE_CACHE 1 28 | #define CONFIG_ESPTOOLPY_FLASHFREQ "40m" 29 | #define CONFIG_AWS_IOT_SHADOW_MAX_SIZE_OF_THING_NAME 20 30 | #define CONFIG_MBEDTLS_KEY_EXCHANGE_RSA 1 31 | #define CONFIG_UDP_RECVMBOX_SIZE 6 32 | #define CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE 0 33 | #define CONFIG_MBEDTLS_AES_C 1 34 | #define CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED 1 35 | #define CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN 752 36 | #define CONFIG_MBEDTLS_GCM_C 1 37 | #define CONFIG_ESPTOOLPY_FLASHSIZE "2MB" 38 | #define CONFIG_HEAP_POISONING_DISABLED 1 39 | #define CONFIG_SPIFFS_CACHE_WR 1 40 | #define CONFIG_BROWNOUT_DET_LVL_SEL_0 1 41 | #define CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER 1 42 | #define CONFIG_EMAC_L2_TO_L3_RX_BUF_MODE 1 43 | #define CONFIG_BTDM_CONTROLLER_MODEM_SLEEP 1 44 | #define CONFIG_SPIFFS_CACHE 1 45 | #define CONFIG_INT_WDT 1 46 | #define CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN 3 47 | #define CONFIG_MBEDTLS_SSL_PROTO_TLS1 1 48 | #define CONFIG_ESP_GRATUITOUS_ARP 1 49 | #define CONFIG_AWS_IOT_SHADOW_MAX_SIZE_OF_UNIQUE_CLIENT_ID_BYTES 80 50 | #define CONFIG_MBEDTLS_ECDSA_C 1 51 | #define CONFIG_ESPTOOLPY_FLASHFREQ_40M 1 52 | #define CONFIG_LOG_BOOTLOADER_LEVEL_INFO 1 53 | #define CONFIG_ESPTOOLPY_FLASHSIZE_2MB 1 54 | #define CONFIG_HTTPD_MAX_REQ_HDR_LEN 512 55 | #define CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE 0 56 | #define CONFIG_AWS_IOT_MQTT_PORT 8883 57 | #define CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS 1 58 | #define CONFIG_MBEDTLS_ECDH_C 1 59 | #define CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE 1 60 | #define CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM 10 61 | #define CONFIG_AWS_IOT_MQTT_MAX_RECONNECT_WAIT_INTERVAL 128000 62 | #define CONFIG_MBEDTLS_SSL_ALPN 1 63 | #define CONFIG_BTM_TRACE_LEVEL_WARNING 1 64 | #define CONFIG_MBEDTLS_PEM_WRITE_C 1 65 | #define CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN 4096 66 | #define CONFIG_RFCOMM_TRACE_LEVEL_WARNING 1 67 | #define CONFIG_LOG_DEFAULT_LEVEL_INFO 1 68 | #define CONFIG_BT_RESERVE_DRAM 0xdb5c 69 | #define CONFIG_FATFS_FS_LOCK 0 70 | #define CONFIG_IP_LOST_TIMER_INTERVAL 120 71 | #define CONFIG_SPIFFS_META_LENGTH 4 72 | #define CONFIG_ESP32_PANIC_PRINT_REBOOT 1 73 | #define CONFIG_MB_CONTROLLER_NOTIFY_QUEUE_SIZE 20 74 | #define CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED 1 75 | #define CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED 1 76 | #define CONFIG_AWS_IOT_MQTT_RX_BUF_LEN 512 77 | #define CONFIG_MB_SERIAL_BUF_SIZE 256 78 | #define CONFIG_CONSOLE_UART_BAUDRATE 115200 79 | #define CONFIG_LWIP_MAX_SOCKETS 10 80 | #define CONFIG_LWIP_NETIF_LOOPBACK 1 81 | #define CONFIG_MCA_TRACE_LEVEL_WARNING 1 82 | #define CONFIG_EMAC_TASK_PRIORITY 20 83 | #define CONFIG_TIMER_TASK_STACK_DEPTH 2048 84 | #define CONFIG_TCP_MSS 1436 85 | #define CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED 1 86 | #define CONFIG_BTIF_INITIAL_TRACE_LEVEL 2 87 | #define CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN_EFF 3 88 | #define CONFIG_FATFS_CODEPAGE 437 89 | #define CONFIG_APPL_TRACE_LEVEL_WARNING 1 90 | #define CONFIG_BTC_INITIAL_TRACE_LEVEL 2 91 | #define CONFIG_ESP32_DEFAULT_CPU_FREQ_160 1 92 | #define CONFIG_ULP_COPROC_RESERVE_MEM 0 93 | #define CONFIG_LWIP_MAX_UDP_PCBS 16 94 | #define CONFIG_ESPTOOLPY_BAUD 115200 95 | #define CONFIG_INT_WDT_CHECK_CPU1 1 96 | #define CONFIG_AVRC_INITIAL_TRACE_LEVEL 2 97 | #define CONFIG_ADC_CAL_LUT_ENABLE 1 98 | #define CONFIG_AWS_IOT_MQTT_TX_BUF_LEN 512 99 | #define CONFIG_FLASHMODE_DIO 1 100 | #define CONFIG_ESPTOOLPY_AFTER_RESET 1 101 | #define CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED 1 102 | #define CONFIG_LWIP_DHCPS_MAX_STATION_NUM 8 103 | #define CONFIG_TOOLPREFIX "xtensa-esp32-elf-" 104 | #define CONFIG_MBEDTLS_ECP_C 1 105 | #define CONFIG_FREERTOS_IDLE_TASK_STACKSIZE 1536 106 | #define CONFIG_MBEDTLS_RC4_DISABLED 1 107 | #define CONFIG_GAP_TRACE_LEVEL_WARNING 1 108 | #define CONFIG_CONSOLE_UART_NUM 0 109 | #define CONFIG_AWS_IOT_SHADOW_MAX_JSON_TOKEN_EXPECTED 120 110 | #define CONFIG_ESP32_APPTRACE_LOCK_ENABLE 1 111 | #define CONFIG_PTHREAD_STACK_MIN 768 112 | #define CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC 1 113 | #define CONFIG_ESPTOOLPY_BAUD_115200B 1 114 | #define CONFIG_TCP_OVERSIZE_MSS 1 115 | #define CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS 1 116 | #define CONFIG_CONSOLE_UART_DEFAULT 1 117 | #define CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS 4 118 | #define CONFIG_GATT_TRACE_LEVEL_WARNING 1 119 | #define CONFIG_ESPTOOLPY_FLASHSIZE_DETECT 1 120 | #define CONFIG_EXAMPLE_EMBEDDED_CERTS 1 121 | #define CONFIG_TIMER_TASK_STACK_SIZE 3584 122 | #define CONFIG_BTIF_TRACE_LEVEL_WARNING 1 123 | #define CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE 1 124 | #define CONFIG_HCI_INITIAL_TRACE_LEVEL 2 125 | #define CONFIG_AVDT_INITIAL_TRACE_LEVEL 2 126 | #define CONFIG_MBEDTLS_X509_CRL_PARSE_C 1 127 | #define CONFIG_SCAN_DUPLICATE_BY_DEVICE_ADDR 1 128 | #define CONFIG_AWS_IOT_SHADOW_MAX_SHADOW_TOPIC_LENGTH_WITHOUT_THINGNAME 60 129 | #define CONFIG_MB_SERIAL_TASK_STACK_SIZE 2048 130 | #define CONFIG_GATTS_SEND_SERVICE_CHANGE_AUTO 1 131 | #define CONFIG_LWIP_DHCPS_LEASE_UNIT 60 132 | #define CONFIG_SPIFFS_USE_MAGIC 1 133 | #define CONFIG_TCPIP_TASK_STACK_SIZE 3072 134 | #define CONFIG_BLUFI_TRACE_LEVEL_WARNING 1 135 | #define CONFIG_BLUEDROID_PINNED_TO_CORE_0 1 136 | #define CONFIG_TASK_WDT 1 137 | #define CONFIG_RFCOMM_INITIAL_TRACE_LEVEL 2 138 | #define CONFIG_MAIN_TASK_STACK_SIZE 3584 139 | #define CONFIG_SPIFFS_PAGE_CHECK 1 140 | #define CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0 1 141 | #define CONFIG_LWIP_MAX_ACTIVE_TCP 16 142 | #define CONFIG_TASK_WDT_TIMEOUT_S 5 143 | #define CONFIG_INT_WDT_TIMEOUT_MS 300 144 | #define CONFIG_ESPTOOLPY_FLASHMODE "dio" 145 | #define CONFIG_BTC_TASK_STACK_SIZE 3072 146 | #define CONFIG_BLUEDROID_ENABLED 1 147 | #define CONFIG_NEWLIB_STDIN_LINE_ENDING_CR 1 148 | #define CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA 1 149 | #define CONFIG_ESPTOOLPY_BEFORE "default_reset" 150 | #define CONFIG_ADC2_DISABLE_DAC 1 151 | #define CONFIG_FATFS_LFN_HEAP 1 152 | #define CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_NUM 100 153 | #define CONFIG_LOG_DEFAULT_LEVEL 3 154 | #define CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION 1 155 | #define CONFIG_TIMER_QUEUE_LENGTH 10 156 | #define CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT 1 157 | #define CONFIG_GATTS_SEND_SERVICE_CHANGE_MODE 0 158 | #define CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY 1 159 | #define CONFIG_MAKE_WARN_UNDEFINED_VARIABLES 1 160 | #define CONFIG_FATFS_TIMEOUT_MS 10000 161 | #define CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM 32 162 | #define CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS 1 163 | #define CONFIG_PAN_INITIAL_TRACE_LEVEL 2 164 | #define CONFIG_MBEDTLS_CCM_C 1 165 | #define CONFIG_SPI_MASTER_ISR_IN_IRAM 1 166 | #define CONFIG_MCA_INITIAL_TRACE_LEVEL 2 167 | #define CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER 20 168 | #define CONFIG_A2D_INITIAL_TRACE_LEVEL 2 169 | #define CONFIG_ESP32_RTC_CLK_CAL_CYCLES 1024 170 | #define CONFIG_ESP32_WIFI_TX_BA_WIN 6 171 | #define CONFIG_ESP32_WIFI_NVS_ENABLED 1 172 | #define CONFIG_MDNS_MAX_SERVICES 10 173 | #define CONFIG_EMAC_CHECK_LINK_PERIOD_MS 2000 174 | #define CONFIG_BTDM_LPCLK_SEL_MAIN_XTAL 1 175 | #define CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED 1 176 | #define CONFIG_LIBSODIUM_USE_MBEDTLS_SHA 1 177 | #define CONFIG_AWS_IOT_SDK 1 178 | #define CONFIG_DMA_RX_BUF_NUM 10 179 | #define CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED 1 180 | #define CONFIG_TCP_SYNMAXRTX 6 181 | #define CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA 1 182 | #define CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN_EFF 0 183 | #define CONFIG_PYTHON "python" 184 | #define CONFIG_MBEDTLS_ECP_NIST_OPTIM 1 185 | #define CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1 1 186 | #define CONFIG_ESPTOOLPY_COMPRESSED 1 187 | #define CONFIG_PARTITION_TABLE_FILENAME "partitions_singleapp.csv" 188 | #define CONFIG_MB_CONTROLLER_STACK_SIZE 4096 189 | #define CONFIG_TCP_SND_BUF_DEFAULT 5744 190 | #define CONFIG_GARP_TMR_INTERVAL 60 191 | #define CONFIG_LWIP_DHCP_MAX_NTP_SERVERS 1 192 | #define CONFIG_BNEP_INITIAL_TRACE_LEVEL 2 193 | #define CONFIG_HCI_TRACE_LEVEL_WARNING 1 194 | #define CONFIG_TCP_MSL 60000 195 | #define CONFIG_MBEDTLS_SSL_PROTO_TLS1_1 1 196 | #define CONFIG_LWIP_SO_REUSE_RXTOALL 1 197 | #define CONFIG_MB_CONTROLLER_NOTIFY_TIMEOUT 20 198 | #define CONFIG_PARTITION_TABLE_SINGLE_APP 1 199 | #define CONFIG_ESP32_WIFI_RX_BA_WIN 6 200 | #define CONFIG_MBEDTLS_X509_CSR_PARSE_C 1 201 | #define CONFIG_SPIFFS_USE_MTIME 1 202 | #define CONFIG_BTC_TRACE_LEVEL_WARNING 1 203 | #define CONFIG_EMAC_TASK_STACK_SIZE 3072 204 | #define CONFIG_SMP_TRACE_LEVEL_WARNING 1 205 | #define CONFIG_MB_QUEUE_LENGTH 20 206 | #define CONFIG_SW_COEXIST_PREFERENCE_VALUE 2 207 | #define CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA 1 208 | #define CONFIG_LWIP_DHCP_DOES_ARP_CHECK 1 209 | #define CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER 1 210 | #define CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE 2304 211 | #define CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V 1 212 | #define CONFIG_A2D_TRACE_LEVEL_WARNING 1 213 | #define CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY 2000 214 | #define CONFIG_AWS_IOT_MQTT_NUM_SUBSCRIBE_HANDLERS 5 215 | #define CONFIG_BROWNOUT_DET_LVL 0 216 | #define CONFIG_MBEDTLS_PEM_PARSE_C 1 217 | #define CONFIG_SPIFFS_GC_MAX_RUNS 10 218 | #define CONFIG_ESP32_APPTRACE_DEST_NONE 1 219 | #define CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC 1 220 | #define CONFIG_MBEDTLS_SSL_PROTO_TLS1_2 1 221 | #define CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA 1 222 | #define CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM 32 223 | #define CONFIG_HTTPD_MAX_URI_LEN 512 224 | #define CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED 1 225 | #define CONFIG_AVCT_TRACE_LEVEL_WARNING 1 226 | #define CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED 1 227 | #define CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1 1 228 | #define CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ 160 229 | #define CONFIG_MBEDTLS_HARDWARE_AES 1 230 | #define CONFIG_FREERTOS_HZ 100 231 | #define CONFIG_LOG_COLORS 1 232 | #define CONFIG_OSI_TRACE_LEVEL_WARNING 1 233 | #define CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE 1 234 | #define CONFIG_STACK_CHECK_NONE 1 235 | #define CONFIG_ADC_CAL_EFUSE_TP_ENABLE 1 236 | #define CONFIG_BNEP_TRACE_LEVEL_WARNING 1 237 | #define CONFIG_FREERTOS_ASSERT_FAIL_ABORT 1 238 | #define CONFIG_BROWNOUT_DET 1 239 | #define CONFIG_AWS_IOT_SHADOW_MAX_SIMULTANEOUS_THINGNAMES 10 240 | #define CONFIG_ESP32_XTAL_FREQ 40 241 | #define CONFIG_OSI_INITIAL_TRACE_LEVEL 2 242 | #define CONFIG_MONITOR_BAUD_115200B 1 243 | #define CONFIG_LOG_BOOTLOADER_LEVEL 3 244 | #define CONFIG_MBEDTLS_TLS_ENABLED 1 245 | #define CONFIG_LWIP_MAX_RAW_PCBS 16 246 | #define CONFIG_SMP_ENABLE 1 247 | #define CONFIG_HID_TRACE_LEVEL_WARNING 1 248 | #define CONFIG_AVRC_TRACE_LEVEL_WARNING 1 249 | #define CONFIG_MBEDTLS_SSL_SESSION_TICKETS 1 250 | #define CONFIG_SPIFFS_MAX_PARTITIONS 3 251 | #define CONFIG_ESP_ERR_TO_NAME_LOOKUP 1 252 | #define CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE_0 1 253 | #define CONFIG_MBEDTLS_SSL_RENEGOTIATION 1 254 | #define CONFIG_HID_INITIAL_TRACE_LEVEL 2 255 | #define CONFIG_ESPTOOLPY_BEFORE_RESET 1 256 | #define CONFIG_MB_EVENT_QUEUE_TIMEOUT 20 257 | #define CONFIG_ESPTOOLPY_BAUD_OTHER_VAL 115200 258 | #define CONFIG_AWS_EXAMPLE_CLIENT_ID "myesp32" 259 | #define CONFIG_SPIFFS_OBJ_NAME_LEN 32 260 | #define CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT 5 261 | #define CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN_EFF 0 262 | #define CONFIG_PARTITION_TABLE_MD5 1 263 | #define CONFIG_TCPIP_RECVMBOX_SIZE 32 264 | #define CONFIG_TCP_MAXRTX 12 265 | #define CONFIG_BTM_INITIAL_TRACE_LEVEL 2 266 | #define CONFIG_ESPTOOLPY_AFTER "hard_reset" 267 | #define CONFIG_TCPIP_TASK_AFFINITY 0x7FFFFFFF 268 | #define CONFIG_LWIP_SO_REUSE 1 269 | #define CONFIG_ESP32_XTAL_FREQ_40 1 270 | #define CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY 1 271 | #define CONFIG_DMA_TX_BUF_NUM 10 272 | #define CONFIG_LWIP_MAX_LISTENING_TCP 16 273 | #define CONFIG_FREERTOS_INTERRUPT_BACKTRACE 1 274 | #define CONFIG_WL_SECTOR_SIZE 4096 275 | #define CONFIG_ESP32_DEBUG_OCDAWARE 1 276 | #define CONFIG_MQTT_TRANSPORT_WEBSOCKET 1 277 | #define CONFIG_TIMER_TASK_PRIORITY 1 278 | #define CONFIG_MBEDTLS_TLS_CLIENT 1 279 | #define CONFIG_AWS_IOT_MQTT_MIN_RECONNECT_WAIT_INTERVAL 1000 280 | #define CONFIG_BTDM_CONTROLLER_HCI_MODE_VHCI 1 281 | #define CONFIG_BT_ENABLED 1 282 | #define CONFIG_SDP_TRACE_LEVEL_WARNING 1 283 | #define CONFIG_SW_COEXIST_PREFERENCE_BALANCE 1 284 | #define CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED 1 285 | #define CONFIG_MONITOR_BAUD 115200 286 | #define CONFIG_ESP32_DEBUG_STUBS_ENABLE 1 287 | #define CONFIG_TCPIP_LWIP 1 288 | #define CONFIG_REDUCE_PHY_TX_POWER 1 289 | #define CONFIG_BOOTLOADER_WDT_TIME_MS 9000 290 | #define CONFIG_PAN_TRACE_LEVEL_WARNING 1 291 | #define CONFIG_FREERTOS_CORETIMER_0 1 292 | #define CONFIG_PARTITION_TABLE_CUSTOM_FILENAME "partitions.csv" 293 | #define CONFIG_MBEDTLS_HAVE_TIME 1 294 | #define CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY 1 295 | #define CONFIG_TCP_QUEUE_OOSEQ 1 296 | #define CONFIG_GATTS_ENABLE 1 297 | #define CONFIG_ADC_CAL_EFUSE_VREF_ENABLE 1 298 | #define CONFIG_MBEDTLS_TLS_SERVER 1 299 | #define CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT 1 300 | #define CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_SUPPORTED 1 301 | #define CONFIG_FREERTOS_ISR_STACKSIZE 1536 302 | #define CONFIG_SUPPORT_TERMIOS 1 303 | #define CONFIG_OPENSSL_ASSERT_DO_NOTHING 1 304 | #define CONFIG_WL_SECTOR_SIZE_4096 1 305 | #define CONFIG_OPTIMIZATION_LEVEL_DEBUG 1 306 | #define CONFIG_GATT_INITIAL_TRACE_LEVEL 2 307 | #define CONFIG_FREERTOS_NO_AFFINITY 0x7FFFFFFF 308 | #define CONFIG_AWS_IOT_MQTT_HOST "" 309 | #define CONFIG_L2CAP_TRACE_LEVEL_WARNING 1 310 | #define CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED 1 311 | #define CONFIG_MB_TIMER_INDEX 0 312 | #define CONFIG_SCAN_DUPLICATE_TYPE 0 313 | #define CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED 1 314 | #define CONFIG_APPL_INITIAL_TRACE_LEVEL 2 315 | #define CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED 1 316 | #define CONFIG_SMP_INITIAL_TRACE_LEVEL 2 317 | #define CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA 1 318 | #define CONFIG_SPI_SLAVE_ISR_IN_IRAM 1 319 | #define CONFIG_L2CAP_INITIAL_TRACE_LEVEL 2 320 | #define CONFIG_SYSTEM_EVENT_QUEUE_SIZE 32 321 | #define CONFIG_BT_ACL_CONNECTIONS 4 322 | #define CONFIG_FATFS_MAX_LFN 255 323 | #define CONFIG_ESP32_WIFI_TX_BUFFER_TYPE 1 324 | #define CONFIG_BOOTLOADER_WDT_ENABLE 1 325 | #define CONFIG_GAP_INITIAL_TRACE_LEVEL 2 326 | #define CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED 1 327 | #define CONFIG_LWIP_LOOPBACK_MAX_PBUFS 8 328 | #define CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN 16384 329 | #define CONFIG_MB_TIMER_GROUP 0 330 | #define CONFIG_SPI_FLASH_ROM_DRIVER_PATCH 1 331 | #define CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE 1 332 | #define CONFIG_SPIFFS_PAGE_SIZE 256 333 | #define CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED 1 334 | #define CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0 1 335 | #define CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT 3072 336 | #define CONFIG_MB_TIMER_PORT_ENABLED 1 337 | #define CONFIG_DUPLICATE_SCAN_CACHE_SIZE 200 338 | #define CONFIG_MONITOR_BAUD_OTHER_VAL 115200 339 | #define CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF 1 340 | #define CONFIG_ESPTOOLPY_PORT "/dev/ttyUSB0" 341 | #define CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS 1 342 | #define CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN 1 343 | #define CONFIG_BLE_ADV_REPORT_DISCARD_THRSHOLD 20 344 | #define CONFIG_BLUEDROID_PINNED_TO_CORE 0 345 | #define CONFIG_BTDM_MODEM_SLEEP_MODE_ORIG 1 346 | #define CONFIG_ESP32_WIFI_IRAM_OPT 1 347 | #define CONFIG_BLUFI_INITIAL_TRACE_LEVEL 2 348 | #define CONFIG_FATFS_API_ENCODING_ANSI_OEM 1 349 | -------------------------------------------------------------------------------- /test/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for PIO Unit Testing and project tests. 3 | 4 | Unit Testing is a software testing method by which individual units of 5 | source code, sets of one or more MCU program modules together with associated 6 | control data, usage procedures, and operating procedures, are tested to 7 | determine whether they are fit for use. Unit testing finds problems early 8 | in the development cycle. 9 | 10 | More information about PIO Unit Testing: 11 | - https://docs.platformio.org/page/plus/unit-testing.html 12 | --------------------------------------------------------------------------------