Download address: https://pan.baidu.com/s/1-oGcJ0p-iV4WZ9d6lL0KaA
Extraction code: 7v35
Espressif4_4_1 streamlined portable: https://download.csdn.net/download/qq_29246181/86399639
VSCode1.61_Embedded Convenient_Including essential plug-ins: https://download.csdn.net/download/qq_29246181/86244991
1. Unzip the compressed file to the root directory of drive C
C:prog
Copy [settings.json] to "C:UsersUsernameAppDataRoamingCodeUser"
2. Install the VScode plugin Espressif IDF
3. Compile the routine and debug
Use VScode to open C:progEspressifesp-idfexamplesperipheralsgpiogeneric_gpio
Select the corresponding chip model and then execute the compilation
After compiling, execute burning
Open the observation window and view the serial port log
The second method: Change any drive letter
Portable vscode v1.69.1, integrated embedded common plug-ins (unzip and use) Download:
Portable Espressif v4.4.1, after decompression, write the environment variables. Download:
The environment variables that need to be added are as follows:
IDF_PATH D:progEspressif
IDF_PYTHON_ENV_PATH %IDF_PATH%toolspython_envidf4.4_py3.8_env
IDF_TOOLS_PATH %IDF_PATH%tools
Add the following to PATH:
Manually add once
%IDF_PATH%;
%IDF_TOOLS_PATH%toolsidf-python3.8.7;
%IDF_TOOLS_PATH%toolsxtensa-esp32-elfesp-2021r2-patch3-8.4.0xtensa-esp32-elfbin;
%IDF_TOOLS_PATH%toolsxtensa-esp32s2-elfesp-2021r2-patch3-8.4.0xtensa-esp32s2-elfbin;
%IDF_TOOLS_PATH%toolsxtensa-esp32s3-elfesp-2021r2-patch3-8.4.0xtensa-esp32s3-elfbin;
%IDF_TOOLS_PATH%toolsriscv32-esp-elfesp-2021r2-patch3-8.4.0riscv32-esp-elfbin;
%IDF_TOOLS_PATH%toolsesp32ulp-elf2.28.51-esp-20191205esp32ulp-elf-binutilsbin;
%IDF_TOOLS_PATH%toolsesp32s2ulp-elf2.28.51-esp-20191205esp32s2ulp-elf-binutilsbin;
%IDF_TOOLS_PATH%toolscmake3.20.3bin;
%IDF_TOOLS_PATH%toolsopenocd-esp32v0.11.0-esp32-20211220openocd-esp32bin;
%IDF_TOOLS_PATH%toolsninja1.10.2;
%IDF_TOOLS_PATH%toolsidf-exe1.0.3;
%IDF_TOOLS_PATH%toolsccache4.3ccache-4.3-windows-64;
%IDF_TOOLS_PATH%toolsdfu-util.9dfu-util-0.9-win64;
%IDF_TOOLS_PATH%python_envidf4.4_py3.8_envScripts;
At the end; add
%IDF_PATH%;%IDF_PATH%tools;%IDF_TOOLS_PATH%toolsidf-python3.8.7;%IDF_TOOLS_PATH%toolsxtensa-esp32-elfesp-2021r2-patch3-8.4.0xtensa-esp32-elfbin;%IDF_TOOLS_PATH%toolsxtensa-esp32s2-elfesp-2021r2-patch3-8.4.0xtensa-esp32s2-elfbin;%IDF_TOOLS_PATH%toolsxtensa-esp32s3-elfesp-2021r2-patch3-8.4.0xtensa-esp32s3-elfbin;%IDF_TOOLS_PATH%toolsriscv32-esp-elfesp-2021r2-patch3-8.4.0riscv32-esp-elfbin;%IDF_TOOLS_PATH%toolsesp32ulp-elf2.28.51-esp-20191205esp32ulp-elf-binutilsbin;%IDF_TOOLS_PATH%toolsesp32s2ulp-elf2.28.51-esp-20191205esp32s2ulp-elf-binutilsbin;%IDF_TOOLS_PATH%toolscmake3.20.3bin;%IDF_TOOLS_PATH%toolsopenocd-esp32v0.11.0-esp32-20211220openocd-esp32bin;%IDF_TOOLS_PATH%toolsninja1.10.2;%IDF_TOOLS_PATH%toolsidf-exe1.0.3;%IDF_TOOLS_PATH%toolsccache4.3ccache-4.3-windows-64;%IDF_TOOLS_PATH%toolsdfu-util.9dfu-util-0.9-win64;%IDF_TOOLS_PATH%python_envidf4.4_py3.8_envScripts;
3. Make IDF support C++17
xEspressiftoolscmakebuild.cmake
Four indefinite length receiving serial port data
Four indefinite length receiving serial port data
xEspressifcomponentsdriveruart.c
//read any size, only added two line to fucntion uart_read_bytes, marked with mk
int uart_read_frame(uart_port_t uart_num, uint8_t* buf, TickType_t ticks_to_wait) {
//mk: set to 1 so that it will pass the while
uint32_t length = 1;
uint8_t* data = NULL;
size_t size;
size_t copy_len = 0;
int len_tmp;
if(xSemaphoreTake(p_uart_obj[uart_num]->rx_mux,(portTickType)ticks_to_wait) != pdTRUE) {
return -1;
}
while(length) {
if(p_uart_obj[uart_num]->rx_cur_remain == 0) {
data = (uint8_t*) xRingbufferReceive(p_uart_obj[uart_num]->rx_ring_buf, &size, (portTickType) ticks_to_wait);
//mk: get actual length received
length = p_uart_obj[uart_num]->rx_buffered_len;
if(data) {
p_uart_obj[uart_num]->rx_head_ptr = data;
p_uart_obj[uart_num]->rx_ptr = data;
p_uart_obj[uart_num]->rx_cur_remain = size;
} else {
//When using dual cores, `rx_buffer_full_flg` may read and write on different cores at same time,
//which may lose synchronization. So we also need to call `uart_check_buf_full` once when ringbuffer is empty
//to solve the possible asynchronous issues.
if(uart_check_buf_full(uart_num)) {
//This condition will never be true if `uart_read_bytes`
//and `uart_rx_intr_handler_default` are scheduled on the same core.
continue;
} else {
xSemaphoreGive(p_uart_obj[uart_num]->rx_mux);
return copy_len;
}
}
}
if(p_uart_obj[uart_num]->rx_cur_remain > length) {
len_tmp = length;
} else {
len_tmp = p_uart_obj[uart_num]->rx_cur_remain;
}
memcpy((uint8_t *)buf + copy_len, p_uart_obj[uart_num]->rx_ptr, len_tmp);
UART_ENTER_CRITICAL(&(uart_context[uart_num].spinlock));
p_uart_obj[uart_num]->rx_buffered_len -= len_tmp;
uart_pattern_queue_update(uart_num, len_tmp);
p_uart_obj[uart_num]->rx_ptr += len_tmp;
UART_EXIT_CRITICAL(&(uart_context[uart_num].spinlock));
p_uart_obj[uart_num]->rx_cur_remain -= len_tmp;
copy_len += len_tmp;
length -= len_tmp;
if(p_uart_obj[uart_num]->rx_cur_remain == 0) {
vRingbufferReturnItem(p_uart_obj[uart_num]->rx_ring_buf, p_uart_obj[uart_num]->rx_head_ptr);
p_uart_obj[uart_num]->rx_head_ptr = NULL;
p_uart_obj[uart_num]->rx_ptr = NULL;
uart_check_buf_full(uart_num);
}
}
xSemaphoreGive(p_uart_obj[uart_num]->rx_mux);
return copy_len;
}
Previous article:[ESP32] Quickly build a vscode development environment (convenient)
Next article:[nrf51][nrf52] sd_power_gpregret_set special register
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- Come on Shenzhen
- Pingtouge RISC-V development board--STEP2--CDK environment construction learning, let the LED light start flashing
- Getting Started with MSP430F5529
- HPM6750 Evaluation of Pioneer Semiconductor Step 4 (FreeRTOS+TinyUSB+LVGL) Comprehensive Example
- Understanding the configuration of C2000 series CMD files
- MicroPython Hands-on (01)——After the Spring Festival, I bought a K210 chip AI development board
- FP8102 1A single-cell lithium-ion linear charging IC
- Design of Passive Acoustic Target Detection Platform Based on Single Chip Microcomputer and DSP
- 6. "Wanli" Raspberry Pi car - wiringPi learning (PWM and external interrupt simulation timer)
- Design of low power portable electrocardiograph based on MSP430