Я пытаюсь скомпилировать свой первый пример проекта ESP32. Я установил Visual Studio Code со всеми последними инструментами. (Python, набор инструментов и т. Д.). Я не уверен, что именно мне нужно, так как я новичок в этой среде, так что, возможно, я что-то пропустил.
Я следовал руководству пользователя о том, как создать и скомпилировать первый проект, я использовал проект Blink из папки с примерами.
Вот что я получаю.
> Executing task: cmake -G Ninja .. <
-- Project is not inside a git repository, or git repository has no commits; will not use 'git describe' to determine PROJECT_VER.
-- Building ESP-IDF components for target esp32s2
-- Checking Python dependencies...
Python requirements from C:\Users\dmitryke\esp\esp-idf\requirements.txt are satisfied.
-- Project sdkconfig file C:/ESP32_projects/blink/sdkconfig
Loading defaults file C:/ESP32_projects/blink/sdkconfig.defaults...
-- Components:
-- Component paths:
-- Configuring done
-- Generating done
-- Build files have been written to C:/ESP32_projects/blink/build
The terminal will be reused by tasks, press any key to close it.
> Executing task: cmake --build . <
[1/1] Linking C executable blink.elf
FAILED: blink.elf
cmd.exe /C "cd . && C:\Users\dmitryke\.espressif\tools\xtensa-esp32s2-elf\esp-2020r3-8.4.0\xtensa-esp32s2-elf\bin\xtensa-esp32s2-elf-gcc.exe -mlongcalls CMakeFiles/blink.elf.dir/project_elf_src.c.obj -o blink.elf -Wl,--cref -Wl,--Map=C:/ESP32_projects/blink/build/blink.map -fno-rtti -fno-lto && cd ."
c:/users/dmitryke/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld.exe: c:/users/dmitryke/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/lib/no-rtti/crt0.o:(.literal+0x0): undefined reference to `main'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
The terminal process "C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command cmake --build ." terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.
Я удалил все из blink.c, чтобы избежать ошибок кода.
blink.c
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"
#include "sdkconfig.h"
/* Can use project configuration menu (idf.py menuconfig) to choose the GPIO to blink,
or you can edit the following line and set a number here.
*/
#define BLINK_GPIO 0x01
void app_main(void)
{
while(1) { }
}
Другой вопрос, есть возможность запустить idf.py menuconfig
. Иногда это работает, а иногда говорит:
C:\ESP32_projects\blink>idf.py menuconfig
'idf.py' is not recognized as an internal or external command,
operable program or batch file.
Любая помощь будет оценена по достоинству!