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
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.
Wangjialin [Mon, 7 Nov 2016 06:16:52 +0000 (14:16 +0800)]
Minor changes for driver
1. remove "\n" when calling ESP_LOGX APIs.
2. modify uart_event_t for uart rx data.
3. use MICRO for uart inverse value
4. add uart_tx_data_t for internal tx function.
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.
Krzysztof [Sun, 6 Nov 2016 16:41:08 +0000 (17:41 +0100)]
Non-Volatile Storage (NVS) example
Demonstrates how to read and write a value using NVS.
The value tracks number of ESP32 module restarts.
Example also shows how to use basic diagnostics if read / write
operation was successful.
Krzysztof [Sat, 5 Nov 2016 16:11:40 +0000 (17:11 +0100)]
Resolved issue with version / release on Read the Docs
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
Wangjialin [Fri, 4 Nov 2016 04:52:34 +0000 (12:52 +0800)]
Modify as Angus's suggestion:
1. Set XXX_TAG static, remove extern XXX_TAG in uart.h/ledc.h/gpio.h
2. I removed uart_set/get_print_port() functions, these functions are not well tested, I removed them for now.
3. Modify some function names for uart_read/write_bytes
4. Modify uart_write_bytes and uart_write_bytes_with_break.
Wangjialin [Thu, 3 Nov 2016 18:48:25 +0000 (02:48 +0800)]
Update UART driver
1. fix bug in ringbuffer.c:
When return an dummy item, free_ptr might exceed rd_ptr, so the write_ptr would overwrite rd_ptr in this case.
2. Delete UART tx task in buffer mode. UART ISR will copy the data from tx buffer to fifo.
Ivan Grokhotkov [Thu, 3 Nov 2016 12:18:30 +0000 (20:18 +0800)]
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