1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

279 Commits

Author SHA1 Message Date
Gunar Schorcht
464e3a8741 cpu/esp8266: add RTT implementation 2020-03-19 13:59:58 +01:00
Koos
67dfb9d39e cpu/esp8266: Fixed small typo in code example 2020-03-04 09:54:36 +01:00
Gunar Schorcht
ef248b392d cpu/esp_comomon: rename cpu_conf.h to cpu_conf_common.h
To be able to define common configurations for all ESP CPUs, the CPU specific configuration cpu_conf.h has to include a common configuration. For that purpose cpu_conf.h in cpu/esp_common is renamed to cpu_conf_common.h and included in CPU specific configurations.
2020-02-29 12:07:12 +01:00
Gunar Schorcht
32c7bd8867 cpu/esp8266: remove unused function definitions 2020-02-21 09:09:34 +01:00
Gunar Schorcht
98ca108be5 cpu/esp8266: move esp_wifi to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
9723e3e3cf cpu/esp*: move freertos/task to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
61339001e7 cpu/esp*: move common freertos code to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
18659bdf26 cpu/esp*: move FreeRTOS headers to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
05faec7cf8 cpu/esp*: move periph/i2c_sw to esp/common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
0292f8b6a3 cpu/esp*: move periph/hwrng to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
d90164b19a cpu/esp*: move perioph/spi to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
66ee155562 cpu/esp*: move periph/flash to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
b0517c6733 cpu/esp*: move periph/uart to cpu/esp_common
tmp
2020-02-21 09:09:34 +01:00
Gunar Schorcht
39ee806d3c cpu/esp*: move some vendor/esp code to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
75d23e8458 cpu/esp*: common exception handling 2020-02-21 09:09:34 +01:00
Gunar Schorcht
90dc2ce846 cpu/esp*: common parts of syscalls in cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
4c466e54ec cpu/esp*: common irq_arch in cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
43b89a61eb cpu/esp*: move common parts of gpio_arch to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
45c71f1a31 esp/esp*: move common code to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
7d701f6fa8 cpu/esp*: move common headers to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
53a3756e0c cpu/esp*: common Makfile* added 2020-02-21 09:09:34 +01:00
Gunar Schorcht
b132698cd5 cpu/esp*: move parition table tool to dist/tools/esptool
The same tool 'gen_esp32part.py' is used for the generation of partition tables on ESP8266 as well as n ESP32. The tool is therefore added to 'dist/tools/esptool'
2020-02-21 09:09:08 +01:00
Gunar Schorcht
e4be9b4b36 cpu/esp8266/esp_wifi: move gnrc specific code to separate file 2020-01-31 09:32:23 +01:00
Gunar Schorcht
058c710cba cpu/esp8266/esp_wifi: remove gnrc specific code 2020-01-31 09:32:23 +01:00
Sören Tempel
5ef5ab7e4b Add CPU feature for stack smash protections 2020-01-22 15:59:02 +01:00
benpicco
3672502f6f
Merge pull request #12998 from gschorcht/cpu/esp/common_sdk_log_output
cpu/esp: cleanup of ESP SDK log outputs
2020-01-15 15:08:02 +01:00
Francisco
1977423e9b
Merge pull request #13048 from maribu/adc-int32_t
periph/adc: Change return type of `adc_sample()` to `int32_t`
2020-01-13 12:56:09 +01:00
Marian Buschsieweke
55dc429d11
cpu/esp8266/periph: adc_sample() now returns int32_t 2020-01-10 14:13:14 +01:00
Gunar Schorcht
6e31a0cb92 cpu/esp*: esp_wifi used as default netdev for lwip 2019-12-26 19:02:04 +01:00
Gunar Schorcht
1899c257b7 cpu/esp_common: functions for SDK log outputs
To control the log level and the format of the log output of SDK libraries, a bunch of library-specific printf functions are realized which map the log output from SDK libraries to RIOT's log macros.
2019-12-20 17:58:58 +01:00
Gunar Schorcht
649bce4a46 cpu/esp*: cleanup the log level for init functions
The log level for normal information should be LOG_DEBUG.
2019-12-20 16:25:41 +01:00
Gunar Schorcht
7bf5bba564 cpu/esp_common: LOG_TAG macro for DEBUG_ALL
LOG_TAG macro is required for LOG_VERBOSE level in ESP SDK log output handling.
2019-12-20 16:25:41 +01:00
Gunar Schorcht
40b878ebfa cpu/esp32: unify esp_wifi log output 2019-12-20 16:25:41 +01:00
Gunar Schorcht
0194d7f44b cpu/esp8266: fix of esp_wifi_send
In case of succes, the esp_wifi_send function returned a 0 instead of sent bytes.
2019-12-18 21:52:25 +01:00
Gunar Schorcht
8021888c06 pkg/lwip: remove esp8266 from blacklist 2019-12-17 08:28:33 +01:00
Gunar Schorcht
dcb6673024 cpu/esp8266: platform dependent settings for lwIP 2019-12-17 08:28:33 +01:00
Gunar Schorcht
baf4db675d cpu/esp8266: fix bootloader images
Some ESP8266/ESP8285 modules only work with DOUT SPI flash mode and a SPI flash frequency of 26 MHz. Therefore, these parameters have to be used by default. Otherwise some modules will no boot.
2019-12-12 08:16:54 +01:00
Gunar Schorcht
3e3a6f7018 cpu/esp8266: change of log output level in vendor code 2019-12-12 08:16:54 +01:00
Gunar Schorcht
a3de59fec3 cpu/esp8266: log outputs from esp vendor code
Log outputs from the Espressif vendor code are completely controlled by LOG_LEVEL and should not be controlled by ENABLE_DEBUG by file.
2019-12-12 08:16:54 +01:00
Gunar Schorcht
81cde86a73 cpu/esp8266: enable esp_log_startup on LOG_LEVL=4 2019-12-07 15:16:32 +01:00
Gunar Schorcht
b4b3e4f934 cpu/esp8266: module to print startup info
Startup information, including board configuration, is only printed when module esp_log_startup is used. This reduces the amount of information that is printed by default to the console during the startup. The user can enable module esp_log_startup to get the additional startup information.
2019-12-07 15:16:32 +01:00
Gunar Schorcht
35357b86a8 cpu/esp*: reduce test timeouts for spiffs/littlefs
To avoid that murdock times out before tests/pkg_spiffs and tests/pkg_littlefs time out, the configured test timeouts for these tests is reduced to 200 seconds which should be enough. An ESP32 needs an average of 60 seconds for these tests, while an ESP8266 needs in average 100 seconds.
2019-12-06 11:44:15 +01:00
Tim Broenink
e35e9ea59f cpu/common/esp8266: use 'awk/printf' instead of 'echo' 2019-12-01 14:36:42 +01:00
Gunar Schorcht
7325192fcd cpu/esp8266: defines esp_now as default netdev
If the user or the board definition doesn't enable `esp_wifi`, `esp_now` is defined as default netdev.
2019-11-23 14:26:37 +01:00
MrKevinWeiss
d218b77ff7 cpu/esp8266: Suppress cpu specific i2c_speed_t in doxygen 2019-11-18 11:43:45 +01:00
MrKevinWeiss
02bd107722 cpu/esp8266: Suppress cpu specific gpio_flank_t in doxygen
The enumeration takes both the cpu and the driver, it should only show the driver enum
2019-11-18 11:43:12 +01:00
Gunar Schorcht
555a7040db cpu/esp8266: reset tool to allow automatic tests 2019-11-14 13:58:48 +01:00
Gunar Schorcht
309eab9ae0 cpu/esp8266: enable colored output with log_color 2019-11-14 13:58:48 +01:00
Gunar Schorcht
fe028455e5 cpu/esp8266: esptool.py is provided as tool
The modified version esptool.py from RTOS SDK that is required for flashing an image, is now placed in `dist/tools/esptool.py` and used directly from there. The advantage is that `esptool.py` hasn't to be installed explicitly anymore. Having RIOT is enough. The documentation is adapted accordingly. The oly prerequisite is that python and the pyserial module are installed.
2019-11-14 13:58:48 +01:00
Gunar Schorcht
62922769b3 cpu/esp8266: high-priority threads creation
High priority thread for the WiFi interface are only created at startup when the WiFi interface is used.
2019-11-14 13:58:48 +01:00
Gunar Schorcht
405be02da4 cpu/esp8266: funcs must not be called in assert
In vendor startup code, initialization function were called as parameters of assert statement. With DEVELHELP, they are not called since the assert macro does nothing.
2019-11-14 13:58:48 +01:00
Gunar Schorcht
2c7b9b4fb4 cpu/esp8266: toolchain renamed
To make the migration progress to the new RTOS SDK easier, the new toolchain was renamed to xtensa-esp8266-elf. This makes it possible to have the new and the old toolchain installed in parallel.
2019-11-14 13:58:48 +01:00
Gunar Schorcht
b15d7df6dc cpu/esp8266: ESP8266_SDK_DIR renamed
To make the migration progress to the new RTOS SDK easier, the ESP8266_SDK_DIR variable was renamed to ESP8266_RTOS_SDK_DIR.
2019-11-14 13:58:44 +01:00
Gunar Schorcht
9facce8c02 cpu/esp8266: use default number of priority levels
If the WiFi module is used, a number of high priority tasks is created. To void priority collisions with netdev drivers, the number of priorities SCHED_PRIO_LEVELS has to be increased to 32. But in other cases, the default number should be used, also to keep automatic tests working.
2019-11-14 13:58:25 +01:00
Gunar Schorcht
afa02044f2 cpu/esp8266: required bootloader binaries 2019-11-14 13:58:25 +01:00
Gunar Schorcht
ddc91df4ca cpu/esp8266: changes for RTOS SDK 2019-11-14 13:58:22 +01:00
Gunar Schorcht
a212228147 cpu/esp8266: files that are not needed any longer removed 2019-11-14 12:04:29 +01:00
Gunar Schorcht
28ea0a0914 cpu/esp8266: required vendor RTOS SDK components added 2019-11-14 12:04:21 +01:00
Gunar Schorcht
f397a74948 cpu/esp8266: FreeRTOS adaption layer added for RTOS SDK 2019-11-13 19:00:39 +01:00
Gunar Schorcht
a6d01fc2de cpu/esp8266: vendor files changed for RTOS SDK 2019-11-08 10:32:18 +01:00
Gunar Schorcht
464bb9f4c4 cpu/esp8266: vendor files that are no longer needed removed 2019-11-08 10:32:18 +01:00
Gunar Schorcht
e38d3e24ec
Merge pull request #12548 from maribu/c11_atomcis_cpp_compat
sys: Basic C++ compatibility with C11 atomcis
2019-10-25 11:48:58 +02:00
Marian Buschsieweke
314184adb5
cpu: Platform specific C11 atomics compat headers
Added headers to define platform specific sizes and types for the C11 atomics
compatibility module for C++.
2019-10-24 23:08:36 +02:00
Francisco Molina
1ae0873769 boards: change PORT used for flash/debug/reset to PROG_DEV 2019-10-24 12:58:12 +02:00
ebf43616b7 cpu: add arch_* features 2019-10-13 21:03:41 +02:00
Kevin "Tristate Tom" Weiss
4b7c5915ec
Merge pull request #10953 from gschorcht/sys/shell/heap_cmd/pr
sys/shell: add heap command
2019-10-04 13:49:57 +02:00
Gunar Schorcht
5521a6c39d cpu/esp: fix conflicts after rebase 2019-10-02 14:21:35 +02:00
Gunar Schorcht
02d81b717e
Merge pull request #12063 from maribu/i2c_release
drivers/periph/i2c: Updated i2c_release() to return void
2019-10-01 19:50:38 +02:00
Gaëtan Harter
15ea073f64
Revert "cpu/esp8266: update deprecated flash_size argument"
This reverts commit 422644bd3a.

The option is only supported after 2.6 which is currently not the
version given with 'esp' toolchain.
It was a bit too early to switch to the new version.
Version 2.7 also supports the old option with only a warning.
2019-09-16 16:08:35 +02:00
Marian Buschsieweke
baf911bd7d
cpu/esp8266: Moved stdio_init before periph_init
- This guarantees that DEBUG() is available early in boot process
- Forgotten in https://github.com/RIOT-OS/RIOT/pull/11367, this fixes broken stdio
2019-09-14 12:17:14 +02:00
Juan I Carrano
c50d8fada1
Merge pull request #11646 from cladmi/pr/esp/programmer_update
esp*: updates to the programmer configuration
2019-09-10 17:58:20 +02:00
benpicco
3aa8bc0d70
Merge pull request #12150 from jcarrano/compress-debuginfo
toolchain/cflags: enable dwarf compression (save 50% HDD)
2019-09-10 10:31:45 +02:00
Sebastian Meiling
c4dbdb7626
Merge pull request #12134 from gschorcht/cpu/esp/fix_i2c_ack_err_errno
cpu/esp*: fix of the error code for I2C address ACK errors
2019-09-05 12:23:24 +03:00
Gunar Schorcht
056a223c33 cpu/esp8266: changes for common heap command 2019-09-05 09:20:55 +02:00
Gaëtan Harter
422644bd3a
cpu/esp8266: update deprecated flash_size argument
Using flash size in megabits is deprecated by esptool.
Use the new megabyte notation.

    WARNING: Flash size arguments in megabits like '8m' are deprecated.
    Please use the equivalent size '1MB'.
    Megabit arguments may be removed in a future release.
    esptool.py v2.6
2019-09-04 15:07:37 +02:00
Gunar Schorcht
37ecb4fc5d cpu/esp8266: periph/uart FIFO resized to 1 byte
UART FIFO must contain only 1 byte when newlib's `printf` function is used. Otherwise, outputs that are still not sent over UART are lost when `printf` is called asynchronousely.
2019-09-04 14:58:59 +02:00
Gunar Schorcht
7fe1056aa7 cpu/esp8266: enable newlib with nano-formatted-io 2019-09-04 14:41:31 +02:00
Gunar Schorcht
646a173738 cpu/esp8266: fix unresolved symbols
To avoid unresolved symbols for unused functions during linking, compiler option `-ffunction-sections` is used now. Linker option `--warn-unresolved-symbols` is removed to get errors if required symbols cannot be resolved.
2019-09-04 14:41:31 +02:00
Gunar Schorcht
69a5cc753d cpu/esp8266: use always newlib stdio functions
The modules `newlib, `newlib_syscalls_default` and `stdio_uart` are now used by default for output to the UART interface. This also reduces the dependency rules.
2019-09-04 14:41:31 +02:00
Gunar Schorcht
ae8afaf42e cpu/esp8266: remove overridden stdio functions
The overridden stdio functions `puts`, `putchar` and `printf` were removed. Instead, the corresponding newlib functions are always used. Using the newlib functions fixes output conflicts when using `f *` functions like `fprintf`,` fputs`, ... with `stdout` as the file parameter.
2019-09-04 14:41:31 +02:00
Juan Carrano
63c475cd4d toolchain/cflags: enable dwarf compression.
Use the -gz option to compress ELF sections containing DWARF information.
This saves around 50% of disk space, without any side effects.

See https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Debugging-Options.html#Debugging-Options
for more infomation on this option.

Some platforms have an outdated toolchain that does not support -gz so
the flag is blacklisted there. Even then, the results are quite impressive.

I used @cladmi's `buildtest` branch (https://github.com/cladmi/RIOT/tree/wip/du/buildtest)
with this change and compiled the `examples/default` application:

```
$ BUILD_IN_DOCKER=1 DOCKER="sudo docker" make -C examples/default buildtest-indocker
```

The size was obtained with:

```
$ find output -name "*.bin.bindirsize" -type f -exec tail  -n1 '{}' \; | cut -f 1 | awk '{s+=$1} END {printf "%.0f", s}'
```

Results:

- Vanilla: 10328112 KB (~10GB).
- with -gz: 4982788 KB (~5GB).

This was inspired by #8496.
2019-09-02 14:43:26 +02:00
Gunar Schorcht
8c8306e1ca cpu/esp8266: fix errno for I2C addr ack error 2019-08-31 12:09:09 +02:00
Gaëtan Harter
e4331e8391
cpu/arch: blacklist incompatible CFLAGS
Blacklist incompatible CFLAGS that are currently "optionally" included
in 'cflags.inc.mk'.

This prepares for the migration to 'OPTIONAL_CFLAGS'.
2019-08-29 17:43:54 +02:00
Marian Buschsieweke
530cf801fe
cpu/esp8266: Updated i2c_release() 2019-08-22 12:03:08 +02:00
Benjamin Valentin
b8c4ab5b69 cpu: make use of ARRAY_SIZE macro 2019-08-06 19:43:54 +02:00
Gunar Schorcht
97bb33788b cpu/esp*: changes to use esp_wifi and esp_now 2019-07-31 13:53:48 +02:00
Kevin "Bear Puncher" Weiss
135ad3817b
Merge pull request #10982 from gschorcht/cpu/esp8266/periph/pwm/pr
cpu/esp8266: fix pwm_set func
2019-06-27 16:35:53 +02:00
Gunar Schorcht
d3e0b78f7c cpu/esp8266: fix of set func in periph/pwm
In the `pwm_set` function, the switch-on and switch-off times for PWM channels were only determined for the following phase, but not for the current phase. This could result in a missing duty cycle when calling the function `pwm_set` if the switch-on time of the current phase was not yet reached or to an extended duty cycle if the switch-off time of the current phase had not yet been reached.
2019-06-26 16:00:02 +02:00
Gaëtan Harter
90a9adbbda
cpu/esp*: append to FLASHDEPS
Append to FLASHDEPS instead of overwriting/lazy setting it.
2019-06-14 15:58:36 +02:00
Gunar Schorcht
563c41f191
cpu/esp8266: use FLASHFILE variable
Use ELFFILE as FLASHFILE as all files are created from this
one using esptool.
2019-06-06 14:59:24 +02:00
smlng
2de4b3011b periph_common: add as dependency to periph drivers
Rational: the periph_common module is required by (most) other periph drivers
and also during startup of the CPU/MCU to run periph_init. The latter is only
required if other periph drivers are used, hence periph_common should be a
depency of periph_* modules and *not* of the CPU/MCU. This PR fixes that
by making periph_common a depency of periph_* and removing the explicit
include in the CPU/MCU implementation.
2019-06-03 13:44:10 +02:00
Gaëtan Harter
79280eb12e
boards/tools: remove exporting PREFLASH/FLASHDEPS
PREFLASHER/PREFFLAGS/FLASHDEPS are evaluated by the main Makefile.include.
Their value does not need to be exported.

Testing
-------

`git diff --word-diff` only reports `export` being removed.

`git show --stat` reports `16 insertions(+), 16 deletions(-)`
Which is the same amount as lines that where matching
`export[[:blank::]]\+VARIABLE` plus the newline that is said to have
changed.
2019-05-28 09:58:40 +02:00
Gaëtan Harter
ac113ca2f8
boards/tools: remove exporting FLASHER/FFLAGS
FLASHER and FFLAGS are evaluated by the main Makefile.include or by file
included by it. Their value does not need to be exported.

This will also prevent evaluating 'PORT' for FFLAGS when not needed.

Testing
-------

`git diff --word-diff` only reports `export` being removed.

`git show --stat` reports `84 insertions(+), 84 deletions(-)`
Which is the same amount as lines that where matching
`export[[:blank::]]\+VARIABLE`.
2019-05-28 09:56:00 +02:00
Gunar Schorcht
2c555a72ec cpu/esp8266: print_meminfo function added 2019-05-24 00:28:57 +02:00
Gunar Schorcht
501d679f67 cpu/esp8266: fix of printf format identifiers
Format identifier `h` and `hh` removed since `esp_printf` does not support them.
2019-05-24 00:28:24 +02:00
Gunar Schorcht
46ea36ff52 cpu/esp8266: fix of esp_hexdump function
A space was mission after each field.
2019-05-24 00:28:24 +02:00
Gunar Schorcht
09a2a11dd7 cpu/esp: fix computation of coprocessor save area
`top_of_stack` isn't aligned down to the previous 16 byte aligned address. Furthermore, `top_of_stack` as well as `XT_CP_SIZE` are used unaligned in `cpu/esp_common/vendor/xtensa/portasm.S` in the address computation for the coprocessor save area, .

Aligning pointer `p` down to the previous 16 byte aligned address results in a wrong address of the coprocessor save area during the initialization of the thread context. This leads to wrong values and wrong positions of these values in the coprocessor save area in inital thread context.

Since ESP8266 doesn't have a coprocessor, this bug affects only ESP32.
2019-04-27 13:23:04 +02:00
Gunar Schorcht
b17070fbf1 cpu/esp_common: doc fixes 2019-04-15 12:50:44 +02:00
Gunar Schorcht
70ab7501af cpu/esp8266: move xtensa lib to esp_common 2019-04-15 11:46:57 +02:00
Gunar Schorcht
2ac4d08b43 cpu/esp8266: same xtensa basics as ESP32 2019-04-15 11:45:59 +02:00
Gunar Schorcht
75c0d06913 cpu/esp8266: changes for ESP32 compatibility 2019-04-15 11:45:59 +02:00
Gunar Schorcht
dc7f979201 cpu/esp8266: SDK interrupt handling removed 2019-04-15 11:45:59 +02:00
Sebastian Meiling
e9072b1e28
Merge pull request #10981 from gschorcht/cpu/esp8266/rodata_IROM/pr
cpu/esp8266: most .rodata sections are moved from DRAM to IROM (flash)
2019-03-29 20:18:06 +01:00
Gunar Schorcht
00ac8ea69a cpu/esp8266: add init function in dummy lwIP
Calling the initialization function ensures that the dummy lwIP library is used instead of the real lwIP, even if the esp_wifi module for esp8266 is not used.
2019-03-05 16:43:45 +01:00
Gunar Schorcht
226e854a28 cpu/esp8266: doc fixes
The documentation had to be changed due to the relation of module `esp_now` to `esp_wifi` module. In addition, a number of corrections have been made. In the case of documentation, it is impossible to do this in various commits.
2019-03-05 16:43:45 +01:00
Gunar Schorcht
3d2df7114f cpu/esp8266: doc restructured for esp_now_netdev 2019-03-05 16:43:45 +01:00
Gunar Schorcht
cd1bd3811c cpu/esp8266: makefile support for esp_now_netdev 2019-03-05 16:43:45 +01:00
Gunar Schorcht
b6d15565be cpu/esp8266: macros required by esp_now_netdev 2019-03-05 16:43:45 +01:00
Gunar Schorcht
8e03e692ed cpu/esp8266: modified ld file for non-SDK version
Introduction of LoadStoreError handler requires new .UserExceptionTrampoline.tex section in ld script.
2019-02-10 13:55:42 +01:00
Gunar Schorcht
cda45fad8f cpu/esp8266: move most rodata sections to IROM
Usually, all .rodata sections are placed in RAM by the Espressif SDK since IROM (flash) access requires 32-bit word aligned reads. thanks to the LoadStoreError exception handler from esp-open-rtos which is used now in RIOT-OS, it is also possible to place .rodata sections in IROM (flash) to save RAM resources.
2019-02-09 20:04:15 +01:00
Gunar Schorcht
5201cd2c71 cpu/esp8266: add LoadStoreError exception handler
Usually, the access to the IROM (flash) memory requires 32-bit word aligned reads. Attempts to access data in the IROM (flash) memory less than 32 bits in size triggers a LoadStoreError exception. With the exception handler from esp-open-rtos it becomes possible to access data in IROM (flash) with a size of less than 32 bits and thus to place .rodata sections in the IROM (flash).
2019-02-09 17:48:40 +01:00
Gunar Schorcht
f4a9f5a0d6 cpu/esp8266: netstats removed from esp_wifi 2019-02-07 15:44:04 +01:00
Gunar Schorcht
66c4cf8647 cpu/esp8266: avoid WiFi going into sleep mode 2019-01-30 08:27:21 +01:00
Gunar Schorcht
57fdb23464 cpu/esp8266: fix compile problems 2019-01-29 23:25:31 +01:00
Gunar Schorcht
975fba8265 cpu/esp8266: check free heap before pbuf alloc
Checking by the send function that at least two maximum size Ethernet frames fit in the remaining heap before the LwIP packet buffer is allocated seems to increase stability. This can be caused by the fact that WLAN hardware interrupts allocate additional memory when receiving a frame during the send attempt.
2019-01-29 18:16:21 +01:00
Gunar Schorcht
c81138367b cpu/esp8266: dbg msg replaced by an error msg
The situation where the firmware `lwIP` packet buffer is exhausted is an important indication that the traffic sent to and sent from the esp8266 is more than the esp8266 is able to handle. Therefore, it should be an error message.
2019-01-27 12:14:18 +01:00
Gunar Schorcht
fa48e3f51f cpu/esp8266: event handling for link up/down 2019-01-26 17:34:13 +01:00
Gunar Schorcht
4e41afa2fb cpu/esp8266: readable disconn reasons in esp_wifi 2019-01-26 17:33:28 +01:00
Gunar Schorcht
1a8a560bb5 cpu/esp8266: remove timeout handling in send func
It is not necessary to realize timeout handling in send function or to disconnect from AP if lwIP packet buffer is exhausted. Waiting that the frame allocated in lwIP packet buffer is freed by MAC layer led to the complete blockage of send function on heavy network load. Disconnecting from AP is counterproductive since reconnecting usually fails on heavy network load.
2019-01-26 17:32:04 +01:00
Gunar Schorcht
fa5fe7e48f cpu/esp8266: don't disconnect on pbuf full in send
Disconnecting from the AP in the send function if the lwIP packet buffer is exhausted is counterproductive since reconnecting usually fails on heavy network load. A better strategy is to slow down the sending of MAC frames from netif a bit to wait for flushing the buffer in the MAC layer.
2019-01-26 17:23:21 +01:00
Gunar Schorcht
5d0b447209 cpu/esp8266: auto reconnect in esp_wifi
It seems to be more stable and less memory consuming to use auto reconnect policy.
2019-01-25 23:59:42 +01:00
Gunar Schorcht
457ef97d74 cpu/esp8266: lwIP dummy functions added
Defines a number of lwIP functions that are required as symbols by Espressif's SDK libraries. These functions are only dummies without real functionality. Using these functions instead of real lwIP functions provided with the SDK saves arround 4 kBytes of RAM.
2019-01-25 23:59:42 +01:00
Gunar Schorcht
24b71a7fbe cpu/esp8266: call _recv directly in esp_wifi
Since _esp_wifi_recv_cb is not executed in interrupt context but in the context of the `ets` thread, it is not necessary to pass the`NETDEV_EVENT_ISR` event first. Instead, the receive function can be called directly which result in much faster handling, a less frame lost rate and more robustness.
2019-01-25 23:59:42 +01:00
Gunar Schorcht
f12606d7c0 cpu/esp8266: removes the mutex in esp_wifi
Since _esp_wifi_recv_cb is not executed in interrupt context but in the context of the `ets` thread, the receive function can be called directly. There is no need for a mutex anymore to synchronize the access to the receive buffer between _esp_wifi_recv_cb and _recv function.
2019-01-25 23:59:42 +01:00
Gunar Schorcht
49f06efd38 cpu/esp8266: fix pbuf length check in esp_wifi
When the size of a received frame is checked, always the total length should be used instead of the length of the first lwIP pbuf in the pbuf chain. Otherwise, the check that the length does not exceed ETHERNET_MAX_LEN will always be true since the maximum size of one lwIP pbuf in a pbuf chain is 512 bytes.
2019-01-24 09:54:53 +01:00
Gunar Schorcht
88c65aff0b cpu/esp8266: allow _esp_wifi_recv_cb during send
Receiption of a frame in _esp_wifi_recv_cb while sending has no effect and should be possible to increases the performance.
2019-01-24 09:39:45 +01:00
Gunar Schorcht
0920bbb4fb cpu/esp8266: log message on reconnect in esp_wifi 2019-01-24 09:21:17 +01:00
Gunar Schorcht
92f6c1a7c6 cpu/esp8266: WiFi mode changed in esp_wifi
Although only the station interface is needed, the WiFi interface has to be used in SoftAP + Station mode. Otherwise the send function blocks sporadically. Since the SoftAP interface is not used, it is configured with a hidden SSID and a long beacon interval. Connections from other stations are not allowed.
2019-01-24 09:21:17 +01:00
Gunar Schorcht
538aac00ad cpu/esp8266: fix of allocated pbuf in esp_wifi 2019-01-24 09:21:17 +01:00
Gunar Schorcht
e384f1e502 cpu/esp8266: send timeout handling in esp_wifi
A timeout was introduced if sending a frame takes to long time. In that case the WiFi interface disconnects and reconnects automatically to recover.
2019-01-24 09:21:17 +01:00
Gunar Schorcht
04ee2ebe15 cpu/esp8266: automatic reconnect in esp_wifi
A reconnect timer is used to try to reconnect every 20 secons if WiFi interface is in disconnected or connecting state.
2019-01-24 09:21:17 +01:00
Gunar Schorcht
87b87631a6 cpu/esp8266: functions that have to run in IRAM
Due to performance reasons _esp_wifi_recv_cb and _send have to be executed in IRAM.
2019-01-24 09:21:17 +01:00
Gunar Schorcht
96d0910d33 cpu/esp8266: avoid _esp_wifi_recv_cb during send
To avoid conflicts on receiption of a frame while sending, _esp_wifi_recv_cb should not executed while a frame is in transmission
2019-01-24 09:21:17 +01:00
Gunar Schorcht
78e0aa2a77 cpu/esp8266: usage of _esp_wifi_recv_cb
Overriding ethernet_input function _esp_wifi_recv_cb is only used when the WiFi interface is in connected state.
2019-01-24 09:21:17 +01:00
Gunar Schorcht
c5a9058ab9 cpu/esp8266: simplified error handling in esp_wifi
wifi_station_connect and wifi_stattion_disconnect never produce errors. Thus, error handling can be removed.
2019-01-24 09:21:17 +01:00
Gunar Schorcht
3225aaa387 cpu/esp8266: different conn states in esp_wifi
Different connection states defined to be able to realize a better connect/reconnect handling
2019-01-24 09:21:17 +01:00
Gunar Schorcht
88f6beeca2 cpu/esp8266: use SDK mem management for esp_wifi
Some SDK interrupt service routines obviously use malloc/free in the interrupt context. Because the rmutex-based lock/unlock approach of the malloc/free function suite of the newlib does not work in the interrupt context, the SDK memory management functions MUST therefore be used. To use the same memory management functions in RIOT as in the SDK, the malloc/free function suite has to be replaced by wrapper functions.
2019-01-24 09:21:17 +01:00
Gunar Schorcht
5a835e91ba cpu/esp8266: fix some comments in esp_wifi 2019-01-24 09:21:17 +01:00
Gunar Schorcht
107e196b18 cpu/esp8266: fix of maximum frame length in esp_wif
Since complete MAC frames are handled, ETHERNET_MAX_LEN has to be used instead of ETHERNET_DATA_LEN for receive buffer size and length check.
2019-01-24 09:21:17 +01:00
Gunar Schorcht
0e46869e57 cpu/esp8266: react to "out of memory" in esp_wifi 2019-01-24 09:21:17 +01:00
Gunar Schorcht
35a751c245 cpu/esp8266: avoid send interruption in esp_wifi 2019-01-24 09:21:17 +01:00
Gunar Schorcht
f7998c2ad6 cpu/esp8266: automatic reconnect in esp_wifi 2019-01-24 09:21:17 +01:00
Gunar Schorcht
d6664dafad cpu/esp8266: esp_wifi dbg msg changed to err msg 2019-01-24 09:21:17 +01:00
Gunar Schorcht
be3a2a4cb5 cpu/esp8266: fix compilation problem of esp_wif 2019-01-24 09:21:17 +01:00
Gunar Schorcht
698770ddb5 cpu/esp8266: fix esp_wifi stability issues
Fixes sporadic blocking of the wifi thread in esp_wifi_recv_cb function under heavy network load conditions when frames are coming in faster than they can be processed. Since esp_wifi_recv_cb function is not executed in interrupt context, the msg_send function used for ISR event can block when the message queue is full. With this change esp_wifi can be flooded with icmpv6 packets of maximum size without any problems over hours.
2019-01-24 09:21:17 +01:00
Gunar Schorcht
21db1ce224 cpu/esp8266: doc extended for esp_wifi 2019-01-24 09:21:17 +01:00
Gunar Schorcht
664566ce70 cpu/esp8266: makefile support for esp_wifi 2019-01-24 09:21:17 +01:00
Gunar Schorcht
04de1e75aa cpu/esp8266: stack sizes tuned for esp_wifi 2019-01-24 09:21:17 +01:00
Gunar Schorcht
642c48f856 cpu/esp8266: add built-in WiFi netdev driver 2019-01-24 09:21:17 +01:00
Gunar Schorcht
e4b0ace841 cpu/esp8266: inc ets_task stack size for esp_now 2019-01-21 16:30:33 +01:00