Jeroen Domburg [Tue, 15 Nov 2016 04:27:23 +0000 (12:27 +0800)]
Merge branch 'bugfix/workaround_gpio_pullupdown_bug' into 'master'
Work around the GPIO pullup/pulldown SoC bug
Some GPIO pins need to have their pullups/pulldowns set in the RTC peripheral instead of in the GPIO peripheral because of a silicon bug.
This merge:
- Declares PIN_PULLUP_EN and friends as deprecated; they can't really be changed to work around the issue because they get passed an iomux register instead of an io pin number
- Adds gpio_pullup_en and friends to the GPIO driver. These functions do have the workaround (as well as all the other functions in the gpio driver) and are meant to easily replace the PIN_PULLUP_EN routines
- Fixes some comments in the gpio headers
Jeroen Domburg [Tue, 15 Nov 2016 02:29:52 +0000 (10:29 +0800)]
Amend gpio driver to work around SoC bug with some pullups/pulldowns in the GPIO peripheral; mark existing function that does not always work as deprecated
Angus Gratton [Mon, 14 Nov 2016 04:42:44 +0000 (12:42 +0800)]
Merge branch 'feature/build_component_project_vars' into 'master'
build system: General refactoring
The original goal here was to support setting different COMPONENT_INCLUDEDIRS/COMPONENT_LDFLAGS based on sdkconfig. It's turned into a general refactor.
* The `get_variable` target & associated macros have been replaced with a target that generates a makefile snippet for each component (inside the build directory), and includes these in the project make pass. This improves build speed ( "no-op" `make all` on my system is down from 1.43s (wall) / 0.55s (CPU) to 0.49s (wall) / 0.23s (CPU) due to not forking as many processes) and also makes the builds more debuggable, as you can go and look at the component_project_vars.mk files in the build directory to see what paths are being added where.
* Including component_common.mk from component.mk is no longer necessary (and prints a deprecation warning). Instead, component.mk is included from inside a wrapper makefile. This allows default variables and project configuration to be loaded before component.mk begins, and removes the need to split makefile statements arbitrarily between "before including component_common" and "after including component_common", with which goes where depending on internals of the build system. Part-fix for TW#8017.
* Rewrote build system docs to reflect these details and also clarify some other points, add more ReST structure. Fixes other issues raised in TW#8017.
* Should be backwards compatible with existing components. The only difference I know is the deprecation warning when including component_common.mk.
Adds one new failure case: because some paths are encoded in the generated component_project_vars.mk files then reorganising the component directory structure (but not modifying any other files or menuconfig) may cause a partial build to fail and require a `make clean`. Moving the whole project directory, whole build directory, or whole ESP-IDF directory will not trigger this. This failure case should only ever cause a build error, not incorrect build output.
Angus Gratton [Mon, 14 Nov 2016 03:32:04 +0000 (11:32 +0800)]
Merge branch 'feature/esptool_secure_boot' into 'master'
Secure boot support
Also includes a lot of esptool.py changes (two new command line tools, espefuse.py and espsecure.py)
https://github.com/themadinventor/esptool/compare/feature/esp32_v20_refactor...feature/esp32_secure_boot?expand=1
Jeroen Domburg [Fri, 11 Nov 2016 06:50:29 +0000 (14:50 +0800)]
Merge branch 'feature/per_cpu_interrupt_handlers' into 'master'
Per-CPU interrupt handlers and args
Up to now, the interrupt handlers and args were shared between CPUs, that is, if you set an interrupt handler on CPU0, CPU1 would invoke the same interrupt handler on that interrupt. This code gives every CPU its own space for interrupt handlers.
Ivan Grokhotkov [Thu, 10 Nov 2016 08:58:39 +0000 (16:58 +0800)]
Merge branch 'bugfix/nvs_lookup_failure' into 'master'
nvs: fix Page::findItem and Storage::findItem regression
When read caching was added, Page::findItem started modifying itemIndex reference argument even if item wasn't found.
Incidentally, Storage::findItem reused itemIndex when starting search at next page.
So,
- if the first page had a cached index (findItem was called for that page), and it pointed to a non-zero index,
- first page has a few empty items at the end (but is marked full),
- next search looked up the item on the second page,
- index of the item on the second page was less than the cached index on the first page,
then the search would fail because cached starting index was reused.
This change fixes both sides of the problem:
- Page::findItem shouldn't modify itemIndex argument if item is not found
- Storage::findItem should not reuse itemIndex between pages
Krzysztof [Wed, 9 Nov 2016 19:26:28 +0000 (20:26 +0100)]
NVS Examples update
Updated previusly submitted example, saved it as "07_nvs_rw_value" and
added a new one.
Overview of examples:
* 07_nvs_rw_value - simple read and write a single value
* 08_nvs_rw_blob - read and write a blob that is extened with new data
on each restart of ESP32
Angus Gratton [Thu, 10 Nov 2016 02:20:55 +0000 (13:20 +1100)]
build system: Refactor component.mk to not need component_common.mk
New makefile component_wrapper.mk allows some variables to be set
before component.mk is evaluated. This properly fixes problems with
sdkconfig being hard to access in all phases of the build.
Including component_common.mk is no longer necessary and will print a
deprecation warning for components which use it.
Ivan Grokhotkov [Wed, 9 Nov 2016 02:12:25 +0000 (10:12 +0800)]
Merge branch 'bugfix/github_issues' into 'master'
Fixes for github issues
This MR contains a bunch of small fixes for issues raised on Github and esp32.com forum:
- vfs doesn't check error code returned by open syscall
- spi_flash doesn't work when built in release mode
- duplicate definition of O_NONBLOCK when combining LwIP socket.h with sys/fcntl.h
- wrong order of creation of standard streams
- `_times_r` returning incorrect values, causing `clock`to return double of the actual time
- driver/gpio.h: comment fix
- wifi event handlers: fix incorrect MAC address printed by logging statements
- move some functions out of IRAM when compiling for bootloader
Please check commit descriptions for links to issues/forum posts and more details.
Angus Gratton [Wed, 9 Nov 2016 01:21:23 +0000 (09:21 +0800)]
Merge branch 'bugfix/compile_with_no_timers' into 'master'
newlib: fix compilation error when no timers are enabled in menuconfig
I have checked that three options (RTC/RTC+FRC1/FRC1) work, but didn't check "None" option.
This adds some missing ifdef blocks to remove "unused function/variable" warnings and fixes the use of `__errno_r` in a non-reentrant function.
Ivan Grokhotkov [Tue, 8 Nov 2016 01:08:23 +0000 (09:08 +0800)]
fix order of creation of standard streams
With existing order, file descriptors assigned to stdin, stdout, stderr didn't match standard assignment.
https://github.com/espressif/esp-idf/issues/67
Ivan Grokhotkov [Tue, 8 Nov 2016 01:05:05 +0000 (09:05 +0800)]
lwip: fix duplicate definition of O_NONBLOCK
LwIP will define O_NONBLOCK in sockets.h if it isn't defined yet.
If sys/fcntl.h is included after socket.h, there will be duplicate definition.
Work around by including sys/fcntl.h into lwipopts.h.
Wu Jian Gang [Tue, 8 Nov 2016 11:48:11 +0000 (19:48 +0800)]
Merge branch 'feature/tw8193_add_wifi_api_detail_return_code' into 'master'
esp32/make: add detailed return error code for wifi APIs
1. Add detailed return error code for wifi APIs
2. Add description about error code in esp_wifi.h
3. Modify esp_wifi_reg_rxcb to esp_wifi_internal_reg_rxcb
4. Modify esp_wifi_set_sta_ip to esp_wifi_internal_set_sta_ip
5. Mark system_init as deprecated API