Git Product home page Git Product logo

rtthread-esp-idf's Introduction

rtthread-esp-idf

RT-Thread针对ESP32的移植(使用Espressif Systems的IDF框架)

获得rtthread esp-idf

获得RT-Thread的ESP32版本,需要安装git,并以以下方式获得代码:

git clone https://github.com/BernardXiong/rtthread-esp-idf

cd rtthread-esp-idf
git submodule init
git submodule update

cd esp-idf-port/esp-idf
git submodule init
git submodule update

git apply ../esp-idf-port.patch

交叉编译工具链下载

注:交叉工具链目前验证过的是1.22.0-61版本,工具链版本太高,或太低都不行。

  • Linux版本:
  • CentOS 7::

    sudo yum install git wget make ncurses-devel flex bison gperf python pyserial

  • Ubuntu and Debian::

    sudo apt-get install git wget make libncurses-dev flex bison gperf python python-serial

  • Arch::

    sudo pacman -S --needed gcc git make ncurses flex bison gperf python2-pyserial

64位 32位

  • MacOS版本

MacOS

  • Windows版本

Windows

依赖软件

  1. scons
  2. python
  3. pyserial
  • 安装Python后,可以安装pip,以pip install scons pyserial的方式安装其他

编译

  1. 修改根目录下"rtconfig.py"文件内EXEC_PATH = r'D:\tools\msys32\opt\xtensa-esp32-elf\bin'为xtensa-esp32-elf交叉编译器所在目录;
  2. 在命令行下使用scons命令编译并生成bin文件或直接执行make all;

rt-iot audio开发板烧录

rt-iot audio开发板因为有音频的缘故,未包括串口自动复位烧录的操作,所以在进行烧录时,需要以按键方式辅助。

  1. USB连接PC和开发板;
  2. 在PC上运行烧写的软件,它会打开串口试图烧写;
  3. 按住rt-iot audio朝外边的两个按键,然后按最内侧按键(reset按键),松开内侧按键,然后再松开外侧两个按键。

这个时候PC侧软件自动进入烧写模式,开始进行固件烧写。

音频

当前在applications下放了两个音频相关的代码:

  • wav_play.c -- 用于播放一个wav文件;
  • wav_record.c -- 用于录音(默认以16000 samplerate、单声道方式录音,并保存为文件)

rtthread-esp-idf's People

Contributors

bernardxiong avatar gbcwbz avatar wang33winner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rtthread-esp-idf's Issues

windows编译错误了

> scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
scons: building associated VariantDir targets: build
CC build\applications\audio_device.o
Error in calling:
xtensa-esp32-elf-gcc -o "build\applications\audio_device.o" -c -Os -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Wno-address -ggdb -std=gnu99 -DRT_USING_NEWLIB -DWITH_POSIX -DESP_PLATFORM -I. -Iapplications -Icomponents -Idrivers -Iesp-idf-port\newlib -Iesp-idf-port\stubs -Iesp-idf-port\wlan -Iesp-idf-port\esp-idf\components\app_trace\include -Iesp-idf-port\esp-idf\components\app_update\include -Iesp-idf-port\esp-idf\components\bootloader_support\include -Iesp-idf-port\esp-idf\components\bootloader_support\include_priv -Iesp-idf-port\esp-idf\components\bt\include -Iesp-idf-port\esp-idf\components\cxx\include -Iesp-idf-port\esp-idf\components\driver\include -Iesp-idf-port\esp-idf\components\driver\include\driver -Iesp-idf-port\esp-idf\components\esp32 -Iesp-idf-port\esp-idf\components\esp32\include -Iesp-idf-port\esp-idf\components\ethernet\include -Iesp-idf-port\esp-idf\components\freertos\include -Iesp-idf-port\esp-idf\components\freertos\include\freertos -Iesp-idf-port\esp-idf\components\json\include -Iesp-idf-port\esp-idf\components\json\port\include -Iesp-idf-port\esp-idf\components\log\include -Iesp-idf-port\esp-idf\components\newlib\include -Iesp-idf-port\esp-idf\components\newlib\platform_include -Iesp-idf-port\esp-idf\components\nvs_flash\include -Iesp-idf-port\esp-idf\components\sdmmc\include -Iesp-idf-port\esp-idf\components\spi_flash\include -Iesp-idf-port\esp-idf\components\tcpip_adapter\include -Iesp-idf-port\esp-idf\components\ulp\include -Iesp-idf-port\esp-idf\components\soc\esp32\include -Iesp-idf-port\esp-idf\components\wpa_supplicant\include -Iesp-idf-port\esp-idf\components\wpa_supplicant\port\include -Iesp-idf-port\esp-idf\components\xtensa-debug-module\include -Irt-thread\include -Irt-thread\components\dfs\include -Irt-thread\components\dfs\filesystems\devfs -Irt-thread\components\dfs\filesystems\elmfat -Irt-thread\components\dfs\filesystems\romfs -Irt-thread\components\drivers\include -Irt-thread\components\drivers\include -Irt-thread\components\drivers\include -Irt-thread\components\drivers\include -Irt-thread\components\finsh -Irt-thread\components\libc\pthreads -Irt-thread\components\net\lwip-2.0.2\src -Irt-thread\components\net\lwip-2.0.2\src\include -Irt-thread\components\net\lwip-2.0.2\src\include\ipv4 -Irt-thread\components\net\lwip-2.0.2\src\arch\include -Irt-thread\components\net\lwip-2.0.2\src\include\netif "applications\audio_device.c"
Exception: [Error 2] : No such file or directory
scons: *** [build\applications\audio_device.o] Error 2
scons: building terminated because of errors.

ubuntu14.04编译报错,Could not find platform independent libraries <prefix>.....

貌似是在最后一步,调用python脚本生成镜像的时候报错:
python esp-idf-port/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 elf2image --flash_mode "dio" --flash_freq "40m" --flash_size "4MB" -o rtthread.bin rtthread-esp32.elf
Could not find platform independent libraries
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to [:<exec_prefix>]
ImportError: No module named site
scons: *** [rtthread.bin] Error 1
scons: building terminated because of errors.
make: *** [all] Error 2

fatal: git apply: bad git-diff

$ git apply ../esp-idf-port.patch
../esp-idf-port.patch:10: trailing whitespace.
uint8_t *ptr;
../esp-idf-port.patch:11: trailing whitespace.
xQueueReceiveFromISR(p_i2s->tx->queue, &ptr, &high_priority_task_awoken);
../esp-idf-port.patch:12: trailing whitespace.
memset(ptr, 0x0, p_i2s->tx->buf_size);
../esp-idf-port.patch:14: trailing whitespace.

../esp-idf-port.patch:26: trailing whitespace.
#include "esp_task.h"
fatal: git apply: bad git-diff - expected /dev/null on line 59

执行patch的时候出现这个问题,这个怎么处理啊

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.