ESP32 开发环境搭建 Windows + CLION / MAC + CLION

经过3天的浴血奋战,终于搞清楚这两个的开发环境搭建,安装方法省略,直接干活,核心设置:

MAC 的核心设置:

CMakeList.txt 文件配置:

# The following lines of boilerplate have to be in your project's CMakeLists
# in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)

set(PYTHON "/Users/linux/.espressif/python_env/idf4.2_py3.11_env/bin/python")
set(python "/Users/linux/.espressif/python_env/idf4.2_py3.11_env/bin/python")

# 不加这句默认为 'esp32'
set(IDF_TARGET "esp32")
set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/bluetooth/esp_ble_mesh/common_components/example_init)
set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_examples_common)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(ble_mesh_provisioner)

MAC里的位置:

/Users/linux/esp/esp-idf/tools/cmake/toolchain-esp32.cmake

toolchian-esp32.cmake 设置:

set(CMAKE_SYSTEM_NAME Generic)

set(CMAKE_C_COMPILER /Users/linux/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc)
set(CMAKE_CXX_COMPILER /Users/linux/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++)
set(CMAKE_ASM_COMPILER /Users/linux/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc)

set(CMAKE_C_FLAGS "-mlongcalls -Wno-frame-address" CACHE STRING "C Compiler Base Flags")
set(CMAKE_CXX_FLAGS "-mlongcalls -Wno-frame-address" CACHE STRING "C++ Compiler Base Flags")

WINDOWS 的核心设置:

关于软件的安装,环境变量的设置,已经有很多文章写过了,再此就不在赘述了。感谢大家的支持,什么问题可以留言给我。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值