Ivan Grokhotkov [Tue, 14 Mar 2017 13:24:56 +0000 (21:24 +0800)]
nvs: check that storage has at least one free page
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.
Ivan Grokhotkov [Tue, 14 Mar 2017 13:42:06 +0000 (21:42 +0800)]
Merge branch 'bugfix/mdns_security_issues' into 'master'
Bugfix/mdns security issues
Fixes a series of security issues with MDNS.
STACK-SMASH: https://github.com/espressif/esp-idf/blob/dd3f18d2d88ee78909d4af2840dfdf0b9f715f28/components/mdns/mdns.c#L494:
The sprintf is not limited. We can execute the sprintf codeflow as
many times as we want, allowing arbitrary long data being written
into stack.
PACKET-OF-DEATH:
https://github.com/espressif/esp-idf/blob/dd3f18d2d88ee78909d4af2840dfdf0b9f715f28/components/mdns/mdns.c#L502.
The compare allows equal, and thus jumping back to it self infinite
recursion -> guaranteed crash
TXT-SMASH: https://github.com/espressif/esp-idf/blob/dd3f18d2d88ee78909d4af2840dfdf0b9f715f28/components/mdns/mdns.c#L1381
The loop does not check on reaching a->txt maximum size (1024),
resulting in stack overflow.
Ivan Grokhotkov [Tue, 14 Mar 2017 07:16:51 +0000 (15:16 +0800)]
Merge branch 'bugfix/make_test_components' into 'master'
make: don’t override TEST_COMPONENTS
When idf_monitor is launched from make, it gets modified `TEST_COMPONENTS`
variable which contains full paths to the test components instead of the
names. This causes `TEST_COMPONENT_PATHS` to be empty and the unit test
app gets built without any test components.
This change introduces an internal `TEST_COMPONENTS_LIST` variable which
gets set either from `COMPONENTS` if `TESTS_ALL` is 1, or from
`TEST_COMOPONENTS` otherwise.
Bootloader makefile is also fixed to avoid propagating `TESTS_ALL` to the
bootloader build step.
Ivan Grokhotkov [Thu, 9 Mar 2017 11:42:46 +0000 (19:42 +0800)]
make: don’t override TEST_COMPONENTS
When idf_monitor is launched from make, it gets modified TEST_COMPONENTS
variable which contains full paths to the test components instead of the
names. This causes TEST_COMPONENT_PATHS to be empty and the unit test
app gets built without any test components.
This change introduces an internal TEST_COMPONENTS_LIST variable which
gets set either from $(COMPONENTS) if TESTS_ALL is 1, and from
TEST_COMOPONENTS otherwise.
Bootloader makefile is also fixed to avoid propagating TESTS_ALL to the
bootloader build step.
Ivan Grokhotkov [Thu, 9 Mar 2017 05:28:11 +0000 (13:28 +0800)]
Merge branch 'bugfix/btdm_gatt_attribute_table_debug' into 'master'
bt component: fix bluetooth gatt packets process bugs
1. Add process of prepare write request packets
2. Add process of execute write request packets
3. Add process of reliable write request packets
4. Fix bug of processing read blob request packets
5. Fix bug of processing write request packets
6. Optimize error check and process in stack
Ivan Grokhotkov [Wed, 8 Mar 2017 06:27:58 +0000 (14:27 +0800)]
Merge branch 'feature/deep_sleep_wakeup_from_touch' into 'master'
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
Angus Gratton [Tue, 7 Mar 2017 01:03:11 +0000 (09:03 +0800)]
Merge branch 'feature/touch_pad_examples' into 'master'
Examples on using capacitive touch sensors
- `touch_pad_read` - read sensor values and show on terminal
- `touch_pad_interrupt` - perform simple calibration; trigger an interrupt when any pad is touched
Angus Gratton [Mon, 6 Mar 2017 23:08:18 +0000 (07:08 +0800)]
Merge branch 'feature/esptool_espefuse_set_flash_voltage' into 'master'
esptool version bump and new "espefuse.py set_flash voltage" command
* New "espefuse.py set_flash_voltage" command to easily set a fix
VDD_SDIO regulator voltage (1.8V, 3.3V or disabled).
* Fixes bugs when flashing files with non-4-byte aligned lengths
(doesn't effect esp-idf image files)
* esptool README improvements
* Detect overlapping files in write_flash
* read_mac now works correctly on ESP32
* Integrates reset fix for older dev boards (formerly the "Windows ESP32R0 reset workaround")
island [Mon, 6 Mar 2017 09:20:45 +0000 (17:20 +0800)]
bt component: fix bluetooth gatt packets process bugs
1. Add process of prepare write request packets
2. Add process of execute write request packets
3. Add process of reliable write request packets
4. Fix bug of processing read blob request packets
5. Fix bug of processing write request packets
6. Optimize error check and process in stack
Ivan Grokhotkov [Mon, 6 Mar 2017 07:59:28 +0000 (15:59 +0800)]
Merge branch 'bugfix/partition_and_mmap_issues' into 'master'
Fix partition- and mmap-related issues
- Fix unit tests failing to start up due to a mismatch between sdkconfig flash size and size required by partition table.
- Fix a bug that partition APIs loaded the partition table in reverse order. As such, `esp_partition_next` and `esp_partition_find_first` did not work as expected. Add a test.
- Update the workaround for stale cache reads issue: do Cache_Flush for non-encrypted flash as well. Add a test.
Ivan Grokhotkov [Mon, 6 Mar 2017 06:22:11 +0000 (14:22 +0800)]
Merge branch 'bugfix/master_out_of_sync' into 'master'
Merge github master branch
We have set up auto-push from release branch, but the CI script had `git push github HEAD:master` command in it.
Normally remote would reject the push from release branch into master because remote would have commits which the release branch didn't have.
But unit tests have been failing in master, so master branch wasn't deployed to Github recently, and Github master branch was behind the release branch. So the push from release branch into Github master went okay and now Gitlab master is behind Github master.
This PR merges Github master (which is now equal to release/v2.0) into Gitlab master so that automatic push can work again.
The original issue with push to master is also fixed.
Ivan Grokhotkov [Sat, 4 Mar 2017 09:48:44 +0000 (17:48 +0800)]
spi_flash: fix stale data being read from mmaped region
The issue that cache entries are not invalidated correctly sometimes
can also be reproduced for non-encrypted flash as well.
This change updates the workaround to do Cache_Flush, enabling it for
non-encrypted flash, and adds a unit test.
Ivan Grokhotkov [Sat, 4 Mar 2017 07:34:51 +0000 (15:34 +0800)]
partition_table: update unit test
- change order of assert arguments to (expected, actual)
- set expected partition count to 3 to match the new partition table
- use the new get_test_partition facility
- check that partitions are listed in correct order
- remove leftover debugging printfs
Angus Gratton [Fri, 3 Mar 2017 00:22:25 +0000 (11:22 +1100)]
esptool: Update esptool.py to integrate reset fix for older dev boards
Originally marked "Reset with ESP32R0 Windows workaround", but proven to be
necessary on some other platforms as well. This is now integrated into the
default esptool.py reset behaviour.
Angus Gratton [Fri, 3 Feb 2017 05:08:17 +0000 (16:08 +1100)]
esptool: Update to latest v2.0 beta version
* New "espefuse.py set_flash_voltage" command to easily set a fix
VDD_SDIO regulator voltage (1.8V, 3.3V or disabled).
* Fixes bugs when flashing files with non-4-byte aligned lengths
(doesn't effect esp-idf image files)
* README improvements
Ivan Grokhotkov [Fri, 3 Mar 2017 03:53:32 +0000 (11:53 +0800)]
Merge branch 'bugfix/separate_ethernet_and_wifi' into 'master'
Allow separate ethernet & wifi configuration
If only 1/2 of ethernet & WiFi are enabled in config, the other interface is no longer linked into the firmware.
* Fixes bug where enabling Ethernet but not WiFi would fail to compile.
* Also means that enabling WiFi but not Ethernet no longer links some unused ethernet interface functions.
Ivan Grokhotkov [Fri, 3 Mar 2017 03:45:59 +0000 (11:45 +0800)]
Merge branch 'bugfix/freertos_event_groups' into 'master'
FreeRTOS: Fix cross-core event group sync
As above
Also includes fixes which allowed removing some semi-hacky bits from the event group unit tests - specifically, higher priority tasks will always be started immediately even if they run on the opposite core.
Ivan Grokhotkov [Fri, 3 Mar 2017 03:40:37 +0000 (11:40 +0800)]
Merge branch 'feature/fatfs_dynamic_pdrv' into 'master'
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
* Allow setting task name length via kconfig
* Move task stack overflow watchpoint out of internals debugging submenu, place next to other stack overflow checks.
* Thread local pointer feature should depend on Ethernet or WiFi
Ivan Grokhotkov [Fri, 3 Mar 2017 03:27:01 +0000 (11:27 +0800)]
Merge branch 'feature/docs_partition_ota_flash' into 'master'
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()
Merge branch 'feature/add_user_set_mac' into 'master'
Feature/add user set mac
1. Add menuconfig for user to set mac address of wifi, bt and ethernet.
2. Add the number of MAC address generated from efuse for user to choose.
3. Add MAC address derive method.