Commit graph

696 commits

Author SHA1 Message Date
Yinling 2e319705ec forget to break when test succeed 2016-11-02 19:41:33 +08:00
Yinling fdff6b2b01 run unit test case by case name 2016-11-02 19:08:55 +08:00
Ivan Grokhotkov c534dedf2d newlib: implement time syscalls 2016-11-02 17:31:35 +08:00
Dong Heng 0aadc58b87 Merge branch 'master' into feature/openssl 2016-11-02 15:46:52 +08:00
Jeroen Domburg 3af7872839 Merge branch 'bugfix/small_fixes' into 'master'
OpenOCD doc fix, fix gdbstub

- Fixes a few typos in the OpenOCD docs
- Fix compiling with gdbstub as panic handler

See merge request !165
2016-11-02 10:27:26 +08:00
Wangjialin e1f0c98ef5 Modify gpio.h and ledc.h 2016-11-01 22:35:42 +08:00
Ivan Grokhotkov f18c1f13b1 Merge branch 'feature/deepsleep_stub_linker' into 'master'
Deep sleep: Any source named rtc_wake_stub* is linked as RTC wake stub code

Also move esp_deepsleep.h documentation out to docs/deep-sleep-stub.rst

See merge request !142
2016-11-01 22:27:13 +08:00
Ivan Grokhotkov b8e940d645 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.

See merge request !161
2016-11-01 22:26:37 +08:00
Ivan Grokhotkov fe64ea95b4 Merge branch 'feature/tw8155_optimize_tx_flow_control' into 'master'
Feature/tw8155 optimize tx flow control

1. Remove TX flow control in LWIP
2. Make the return value of esp_wifi_internal_tx consistent with LWIP error code

See merge request !164
2016-11-01 22:26:15 +08:00
Yinling 5784586041 integrate unit test to CI 2016-11-01 19:30:42 +08:00
Jeroen Domburg 8c1d1e19c2 OpenOCD doc fix, fix gdbstub 2016-11-01 15:41:10 +08:00
Liu Zhi Fu edf5b10344 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.
2016-11-01 15:34:30 +08:00
Liu Zhi Fu f0cd38a079 lwip: remove tx flow control code 2016-11-01 15:25:46 +08:00
Dong Heng 12e78e9590 components/openssl: add more debug stream output function 2016-11-01 15:16:14 +08:00
Dong Heng bc710e5b88 components/openssl: refacetor the SSL debug function
Add the "ssl_opt.h" file to make user able t add its platform interface
2016-11-01 14:59:50 +08:00
Dong Heng 8d1f360ca6 components/openssl: ssl port use esp32_idf default 2016-11-01 13:10:56 +08:00
Dong Heng 16a4d56fe5 components/openssl: remove some platform interface 2016-11-01 13:09:54 +08:00
Dong Heng fc6b52574a components/openssl: refactor the SSL port function and debug function 2016-11-01 13:07:10 +08:00
Wangjialin ce9e73cd19 merge master 2016-11-01 10:34:13 +08:00
Wangjialin 8d6b782327 Modify UART driver:
1. Add a ring buffer for UART TX.
    If the buffer size is set to zero, driver will not use a buffer. But we need a task to send data from buffer to fifo. I tried directly copy data in ISR, but the code looked too long for ISR.
2. Modify the format in uart.h
2016-11-01 09:22:09 +08:00
Krzysztof 12efd96fb4 Corrected documentation style
This is for better visuaization with Sphinx
2016-11-01 01:21:18 +08:00
Krzysztof 079f5faad8 Fixed confused Sphinx
Sphinx failed to phrase esp_log_timestamp
reorderdering esp_log_write and esp_log_timestamp fixed this issue
2016-11-01 01:21:18 +08:00
Krzysztof f6118c67b0 Fixed desription of logging library 2016-11-01 01:21:18 +08:00
Krzysztof 2d56953ee4 docu makup update 2016-11-01 01:21:18 +08:00
Krzysztof fa002b4909 Fixed headers to match python doc standard 2016-11-01 01:20:04 +08:00
Krzysztof 1263cd340e Add missing annotations 2016-11-01 01:20:04 +08:00
Krzysztof f05cd619f4 Sample cleaning of markup 2016-11-01 01:20:04 +08:00
Liu Zhi Fu 92b663d9f2 lwip: optimize tx flow control
1. Remove tx flow control for TCP
2. Remove tx flow control for UDP temporary
3. Return the error code when call esp_wifi_internal_tx()
2016-10-31 21:26:33 +08:00
Ivan Grokhotkov abea6c50f1 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.
2016-10-31 21:10:47 +08:00
Wu Jian Gang c7f8d206ed Merge branch 'bugfix/tw8242_fix_tcp_rx_abnormal_issue' into 'master'
lwip: fix tcp rx abnormal issue(tw8242)

In tcp_alloc(), initialize per_soc_tcp_wnd before initializing recv_wnd because recv_wnd depends on per_soc_tcp_wnd. 

See merge request !160
2016-10-31 20:28:11 +08:00
Ivan Grokhotkov d9cdc7de58 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.
2016-10-31 19:48:28 +08:00
Liu Zhi Fu 2b722ea468 turn on per socket tcp window by default 2016-10-31 19:43:18 +08:00
Liu Zhi Fu 19f61332a9 make build pass when disable per soc tcp window 2016-10-31 19:38:47 +08:00
Ivan Grokhotkov 413f2c00f6 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.
2016-10-31 19:17:25 +08:00
Ivan Grokhotkov 269332f473 nvs_flash: use CRC-32 routine compatible with ROM version
Host tests used different flavour of CRC-32, which made it impossible to load NVS partition dumps created on the chip
2016-10-31 19:11:40 +08:00
Ivan Grokhotkov 2119b98469 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
2016-10-31 19:08:56 +08:00
Wu Jian Gang d7b4197ade Merge branch 'feature/tw8221_softap_supports_max_10_stations' into 'master'
esp32/tcpip_adapter: softap supports max 10 stations

The max number of stations softap supports is modified from 8 to 10

See merge request !158
2016-10-31 18:09:03 +08:00
Liu Zhi Fu a5552b1e21 lwip: fix tcp rx abnormal issue(tw8242)
In tcp_alloc(), initialize per_soc_tcp_wnd before initializing recv_wnd because recv_wnd depends on per_soc_tcp_wnd.
2016-10-31 17:50:09 +08:00
Ivan Grokhotkov e34fc7a46c Merge branch 'bugfix/nvs_leaks' into 'master'
nvs: fix memory leaks in HashList and nvs_close

Fixes TW8162.
Associated test case is run under Instruments on macOS, until I set up valgrind to test this automatically on Linux.

See merge request !150
2016-10-31 17:30:00 +08:00
He Yin Ling e7cc1aded5 Merge branch 'test/clean_ci_fails' into 'master'
Test/clean ci fails



See merge request !159
2016-10-31 16:37:36 +08:00
Dong Heng 9555ce291e feature/openssl: correct wrong description 2016-10-31 14:13:00 +08:00
Dong Heng 41a91d7cb9 feature/openssl: change the description for docbook 2016-10-31 14:06:29 +08:00
Liu Zhi Fu f30887bc70 modify comments according to review 2016-10-31 11:17:33 +08:00
Jeroen Domburg ffeffcd315 Merge branch 'feature/crosscore_int' into 'master'
Add cross-core int to accelerate task being awoken from another CPU.

This adds a per-CPU interrupt that can be used to poke the CPU to go do something. In this case all that is implemented is a request to yield the current task, used in case a CPU unblocks a task that runs on another CPU. This gets rid of the limitation that inter-CPU communication using queues, muxes etc can take up to a FreeRTOS tick to happen.

Specs!
Sending an in in a queue of length 1 (essentially a semaphore) as quickly as possible (just a small delay in the sender, to make sure the receiver task gets swapped out) for 10 seconds. Number indicates the amount of ints transferred

Old code:

CPU0->CPU0: 42986

CPU0->CPU1,: 2999

New code:

CPU0->CPU0: 42868

CPU0->CPU1: 62073

See merge request !155
2016-10-31 11:04:28 +08:00
Jeroen Domburg 90b787636a Remove redundant volatile keyword 2016-10-31 11:00:27 +08:00
Liu Zhi Fu 4f2719236f esp32/tcpip_adapter: softap supports max 10 stations
The max number of stations softap supports is modified from 8 to 10
2016-10-28 16:53:49 +08:00
Ivan Grokhotkov 19c4996bc8 Merge branch 'bugfix/int-wdt-fix' into 'master'
Fix the things that broke when adding the new WDTs

Seemingly, I broke a bunch of things when adding the interrupt WDTs and moved the panic handler to the esp32 directory. This fixes that, as well as the issue where flashing would trigger the int wdt. It also bodges in a fix for a merge artifact breaking the halt-on-first-thread-when-openocd-is-connected; that fix should be refined later.

See merge request !157
2016-10-28 16:21:34 +08:00
Ivan Grokhotkov 5ffd6155f2 set default interrupt watchdog timeout to 300ms
10ms is too low for openocd/gdb to work, so it's not a very useful default value.
2016-10-28 16:17:41 +08:00
Ivan Grokhotkov 0e90983c9f vfs: fix adding CR 2016-10-28 16:16:12 +08:00
Wu Jian Gang 95403b8803 Merge branch 'feature/support_max_16_sockets' into 'master'
lwip: support max 16 sockets

Since the customers need more sockets in their application, support max 16 sockets,
in other words, the total socket number of UDP/TCP/RAW sockets should not exceed 16.

See merge request !156
2016-10-28 15:38:57 +08:00
Jeroen Domburg 3cd86d6bce Also call tick hook on app cpu when scheduler is suspended 2016-10-28 14:37:36 +08:00
Dong Heng 78392bf76b components/openssl: change the description
1. change the description of Makefile.projbuild
2. remove the license header in the API document
3. add private inlcuding header code in the components file
2016-10-28 14:32:13 +08:00
Jeroen Domburg 309bd12855 Re-add panic.o to IRAM/DRAM. 2016-10-28 14:32:11 +08:00
Ivan Grokhotkov a038a2b533 freertos: fix calling first task hook 2016-10-28 13:41:07 +08:00
Liu Zhi Fu 9e7bc900c5 lwip: rework comments according to review 2016-10-28 13:35:06 +08:00
Liu Zhi Fu 38ff616e4a lwip: add prompt when configure max sockets number in menuconfig 2016-10-28 12:29:26 +08:00
Jeroen Domburg 4d8ad3c877 Fix int wdt iram, fix some fallout of moving panic stuff to esp32 2016-10-28 12:05:42 +08:00
Liu Zhi Fu 305b63209e lwip: support max 16 sockets
Since the customers need more sockets in their application, support max 16 sockets,
in other words, the total socket number of UDP/TCP/RAW sockets should not exceed 16.
2016-10-28 12:03:51 +08:00
Ivan Grokhotkov dc2b5d0c96 spi_flash: update comment blocks 2016-10-27 17:58:42 +08:00
Ivan Grokhotkov c581229e1d partition API: separate type and subtype into two enums 2016-10-27 17:58:42 +08:00
Ivan Grokhotkov 9f0f05d520 spi_flash: change pointer type to void* 2016-10-27 17:58:42 +08:00
Ivan Grokhotkov e03b45eb0a spi_flash: improve documentation 2016-10-27 17:58:42 +08:00
Ivan Grokhotkov e229ec0340 spi_flash: check physical address in mmap against flash chip size 2016-10-27 17:58:42 +08:00
Ivan Grokhotkov b6693225c1 spi_flash: implement partition API, drop trivial wrappers
This implements esp_partition_read, esp_partition_write, esp_partition_erase_range, esp_partition_mmap.
Also removed getters which didn't add much sugar after all.
2016-10-27 17:58:42 +08:00
Ivan Grokhotkov 2c5340d47e spi_flash: change argument types
spi_flash_read and spi_flash_write currently have a limitation that source and destination must be word-aligned.
This can be fixed by adding code paths for various unaligned scenarios, but function signatures also need to be adjusted.
As a first step (since we are pre-1.0 and can still change function signatures) alignment checks are added, and pointer types are relaxed to uint8_t.
Later we will add handling of unaligned operations.
This change also introduces spi_flash_erase_range and spi_flash_get_chip_size functions.

We probably need something like spi_flash_chip_size_detect which will detect actual chip size.
This is to allow single application binary to be used on a variety of boards and modules.
2016-10-27 17:58:42 +08:00
Ivan Grokhotkov 079d9ea018 spi_flash: implement partition API 2016-10-27 17:58:42 +08:00
Ivan Grokhotkov 999e6d4e8f freertos: move panic handler data to DRAM
Fixes https://ezredmine.espressif.com/issues/7817
2016-10-27 17:57:29 +08:00
Ivan Grokhotkov 42068c3b36 spi_flash: implement mmap/munmap 2016-10-27 17:57:29 +08:00
Ivan Grokhotkov 54ca573ce4 spi_flash: move cache operations into separate file 2016-10-27 17:57:29 +08:00
Ivan Grokhotkov 628bde2080 bootloader: move useful structures to esp32 component 2016-10-27 17:57:29 +08:00
Ivan Grokhotkov f6f23141b3 components/spi_flash: add high level partition api header
TW6701
2016-10-27 17:57:29 +08:00
Ivan Grokhotkov 6f1d3ce4a7 vfs: code review fixes
- fix typo in readme
- remove unneeded extern declaration
- fix header guard macro
- tabs->spaces in syscalls.c
- spaces->tabs in tasks.c
2016-10-27 17:25:38 +08:00
Ivan Grokhotkov da56e76255 vfs: add readme file 2016-10-27 17:22:47 +08:00
Ivan Grokhotkov 7e201c5527 vfs and newlib: small fixes
- spaces->tabs in tasks.c
- update vfs_uart.c to use per-UART locks
- add license to vfs_uart.c
- allocate separate streams for stdout, stdin, stderr, so that they can be independently reassigned
- fix build system test failure
- use posix off_t instead of newlib internal _off_t
2016-10-27 17:22:18 +08:00
Ivan Grokhotkov 0c130ecf19 vfs: code review fixes
- fix typo in readme
- remove unneeded extern declaration
- fix header guard macro
- tabs->spaces in syscalls.c (+1 squashed commit)
- fix minor typos
2016-10-27 17:21:17 +08:00
Ivan Grokhotkov b3b8334d54 vfs and newlib: small fixes
- spaces->tabs in tasks.c
- update vfs_uart.c to use per-UART locks
- add license to vfs_uart.c
- allocate separate streams for stdout, stdin, stderr, so that they can be independently reassigned
- fix build system test failure
2016-10-27 17:19:39 +08:00
Ivan Grokhotkov 587360363c vfs: add UART device
This should be integrated with UART driver once everything is merged
2016-10-27 17:18:43 +08:00
Ivan Grokhotkov 401f6e4713 vfs: initial version of virtual filesystem API 2016-10-27 17:18:43 +08:00
Ivan Grokhotkov 38c6256db9 Merge branch 'feature/wdts' into 'master'
Feature/wdts

This adds two watchdogs to  esp-idf:

- An interrupt watchdog. Kicks in if the FreeRTOS timer interupt on either the PRO_CPU or (when configured) the APP CPU isn't called for a configurable time. Panics, displaying which CPU caused the problem and the registers that may lead to the offending code.
- A task watchdog. A task has to feed it every once in a while. If not, it will print the name of the offending tasks, as well as the tasks currently running on both CPUs, and optionally panic.

Also adds a panic reason to the panic call, as well as fixes the panic code a bit.

See merge request !148
2016-10-27 17:09:35 +08:00
Jeroen Domburg 68f39c1ed9 Only init crosscore when FreeRTOS runs in multicore mode, add warnings that cross_int calls are private. 2016-10-27 16:50:28 +08:00
Jeroen Domburg b14faabfda Merge latest master in 2016-10-27 16:18:55 +08:00
Jeroen Domburg 3371083c16 Add checks for tasks woken up on other CPUs where needed, make xYieldPending and xPendingReadyList per-processor, add configurable ISR stack size to Kconfig, in general fix the entire wake-up-task-on-other-cpu-by-interrupt implementation 2016-10-27 16:07:47 +08:00
Wu Jian Gang 84c2e61b12 Merge branch 'feature/refractor_for_lwip' into 'master'
lwip: refactoring for lwip

1. All espressif specific code are prefix with ESP_
2. Define all ESP_ options in lwipopts.h
3. Remove useless code added in 8266

See merge request !154
2016-10-27 15:47:18 +08:00
Liu Zhi Fu 6e6e51426f lwip: refractor for lwip
1. All espressif specific code are prefix with ESP_
2. Define all ESP_ options in lwipopts.h
3. Remove useless code added in 8266
2016-10-27 14:11:01 +08:00
Ivan Grokhotkov 50bd28353d Merge branch 'master' into feature/freertos_static_buffers 2016-10-27 12:38:35 +08:00
Ivan Grokhotkov 329ad14b8c esp32: update libs for changes in FreeRTOS header files 2016-10-27 12:37:34 +08:00
Jeroen Domburg c6477ff10d Fix int clear, actually call int init code 2016-10-27 12:37:19 +08:00
Jeroen Domburg ff6b8addd9 Fix panic config ifdefs, un-stall app cpu on boot so it restarts after panic 2016-10-27 11:17:24 +08:00
Liu Zhi Fu e0f49c2221 esp32: add esp_wifi_sta_get_ap_info
The customers need to get information about AP that associated with ESP32 station,
these information includes RSSI, channel number etc, so add this new API
2016-10-27 10:42:01 +08:00
Jeroen Domburg fd887dbeea Merge remote-tracking branch 'origin/master' into feature/wdts 2016-10-27 10:25:23 +08:00
Wu Jian Gang 8dcd78d52f Merge branch 'feature/refractor_for_some_wifi_APIs' into 'master'
Feature/refractor for some wifi ap is

    1. Modify esp_wifi_get_station_list to esp_wifi_ap_get_sta_list
    2. Modify tcpip_adapter_get_station_list to tcpip_adapter_get_sta_list
    3. Remove esp_wifi_free_station_list
    4. Remove tcpip_adapter_free_station_list
    5. Modify related data struct accordingly
    6. Move soft watchdog from wifi lib to IDF

See merge request !152
2016-10-27 10:08:32 +08:00
Jeroen Domburg 6d54fb004d Change inline to static inline functions. Ref Github issue 62. 2016-10-27 09:17:04 +08:00
Jeroen Domburg 5642a8061e Merge branch 'feature/add_per_socket_tcp_window' into 'master'
components/lwip - add per socket tcp window

Add code to support per socket tcp window and tcp send buffer size configuration.

See merge request !145
2016-10-26 23:39:36 +08:00
liuzhifu df1c2f0da5 components/esp32: refractor according to review comments
modify esp_wifi_kick_sta to esp_wifi_deauth_sta
2016-10-26 21:50:15 +08:00
Jeroen Domburg d3d9a8bc28 Most code written. Interrupts still do not fire yet. 2016-10-26 21:09:55 +08:00
liuzhifu 750d6faf51 esp32/tcpip_adapter: rework according to review comments
1. Modify sta to station in comments
2. Modify esp_wifi_get_ap_num to esp_wifi_scan_get_ap_num
3. Modify esp_wifi_get_ap_list to esp_wifi_scan_get_ap_records
2016-10-26 20:02:39 +08:00
liuzhifu 345cf333a8 components/esp32: udpate wifi lib
1. cc5a5e29 - refractor for some wifi APIs
2. 8d787147 - move soft wdt to idf
2016-10-26 18:18:58 +08:00
liuzhifu 3cca62dfa4 esp32/tcpip_adapter: refractor for some wifi APIs
1. Modify esp_wifi_get_station_list to esp_wifi_ap_get_sta_list
2. Modify tcpip_adapter_get_station_list to tcpip_adapter_get_sta_list
3. Remove esp_wifi_free_station_list
4. Remove tcpip_adapter_free_station_list
5. Modify related data struct accordingly
2016-10-26 18:16:40 +08:00
Jeroen Domburg 9546ad5b5e Move write key and stage action select constants into headers 2016-10-26 14:54:50 +08:00
liuzhifu a90217e201 components esp32/lwip: modify code according to review comments
1. Modify comments for esp_wifi_internal_tx
2. Fix delay time error in esp32_tx_flow_ctrl which is found in code review,
   modify _wait_delay init value from 0 to 1
2016-10-26 14:09:54 +08:00