Commit graph

305 commits

Author SHA1 Message Date
Wu Jian Gang e04e6b0c7f Merge branch 'feature/wifi_lib_update' into 'master'
esp32/lib: update to 1303c92c

1. support to set vendor ie;
2. fix "mode:" log twice issue; TW7019
3. fix station can not connect to some AP in WEP mode; TW7021

See merge request !85
2016-09-14 17:53:01 +08:00
Wu Jian Gang 8051a8b91e Merge branch 'bugfix/tw7058_mode_fatal' into 'master'
[teamwork7058]It causes fatal when switch wifi mode.



See merge request !84
2016-09-14 17:46:12 +08:00
Wu Jian Gang 6bfe892099 esp32/lib: update to 1303c92c 2016-09-14 16:57:00 +08:00
Wu Jian Gang 6104370ac9 Merge branch 'feature/support_vendor_ie_api' into 'master'
esp32: add vendor ie API

1. add esp_wifi_set_vnd_ie
2. add esp_wifi_set_vnd_ie_cb

See merge request !75
2016-09-14 16:53:53 +08:00
Xu Chun Guang 064d2b4ecb dhcpserver: Fix crash when switching wifi mode
See Teamwork 7058.
2016-09-14 16:14:50 +08:00
Angus Gratton 67a26d52ac mbedtls: Temporarily disable default hardware crypto SHA & bignum
Due to limitations referenced in the comments of the changes.
2016-09-14 17:52:39 +10:00
Angus Gratton f01cabf71d mbedtls hwcrypto sha512: Fix redirection of function names 2016-09-14 17:52:24 +10:00
Angus Gratton 126a68ca1f mbedtls upstream tweak: Move mbedtls_sha512_process in sha512.h
Function declaration should only be included if MBEDTLS_SHA512_ALT is
not set. This matches sha1.h and sha256.h

This change should be contributed back upstream to mbedTLS project.
2016-09-14 17:51:27 +10:00
qiyueixa 56586a10ac Format code by using 4 spaces instead 2016-09-14 15:18:06 +08:00
Wangjialin f32823ff6c modify character conversion error and typo 2016-09-14 13:47:28 +08:00
Wangjialin c13ab62e4c modify i2s_reg.h, rebase to master 2016-09-14 13:47:28 +08:00
Wangjialin 41d397cf3f Only modify headers in soc/ .
Pass compiling under esp-idf-tests/merge_soc_tmp/merge_for_soc_headers branch.(only change some names of register and INUM).
2016-09-14 13:47:28 +08:00
qiyueixa f02e5cdec7 Rename vender_ie_type_t and vendor_ie_id_t to wifi_vendor_ie_type_t and wifi_vendor_ie_id_t respectively 2016-09-14 13:39:30 +08:00
qiyueixa d866fe84a4 modify arguments for vendor ie APIs by using enum instead 2016-09-14 13:39:30 +08:00
Wu Jian Gang 01cc811ee0 esp32: fix typo 2016-09-14 13:26:17 +08:00
Wu Jian Gang c1a874fb9e esp32: fix kconfig 2016-09-14 12:55:41 +08:00
Ivan Grokhotkov 2fc60ba938 Merge branch master into feature/logging
* branch master: (51 commits)
  fix typos
  callback: add a void* pointer with each callback
  header: callbacks use "void *" as arguments
  header: format and fix typos
  add wifi api comments
  add wifi api comments
  components/spi_flash: call SPIUnlock only once
  components/spi_flash: improve comments and readability
  esp32 cpu_start: Include rom/uart.h, remove inline ROM function declarations
  bootloader: Add bootloader Kconfig
  Fix bug where nesting vTaskEnterCritical calls would not re-enable interrupts after vTaskExitCritical sections.
  installed gitlab key in global before_script, don't need to overwrite in template before_script
  ci: Use github repo for wifi libraries on master branch, gitlab repo otherwise
  components/esp32,spi_flash: update some comments
  components/esp32: remove dependency of WIFI_ENABLED on FREERTOS_UNICORE
  esp32/lib: Bump WiFi revision
  update ci: build ssc with idf submodule wifi lib
  components/esp32: add inter-processor call API and implement spi_flash through it
  add MACRO to get flash pad number from efuse value
  add comments to register read/write operations
  ...
2016-09-14 12:19:43 +08:00
liuzhifu d2d231de29 define lwip task priority in esp_task.h 2016-09-14 12:00:46 +08:00
liuzhifu 8ed5010356 components: esp32 - fix build error 2016-09-14 12:00:46 +08:00
liuzhifu 4a98027242 components: lwip - Modify lwip task priority and stack definition method
lwip task priority and stack size defintion should not depends on esp_task.h, define it
in lwipopts.h directly
2016-09-14 12:00:46 +08:00
liuzhifu 2a15eda8bc components: esp32
Remove priority/stack definition of task that is freertos/lwip/app
2016-09-14 12:00:46 +08:00
liuzhifu 109691f9bc components: esp32
add missing file esp_task.h
2016-09-14 12:00:46 +08:00
liuzhifu 9cf997a6fc components: esp32/lwip
Add esp_task.h for placing all task priority/stack size macro definition
2016-09-14 12:00:46 +08:00
liuzhifu 56a684d9eb task priority: modify lwip/wifi/event task priority
1. Modify lwip core task priority to configMAX_PRIORITIES-7
2. Modify wifi startup task priority to configMAX_PRIORITIES-7
3. Modify event task priority to configMAX_PRIORITIES-4
2016-09-14 11:59:25 +08:00
Wu Jian Gang 058a411786 Merge branch 'feature/add_wifi_api_comments' into 'master'
Feature/add wifi api comments

Add wifi API comments


See merge request !63
2016-09-14 11:17:29 +08:00
Angus Gratton d7cfe08b13 Merge branch 'bugfix/add_tx_flowcontrol' into 'master'
lwip: add socket tx flow control

This fix is used to solve wifi q full issue:
1. When wifi tx q is full, set tx_enable to false
2. When wifi tx q decrease 1/2 max length, set tx_enable to true again
3. esp_wifi_tx_enable return whether tx_enable is true
4. If esp_wifi_tx_enable return false, socket will be blocked

See merge request !62
2016-09-14 09:01:42 +08:00
Angus Gratton 66b6a4c642 Merge branch 'feature/esptool_upstream' 2016-09-14 10:28:41 +10:00
Wu Jian Gang ed8e8848e3 fix typos 2016-09-13 20:54:20 +08:00
Wu Jian Gang b56098a612 Merge remote-tracking branch 'origin/master' into feature/mbedtls 2016-09-13 16:31:48 +08:00
Wu Jian Gang bf5e83a6ed callback: add a void* pointer with each callback
also format event.c/wifi.c/esp_event.h/esp_wifi.h
2016-09-13 16:20:29 +08:00
Wu Jian Gang c56a790f64 header: callbacks use "void *" as arguments 2016-09-13 16:19:09 +08:00
Wu Jian Gang c5f8396df4 header: format and fix typos
SYSTEM_EVENT_STA_GOTIP to SYSTEM_EVENT_STA_GOT_IP
2016-09-13 16:17:41 +08:00
liuzhifu ded5df7513 add wifi api comments 2016-09-13 16:17:41 +08:00
liuzhifu b86e060647 add wifi api comments 2016-09-13 16:17:41 +08:00
Ivan Grokhotkov 29c6eab6dc components/spi_flash: call SPIUnlock only once
This fixes the performance impact for spi_flash_write and spi_flash_erase.
With this change, NVS init in single core mode takes about 50ms (compared to >2seconds before that).
2016-09-13 15:16:36 +08:00
Angus Gratton b6b83c33be Merge branch 'feature/bootloader_config' into 'master'
Add bootloader menuconfig entries

Adds log verbosity & ANSI coloring to menuconfig, also some cleanup in cpu_start.c

See merge request !79
2016-09-13 14:31:18 +08:00
Ivan Grokhotkov f9013d9ff8 Merge branch 'feature/dualcore_spi_flash_api' into 'master'
Dual core compatible spi flash APIs

Implementation of spi flash APIs which work in dual core mode.

This also includes other changes:
- fixes to FreeRTOS tasks.c made by Jeroen and me — these were originally made to fix issues with high priority tasks seen in WiFi stack, but were required to get stuff in ipc.c working as well
- initial base idea with two high-priority tasks was separated into a separate API — esp_ipc.h. That API allows one to run a function on the other CPU from a high-priority task. Because we don't have preemption across CPUs, this is currently not very fast: it requires on average half a tick until the second CPU switches to the high priority task. Currently that API can be either blocking, or non-blocking with queue length of 1. I haven't yet found a use case for arbitrary sized queue of IPC requests. Anyone who needs that can trivially add that later by replacing a binary semaphore with a generic queue.

With these changes i can run application with WiFi stack and NVS on both cores.

See merge request !25
2016-09-13 13:58:54 +08:00
Ivan Grokhotkov ce2153c447 components/spi_flash: improve comments and readability 2016-09-13 12:47:21 +08:00
Angus Gratton 7ba471d531 esp32 cpu_start: Include rom/uart.h, remove inline ROM function declarations 2016-09-13 14:18:17 +10:00
Angus Gratton 3061ae40c0 bootloader: Add bootloader Kconfig
Allow debug level & colour highlighting to be configured
2016-09-13 14:18:17 +10:00
Jeroen Domburg 174a0e3f8b Fix bug where nesting vTaskEnterCritical calls would not re-enable interrupts after vTaskExitCritical sections. 2016-09-13 11:47:22 +08:00
Ivan Grokhotkov 23d5c7579b components/esp32,spi_flash: update some comments 2016-09-12 20:02:51 +08:00
Ivan Grokhotkov 1b6022bd07 components/esp32: remove dependency of WIFI_ENABLED on FREERTOS_UNICORE 2016-09-12 19:53:38 +08:00
Wu Jian Gang 4598f9fc88 esp32/lib: Bump WiFi revision 2016-09-12 19:32:05 +08:00
Ivan Grokhotkov e9f2645b21 components/esp32: add inter-processor call API and implement spi_flash through it
With this change, flash operations can run on both cores.
NVS and WiFi stack can also run in dual core mode now.
2016-09-12 18:54:45 +08:00
Wu Jian Gang 19f9ca0200 Merge branch 'bugfix/wifi_revision' into 'master'
esp32/lib: Bump WiFi revision



See merge request !72
2016-09-12 18:52:40 +08:00
Jack bd8febe58c add MACRO to get flash pad number from efuse value 2016-09-12 17:47:50 +08:00
Jack d0442602c7 add comments to register read/write operations 2016-09-12 17:47:50 +08:00
Wu Jian Gang 04b53643ef header files: clean up
1. format;
2. Slow RTC memory reverse 2KB;
2016-09-12 17:47:50 +08:00
jack 24011ddd05 header files: modify rom code and soc header files
1. timer reg file for both time group 0 and time group 1, not only timer group 0
2. fix bug that io mux header file mismatch with chip
3. fix bug that some BASE address not correct
4. add some static function to eagle.fpga32.rom.addr.v7.ld
5. add interrupts usage table
6. add some comments for rom code functions
2016-09-12 17:47:49 +08:00
Jeroen Domburg fe3380d32e Merge branch 'bugfix/realloc' into 'master'
modify realloc behaves

 modify realloc behaves just like malloc when pass a null pointer for ptr.

See merge request !66
2016-09-12 17:08:57 +08:00
Angus Gratton fcf278848d Merge branch 'master' into feature/esptool_upstream 2016-09-12 18:02:10 +10:00
Angus Gratton 5810dbef05 make: Add macro to test for & try to fix up files required for submodules
Now applied to both esptool.py & esp32 wifi libs
2016-09-12 18:00:20 +10:00
Angus Gratton f293d530f8 esp32/lib: Bump WiFi revision 2016-09-12 17:31:43 +10:00
Angus Gratton 9c51f8a7a3 Merge branch 'master' into feature/mbedtls 2016-09-12 17:30:11 +10:00
xiaxiaotian 7c607e4d63 Change the enum of wifi_storage_t to be the same as that in wifi lib. 2016-09-12 11:38:13 +08:00
Ivan Grokhotkov 1c6859573b freertos: protect calls to prvAddTaskToReadyList with xTaskQueueMutex 2016-09-09 17:59:37 +08:00
liuzhifu 32f01c61a2 add comments about current tx flow control 2016-09-09 17:58:21 +08:00
liuzhifu e38c4b0365 modify esp32_tx_flow_ctrl to static function and move extern api to header file 2016-09-09 17:58:21 +08:00
liuzhifu 19c8476344 modify macro ESP32_TX_FLOW_CTRL to inline function 2016-09-09 17:58:21 +08:00
liuzhifu a28ef1776e lwip: add socket tx flow control 2016-09-09 17:58:21 +08:00
Jeroen Domburg 9664de6867 Add working portASSERT_IF_IN_ISR function, fix enter_critical thing even better. 2016-09-09 17:15:50 +08:00
Jeroen Domburg 128bb77c5a Fix prev code to not crash horribly when scheduler is not running yet 2016-09-09 17:15:49 +08:00
Jeroen Domburg 08ec33c6a2 Make vTaskEnterCritical callable from ISR 2016-09-09 17:15:12 +08:00
Ivan Grokhotkov be4dfed822 Merge branch 'master' into feature/dualcore_spi_flash_api
* master: (130 commits)
  lwip: Define LWIP_ESP8266 in port lwipopts.h not gcc command line
  CI: Build the esp-idf-template with the matching branch name, if it exists
  README: Add Resources section with some links
  Rename README.buildenv to docs/build_system.rst and ReST-ify it
  Eclipse docs: Easier to just replace entire PATH, msys32 has everything we need to build/flash
  test_build_system: Print ESP_IDF_TEMPLATE_GIT for easier debugging
  Name component makefiles component.mk instead of Makefile
  Eclipse doc: Add troubleshooting note about Makefile directories
  eclipse_make.sh: Fix printing of make directory
  Move bin/eclipse_windows_make.sh to tools/windows_eclipse_make.sh
  Eclipse docs: Prepend IDF paths to beginning of PATH
  Set default SPI flash access mode to DIO
  FreeRTOS: temporary solution for memory canaries and memory debug
  tcpip_adapter: fix dhcp client work flow
  event: not post got ip event if static is invalid
  tcpip_adapter: typedef clean up
  event: post got ip event when use static ip
  tcpip_adapter: use dhcp callback to post got ip event
  dhcp: add dhcp callback
  lwip: remove netif_reg_addr_change_cb
  ...
2016-09-09 17:14:16 +08:00
liuhan 47db66e495 esp32: modify realloc behaves just like malloc when pass a null pointer for ptr. 2016-09-09 15:06:56 +10:00
Angus Gratton 46a9754b8e hwcrypto sha: Fix initialisation of SHA hardware in esp_shaX_start functions
Problem exposed by previous commit.
2016-09-09 14:27:53 +10:00
Angus Gratton eb47a25012 mbedtls: Revert changes to upstream library sources.
This reverts part of commit 0f83831c74.
2016-09-09 14:10:44 +10:00
Angus Gratton 6f006c25fb json & expat: Update component.mk after merging from master 2016-09-09 14:07:45 +10:00
Angus Gratton 264b115eb0 mbedtls: Move esp_config.h file to port directory 2016-09-09 14:06:14 +10:00
Angus Gratton 1d355b93df lwip: Define LWIP_ESP8266 in port lwipopts.h not gcc command line 2016-09-09 13:53:38 +10:00
Angus Gratton a939c15723 mbedtls networking: Remove WIN32 parts, minor cleanup 2016-09-09 11:24:35 +10:00
Angus Gratton 7c58c1e06b Build system: Allow components to add to the global CFLAGS via Makefile.projbuild
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.
2016-09-09 11:08:19 +10:00
Angus Gratton 31e6b2cdb4 Merge branch 'master' into feature/mbedtls 2016-09-09 10:29:19 +10:00
Angus Gratton add32cbc9a Merge branch 'bugfix/docs_eclipse' into 'master'
Eclipse fixes, including renaming component Makefiles to component.mk

Some changes after following up some Eclipse problems with @nilay .

Biggest thing is renaming all component Makefiles to component.mk. This requires changes to all esp-idf projects, ie:
* https://github.com/espressif/esp-idf-template/compare/bugfix/docs_eclipse?expand=1
* http://gitlab.espressif.cn/idf/esp-idf-tests/tree/update/component_makefiles

... this fixes Eclipse weirdness and also means the only "Makefile"s in the project are the ones you should run make against.

If this MR is merged then I'll also merge these, email all developers about the breaking change and post on esp32.com.

See merge request !34
2016-09-09 07:41:32 +08:00
Ivan Grokhotkov 7268f0a60a components/log: add API header for logging library
TW6703
2016-09-08 20:02:26 +08:00
Wu Jian Gang 95defc7d32 mbedtls: Use hardware accelerated AES, SHA, bignum 2016-09-08 17:41:43 +08:00
Angus Gratton 2211759cc0 hwcrypto aes: Fix bugs w/ ECB decrypt, CFB modes 2016-09-08 17:02:52 +08:00
Jeroen Domburg 99b64c82d1 Merge branch 'bugfix/default_dio_spiflashmode' into 'master'
Set default SPI flash access mode to DIO

We have a bunch of boards out there (the NodeMCU-lookalike, breadboardable boards) in the hands of early reviewers. Because the flash chips on these boards have a different command to go into QIO mode, ESP-IDF will break on these boards out of the box. Eventually, we need some nifty way to autodetect this or something, but for now, the quick fix is to make DIO the default access mode.

Once this is merged, I will also modify the default in the template apps sdkconfig.

See merge request !65
2016-09-08 16:58:34 +08:00
Angus Gratton d951ab2661 hwcrypto aes: Performance tweak, only write key to hardware once
Shaves ~10% off time to compute AES-CBC
2016-09-08 16:47:37 +08:00
Angus Gratton a32e954f67 hwcrypto sha: Feed one block at a time to hardware SHA implementation
Fixes a bug where some longer block sizes produced incorrect results.
2016-09-08 16:47:34 +08:00
Angus Gratton 0a970e3a25 hwcrypto: Match API completely to mbedTLS naming conventions 2016-09-08 16:47:31 +08:00
Angus Gratton 2580c07ae6 esp32 hwcrypto: Make SHA-224 an obvious no-op for now
This is not the long term solution...
2016-09-08 16:47:28 +08:00
Angus Gratton 2bee84062a esp32: Add comment to ROM crypto functions recommending they not be used directly 2016-09-08 16:47:24 +08:00
Angus Gratton 0647d1e922 esp32 hwcrypto: Rework hardware crypto locking
Should protect against concurrent use of hardware crypto primitives,
with good performance.

Not necessary to call esp_aes_acquire_hardware(),
esp_sha_acquire_hardware(), etc when using these APIs. These are
provided for external users calling the hardware crypto hardware
directly, to coexist with this implementation.
2016-09-08 16:47:13 +08:00
Angus Gratton 4167b68eef esp32: Move hardware crypto implementation/headers to hwcrypto directories 2016-09-08 16:46:28 +08:00
Wu Jian Gang fc2bfc1f49 mbedtls: just format related files
method from !46
2016-09-08 16:46:25 +08:00
liuhan f4ff32977d components/mbedtls: modify MBEDTLS net feature
modify get the connection's 'errno' info by calling getsockopt function.
2016-09-08 16:46:21 +08:00
Angus Gratton 09aa6ebc85 lwip Makefile: Add POSIX headers to include path to #include <sys/sockets.h>, etc, works. 2016-09-08 16:45:57 +08:00
liuhan 1900c50d3b components/mbedtls: modify hardware encryption feature
rename "flag" and "keybites" in aes file,
rename "xxx_starts" and add license in sha file.
2016-09-08 16:45:51 +08:00
liuhan 2d80fada70 components/mbedtls: MBEDTLS Handshake result check
modify esp_config.h add some feature for support http2.0 protocol, TLS Handshake OK.
2016-09-08 16:45:44 +08:00
liuhan 0f83831c74 1. multi thread verify bignum AES and SHA 2016-09-08 16:45:23 +08:00
liuhan 98021903a2 recompile crypto and bignum function 2016-09-08 16:45:16 +08:00
liuhan d9b660f6d4 1. add lock function for every function
2. modify some function for crypto
2016-09-08 16:44:58 +08:00
liuhan 30be5f6eb5 [t6001]: chip Use hardware acceleration of Encryption 2016-09-08 16:44:53 +08:00
Angus Gratton 3b1c3dab4b Name component makefiles component.mk instead of Makefile
Fixes problems with Eclipse trying to build in directories it shouldn't.

This is a breaking change for existing repositories, they need to rename
any component Makefiles to component.mk and rename their references to
$(IDF_PATH)/make/component.mk to $(IDF_PATH)/make/component_common.mk
2016-09-08 13:41:19 +10:00
Angus Gratton 42357990aa Merge branch 'feature/mbedtls_upstream_source' into 'master'
Add mbedtls release version 2.3.0



See merge request !56
2016-09-08 11:32:02 +08:00
Angus Gratton e9b73e5c0d Merge branch 'feature/memory_canaries_temp' into 'master'
FreeRTOS: temporary solution for memory canaries and memory debug

1. This is just a temporary solution, it will be removed when umm_malloc is ready
2. Support memory canaries mechanism
2. Add debug code to show allocated memory info

See merge request !64
2016-09-08 11:20:17 +08:00
Jeroen Domburg 5a0e374a46 Set default SPI flash access mode to DIO 2016-09-08 10:22:15 +08:00
Wu Jian Gang 28ca0b0526 Merge branch 'bugfix/got_ip_event' into 'master'
tcpip_adapter: got ip event stuff

Include:
1. add dhcp callback;
2. post got ip event in dhcp callback when dhcp bind;
3. tcpip_adapter typedef clean;
4. post got ip event in station connected event handler when use valid static ip;

TW6926

See merge request !61
2016-09-08 09:44:48 +08:00