This adds a simple script which parses Kconfig files using Kconfiglib
and emits ReST document with the list of all options. For each option
a link target is generated, to make it possible to link to any Kconfig
option from the rest of the documentation.
Since Kconfiglib is not on PyPI, the latest version (45f87b9d) is
bundled into the docs directory.
SD SPI mode driver
This MR adds functionality to support SD cards connected via SPI interface.
Additionally, two bugs are fixed:
- Definition of `SPI_TRANS_MODE_DIOQIO_ADDR` in spi_master driver
- SD card probing frequency was 4000kHz instead of 400kHz as required by the standard
See merge request !727
For config-only components, component.mk should now contain "COMPONENT_CONFIG_ONLY := 1"
Also refactored some of the generation of linker paths, library list. This required cleaning up the way the bootloader
project works, it's now mostly independent from the parent.
Each COMPONENT_DIRS directory can now either be a component directory, or a parent directory containing component
subdirectories.
When searching for components, skip any directory which doesn't have component.mk, Kconfig.projbuild, or
Makefile.projbuild in it. This helps with debugging, list-components output, etc.
Implements support for system level traces compatible with SEGGER
SystemView tool on top of ESP32 application tracing module.
That kind of traces can help to analyse program's behaviour.
SystemView can show timeline of tasks/ISRs execution, context switches,
statistics related to the CPUs' load distribution etc.
Also this commit adds useful feature to ESP32 application tracing module:
- Trace data buffering is implemented to handle temporary peaks of events load
1. Name change from chopper to carrier, block diagram update, minor changes to example codes
2. mcpwm_reg.h changed, brought uniformity in comments, worked on suggestions, duty to accept float. Some name changes!
3. Minor readme changes and Indetation
4. Minor change: move mcpwm_reg.h and mcpwm_struct.h to new path
5. Minor change: addition of BLDC example code and Readme
6. Name changed from epwm to mcpwm
7. Improve the reg name in mcpwm_struct.h
8. Name change chopper>carrier, deadband>deadtime
CI: save download config in CI build jobs:
IDF built app download config may change with some modification.
save the download configs for built APP in build stage.
then we can use the correct download config in test stage.
See merge request !676
Split common SPI stuff out of master driver; add slave driver; add workaround for DMA issue.
This merge req mainly adds a slave device. In order to do this, the original master driver is refactored into common code shared by master and slave modes, and a slave driver is added.
The other things added are:
- Added a workaround for a 'feature' of the ESP32 silicon that can lock up the receive DMA channel in some situations. This can only be fixed by resetting *both* DMA channels. The workaround implemented makes sure that the reset only happens when both channels are idle
- Got rid of the automatic choice between register- and DMA-based transfers. The master (and slave) code will now always go for a DMA transfer if a DMA channel is given, and always go for register-based transfers if no DMA channel is given.
- Add in a bunch of fixes for outstanding Github issues.
See merge request !659
wear levelling
This MR adds wear levelling component. It presents an interface similar to the interface of spi_flash and esp_partition. Inside, it stores data inside a partition to in a way that reduces worst case number of erase cycles for any given sector.
Also included are APIs similar to the ones provided for SDMMC to mount FAT filesystem on top of the wear levelling partition. A simple example shows how this API can be used.
Ref TW10338.
See merge request !567
Feature/btdm avrc
The source branch "feature/btdm_avrc" includes classic Bluetooth profiles A2DP(sink role) and AVRCP(controller role);
Menuconfig options to control whether to enable classic BT is added.
See merge request !591
1) fixed SPI_read_status: added check for flash busy flag in matrix mode
2) fixed SPI_page_program: enable write before writing data to SPI FIFO
3) SPI flash ROM funcs replacement is controlled via menuconfig option
Windows setup improvements
* Tweak Makefile to significantly reduce startup time on Windows (also reduced on other platforms, but less obvious.)
* Revise windows setup installation script to fix various issues, use latest toolchain.
* Tweak Windows config docs
See merge request !597
doc: add dev module and boards by Espressif
Overview, picture, link to schematic, ref. design, etc. for the following development module and boards:
- ESP-WROOM-32
- ESP32 Core Board V2 / ESP32 DevKitC
- ESP32 Demo Board V2
- ESP32 WROVER KIT V1 / ESP32 DevKitJ V1
- ESP32 WROVER KIT V2
See merge request !560
Error handling in NVS initialization
Previously nvs_flash_init worked under an assumption that there should always be at least one free page available. This is true during normal operation, but in some cases (such as when changing application partition table from a non-OTA to an OTA one), NVS partition may get truncated, which will cause empty pages to be lost.
This MR adds error checks for this condition, and updates code which calls `nvs_flash_init` to check for the return code.
For most examples, a simple `ESP_ERROR_CHECK` is added around `nvs_flash_init`. For NVS examples and the OTA example, more robust error handling is added.
This change also removes nvs_flash_init calls from examples which don't use NVS.
See merge request !582
* "make monitor" not passed the configured baud rate
Closes#436https://github.com/espressif/esp-idf/issues/436
* Pass toolchain prefix from sdkconfig into monitor tool
* Allow setting EOL in idf_monitor.py, use CRLF by default
* Detect if /dev/tty.X is used on macOS, warn and replace with /dev/cu.X
* If a build fails or gdb exits, ignore Ctrl-T (allowing Ctrl-T Ctrl-A/F to be same key sequence everywhere)
* Add a note about winpty on Windows
Ref 02fdf8271d (commitcomment-21369196)
Expand 'make monitor' support
New 'make monitor' idf_monitor tool for better monitor output. Running 'make monitor' will now:
* Automatically look up code addresses via addr2line and print function, source file, line number in terminal.
* Can reset the ESP32 by typing Ctrl-T Ctrl-R.
* Can run "make flash" by typing Ctrl-T Ctrl-F.
* Can run "make app-flash" by typing Ctrl-T Ctrl-A.
* If gdb stub starts, monitor will automatically run gdb and connect. When gdb exits, ESP32 resets and monitor resumes.
* Exit is still Ctrl-[
Have some more features I'd like to add (log output to file, crash dump support) but I think this is at the point of being useful.
See merge request !565
This change adds a check for the free page count to nvs_flash_init.
Under normal operation, NVS keeps at least one free page available,
except for transient states such as freeing up new page. Due to external
factors (such as NVS partition size reduction) this free page could be
lost, making NVS operation impossible. Previously this would cause an
error when performing any nvs_set operation or opening a new namespace.
With this change, an error is returned from nvs_flash_init to indicate
that NVS partition is in such a state.
add wakeup from touch sensor, and deep sleep example
- add new deep sleep wakeup mode
- change documentation to explain incompatibilities between different wakeup mode, add error checks
- add new ULP instructions necessary for ULP wakeup scenario
- fix issues with I_WR_REG, I_SLEEP, I_END instructions
- add deep sleep example, illustrating the use of timer, gpio, touch, and ULP wakeup triggers
See merge request !461
Not sure which Ubuntu is used in the installation guide but for the latest LTS release 16.04 we need libtool-bin for
compiling crosstool-NG proper
Merges #46https://github.com/espressif/esp-idf/pull/46
FATFS enable support for multiple drives
Current implementation has drive numbers and paths hardcoded to support
only one FATFS drive. Arduino has it's own SPI driver to allow
compatibility and flexibility. With the MR it is possible to have up to
```_VOLUMES``` drives connected (SPI, SDMMC and others) at the same
time and accessed through VFS
See merge request !478
Partition/SPI/OTA docs & OTA new functionality
* Update partition, SPI flash & OTA docs to reflect functionality changes
* Refactor OTA implementation to perform checks mentioned in API doc
* Add new functions to OTA API: esp_ota_get_running_partition() & esp_ota_get_next_update_partition() functions
* Add spi_flash_cache2phys() & spi_flash_phys2cache() functions to support esp_ota_get_running_partition()
See merge request !513
1. indicate adv/scan start complete success or failed
2. controller do limit of adv/scan concurrence, so add some codes to report adv/scan start failed or not.
This change adds esp_deep_sleep_get_wakeup_cause, which returns the
source which has caused wakeup from deep sleep.
Similar to esp_deep_sleep_get_ext1_wakeup_status, a function is added
to check touch pad wakeup status: esp_deep_sleep_get_touchpad_wakeup_status.
This function returns the touch pad which has caused wakeup.
ULP and touch FSMs in ESP32 revisions 0 and 1 do not operate correctly
if RTC_PERIPH power domain is force powered on (ESP_PD_OPTION_ON).
Both ULP and touch still work, but clock frequency of the ULP may be
incorrect and touch values may be off by considerable amount. As such,
when these wakeup modes are used, RTC_PERIPH power domain has to be set
to ESP_PD_OPTION_AUTO (or, in the current implementation,
ESP_PD_OPTION_OFF — though this will change in the future when _OFF will
actually *force* the power domain to be powered off).
Because EXT0 wakeup source requires RTC_PERIPH to be powered ON, mark
ULP and touch wakeup sources as incompatible with EXT0. Workaround for
this is to use EXT1 wakeup source instead, which offers similar or
better functions without having to keep RTC_PERIPH powered on.
1. add new APIs bt controller enable/disab/deinit
2. make bt controller work need to call two APIs of esp_bt_controller_init and enable
3. modify phy init to make mac reset once
Also add steps to disable flash encryption, as some people seem to
accidentally enable it.
Explicitly mark the flash encryption and secure boot as "READ DOCS
FIRST" in menuconfig.
docs: use custom roles to generate GitHub links
This change replaces direct links to GitHub master branch with
auto-generated links using docutils custom roles.
These auto-generated links point to the tree or blob for the git commit
ID (or tag) of the repository. This is needed to ensure that links don’t
become broken when files in master branch are moved around or deleted.
The following roles are introduced:
```
- :idf:`path` - points to directory inside ESP-IDF
- :idf_blob:`path` - points to file inside ESP-IDF
- :idf_raw:`path` - points to raw view of the file inside ESP-IDF
- :component:`path` - points to directory inside ESP-IDF components dir
- :component_blob:`path` - points to file inside ESP-IDF components dir
- :component_raw:`path` - points to raw view of the file inside ESP-IDF
components dir
- :example:`path` - points to directory inside ESP-IDF examples dir
- :example_blob:`path` - points to file inside ESP-IDF examples dir
- :example_raw:`path` - points to raw view of the file inside ESP-IDF
examples dir
```
A check is added to the CI build script, which searches RST files for
presence of hard-coded links (identified by tree/master, blob/master,
or raw/master part of the URL).
This check can be run manually: cd docs && make gh-linkcheck
Additionally, Sphinx linkcheck build type is used to create new CI test,
which check for broken links. This test has to be triggered explicitly,
because including it in normal build process (when the commit is not yet
deployed to Github) will not work. It can be triggered in a regular
fashion using a combination of cron and Curl, similar to stress tests.
See merge request !455
This change replaces direct links to GitHub master branch with
auto-generated links using docutils custom roles.
These auto-generated links point to the tree or blob for the git commit
ID (or tag) of the repository. This is needed to ensure that links don’t
become broken when files in master branch are moved around or deleted.
The following roles are introduced:
- :idf:`path` - points to directory inside ESP-IDF
- :idf_blob:`path` - points to file inside ESP-IDF
- :idf_raw:`path` - points to raw view of the file inside ESP-IDF
- :component:`path` - points to directory inside ESP-IDF components dir
- :component_blob:`path` - points to file inside ESP-IDF components dir
- :component_raw:`path` - points to raw view of the file inside ESP-IDF
components dir
- :example:`path` - points to directory inside ESP-IDF examples dir
- :example_blob:`path` - points to file inside ESP-IDF examples dir
- :example_raw:`path` - points to raw view of the file inside ESP-IDF
examples dir
A check is added to the CI build script, which searches RST files for
presence of hard-coded links (identified by tree/master, blob/master,
or raw/master part of the URL).
This check can be run manually: cd docs && make gh-linkcheck
Additionally, Sphinx linkcheck build type is used to create new CI test,
which check for broken links. This test has to be triggered explicitly,
because including it in normal build process (when the commit is not yet
deployed to Github) will not work. It can be triggered in a regular
fashion using a combination of cron and Curl, similar to stress tests.
Organize examples and API documentation - supplement to !430
This supplement to !430, both intended to replace bulky !421.
1. Fixed broken links
2. Added links to available examples in API documentation, where missing
3. Updated links to point directly to example folder (to show README.md with example description)
4. Added README.md in docs folder info to point reader to ReadTheDocs instead of doc sources, ref. https://github.com/espressif/esp-idf/issues/243
5. Fixed some typo errors / Sphinx warnings
6. Fixed memory leak in example, ref. https://github.com/espressif/esp-idf/issues/209
See merge request !440
Most of the packages mentioned are only needed for building the toolchain using crosstool-NG, not for the normal ESP-IDF environment.
Mention that pyserial needs to be installed (fixes https://github.com/espressif/esp-idf/issues/229).
esp32 core dump to flash
1. menuconfig option to select where to store core dump: flash, uart or disable
2. Saving of core dump to flash
3. Partition table definitions files with core dump partition
4. Python scripts to support core dump generation from GDB command line
See merge request !341
The following issues mentioned during MR!341 review were fixed:
1) Core dump test application description
2) Usage of CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH and CONFIG_ESP32_ENABLE_COREDUMP_TO_UART
3) FLASH_GUARD_START macro usage is fixed in flash API
4) Core dump module logging facility
5) cache util functions doc updated
6) interactive delay before print core dump to uart
7) core dump partion support in build system
component bt:Added the create attribute table method to the new API
GATT Server service table APIs.
Have already modify the style and other things as @jeroen suggestion in other MR(the MR have been closed)
See merge request !399
update toolchain version, rebuild newlib
- This MR updates the toolchain version used in the ESP-IDF
- Compiler version check and warning is added to project.mk
- Newlib is rebuilt to include wcsftime function
- libstdc++ build uses correct newlib headers (so we won't get undefined reference to `__impure_ptr` anymore)
See merge request !387
ethernet: support flow control
(1) Only fullduplex mode support flow ctrl .
(2) Fix reboot exception which caused by not-reset EMAC hardware (such as DMA) when reset CPU.
See merge request !392
component/bt: bug fix of lack of checking bluetooth stack status inside API functions
Add an API function for checking bluetooth stack status: whether it is uninitialized, initialized or enabled.
The function is intended to be used by users to check the bluetooth stack status, also, it is used inside bluetooth API functions to ensure the stack is in valid state.
See merge request !405
build system: add IDF_VER environment variable and preprocessor define
This adds an `IDF_VER` preprocessor define which is obtained from `git describe`.
Looks like `v1.0-275-g0efaa4f` for non-release version or `v2.0` for a tagged (release) version.
See merge request !403
SDMMC peripheral driver, SD protocol driver, FATFS library, VFS integration
This MR contains:
- SDMMC host peripheral driver
- SD protocol driver in sdmmc component (can be extended to support MMC/eMMC and SPI based hosts)
- ChaN's FATFS library v0.12b
- VFS integration
- FAT access via VFS is thread-safe (unless same file is read/written/unlinked/renamed from different tasks)
- Support for POSIX directory-related functions in VFS (and in vfs_fatfs.c)
- unit test for the above
- Example
- API documentation
Will be done in other MRs:
- Support for spi_flash IO driver for FatFs
- SPI host driver and support for SPI mode commands in sdmmc component
- MMC/eMMC support in sdmmc component
- Support for slightly higher 53/26.6MHz clocks (currently I'm using 20MHz for DS and 40MHz for HS, instead of 25MHz/50MHz per standard), and arbitrary low clocks (e.g. 4MHz).
See merge request !353
Enable bootloader entropy source for RNG
Enables an entropy source when bootloader starts up, which both seeds the RNG for use before WiFi/BT stack is enabled and provides an adequate RNG for secure boot & flash encryption key generation.
A prerequisite was enabling 80MHz operation, so the CPU is now set to 80MHz as soon as second stage bootloader starts running.
See merge request !363
SPI master driver
This merge requests adds an SPI Master driver. This driver is (of course) multithread capable, has device abstraction, has command queueing, DMA support and all other sorts of nice things you'd expect from a SPI driver.
See merge request !332
1. add fading functions.
2. clear up ledc.c and ledc.h
3. update api doc.
4. add ledc example
5. edit ledc.rst and add readme for example code.
6. add s_ prefix for static global values.
7. add mutex for fade functions
8. minor changes according to the comments.
2. update example comments and other minor changes
3. rename API: i2c_cmd_link_create/i2c_cmd_link_delete (+4 squashed commits)
Squashed commits:
[2e0ac3e] 1. coding style: add one space after condition key words.
2. modify i2c.h, use gpio_num_t instead of int, improve comments of return values
3. add i2c index in index.rst
4. add readme for i2c example
[4991d92] update i2c.doc
[88b672e] driver: i2c
1. add mux and spin lock to run in a thread-safe way.
2. modify example code
[4eb15fe] driver: i2c code
1. add i2c master code
2. add i2c slave code
3. add i2c example code
4. add DRAM_ATTR for I2C array
GPIO driver: add per-pin interrupt handlers
1. add ISR handler apis so that users of different layers can hook their own isr handler on different GPIO.
Audio project has different software layers, they need different gpio isr handler for layer instead of processing all GPIO interrupts in one handler.
If this kind of calling a handler from isr is not proper, please kindly point out.
2. add gpio example code.
3. update gpio doc.
See merge request !345
Clarification on documenting examples
Improve documentation of examples with two basic actions:
- include README.md in each example project
- add a link with synopsis in API documentation
This was not clear reading original API documentation template.
See merge request !349
1. add ISR handler apis so that users of different layers can hook their own isr handler on different GPIO.
Audio project has different software layers, they need different gpio isr handler for layer instead of processing all GPIO interrupts in one handler.
If this kind of calling a handler from isr is not proper, please kindly point out.
2. add gpio example code.
3. improve gpio.rst
4. add readme for gpio example
Squashed commits:
[278e50f] update: GPIO
1. coding style, add a space between conditional or loop keyword and an opening paren.
2. modify some return value and doc
3. use printf in example code
Squashed commits:
[efb23bb] minor change of comment
Secure boot: Option for app & partition table signing to happen outside build system
Allows for a remote signing server, private signing key does not need to be on the build system.
See merge request !320
1. add sigma-delta code and example.
2. add gpio output signal in io matrix.
Squashed commits:
[a25e7d4] minor changes for doc
[6a03a1e] minor changes on comments and doc.
[97dd9e4] Add doc.
update index.rst
change example index
1. TW8657, WIFI send the whole packet to smartconfig;
2. modify API annotation of smartconfig and sniffer;
3. export smartconfig APIs to programming guide;
Restore ability to alloc IRAM, and more.
- Fix mem regions so allocating IRAM works again
- Optimize allocator slightly, uses 4 less bytes per malloc now
- Allow querying free heap memory space per memory type
See merge request !301
Flash encryption support
Flash encryption support in build system, tooling
To come in future MR:
* On-device key generation on first boot (for production devices), need to finalise testing of bootloader entropy seeding.
* spi_flash_encrypted_write to support non-32-byte block writes (at least optionally.)
* I think a lot of the bootloader_support component can possibly be rolled into "spiflash" and other components, to use a common API.
See merge request !240
Add dynamic interrupt allocation mechanism
This adds:
- Dynamic allocation of interrupts. Pass it the features of the interrupt you want, it'll set you up with an int.
- Shared interrupts. Enables multiple peripheral drivers to use the same interrupt.
- Marking what interrupts are fully executable from IRAM; if an int isn't marked like that it will get disabled once flash cache gets disabled.
Also:
- Modifies driver to be in line with these changes
See merge request !254
Fail CI build on warnings
This allows developers to add CFLAGS for -Wno-error=XXX while developing, but before code passes the CI build then it must be warning-free.
See merge request !279
Initial support for generation of ULP coprocessor code
This adds basic support for writing ULP coprocessor programs using an assembly-like syntax, with integer labels and branches to labels.
See merge request !261
* App access functions are all flash encryption-aware
* Documentation for flash encryption
* Partition read/write is flash aware
* New encrypted write function
Feature/btdm bluedroid
This branch contain the bluedroid host code.
Currently, Only GAP/GATT SERVER/GATT CLIENT release to users.
Actually, the content of the codes is further more than GAP/GATT and etc.
In this release version, users only need to concern about the APIs which are in "api/include/".
Now, suggestions in comment have been resolved are following:
1. The APIs use callback function. Ivan , Jeroen and me have discussed it. Currently the code will not be changed.
2. The APIs use OPEN/CLOSE. I have ask Ivan, besides bluedroid do this, we will keep the name.
3. Coding style. I have run format.sh to handle the style. And some spell error have been fixed.
4. APIs doxygen. I have clean the warning by doxygen. But bt.rst is still need to be completed.
5. Other comment without resolved face to face that I have to add response in the comment and fix them in the code
6. Fix some incorrect things. See the git log for details.
This 1st version of bluedroid release still have lots of things to do. But it can be done after this merge.
1. Compelete the BLUFI(Bluetooth config wifi connection) documents, security, application protocol and other.
2. Add SPP-LIKE profile.
3. Do more examples codes to cover most of the APIs.
4. Test and fix bug.
Another thing:
1. Do the document of APIs.(xml->bt.rst->html)
(I will do this before merge as Ivan's suggestion)
This is already done. Besides, the union type in doxygen have something error. Ivan will fix it.
See merge request !239
SHA acceleration integrated to mbedTLS incl. TLS sessions
Uses hardware SHA acceleration where available, fails over to software where not available.
Ref TW7112
See merge request !232
SHA hardware allows each of SHA1, SHA256, SHA384&SHA512 to calculate digests
concurrently.
Currently incompatible with AES acceleration due to a hardware reset problem.
Ref TW7111.
Docs: new documentation and warnings cleanup
This change set
- adds a high-level description of application startup flow. Some parts are missing, but hopefully we can use this description as a base to expand on.
- adds a few notes about memory regions and their use in ESP-IDF.
- add SPI flash and partition APIs page
- fixes all Doxygen warnings in header files
- enables build failures on new Doxygen warnings
See merge request !201
Secure boot related fixes
Fix some issues (mostly build system) from the secure boot implementation
Also refactor the way submodule checks are applied to make them more reliable.
See merge request !207
nvs_flash: adjust the nvs_flash start sector number
Modify the nvs flash start sector from 6 to 9 because the partition table bin burn address is modified from 0x4000 to 0x8000
See merge request !215
Required at project level because some components use header files in
other components' submodules, and one component with a
submodule (esptool.py) doesn't have or need a component.mk.
Simplifies examples of embedding a certificate file or a root cert.
This is a much cruder mechanism than the full flash filesystem we want
eventually, but still sometimes useful.
Read the Docs is building documentation referencing to specific releases
on GitHub.
Changing version / release in this script is breaking menu in bottom
left corner
Now version / release should change only for local builds and not for
builds on Read the Docs
This adds initial code style guide. Only section on code formatting is written, other sections to be added later.
Also adds scripts to format code using astyle.
Deep sleep: Any source named rtc_wake_stub* is linked as RTC wake stub code
Also move esp_deepsleep.h documentation out to docs/deep-sleep-stub.rst
See merge request !142
Used by mbedTLS to set MBEDTLS_CONFIG_FILE in all components.
This change sets CFLAGS/etc at the project level and then exports those
variables for components, rather than setting them independently each time
a component Makefile is invoked.
Currently this is mostly a verbatim copy of macOS guide with some obvious changes.
Exact lists of dependencies for Debian and Arch need to be specified.
Also made minor fixes to Windows and macOS guides:
- changed http urls to https
- added --prefix=$PWD to crosstool-NG's configure
- added chmod u+w for the build output directory
In general, except for prerequisites, Linux and macOS guides are virtually identical.
It might make sense to refactor this into single document with prerequisites being
described in separate docs.