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
Liu Zhi Fu [Tue, 8 Nov 2016 09:34:46 +0000 (17:34 +0800)]
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
Ivan Grokhotkov [Mon, 7 Nov 2016 13:15:49 +0000 (21:15 +0800)]
Merge branch 'feature/wpa_supplicant_libcrypto_source' into 'master'
wpa_supplicant: replace pre-built crypto library with source code
This change replaces libcrypto.a pre-built library with source code from wpa_supplicant.
For now i've decided to keep the modified layout of source and header files which is used in the esp32_rtos_sdk_core project. This will make it easier to move other parts of wpa_supplicant from esp32_rtos_sdk_core into esp-idf. Once we move everything, we can rearrange the files and upgrade wpa_supplicant to latest version.
Ivan Grokhotkov [Mon, 7 Nov 2016 04:55:47 +0000 (12:55 +0800)]
Merge branch 'bugfix/osx_menuconfig_build' into 'master'
Allow OS X to build without libintl
https://github.com/espressif/esp-idf/pull/42
I have tested this with the following configurations:
- OS X with Xcode command line tools, no macports, no homebrew
- OS X with Xcode command line tools and homebrew
- OS X with Xcode IDE and macports
All three work with this change, without it the first two had issues.
Ivan Grokhotkov [Mon, 7 Nov 2016 04:27:53 +0000 (12:27 +0800)]
Fix build with macports/pkgconfig, silence format string warnings on OS X
Extra space is needed in echo -n "-lncurses ", otherwise if pkg-config outputs a directory after that, it will result in "-lncurses-L/opt/local/lib" (without space).
-Wno-format-security flag is needed on macOS to silence warnings about printf(gettext("message")) constructs.
Ivan Grokhotkov [Mon, 7 Nov 2016 04:26:15 +0000 (12:26 +0800)]
Merge branch 'feature/style_guide' into 'master'
docs: add style guide
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.
Ivan Grokhotkov [Mon, 7 Nov 2016 04:12:31 +0000 (12:12 +0800)]
Merge branch 'bugfix/bootloader_iram_overlap' into 'master'
fix overlap between bootloader and application IRAM ranges
This change moves the action of enabling APP CPU cache into the application startup code.
Therefore we don't need to use IRAM for the final stage of bootloader, and application can use all 0x20000 of IRAM.
This fixes crashes which happened when application used enough of IRAM to overlap with bootloader functions.
Ivan Grokhotkov [Wed, 7 Sep 2016 04:45:08 +0000 (12:45 +0800)]
tools: add code formatter rules for Eclipse
Generated with Eclipse Neon, should work in earlier versions as well.
This file can be imported
- into the workspace via Preferences > C++ > Code Style > Formatter > Import
- or into the project via Project Preferences > C++ General > Formatter > Import
Configuration options in Eclipse are not exactly the same as in astyle.
There may be some discrepancy between the format astyle and Eclipse will produce.
If anyone notices that, please let me know.
Ivan Grokhotkov [Thu, 1 Sep 2016 04:32:05 +0000 (12:32 +0800)]
docs: add style guide
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.
Ivan Grokhotkov [Thu, 3 Nov 2016 10:02:58 +0000 (18:02 +0800)]
Merge branch 'feature/time_syscalls' into 'master'
implement time syscalls
This change adds optional support for libc time functions.
New menuconfig option allows selecting FRC1, RTC, both, or none to be used for timekeeping.
- If only FRC1 timer is used, gettimeofday will provide time at
microsecond resolution. Time will not be preserved when going
into deep sleep mode.
- If both FRC1 and RTC timers are used, timekeeping will
continue in deep sleep. Time will be reported at 1 microsecond
resolution.
- If only RTC timer is used, timekeeping will continue in
deep sleep, but time will be measured at 6.(6) microsecond
resolution. Also the gettimeofday function itself may take
longer to run.
- If no timers are used, gettimeofday function will return -1 and
set errno to ENOSYS.
`times` function returns time derived from FreeRTOS ticks. It reports all as 'system' time, 'user' time is reported as zero.
`settimeofday` function may be used to set current time.
LwIP SNTP module is hooked up into the system through `settimeofday`/`gettimeofday`.
Example demonstrating this functionality is also added.
Ivan Grokhotkov [Tue, 1 Nov 2016 14:27:37 +0000 (22:27 +0800)]
Merge branch 'bugfix/only_deploy_when_test_pass' into 'master'
fix bug that deploy when test failed:
test report will be a single stage. The result of test report will be calculated from the result of all test jobs in test stage. So it will only deploy when all test job passed.
Ivan Grokhotkov [Tue, 1 Nov 2016 14:26:37 +0000 (22:26 +0800)]
Merge branch 'bugfix/nvs_write_failure' into 'master'
Fix spi_flash_write regression and nvs error recovery
In the previous set of changes related to spi_flash, new alignment checks were added. One of these checks, word alignment of `src` buffer in `nvs_flas_write`, was unnecessary. ROM `SPIWrite` function can handle unaligned source buffers.
This change caused an error to be returned to nvs for some legitimate write operations. Due to a bug in nvs, further write operations were possible, while the internal state of `Page` instance was broken. In WiFi functional tests, this inflicted havoc on the nvs partition, creating multiple duplicate items in the affected page. Because multiple duplicate items per page were never supposed to be handled during page load, duplicates were not removed. Thankfully this caused an assert at a later point in the loading process, otherwise this bug would be very difficult to detect.
This change set fixes the original spi_flash regression, handling of `INVALID` state of `nvs::Page`, and handling of duplicate items.
Ivan Grokhotkov [Tue, 1 Nov 2016 14:25:20 +0000 (22:25 +0800)]
Merge branch 'feature/api_doc' into 'master'
API reference, first batch
This includes fixes to documentation formats in header files, some standalone doc fixes, necessary files for readthedocs, and instructions for documenting the code.
Liu Zhi Fu [Tue, 1 Nov 2016 07:34:30 +0000 (15:34 +0800)]
esp32: update wifi lib
146f5962 - Make the return value of esp_wifi_internal_tx consistent with LWIP error code so that
the up-layer can detect the out-of-memory error and take action accordingly, such do flow control.
Ivan Grokhotkov [Mon, 31 Oct 2016 13:10:47 +0000 (21:10 +0800)]
nvs_flash: delete all duplicate entries in a page while loading
Due to previous flash write bug it was possible to create multiple duplicate entries in a single page.
Recovery logic detected that case and bailed out with an assert.
This change adds graceful recovery from this condition.
Tests included.
Ivan Grokhotkov [Mon, 31 Oct 2016 11:48:28 +0000 (19:48 +0800)]
nvs_flash: don't allow more operation to be done on page in PageState::INVALID
Currently a restart is required to recover a page from invalid state.
The long-term solution is to detect such a condition and recover automatically (without a restart). This will be implemented in a separate change set.
Ivan Grokhotkov [Mon, 31 Oct 2016 11:17:25 +0000 (19:17 +0800)]
nvs_flash: introduce write failures after each word written
Previously the test bench would check failure recovery by introducing error after each write operation.
This makes checks a bit more extensive (and much longer) by failing after every word written. Surprisingly, this change didn't expose any bugs.
Ivan Grokhotkov [Mon, 31 Oct 2016 11:08:56 +0000 (19:08 +0800)]
spi_flash: remove unnecessary src pointer alignment check in spi_flash_write
ROM SPIWrite routine can work with unaligned sources, so this check is unnecessary.
Furthermore, it breaks nvs_set_str and nvs_get_blob when data pointer is unaligned.
Also fix stray backslash in COUNTER_STOP macro